@aurodesignsystem-dev/auro-flightline 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 +37 -51
- package/demo/api.md +232 -232
- package/demo/api.min.js +448 -1
- package/demo/index.md +18 -32
- package/demo/index.min.js +448 -1
- package/demo/readme.md +123 -0
- package/dist/auro-flightline-fhfUfH7l.js +27 -0
- package/dist/index.d.ts +356 -33
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +7 -7
- package/demo/auro-flightline.min.js +0 -432
- package/dist/auro-flightline-Ua1BdkHT.js +0 -27
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ 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
|
# Flightline
|
|
@@ -23,21 +23,21 @@ The following sections are editable by making changes to the following files:
|
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
24
|
The `<auro-flightline>` component represents any layovers and/or stopovers a guest may encounter throughout their journey.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
When its container is `320px` wide or narrower, the flightline hides the individual segments and shows the number of stops, counted from the `auro-flight-segment` elements inside it.
|
|
27
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
28
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
29
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
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
31
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
32
32
|
|
|
33
|
-
## Use
|
|
33
|
+
## Use cases
|
|
34
34
|
|
|
35
35
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
36
36
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
37
|
-
|
|
37
|
+
Use `<auro-flightline>` to show a route that includes layovers or stopovers, such as:
|
|
38
38
|
|
|
39
|
-
*
|
|
40
|
-
*
|
|
39
|
+
* A flight from SEA (Seattle, WA) to AVP (Scranton, PA) that requires a *layover* in ORD (Chicago, IL).
|
|
40
|
+
* A flight from ANC (Anchorage, AK) to ADK (Adak Island, AK) that has a *stopover* in CDB (Cold Bay, AK). [Passengers stay on the plane in Cold Bay](https://onemileatatime.com/alaska-airlines-adak-cold-bay/), and the stopover duration can't be predicted because passenger and cargo loads vary.
|
|
41
41
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
42
42
|
|
|
43
43
|
## Install
|
|
@@ -48,90 +48,76 @@ The `<auro-flightline>` element should be used in situations where users may:
|
|
|
48
48
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
49
49
|

|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
$ npm i @aurodesignsystem/auro-flightline
|
|
53
|
-
```
|
|
51
|
+
<pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-flightline</code></pre>
|
|
54
52
|
|
|
55
53
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
56
54
|
|
|
57
|
-
### Define
|
|
55
|
+
### Define dependency in project
|
|
58
56
|
|
|
59
57
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
60
|
-
|
|
58
|
+
Import the component in each project that uses `<auro-flightline>`.
|
|
61
59
|
|
|
62
60
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
63
61
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
import "@aurodesignsystem/auro-flightline";
|
|
67
|
-
```
|
|
63
|
+
<pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-flightline";</code></pre>
|
|
68
64
|
|
|
69
65
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
70
66
|
|
|
71
67
|
### Use CDN
|
|
72
68
|
|
|
73
69
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
74
|
-
|
|
70
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-flightline@latest/+esm"></script>
|
|
78
|
-
```
|
|
72
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-flightline@latest/+esm"></script></code></pre>
|
|
79
73
|
|
|
80
74
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
81
75
|
|
|
82
|
-
## Basic
|
|
76
|
+
## Basic example
|
|
83
77
|
|
|
84
78
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
85
79
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
86
80
|
|
|
87
|
-
|
|
88
|
-
<auro-flightline></auro-flightline>
|
|
89
|
-
```
|
|
81
|
+
<pre class="language-html"><code class="language-html"><auro-flightline></auro-flightline></code></pre>
|
|
90
82
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
91
83
|
|
|
92
|
-
## Custom
|
|
84
|
+
## Custom component registration for version management
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
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.
|
|
95
87
|
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
96
88
|
|
|
97
|
-
|
|
89
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
98
90
|
|
|
99
|
-
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),
|
|
91
|
+
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.
|
|
100
92
|
|
|
101
|
-
|
|
93
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
102
94
|
|
|
103
95
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
104
96
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
105
97
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
<pre class="language-js"><code class="language-js">// Import the classes only
|
|
99
|
+
import { AuroFlightline, AuroFlightSegment } from "@aurodesignsystem/auro-flightline/class";
|
|
100
|
+
// Register with custom names if desired
|
|
101
|
+
AuroFlightSegment.register("custom-flight-segment");
|
|
102
|
+
AuroFlightline.register("custom-flightline");</code></pre>
|
|
110
103
|
|
|
111
|
-
|
|
112
|
-
AuroFlightSegment.register('custom-flight-segment');
|
|
113
|
-
AuroFlightline.register('custom-flightline');
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
This will create a new custom element `<custom-flightline>` and `<custom-flight-segment>` that behaves exactly like `<auro-flightline>` and `<auro-flight-segment>`, allowing both sets of components to coexist on the same page without interfering with each other.
|
|
104
|
+
This creates `<custom-flightline>` and `<custom-flight-segment>`, which work like `<auro-flightline>` and `<auro-flight-segment>`. The flightline's "number of stops" summary at narrow widths still uses `<auro-flight-segment>`, so keep that element registered too.
|
|
117
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
118
106
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
108
|
+
<!-- The below content is automatically added from ./apiExamples/custom.html -->
|
|
109
|
+
<custom-flightline>
|
|
110
|
+
<custom-flight-segment canceled iata="ORD" duration="3h 40m"></custom-flight-segment>
|
|
111
|
+
</custom-flightline>
|
|
112
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
125
113
|
</div>
|
|
126
114
|
<auro-accordion alignRight>
|
|
127
|
-
|
|
115
|
+
<span slot="trigger">See code</span>
|
|
128
116
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
|
|
129
117
|
<!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
|
|
130
118
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
</custom-flightline>
|
|
135
|
-
```
|
|
119
|
+
<pre class="language-html"><code class="language-html"><custom-flightline>
|
|
120
|
+
<custom-flight-segment canceled iata="ORD" duration="3h 40m"></custom-flight-segment>
|
|
121
|
+
</custom-flightline></code></pre>
|
|
136
122
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
137
123
|
</auro-accordion>
|