@aurodesignsystem-dev/auro-popover 0.0.0-pr140.0 → 0.0.0-pr141.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/README.md +26 -27
- package/demo/api.md +155 -143
- package/demo/api.min.js +42 -24
- package/demo/index.md +9 -9
- package/demo/index.min.js +42 -24
- package/demo/readme.md +26 -27
- package/dist/index.d.ts +95 -64
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -12,23 +12,23 @@ The following sections are editable by making changes to the following files:
|
|
|
12
12
|
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
13
|
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
14
14
|
| Description | Description of the component | `./docs/partials/description.md` |
|
|
15
|
-
| Use
|
|
16
|
-
| Additional
|
|
17
|
-
| Component
|
|
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
18
|
-->
|
|
19
19
|
|
|
20
20
|
# Popover
|
|
21
21
|
|
|
22
22
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
-
|
|
24
|
+
Shows short supporting content next to a trigger when someone hovers over, focuses, or taps it. It uses the [Popper.js](https://popper.js.org/) library to position itself relative to the trigger and supports placements such as `top` and `bottom`.
|
|
25
25
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
26
26
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
27
27
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
28
28
|
<!-- 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. -->
|
|
29
29
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
30
30
|
|
|
31
|
-
## Use
|
|
31
|
+
## Use cases
|
|
32
32
|
|
|
33
33
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
34
34
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
@@ -51,10 +51,10 @@ The `auro-popover` element should be used in situations where users may:
|
|
|
51
51
|
|
|
52
52
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
53
53
|
|
|
54
|
-
### Define
|
|
54
|
+
### Define dependency in project
|
|
55
55
|
|
|
56
56
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
57
|
-
|
|
57
|
+
Import the component in each project that uses `<auro-popover>`.
|
|
58
58
|
|
|
59
59
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
60
60
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -66,44 +66,43 @@ Defining the dependency within each project that is using the `<auro-popover>` c
|
|
|
66
66
|
### Use CDN
|
|
67
67
|
|
|
68
68
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
69
|
-
|
|
69
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
70
70
|
|
|
71
|
-
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@latest/+esm"></script></code></pre>
|
|
71
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@latest/+esm"></script></code></pre>
|
|
72
72
|
|
|
73
73
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
74
74
|
|
|
75
|
-
## Basic
|
|
75
|
+
## Basic example
|
|
76
76
|
|
|
77
77
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
78
78
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
79
79
|
|
|
80
80
|
<pre class="language-html"><code class="language-html"><auro-popover>
|
|
81
81
|
Top popover content!
|
|
82
|
-
<auro-button slot="trigger">Popover
|
|
83
|
-
</auro-popover></code></pre>
|
|
82
|
+
<auro-button slot="trigger">Popover test</auro-button>
|
|
83
|
+
</auro-popover></code></pre>
|
|
84
84
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
85
85
|
|
|
86
|
-
## Custom
|
|
86
|
+
## Custom component registration for version management
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Every Auro component has two key parts: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
|
|
89
89
|
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
92
92
|
|
|
93
|
-
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions),
|
|
93
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), register the class manually under a custom element name to avoid conflicts.
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
96
96
|
|
|
97
97
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
98
98
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
99
99
|
|
|
100
100
|
<pre class="language-js"><code class="language-js">// Import the class only
|
|
101
101
|
import { AuroPopover } from '@aurodesignsystem/auro-popover/class';
|
|
102
|
-
|
|
103
|
-
// Register with a custom name if desired
|
|
102
|
+
// Register with a custom name if desired
|
|
104
103
|
AuroPopover.register('custom-popover');</code></pre>
|
|
105
104
|
|
|
106
|
-
This
|
|
105
|
+
This registers a new custom element, `<custom-popover>`, that behaves like `<auro-popover>`. Both can exist on the same page without interfering with each other.
|
|
107
106
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
108
107
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
109
108
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
@@ -111,12 +110,12 @@ This will create a new custom element `<custom-popover>` that behaves exactly li
|
|
|
111
110
|
<!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
112
111
|
<custom-popover>
|
|
113
112
|
Top popover content!
|
|
114
|
-
<auro-button slot="trigger">Popover
|
|
113
|
+
<auro-button slot="trigger">Popover test</auro-button>
|
|
115
114
|
</custom-popover>
|
|
116
115
|
<!-- Using the placement=bottom attribute -->
|
|
117
116
|
<custom-popover placement="bottom">
|
|
118
117
|
Popover content!
|
|
119
|
-
<auro-button slot="trigger">Popover
|
|
118
|
+
<auro-button slot="trigger">Popover test</auro-button>
|
|
120
119
|
</custom-popover>
|
|
121
120
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
122
121
|
</div>
|
|
@@ -128,12 +127,12 @@ This will create a new custom element `<custom-popover>` that behaves exactly li
|
|
|
128
127
|
<pre class="language-html"><code class="language-html"><!-- The slot=trigger attribute is bound directly to the auro-button element -->
|
|
129
128
|
<custom-popover>
|
|
130
129
|
Top popover content!
|
|
131
|
-
<auro-button slot="trigger">Popover
|
|
132
|
-
</custom-popover>
|
|
133
|
-
|
|
130
|
+
<auro-button slot="trigger">Popover test</auro-button>
|
|
131
|
+
</custom-popover>
|
|
132
|
+
<!-- Using the placement=bottom attribute -->
|
|
134
133
|
<custom-popover placement="bottom">
|
|
135
134
|
Popover content!
|
|
136
|
-
<auro-button slot="trigger">Popover
|
|
137
|
-
</custom-popover></code></pre>
|
|
135
|
+
<auro-button slot="trigger">Popover test</auro-button>
|
|
136
|
+
</custom-popover></code></pre>
|
|
138
137
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
139
138
|
</auro-accordion>
|