@aurodesignsystem-dev/auro-popover 0.0.0-pr102.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/.husky/commit-msg +1 -0
- package/.husky/pre-commit +1 -0
- package/LICENSE +201 -0
- package/README.md +196 -0
- package/demo/api.md +250 -0
- package/index.js +3 -0
- package/package.json +169 -0
- package/packageScripts/postinstall.mjs +28 -0
- package/src/auro-popover.js +165 -0
- package/src/layoverVersion.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx --no-install commitlint --edit "$1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
./node_modules/.bin/npm-run-all preCommit test linters postinstall
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The README.md file is a compiled document. No edits should be made directly to this file.
|
|
3
|
+
|
|
4
|
+
README.md is created by running `npm run build:docs`.
|
|
5
|
+
|
|
6
|
+
This file is generated based on a template fetched from
|
|
7
|
+
`https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/README_updated_paths.md`
|
|
8
|
+
and copied to `./componentDocs/README.md` each time the the docs are compiled.
|
|
9
|
+
|
|
10
|
+
The following sections are editable by making changes to the following files:
|
|
11
|
+
|
|
12
|
+
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
|
+
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
14
|
+
| Description | Description of the component | `./docs/partials/description.md` |
|
|
15
|
+
| Use Cases | Examples for when to use this component | `./docs/partials/useCases.md` |
|
|
16
|
+
| Additional Information | For use to add any component specific information | `./docs/partials/readmeAddlInfo.md` |
|
|
17
|
+
| Component Example Code | HTML sample code of the components use | `./apiExamples/basic.html` |
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
# Popover
|
|
21
|
+
|
|
22
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
|
+
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
+
The Auro Design System fully supports `top` and `bottom` placed popovers. The following examples illustrate common popover uses followed up by code examples.
|
|
25
|
+
|
|
26
|
+
See for more information as how to install and full API for the `<auro-popover>` element.
|
|
27
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
|
+
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
|
+
<!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
|
|
31
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
32
|
+
|
|
33
|
+
## UI development browser support
|
|
34
|
+
|
|
35
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/browserSupport.md) -->
|
|
36
|
+
For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
|
|
37
|
+
|
|
38
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentInstall_esm.md) -->
|
|
43
|
+
[](https://github.com/AlaskaAirlines/auro-popover/actions/workflows/testPublish.yml)
|
|
44
|
+
[](https://www.npmjs.com/package/@aurodesignsystem/auro-popover)
|
|
45
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
$ npm i @aurodesignsystem/auro-popover
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Installing as a direct, dev or peer dependency is up to the user installing the package. If you are unsure as to what type of dependency you should use, consider reading this [stack overflow](https://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies) answer.
|
|
53
|
+
|
|
54
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
55
|
+
|
|
56
|
+
### Design Token CSS Custom Property dependency
|
|
57
|
+
|
|
58
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/designTokens.md) -->
|
|
59
|
+
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
60
|
+
|
|
61
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
62
|
+
|
|
63
|
+
### Define dependency in project component
|
|
64
|
+
|
|
65
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImportDescription.md) -->
|
|
66
|
+
Defining the component dependency within each component that is using the `<auro-popover>` component.
|
|
67
|
+
|
|
68
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
69
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/componentImport.md) -->
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
import "@aurodesignsystem/auro-popover";
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
76
|
+
**Reference component in HTML**
|
|
77
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
78
|
+
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
82
|
+
<auro-popover>
|
|
83
|
+
Top popover content!
|
|
84
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
85
|
+
</auro-popover>
|
|
86
|
+
<!-- Using the placement=bottom attribute -->
|
|
87
|
+
<auro-popover placement="bottom">
|
|
88
|
+
Popover content!
|
|
89
|
+
<auro-button secondary slot="trigger">Popover Test</auro-button>
|
|
90
|
+
</auro-popover>
|
|
91
|
+
```
|
|
92
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
93
|
+
|
|
94
|
+
## Install bundled assets from CDN
|
|
95
|
+
|
|
96
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/bundleInstallDescription.md) -->
|
|
97
|
+
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. See -- `auro-popover__bundled.js` for modern browsers. Legacy browsers such as IE11 are no longer supported.
|
|
98
|
+
|
|
99
|
+
**WARNING!** When installing into your application environment, DO NOT use `@latest` for the requested version. Risks include unknown MAJOR version releases and instant adoption of any new features and possible bugs without developer knowledge. The `@latest` wildcard should NEVER be used for production customer-facing applications. You have been warned.
|
|
100
|
+
|
|
101
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
|
+
|
|
103
|
+
### Bundle example code
|
|
104
|
+
|
|
105
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/bundleUseModBrowsers.md) -->
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@/dist/auro-classic/CSSCustomProperties.css" />
|
|
109
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@/dist/bundled/essentials.css" />
|
|
110
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@5.1.0/dist/auro-popover__bundled.js" type="module"></script>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
114
|
+
|
|
115
|
+
## auro-popover use cases
|
|
116
|
+
|
|
117
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
118
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
119
|
+
The `auro-popover` element should be used in situations where users may:
|
|
120
|
+
|
|
121
|
+
* interact with an element to get clarification on content offering
|
|
122
|
+
* provide definition to iconic imagery
|
|
123
|
+
* when helper text is required
|
|
124
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
125
|
+
|
|
126
|
+
## API Code Examples
|
|
127
|
+
|
|
128
|
+
### Default auro-popover
|
|
129
|
+
|
|
130
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
131
|
+
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
135
|
+
<auro-popover>
|
|
136
|
+
Top popover content!
|
|
137
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
138
|
+
</auro-popover>
|
|
139
|
+
<!-- Using the placement=bottom attribute -->
|
|
140
|
+
<auro-popover placement="bottom">
|
|
141
|
+
Popover content!
|
|
142
|
+
<auro-button secondary slot="trigger">Popover Test</auro-button>
|
|
143
|
+
</auro-popover>
|
|
144
|
+
```
|
|
145
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
146
|
+
|
|
147
|
+
## Development
|
|
148
|
+
|
|
149
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/developmentDescription.md) -->
|
|
150
|
+
In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
|
|
151
|
+
|
|
152
|
+
Please be sure to review the [contribution guidelines](https://auro.alaskaair.com/contributing) for this project. Please make sure to **pay special attention** to the **conventional commits** section of the document.
|
|
153
|
+
|
|
154
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
155
|
+
|
|
156
|
+
### Start development environment
|
|
157
|
+
|
|
158
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/localhost.md) -->
|
|
159
|
+
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
|
|
160
|
+
|
|
161
|
+
```shell
|
|
162
|
+
$ npm run dev
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Open [localhost:8000](http://localhost:8000/)
|
|
166
|
+
|
|
167
|
+
If running separate sessions is preferred, please run the following commands in individual terminal shells.
|
|
168
|
+
|
|
169
|
+
```shell
|
|
170
|
+
$ npm run build:watch
|
|
171
|
+
|
|
172
|
+
$ npm run serve
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
176
|
+
|
|
177
|
+
### API generation
|
|
178
|
+
|
|
179
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/api.md) -->
|
|
180
|
+
The custom element API file is generated in the build and committed back to the repo with a version change. If the API doc has changed without a version change, author's are to run `npm run build:api` to generate the doc and commit to version control.
|
|
181
|
+
|
|
182
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
183
|
+
|
|
184
|
+
### Testing
|
|
185
|
+
|
|
186
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/testing.md) -->
|
|
187
|
+
Automated tests are required for every Auro component. See `.\test\auro-popover.test.js` for the tests for this component. Run `npm test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
|
|
188
|
+
|
|
189
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
190
|
+
|
|
191
|
+
### Bundled assets
|
|
192
|
+
|
|
193
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/bundles.md) -->
|
|
194
|
+
Bundled assets are only generated in the remote and not merged back to this repo. To review and/or test a bundled asset locally, run `$ npm run bundler` to generate assets.
|
|
195
|
+
|
|
196
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
package/demo/api.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../docs/api.md) -->
|
|
2
|
+
<!-- The below content is automatically added from ../docs/api.md -->
|
|
3
|
+
|
|
4
|
+
# auro-popover
|
|
5
|
+
|
|
6
|
+
Popover attaches to an element and displays on hover/blur.
|
|
7
|
+
|
|
8
|
+
## Attributes
|
|
9
|
+
|
|
10
|
+
| Attribute | Type | Description |
|
|
11
|
+
|---------------|-----------|--------------------------------------------------|
|
|
12
|
+
| [addSpace](#addSpace) | `boolean` | If true, will add additional top and bottom space around the appearance of the popover in relation to the trigger |
|
|
13
|
+
| [removeSpace](#removeSpace) | `boolean` | If true, will remove top and bottom space around the appearance of the popover in relation to the trigger |
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Attribute | Type | Default | Description |
|
|
18
|
+
|-------------|-------------|--------------------|---------|--------------------------------------------------|
|
|
19
|
+
| [boundary](#boundary) | `boundary` | `String \| Object` | | The element to use as the boundary for the popover. Can be a query selector or an HTML element. |
|
|
20
|
+
| [disabled](#disabled) | `disabled` | `boolean` | | If true, will disable the popover from showing on hover and focus |
|
|
21
|
+
| [for](#for) | `for` | `String` | | Directly associate the popover with a trigger element with the given ID. In most cases, this should not be necessary and set slot="trigger" on the element instead. |
|
|
22
|
+
| [placement](#placement) | `placement` | `String` | "top" | Expects top/bottom - position for popover in relation to the element |
|
|
23
|
+
|
|
24
|
+
## Slots
|
|
25
|
+
|
|
26
|
+
| Name | Description |
|
|
27
|
+
|-----------|--------------------------------------------------|
|
|
28
|
+
| | Default unnamed slot for the use of popover content |
|
|
29
|
+
| [trigger](#trigger) | The element in this slot triggers hiding and showing the popover. |
|
|
30
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
31
|
+
|
|
32
|
+
## API Examples
|
|
33
|
+
|
|
34
|
+
### Basic
|
|
35
|
+
|
|
36
|
+
<div class="exampleWrapper">
|
|
37
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/basic.html) -->
|
|
38
|
+
<!-- The below content is automatically added from ../apiExamples/basic.html -->
|
|
39
|
+
<!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
40
|
+
<auro-popover>
|
|
41
|
+
Top popover content!
|
|
42
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
43
|
+
</auro-popover>
|
|
44
|
+
<!-- Using the placement=bottom attribute -->
|
|
45
|
+
<auro-popover placement="bottom">
|
|
46
|
+
Popover content!
|
|
47
|
+
<auro-button secondary slot="trigger">Popover Test</auro-button>
|
|
48
|
+
</auro-popover>
|
|
49
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
50
|
+
</div>
|
|
51
|
+
<auro-accordion alignRight>
|
|
52
|
+
<span slot="trigger">See code</span>
|
|
53
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/basic.html) -->
|
|
54
|
+
<!-- The below code snippet is automatically added from ../apiExamples/basic.html -->
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
58
|
+
<auro-popover>
|
|
59
|
+
Top popover content!
|
|
60
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
61
|
+
</auro-popover>
|
|
62
|
+
<!-- Using the placement=bottom attribute -->
|
|
63
|
+
<auro-popover placement="bottom">
|
|
64
|
+
Popover content!
|
|
65
|
+
<auro-button secondary slot="trigger">Popover Test</auro-button>
|
|
66
|
+
</auro-popover>
|
|
67
|
+
```
|
|
68
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
69
|
+
</auro-accordion>
|
|
70
|
+
|
|
71
|
+
### Attribute Examples
|
|
72
|
+
|
|
73
|
+
#### Disabled
|
|
74
|
+
|
|
75
|
+
When the `disabled` attribute is present, the popover will not appear on hover or focus.
|
|
76
|
+
|
|
77
|
+
<div class="exampleWrapper">
|
|
78
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/disabled.html) -->
|
|
79
|
+
<!-- The below content is automatically added from ../apiExamples/disabled.html -->
|
|
80
|
+
<auro-popover disabled>
|
|
81
|
+
Top popover content!
|
|
82
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
83
|
+
</auro-popover>
|
|
84
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
85
|
+
</div>
|
|
86
|
+
<auro-accordion alignRight>
|
|
87
|
+
<span slot="trigger">See code</span>
|
|
88
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/disabled.html) -->
|
|
89
|
+
<!-- The below code snippet is automatically added from ../apiExamples/disabled.html -->
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<auro-popover disabled>
|
|
93
|
+
Top popover content!
|
|
94
|
+
<auro-button slot="trigger">Popover Test</auro-button>
|
|
95
|
+
</auro-popover>
|
|
96
|
+
```
|
|
97
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
98
|
+
</auro-accordion>
|
|
99
|
+
|
|
100
|
+
#### Add space around popover
|
|
101
|
+
|
|
102
|
+
Use the `addSpace` attribute to add more space between the popover and it's trigger.
|
|
103
|
+
|
|
104
|
+
<div class="exampleWrapper">
|
|
105
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/addSpace.html) -->
|
|
106
|
+
<!-- The below content is automatically added from ../apiExamples/addSpace.html -->
|
|
107
|
+
<auro-popover addSpace>
|
|
108
|
+
Notice this popover is a little<br>further away from the trigger.
|
|
109
|
+
<auro-button slot="trigger">Popover w/additional space above</auro-button>
|
|
110
|
+
</auro-popover>
|
|
111
|
+
<auro-popover placement="bottom" addSpace>
|
|
112
|
+
Notice this popover is a little<br>further away from the trigger.
|
|
113
|
+
<auro-button secondary slot="trigger">Popover w/additional space below</auro-button>
|
|
114
|
+
</auro-popover>
|
|
115
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
|
+
</div>
|
|
117
|
+
<auro-accordion alignRight>
|
|
118
|
+
<span slot="trigger">See code</span>
|
|
119
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/addSpace.html) -->
|
|
120
|
+
<!-- The below code snippet is automatically added from ../apiExamples/addSpace.html -->
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<auro-popover addSpace>
|
|
124
|
+
Notice this popover is a little<br>further away from the trigger.
|
|
125
|
+
<auro-button slot="trigger">Popover w/additional space above</auro-button>
|
|
126
|
+
</auro-popover>
|
|
127
|
+
<auro-popover placement="bottom" addSpace>
|
|
128
|
+
Notice this popover is a little<br>further away from the trigger.
|
|
129
|
+
<auro-button secondary slot="trigger">Popover w/additional space below</auro-button>
|
|
130
|
+
</auro-popover>
|
|
131
|
+
```
|
|
132
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
133
|
+
</auro-accordion>
|
|
134
|
+
|
|
135
|
+
#### Remove space around popover
|
|
136
|
+
|
|
137
|
+
Use the `removeSpace` attribute to lessen the space between the popover and it's trigger.
|
|
138
|
+
|
|
139
|
+
<div class="exampleWrapper">
|
|
140
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/removeSpace.html) -->
|
|
141
|
+
<!-- The below content is automatically added from ../apiExamples/removeSpace.html -->
|
|
142
|
+
<auro-popover removeSpace>
|
|
143
|
+
Notice this popover is a little<br>closer to the trigger.
|
|
144
|
+
<auro-button slot="trigger">Popover w/less space above</auro-button>
|
|
145
|
+
</auro-popover>
|
|
146
|
+
<auro-popover placement="bottom" removeSpace>
|
|
147
|
+
Notice this popover is a little<br>closer to the trigger.
|
|
148
|
+
<auro-button secondary slot="trigger">Popover w/less space below</auro-button>
|
|
149
|
+
</auro-popover>
|
|
150
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
151
|
+
</div>
|
|
152
|
+
<auro-accordion alignRight>
|
|
153
|
+
<span slot="trigger">See code</span>
|
|
154
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/removeSpace.html) -->
|
|
155
|
+
<!-- The below code snippet is automatically added from ../apiExamples/removeSpace.html -->
|
|
156
|
+
|
|
157
|
+
```html
|
|
158
|
+
<auro-popover removeSpace>
|
|
159
|
+
Notice this popover is a little<br>closer to the trigger.
|
|
160
|
+
<auro-button slot="trigger">Popover w/less space above</auro-button>
|
|
161
|
+
</auro-popover>
|
|
162
|
+
<auro-popover placement="bottom" removeSpace>
|
|
163
|
+
Notice this popover is a little<br>closer to the trigger.
|
|
164
|
+
<auro-button secondary slot="trigger">Popover w/less space below</auro-button>
|
|
165
|
+
</auro-popover>
|
|
166
|
+
```
|
|
167
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
168
|
+
</auro-accordion>
|
|
169
|
+
|
|
170
|
+
### Property Examples
|
|
171
|
+
|
|
172
|
+
### Guidelines
|
|
173
|
+
|
|
174
|
+
The auro-popover element is meant to be used when the interaction and it's content is passive. A popover is not to be used for cases where the user must adjust their focus and acknowledge the presented content. For these cases, please see the [auro-dialog](https://auro.alaskaair.com/components/auro/dialog) element.
|
|
175
|
+
|
|
176
|
+
The use of a hyperlink for to trigger an event in the UI is semantically incorrect and this will present itself as a confusing scenario to assistive devices.
|
|
177
|
+
|
|
178
|
+
<auro-alert type="error" noIcon>
|
|
179
|
+
<div class="exampleWrapper">
|
|
180
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/notRecommended.html) -->
|
|
181
|
+
<!-- The below content is automatically added from ../apiExamples/notRecommended.html -->
|
|
182
|
+
<auro-popover>
|
|
183
|
+
This works, but not recommended
|
|
184
|
+
<auro-hyperlink href="#" relative nav slot="trigger">hyperlink popover trigger</auro-hyperlink>
|
|
185
|
+
</auro-popover>
|
|
186
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
187
|
+
</div>
|
|
188
|
+
</auro-alert>
|
|
189
|
+
<auro-accordion alignRight>
|
|
190
|
+
<span slot="trigger">See code</span>
|
|
191
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/notRecommended.html) -->
|
|
192
|
+
<!-- The below code snippet is automatically added from ../apiExamples/notRecommended.html -->
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<auro-popover>
|
|
196
|
+
This works, but not recommended
|
|
197
|
+
<auro-hyperlink href="#" relative nav slot="trigger">hyperlink popover trigger</auro-hyperlink>
|
|
198
|
+
</auro-popover>
|
|
199
|
+
```
|
|
200
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
201
|
+
</auro-accordion>
|
|
202
|
+
In the event that a hyperlink UI is desired, it is recommended to use the `role="button"` semantic reassignment to the hyperlink element.
|
|
203
|
+
|
|
204
|
+
<auro-alert type="success" noIcon>
|
|
205
|
+
<div class="exampleWrapper">
|
|
206
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/recommended.html) -->
|
|
207
|
+
<!-- The below content is automatically added from ../apiExamples/recommended.html -->
|
|
208
|
+
<auro-popover>
|
|
209
|
+
Role button is recommended
|
|
210
|
+
<auro-hyperlink role="button" slot="trigger">hyperlink, role button</auro-hyperlink>
|
|
211
|
+
</auro-popover>
|
|
212
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
213
|
+
</div>
|
|
214
|
+
</auro-alert>
|
|
215
|
+
<auro-accordion alignRight>
|
|
216
|
+
<span slot="trigger">See code</span>
|
|
217
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/recommended.html) -->
|
|
218
|
+
<!-- The below code snippet is automatically added from ../apiExamples/recommended.html -->
|
|
219
|
+
|
|
220
|
+
```html
|
|
221
|
+
<auro-popover>
|
|
222
|
+
Role button is recommended
|
|
223
|
+
<auro-hyperlink role="button" slot="trigger">hyperlink, role button</auro-hyperlink>
|
|
224
|
+
</auro-popover>
|
|
225
|
+
```
|
|
226
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
227
|
+
</auro-accordion>
|
|
228
|
+
|
|
229
|
+
### Developer Notes
|
|
230
|
+
|
|
231
|
+
The default trigger for a popover is a `hover` event. Mobile devices do not support `hover` events directly, so the `hover` event is replaced with a `touchstart` event to produce the popover. This is to ensure reliability of the action versus a dependency on a secondary interruption of the `hover` event on mobile devices.
|
|
232
|
+
|
|
233
|
+
### Theme Support
|
|
234
|
+
|
|
235
|
+
The component may be restyled using the following code sample and changing the values of the following token(s).
|
|
236
|
+
|
|
237
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=../src/tokens.scss) -->
|
|
238
|
+
<!-- The below code snippet is automatically added from ../src/tokens.scss -->
|
|
239
|
+
|
|
240
|
+
```scss
|
|
241
|
+
@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
|
|
242
|
+
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
243
|
+
|
|
244
|
+
:host {
|
|
245
|
+
--ds-auro-popover-boxshadow-color: var(--ds-elevation-200, #{vac.$ds-elevation-200});
|
|
246
|
+
--ds-auro-popover-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
247
|
+
--ds-auro-popover-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": [
|
|
3
|
+
"================================================================================",
|
|
4
|
+
"# To work within the development environment, run the following tasks",
|
|
5
|
+
" 1. $ npm run dev",
|
|
6
|
+
" 2. Go to http://localhost:8000",
|
|
7
|
+
"================================================================================"
|
|
8
|
+
],
|
|
9
|
+
"name": "@aurodesignsystem-dev/auro-popover",
|
|
10
|
+
"version": "0.0.0-pr102.0",
|
|
11
|
+
"description": "auro-popover HTML custom element",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/AlaskaAirlines/auro-popover"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"license": "Apache-2.0",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": "^20.x || ^22.x "
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@aurodesignsystem/auro-library": "^4.1.1",
|
|
24
|
+
"@aurodesignsystem/auro-layover": "npm:@aurodesignsystem-dev/auro-layover@0.0.0-pr1.6",
|
|
25
|
+
"@aurodesignsystem/design-tokens": "^8.2.1",
|
|
26
|
+
"@aurodesignsystem/webcorestylesheets": "10.0.0",
|
|
27
|
+
"@popperjs/core": "^2.11.8",
|
|
28
|
+
"chalk": "^5.3.0",
|
|
29
|
+
"lit": "^3.2.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@aurodesignsystem/eslint-config": "1.3.4",
|
|
33
|
+
"@commitlint/cli": "^19.8.0",
|
|
34
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
35
|
+
"@open-wc/testing": "^4.0.0",
|
|
36
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
37
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
38
|
+
"@semantic-release/git": "^10.0.1",
|
|
39
|
+
"@semantic-release/npm": "^12.0.1",
|
|
40
|
+
"@web/dev-server": "^0.4.6",
|
|
41
|
+
"@web/test-runner": "^0.20.1",
|
|
42
|
+
"autoprefixer": "^10.4.21",
|
|
43
|
+
"compression": "^1.7.4",
|
|
44
|
+
"concat": "^1.0.3",
|
|
45
|
+
"concurrently": "^9.0.1",
|
|
46
|
+
"copyfiles": "^2.4.1",
|
|
47
|
+
"core-js": "^3.41.0",
|
|
48
|
+
"eslint": "^9.24.0",
|
|
49
|
+
"eslint-plugin-jsdoc": "^50.6.9",
|
|
50
|
+
"husky": "^9.1.6",
|
|
51
|
+
"lodash": "^4.17.21",
|
|
52
|
+
"markdown-magic": "^3.4.1",
|
|
53
|
+
"nodemon": "^3.1.7",
|
|
54
|
+
"npm-run-all": "^4.1.5",
|
|
55
|
+
"postcss": "^8.4.47",
|
|
56
|
+
"postcss-discard-comments": "^7.0.3",
|
|
57
|
+
"postcss-selector-replace": "^1.0.2",
|
|
58
|
+
"rollup": "^4.39.0",
|
|
59
|
+
"rollup-plugin-serve": "^3.0.0",
|
|
60
|
+
"sass": "^1.86.3",
|
|
61
|
+
"semantic-release": "^24.1.3",
|
|
62
|
+
"stylelint": "^16.18.0",
|
|
63
|
+
"stylelint-config-idiomatic-order": "^10.0.0",
|
|
64
|
+
"stylelint-config-standard": "^38.0.0",
|
|
65
|
+
"stylelint-config-standard-scss": "^14.0.0",
|
|
66
|
+
"stylelint-order": "^6.0.4",
|
|
67
|
+
"stylelint-scss": "^6.8.1",
|
|
68
|
+
"typescript": "^5.8.3",
|
|
69
|
+
"wc-sass-render": "^1.4.0",
|
|
70
|
+
"web-component-analyzer": "^2.0.0",
|
|
71
|
+
"whatwg-fetch": "^3.6.20",
|
|
72
|
+
"yaml-lint": "^1.7.0"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"wc-sass-render": {
|
|
76
|
+
"sass": "$sass"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"browserslist": [
|
|
80
|
+
"last 2 Chrome versions",
|
|
81
|
+
"last 2 iOS major versions",
|
|
82
|
+
"last 2 Firefox versions",
|
|
83
|
+
"last 2 Edge versions",
|
|
84
|
+
"last 2 Safari major versions"
|
|
85
|
+
],
|
|
86
|
+
"nodemonConfig": {
|
|
87
|
+
"ignore": [
|
|
88
|
+
"*-css.js",
|
|
89
|
+
"*.css"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"release": {
|
|
93
|
+
"branches": [
|
|
94
|
+
{
|
|
95
|
+
"name": "main"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "beta",
|
|
99
|
+
"prerelease": true
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"plugins": [
|
|
103
|
+
"@semantic-release/commit-analyzer",
|
|
104
|
+
"@semantic-release/release-notes-generator",
|
|
105
|
+
[
|
|
106
|
+
"@semantic-release/changelog",
|
|
107
|
+
{
|
|
108
|
+
"changelogFile": "./CHANGELOG.md",
|
|
109
|
+
"changelogTitle": "# Semantic Release Automated Changelog"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"@semantic-release/npm",
|
|
113
|
+
[
|
|
114
|
+
"@semantic-release/git",
|
|
115
|
+
{
|
|
116
|
+
"assets": [
|
|
117
|
+
"./package.json",
|
|
118
|
+
"./CHANGELOG.md",
|
|
119
|
+
"./README.md",
|
|
120
|
+
"./docs/api.md",
|
|
121
|
+
"./demo/demo.md",
|
|
122
|
+
"./demo/api.md"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"@semantic-release/github"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"access": "public"
|
|
131
|
+
},
|
|
132
|
+
"keywords": [
|
|
133
|
+
"alaska airlines",
|
|
134
|
+
"auro",
|
|
135
|
+
"design system",
|
|
136
|
+
"web components"
|
|
137
|
+
],
|
|
138
|
+
"scripts": {
|
|
139
|
+
"build": "npm-run-all build:version build:sass sass:render types",
|
|
140
|
+
"build:test": "npm-run-all test linters",
|
|
141
|
+
"build:release": "npm-run-all build build:test build:api build:docs bundler postinstall",
|
|
142
|
+
"build:ci": "npm-run-all sweep build:release",
|
|
143
|
+
"build:api": "wca analyze 'scripts/wca/*' --outFiles docs/api.md",
|
|
144
|
+
"build:dev:assets": "npm-run-all build:sass:component postCss:component sass:render build:docs",
|
|
145
|
+
"build:docs": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/generateDocs.mjs",
|
|
146
|
+
"build:sass": "npm-run-all build:sass:component postCss:component sass:render",
|
|
147
|
+
"build:sass:component": "sass --load-path=node_modules --no-source-map src:src",
|
|
148
|
+
"build:watch": "nodemon -e scss,js,html --watch src --watch apiExamples/**/* --exec npm run build:dev:assets",
|
|
149
|
+
"build:version": "node scripts/version.mjs",
|
|
150
|
+
"bundler": "rollup -c",
|
|
151
|
+
"bundler:test": "rollup -c -w",
|
|
152
|
+
"scssLint": "stylelint \"./src/**/*.scss\"",
|
|
153
|
+
"dev": "npm run bundler && concurrently --kill-others \"npm run build:watch\" \"npm run bundler:test\" \"npm run serve\"",
|
|
154
|
+
"dist:js": "copyfiles -u 1 -V './src/**/*.js' ./dist",
|
|
155
|
+
"esLint": "eslint src/auro-*.js",
|
|
156
|
+
"linters": "npm-run-all scssLint esLint",
|
|
157
|
+
"preCommit": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/pre-commit.mjs",
|
|
158
|
+
"postCss:component": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/postCss.mjs",
|
|
159
|
+
"postinstall": "node packageScripts/postinstall.mjs",
|
|
160
|
+
"sass:render": "sass-render src/*.css -t ./node_modules/@aurodesignsystem/auro-library/scripts/build/staticStyles-template.js",
|
|
161
|
+
"serve": "web-dev-server --open demo/ --node-resolve --watch",
|
|
162
|
+
"sweep": "rm -rf ./demo/css ./dist | rm ./src/*.css ./src/*-css.js",
|
|
163
|
+
"test": "wtr --coverage",
|
|
164
|
+
"test:watch": "wtr --watch",
|
|
165
|
+
"types": "tsc",
|
|
166
|
+
"prepare": "husky install",
|
|
167
|
+
"postversion": "npm-run-all build:api build:docs"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const pjson = require('../package.json');
|
|
7
|
+
|
|
8
|
+
console.log(chalk.hex('#f26135')(`
|
|
9
|
+
|
|
10
|
+
_______ __ __ __
|
|
11
|
+
| __|.---.-.--.--. | |--.-----.| | |.-----.
|
|
12
|
+
|__ || _ | | | | | -__|| | || _ |
|
|
13
|
+
|_______||___._|___ | |__|__|_____||__|__||_____|
|
|
14
|
+
|_____|
|
|
15
|
+
__ _______ __
|
|
16
|
+
| |_.-----. | _ |.--.--.----.-----.| |
|
|
17
|
+
| _| _ | | || | | _| _ ||__|
|
|
18
|
+
|____|_____| |___|___||_____|__| |_____||__|
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
╭ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ──────────────────────────────╮
|
|
22
|
+
|
|
23
|
+
Thanks for installing the latest version
|
|
24
|
+
of `) + chalk.hex('#ffd200').bold(`${pjson.name} v${pjson.version}.`) + chalk.hex('#f26135')(`
|
|
25
|
+
|
|
26
|
+
╰─────────────────────────────── ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
|
|
27
|
+
`)
|
|
28
|
+
);
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
|
|
4
|
+
// ---------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
|
|
8
|
+
import { html } from "lit/static-html.js";
|
|
9
|
+
import { LitElement, css } from "lit";
|
|
10
|
+
import { createRef, ref } from 'lit/directives/ref.js';
|
|
11
|
+
|
|
12
|
+
import { AuroDependencyVersioning } from '@aurodesignsystem/auro-library/scripts/runtime/dependencyTagVersioning.mjs';
|
|
13
|
+
import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';
|
|
14
|
+
|
|
15
|
+
import {AuroLayover} from "@aurodesignsystem/auro-layover/class";
|
|
16
|
+
import layoverVersion from './layoverVersion.js';
|
|
17
|
+
|
|
18
|
+
// Import touch detection lib
|
|
19
|
+
import styleCss from "./style-css.js";
|
|
20
|
+
import colorCss from "./color-css.js";
|
|
21
|
+
import tokensCss from "./tokens-css.js";
|
|
22
|
+
|
|
23
|
+
const DEFAULTS = {
|
|
24
|
+
placement: 'top',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The amount of extra spacing to add when the user passes "addSpace" */
|
|
28
|
+
const ADD_SPACE_AMOUNT = 22;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Popover attaches to an element and displays on hover/blur.
|
|
32
|
+
*
|
|
33
|
+
* @attr {boolean} disabled - If true, will disable the popover from showing on hover and focus
|
|
34
|
+
* @attr {boolean} addSpace - If true, will add additional top and bottom space around the appearance of the popover in relation to the trigger
|
|
35
|
+
* @attr {boolean} removeSpace - If true, will remove top and bottom space around the appearance of the popover in relation to the trigger
|
|
36
|
+
* @attr {"top"|"bottom"} placement - position for popover in relation to the element
|
|
37
|
+
* @slot - Default unnamed slot for the use of popover content
|
|
38
|
+
* @slot trigger - The element in this slot triggers hiding and showing the popover.
|
|
39
|
+
*/
|
|
40
|
+
export class AuroPopover extends LitElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
this._privateDefaults();
|
|
44
|
+
this._setDefaults(DEFAULTS);
|
|
45
|
+
this._createRefs();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Internal Defaults.
|
|
50
|
+
* @private
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
|
+
_setDefaults(defaults) {
|
|
54
|
+
Object.keys(defaults).forEach((key) => {
|
|
55
|
+
if (this[key] === undefined) {
|
|
56
|
+
this[key] = defaults[key];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Creates references for the layover and arrow elements.
|
|
63
|
+
* @returns {void}
|
|
64
|
+
*/
|
|
65
|
+
_createRefs() {
|
|
66
|
+
this._layoverRef = createRef();
|
|
67
|
+
this._arrowRef = createRef();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Creates versioned tags for internal use.
|
|
72
|
+
* @returns {void}
|
|
73
|
+
*/
|
|
74
|
+
_privateDefaults() {
|
|
75
|
+
const versioning = new AuroDependencyVersioning();
|
|
76
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils();
|
|
77
|
+
this.layoverTag = versioning.generateTag("auro-popover-layover", layoverVersion, AuroLayover);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// function to define props used within the scope of this component
|
|
81
|
+
static get properties() {
|
|
82
|
+
return {
|
|
83
|
+
placement: { type: String },
|
|
84
|
+
disabled: { type: Boolean },
|
|
85
|
+
boundary: { type: String },
|
|
86
|
+
addSpace: { type: Boolean, reflect: true }
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static get styles() {
|
|
91
|
+
return [
|
|
92
|
+
css`${styleCss}`,
|
|
93
|
+
css`${colorCss}`,
|
|
94
|
+
css`${tokensCss}`
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* This will register this element with the browser.
|
|
100
|
+
* @param {string} [name="auro-popover"] - The name of element that you want to register to.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* AuroPopover.register("custom-popover") // this will register this element to <custom-popover/>
|
|
104
|
+
*
|
|
105
|
+
*/
|
|
106
|
+
static register(name = "auro-popover") {
|
|
107
|
+
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroPopover);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get _layover () {
|
|
111
|
+
return this._layoverRef.value;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Toggles the display of the popover content.
|
|
116
|
+
* @private
|
|
117
|
+
* @returns {void} Fires an update lifecycle.
|
|
118
|
+
*/
|
|
119
|
+
toggle() {
|
|
120
|
+
this._layover.toggle();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Hides the popover.
|
|
125
|
+
* @private
|
|
126
|
+
* @returns {void} Fires an update lifecycle.
|
|
127
|
+
*/
|
|
128
|
+
toggleHide() {
|
|
129
|
+
this._layover.hide();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Shows the popover.
|
|
134
|
+
* @private
|
|
135
|
+
* @returns {void} Fires an update lifecycle.
|
|
136
|
+
*/
|
|
137
|
+
toggleShow() {
|
|
138
|
+
this._layover.show();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
get _popoverOffset() {
|
|
142
|
+
// If addSpace is true, we add extra space to the offset
|
|
143
|
+
return this.addSpace ? 12 + ADD_SPACE_AMOUNT : 12;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
147
|
+
render() {
|
|
148
|
+
return html`
|
|
149
|
+
<${this.layoverTag}
|
|
150
|
+
${ref(this._layoverRef)}
|
|
151
|
+
behavior="tooltip"
|
|
152
|
+
.placement="${this.placement}"
|
|
153
|
+
inline="true"
|
|
154
|
+
offset="${this._popoverOffset}"
|
|
155
|
+
?disabled="${this.disabled}"
|
|
156
|
+
>
|
|
157
|
+
<div slot="arrow" ${ref(this._arrowRef)} data-placement="${this.placement}" id="arrow" class="arrow"></div>
|
|
158
|
+
<slot name="trigger" slot="trigger"></slot>
|
|
159
|
+
<div id="popover" class="popover util_insetLg body-default" aria-live="polite" part="popover">
|
|
160
|
+
<slot></slot>
|
|
161
|
+
</div>
|
|
162
|
+
</${this.layoverTag}>
|
|
163
|
+
`;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default '0.0.0'
|