Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alaska.md to processed doc files #170 #172

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions docs/partials/alaska.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Alaska

The `auro-alaska` custom element is more than just an easy-to-use placement of the official logo, but it also comes with automation that will produce the proper version of the logo depending on the size of the parent container.

## Install

```bash
import "@alaskaairux/auro-icon/dist/auro-alaska";
```

## Default component

<div class="exampleWrapper">
<auro-alaska style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska style="width: 192px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper--ondark">
<auro-alaska onDark style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska onDark style="width: 192px"></auro-alaska>
```

</auro-accordion>

## Official logo with tagline

Using the `official` property will display the Alaska Airlines logo with the official tagline.

<div class="exampleWrapper">
<auro-alaska official style="width: 192px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official style="width: 192px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper--ondark">
<auro-alaska official ondark style="width: 192px"></auro-alaska>
rmenner marked this conversation as resolved.
Show resolved Hide resolved
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official ondark style="width: 192px"></auro-alaska>
```

</auro-accordion>

## Auto scale support

The Alaska Airline logo has a preferred version of the logo depending in the size of the rendering. The auro-alaska custom element is auto-aware and will display the proper version of the logo depending on the size of the container automatically.

<div class="exampleWrapper">
<auro-alaska style="width: 72px"></auro-alaska><br>
<auro-alaska style="width: 108px"></auro-alaska><br>
<auro-alaska style="width: 192px"></auro-alaska><br>
<auro-alaska style="width: 528px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska style="width: 72px"></auro-alaska>
<auro-alaska style="width: 108px"></auro-alaska>
<auro-alaska style="width: 192px"></auro-alaska>
<auro-alaska style="width: 528px"></auro-alaska>
```

</auro-accordion>

<div class="exampleWrapper">
<auro-alaska official style="width: 72px"></auro-alaska><br>
<auro-alaska official style="width: 108px"></auro-alaska><br>
<auro-alaska official style="width: 192px"></auro-alaska><br>
<auro-alaska official style="width: 528px"></auro-alaska>
</div>

<auro-accordion alignRight>
<span slot="trigger">See code</span>

```html
<auro-alaska official style="width: 72px"></auro-alaska>
<auro-alaska official style="width: 108px"></auro-alaska>
<auro-alaska official style="width: 192px"></auro-alaska>
<auro-alaska official style="width: 528px"></auro-alaska>
```

</auro-accordion>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"build:ci": "npm-run-all sweep build:release",
"build:api": "wca 'docs/wca/*' --outFiles docs/api.md",
"build:dev:assets": "npm-run-all build:sass:component postCss:component sass:render build:docs",
"build:docs": "node ./node_modules/@aurodesignsystem/auro-library/scripts/build/generateDocs.mjs",
"build:docs": "node ./packageScripts/processDocs.mjs",
"build:sass": "npm-run-all build:sass:component postCss:component sass:render",
"build:sass:component": "sass --no-source-map src:src",
"build:watch": "nodemon -e scss,js,html --watch src --watch apiExamples/**/* --exec npm run build:dev:assets",
Expand Down
44 changes: 44 additions & 0 deletions packageScripts/processDocs.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { fileConfigs as defaultFileConfigs, defaultDocsProcessorConfig } from "@aurodesignsystem/auro-library/scripts/build/processors/defaultDocsProcessor.mjs";
import { Logger } from "@aurodesignsystem/auro-library/scripts/utils/logger.mjs";
import {
fromAuroComponentRoot,
processContentForFile,
templateFiller
} from "@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils.mjs";

/**
* @param {ProcessorConfig} config - The configuration for this processor.
* @returns {import('@aurodesignsystem/auro-library/scripts/utils/sharedFileProcessorUtils').FileProcessorConfig[]}
*/
export const fileConfigs = (config) => [
...defaultFileConfigs(config),
{
identifier: 'alaska.md',
input: fromAuroComponentRoot(`docs/partials/alaska.md`),
output: fromAuroComponentRoot(`demo/alaska.md`)
}
];

/**
*
* @param {ProcessorConfig} config - The configuration for this processor.
* @return {Promise<void>}
*/
export async function processDocFiles(config = defaultDocsProcessorConfig) {
// setup
await templateFiller.extractNames();

for (const fileConfig of fileConfigs(config)) {
rmenner marked this conversation as resolved.
Show resolved Hide resolved
try {
// eslint-disable-next-line no-await-in-loop
await processContentForFile(fileConfig);
} catch (err) {
Logger.error(`Error processing ${fileConfig.identifier}: ${err.message}`);
}
rmenner marked this conversation as resolved.
Show resolved Hide resolved
}
rmenner marked this conversation as resolved.
Show resolved Hide resolved
}

processDocFiles().catch(err => {
Logger.error(`Failed to process docs: ${err}`);
});

Loading