@lion/progress-indicator
Advanced tools
Comparing version 0.3.1 to 0.4.0
# @lion/progress-indicator | ||
## 0.4.0 | ||
### Minor Changes | ||
- f3e54c56: Publish documentation with a format for Rocket | ||
- 5db622e9: BREAKING: Align exports fields. This means no more wildcards, meaning you always import with bare import specifiers, extensionless. Import components where customElements.define side effect is executed by importing from '@lion/package/define'. For multi-component packages this defines all components (e.g. radio-group + radio). If you want to only import a single one, do '@lion/radio-group/define-radio' for example for just lion-radio. | ||
### Patch Changes | ||
- Updated dependencies [f3e54c56] | ||
- Updated dependencies [5db622e9] | ||
- @lion/core@0.15.0 | ||
- @lion/localize@0.17.0 | ||
## 0.3.1 | ||
@@ -4,0 +18,0 @@ |
@@ -74,3 +74,3 @@ { | ||
"type": { | ||
"text": "{\n 'lion-progress-indicator': (locale: string) => Promise<typeof import(\"../translations/bg.js\")>;\n }[]" | ||
"text": "{\n 'lion-progress-indicator': (locale: string) => Promise<typeof import(\"../translations/bg\")>;\n }[]" | ||
} | ||
@@ -77,0 +77,0 @@ }, |
{ | ||
"name": "@lion/progress-indicator", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "A progress indicator that is easily styleable and accessible in all contexts", | ||
@@ -27,7 +27,8 @@ "license": "MIT", | ||
"scripts": { | ||
"custom-elements-manifest": "custom-elements-manifest analyze --litelement --exclude 'docs/**/*' 'demo/**/*'", | ||
"custom-elements-manifest": "custom-elements-manifest analyze --litelement --exclude \"docs/**/*\" \"test-helpers/**/*\"", | ||
"debug": "cd ../../ && npm run debug -- --group progress-indicator", | ||
"debug:firefox": "cd ../../ && npm run debug:firefox -- --group progress-indicator", | ||
"debug:webkit": "cd ../../ && npm run debug:webkit -- --group progress-indicator", | ||
"prepublishOnly": "../../scripts/npm-prepublish.js && npm run custom-elements-manifest", | ||
"publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../", | ||
"prepublishOnly": "npm run publish-docs && npm run custom-elements-manifest", | ||
"test": "cd ../../ && npm run test:browser -- --group progress-indicator" | ||
@@ -39,4 +40,4 @@ }, | ||
"dependencies": { | ||
"@lion/core": "0.14.1", | ||
"@lion/localize": "0.16.1" | ||
"@lion/core": "0.15.0", | ||
"@lion/localize": "0.17.0" | ||
}, | ||
@@ -56,4 +57,6 @@ "keywords": [ | ||
".": "./index.js", | ||
"./lion-progress-indicator": "./lion-progress-indicator.js" | ||
"./define": "./lion-progress-indicator.js", | ||
"./translations/*": "./translations/*", | ||
"./docs/": "./docs/" | ||
} | ||
} |
@@ -1,18 +0,15 @@ | ||
[//]: # 'AUTO INSERT HEADER PREPUBLISH' | ||
# Content >> Progress Indicator >> Overview ||10 | ||
# Progress Indicator | ||
`lion-progress-indicator` implements accessibility requirements for progress indicators. | ||
```js script | ||
import { html } from '@lion/core'; | ||
import './demo/custom-progress-indicator.js'; | ||
export default { | ||
title: 'Others/Progress Indicator', | ||
}; | ||
```html | ||
<lion-progress-indicator></lion-progress-indicator> | ||
``` | ||
Note: You don't see a live demo here as it would be empty, since there is no styling. Check out the [examples](https://github.com/ing-bank/lion/blob/6f2b6f940a0875091f1d940f45f0cd32dffce9ac/docs/components/content/progress-indicator/examples.md) if you want to see a possible implementation. | ||
## Features | ||
`LionProgressIndicator` is designed to be extended to add visuals. | ||
- Accessibility compliant | ||
@@ -22,6 +19,4 @@ - Localized "Loading" label | ||
## How to use | ||
## Installation | ||
### Installation | ||
```bash | ||
@@ -34,59 +29,3 @@ npm i --save @lion/progress-indicator | ||
// or | ||
import '@lion/progress-indicator/lion-progress-indicator.js'; | ||
import '@lion/progress-indicator/define'; | ||
``` | ||
### Example | ||
```html | ||
<lion-progress-indicator></lion-progress-indicator> | ||
``` | ||
## Extended indicator with a custom visual | ||
`LionProgressIndicator` is designed to be extended to add visuals. Implement the `_graphicTemplate` method to set the rendered content, and apply styles normally. | ||
### Example extension | ||
```js | ||
class CustomProgressIndicator extends LionProgressIndicator { | ||
static get styles() { | ||
return [ | ||
css` | ||
svg { | ||
animation: spinner-rotate 2s linear infinite; | ||
display: inline-block; | ||
height: 48px; | ||
width: 48px; | ||
} | ||
circle { | ||
fill: none; | ||
stroke-width: 3.6; | ||
stroke: firebrick; | ||
stroke-dasharray: 100, 28; | ||
} | ||
@keyframes spinner-rotate { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
`, | ||
]; | ||
} | ||
_graphicTemplate() { | ||
return html`<svg viewBox="22 22 44 44"> | ||
<circle cx="44" cy="44" r="20.2" /> | ||
</svg>`; | ||
} | ||
} | ||
``` | ||
### Result | ||
```js preview-story | ||
export const customProgressDemo = () => html` | ||
<custom-progress-indicator></custom-progress-indicator> | ||
`; | ||
``` |
declare const LionProgressIndicator_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@lion/localize/types/LocalizeMixinTypes").LocalizeMixinHost> & Pick<typeof import("@lion/localize/types/LocalizeMixinTypes").LocalizeMixinHost, "prototype" | "localizeNamespaces" | "waitForLocalizeNamespaces"> & Pick<typeof LitElement, "prototype" | "render" | "styles" | "getStyles" | "properties" | "observedAttributes" | "createProperty">; | ||
export class LionProgressIndicator extends LionProgressIndicator_base { | ||
static get localizeNamespaces(): { | ||
'lion-progress-indicator': (locale: string) => Promise<typeof import("../translations/bg.js")>; | ||
'lion-progress-indicator': (locale: string) => Promise<typeof import("../translations/bg")>; | ||
}[]; | ||
@@ -6,0 +6,0 @@ _graphicTemplate(): {}; |
@@ -14,9 +14,9 @@ /* eslint-disable class-methods-use-this */ | ||
case 'bg': | ||
return import('../translations/bg.js'); | ||
return import('@lion/progress-indicator/translations/bg.js'); | ||
case 'cs-CZ': | ||
case 'cs': | ||
return import('../translations/cs.js'); | ||
return import('@lion/progress-indicator/translations/cs.js'); | ||
case 'de-DE': | ||
case 'de': | ||
return import('../translations/de.js'); | ||
return import('@lion/progress-indicator/translations/de.js'); | ||
case 'en-AU': | ||
@@ -27,40 +27,40 @@ case 'en-GB': | ||
case 'en': | ||
return import('../translations/en.js'); | ||
return import('@lion/progress-indicator/translations/en.js'); | ||
case 'es-ES': | ||
case 'es': | ||
return import('../translations/es.js'); | ||
return import('@lion/progress-indicator/translations/es.js'); | ||
case 'fr-BE': | ||
case 'fr-FR': | ||
case 'fr': | ||
return import('../translations/fr.js'); | ||
return import('@lion/progress-indicator/translations/fr.js'); | ||
case 'hu-HU': | ||
case 'hu': | ||
return import('../translations/hu.js'); | ||
return import('@lion/progress-indicator/translations/hu.js'); | ||
case 'it-IT': | ||
case 'it': | ||
return import('../translations/it.js'); | ||
return import('@lion/progress-indicator/translations/it.js'); | ||
case 'nl-BE': | ||
case 'nl-NL': | ||
case 'nl': | ||
return import('../translations/nl.js'); | ||
return import('@lion/progress-indicator/translations/nl.js'); | ||
case 'pl-PL': | ||
case 'pl': | ||
return import('../translations/pl.js'); | ||
return import('@lion/progress-indicator/translations/pl.js'); | ||
case 'ro-RO': | ||
case 'ro': | ||
return import('../translations/ro.js'); | ||
return import('@lion/progress-indicator/translations/ro.js'); | ||
case 'ru-RU': | ||
case 'ru': | ||
return import('../translations/ru.js'); | ||
return import('@lion/progress-indicator/translations/ru.js'); | ||
case 'sk-SK': | ||
case 'sk': | ||
return import('../translations/sk.js'); | ||
return import('@lion/progress-indicator/translations/sk.js'); | ||
case 'uk-UA': | ||
case 'uk': | ||
return import('../translations/uk.js'); | ||
return import('@lion/progress-indicator/translations/uk.js'); | ||
case 'zh-CN': | ||
case 'zh': | ||
return import('../translations/zh.js'); | ||
return import('@lion/progress-indicator/translations/zh.js'); | ||
default: | ||
return import('../translations/en.js'); | ||
return import('@lion/progress-indicator/translations/en.js'); | ||
} | ||
@@ -67,0 +67,0 @@ }, |
import { expect, fixture } from '@open-wc/testing'; | ||
import { html } from '@lion/core'; | ||
import '../lion-progress-indicator.js'; | ||
import '@lion/progress-indicator/define'; | ||
@@ -6,0 +6,0 @@ describe('lion-progress-indicator', () => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32908
43
30
+ Added@lion/core@0.15.0(transitive)
+ Added@lion/localize@0.17.0(transitive)
+ Addedsingleton-manager@1.4.0(transitive)
- Removed@lion/core@0.14.1(transitive)
- Removed@lion/localize@0.16.1(transitive)
- Removedsingleton-manager@1.3.0(transitive)
Updated@lion/core@0.15.0
Updated@lion/localize@0.17.0