style: format luna charts source
This commit is contained in:
@@ -6,4 +6,4 @@ const config = {
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
export default config;
|
||||
|
||||
@@ -12,4 +12,4 @@ defineCustomElements();
|
||||
* Loads and registers component metadata for Storybook.
|
||||
* This enables automatic generation of props, methods, events, slots, shadow parts, and CSS variables tables.
|
||||
*/
|
||||
setCustomElementsManifest(customElements);
|
||||
setCustomElementsManifest(customElements);
|
||||
|
||||
+3
-4
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* This is an autogenerated file created by the Stencil compiler.
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
@@ -29,7 +28,7 @@ interface ComponentCompilerTypeReference {
|
||||
* - globally
|
||||
* - by importing it into a file (and is defined elsewhere)
|
||||
*/
|
||||
location: "local" | "global" | "import";
|
||||
location: 'local' | 'global' | 'import';
|
||||
/**
|
||||
* The path to the type reference, if applicable (global types should not need a path associated with them)
|
||||
*/
|
||||
@@ -152,7 +151,7 @@ export interface JsonDocsComponent {
|
||||
/**
|
||||
* The encapsulation strategy for a component
|
||||
*/
|
||||
encapsulation: "shadow" | "scoped" | "none";
|
||||
encapsulation: 'shadow' | 'scoped' | 'none';
|
||||
/**
|
||||
* The tag name for the component, for use in HTML
|
||||
*/
|
||||
@@ -467,7 +466,7 @@ export interface StyleDoc {
|
||||
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
||||
* ends).
|
||||
*/
|
||||
annotation: "prop";
|
||||
annotation: 'prop';
|
||||
/**
|
||||
* The Stencil style-mode that is associated with this property.
|
||||
*/
|
||||
|
||||
@@ -107,4 +107,4 @@
|
||||
}
|
||||
],
|
||||
"typeLibrary": {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,11 +95,7 @@ function App() {
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<my-component
|
||||
first="Stencil"
|
||||
middle="'Don't call me a framework'"
|
||||
last="JS"
|
||||
></my-component>
|
||||
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
@@ -108,4 +104,4 @@ function App() {
|
||||
export default App;
|
||||
```
|
||||
|
||||
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).
|
||||
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).
|
||||
|
||||
+52
-52
@@ -1,68 +1,68 @@
|
||||
|
||||
/* tslint:disable */
|
||||
/**
|
||||
* This is an autogenerated file created by the Stencil compiler.
|
||||
* It contains typing information for all components that exist in this project.
|
||||
*/
|
||||
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
|
||||
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
|
||||
export namespace Components {
|
||||
interface MyComponent {
|
||||
/**
|
||||
* The first name
|
||||
*/
|
||||
"first"?: string;
|
||||
/**
|
||||
* The last name
|
||||
*/
|
||||
"last"?: string;
|
||||
/**
|
||||
* The middle name
|
||||
*/
|
||||
"middle"?: string;
|
||||
}
|
||||
interface MyComponent {
|
||||
/**
|
||||
* The first name
|
||||
*/
|
||||
first?: string;
|
||||
/**
|
||||
* The last name
|
||||
*/
|
||||
last?: string;
|
||||
/**
|
||||
* The middle name
|
||||
*/
|
||||
middle?: string;
|
||||
}
|
||||
}
|
||||
declare global {
|
||||
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {
|
||||
}
|
||||
var HTMLMyComponentElement: {
|
||||
prototype: HTMLMyComponentElement;
|
||||
new (): HTMLMyComponentElement;
|
||||
};
|
||||
interface HTMLElementTagNameMap {
|
||||
"my-component": HTMLMyComponentElement;
|
||||
}
|
||||
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {}
|
||||
var HTMLMyComponentElement: {
|
||||
prototype: HTMLMyComponentElement;
|
||||
new (): HTMLMyComponentElement;
|
||||
};
|
||||
interface HTMLElementTagNameMap {
|
||||
'my-component': HTMLMyComponentElement;
|
||||
}
|
||||
}
|
||||
declare namespace LocalJSX {
|
||||
interface MyComponent {
|
||||
/**
|
||||
* The first name
|
||||
*/
|
||||
"first"?: string;
|
||||
/**
|
||||
* The last name
|
||||
*/
|
||||
"last"?: string;
|
||||
/**
|
||||
* The middle name
|
||||
*/
|
||||
"middle"?: string;
|
||||
}
|
||||
interface MyComponent {
|
||||
/**
|
||||
* The first name
|
||||
*/
|
||||
first?: string;
|
||||
/**
|
||||
* The last name
|
||||
*/
|
||||
last?: string;
|
||||
/**
|
||||
* The middle name
|
||||
*/
|
||||
middle?: string;
|
||||
}
|
||||
|
||||
interface MyComponentAttributes {
|
||||
"first": string;
|
||||
"middle": string;
|
||||
"last": string;
|
||||
}
|
||||
interface MyComponentAttributes {
|
||||
first: string;
|
||||
middle: string;
|
||||
last: string;
|
||||
}
|
||||
|
||||
interface IntrinsicElements {
|
||||
"my-component": Omit<MyComponent, keyof MyComponentAttributes> & { [K in keyof MyComponent & keyof MyComponentAttributes]?: MyComponent[K] } & { [K in keyof MyComponent & keyof MyComponentAttributes as `attr:${K}`]?: MyComponentAttributes[K] } & { [K in keyof MyComponent & keyof MyComponentAttributes as `prop:${K}`]?: MyComponent[K] };
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
'my-component': Omit<MyComponent, keyof MyComponentAttributes> & { [K in keyof MyComponent & keyof MyComponentAttributes]?: MyComponent[K] } & {
|
||||
[K in keyof MyComponent & keyof MyComponentAttributes as `attr:${K}`]?: MyComponentAttributes[K];
|
||||
} & { [K in keyof MyComponent & keyof MyComponentAttributes as `prop:${K}`]?: MyComponent[K] };
|
||||
}
|
||||
}
|
||||
export { LocalJSX as JSX };
|
||||
declare module "@stencil/core" {
|
||||
export namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
"my-component": LocalJSX.IntrinsicElements["my-component"] & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
|
||||
}
|
||||
declare module '@stencil/core' {
|
||||
export namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
'my-component': LocalJSX.IntrinsicElements['my-component'] & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export const Primary: Story = {
|
||||
last: 'Doe',
|
||||
middle: 'Michael',
|
||||
},
|
||||
render: (props) => <my-component {...props} />,
|
||||
render: props => <my-component {...props} />,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -38,4 +38,4 @@ export const Secondary: Story = {
|
||||
last: 'Smith',
|
||||
middle: 'Marie',
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# my-component
|
||||
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Attribute | Description | Type | Default |
|
||||
@@ -13,7 +10,6 @@
|
||||
| `last` | `last` | The last name | `string \| undefined` | `undefined` |
|
||||
| `middle` | `middle` | The middle name | `string \| undefined` | `undefined` |
|
||||
|
||||
---
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
*Built with [StencilJS](https://stenciljs.com/)*
|
||||
_Built with [StencilJS](https://stenciljs.com/)_
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html dir="ltr" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -9,13 +9,13 @@ export const axeCoreChecker: A11yChecker = {
|
||||
|
||||
return {
|
||||
checkerName: 'axe-core',
|
||||
violations: results.violations.map((violations) => ({
|
||||
violations: results.violations.map(violations => ({
|
||||
id: violations.id,
|
||||
impact: violations.impact ?? null,
|
||||
description: violations.help,
|
||||
helpUrl: violations.helpUrl,
|
||||
nodes: violations.nodes.map((node) => node.target.join(' ')),
|
||||
nodes: violations.nodes.map(node => node.target.join(' ')),
|
||||
})),
|
||||
};
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -14,4 +14,4 @@ export interface A11yCheckResult {
|
||||
export interface A11yChecker {
|
||||
name: string;
|
||||
run(root: Element): Promise<A11yCheckResult>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import type { A11yChecker, A11yCheckResult } from './checkers/types';
|
||||
import { axeCoreChecker } from './checkers/axe-core.checker';
|
||||
|
||||
const a11yCheckerRegistry: A11yChecker[] = [
|
||||
axeCoreChecker,
|
||||
];
|
||||
const a11yCheckerRegistry: A11yChecker[] = [axeCoreChecker];
|
||||
|
||||
export async function runA11yChecks(rootElement: Element): Promise<A11yCheckResult[]> {
|
||||
return Promise.all(a11yCheckerRegistry.map((a11yChecker) => a11yChecker.run(rootElement)));
|
||||
return Promise.all(a11yCheckerRegistry.map(a11yChecker => a11yChecker.run(rootElement)));
|
||||
}
|
||||
|
||||
export type { A11yChecker, A11yCheckResult, A11yViolation } from './checkers/types';
|
||||
export type { A11yChecker, A11yCheckResult, A11yViolation } from './checkers/types';
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { A11yCheckResult } from './checkers/types';
|
||||
|
||||
expect.extend({
|
||||
toHaveNoA11yViolations(results: A11yCheckResult[]) {
|
||||
const failing = results.filter((results) => results.violations.length > 0);
|
||||
const failing = results.filter(results => results.violations.length > 0);
|
||||
|
||||
if (failing.length === 0) {
|
||||
return {
|
||||
@@ -14,11 +14,9 @@ expect.extend({
|
||||
|
||||
const message = failing
|
||||
.map(
|
||||
(results) =>
|
||||
results =>
|
||||
`[${results.checkerName}] ${results.violations.length} violation(s):\n` +
|
||||
results.violations
|
||||
.map((validation) => ` - ${validation.id} (${validation.impact}): ${validation.description}\n affected: ${validation.nodes.join(', ')}`)
|
||||
.join('\n')
|
||||
results.violations.map(validation => ` - ${validation.id} (${validation.impact}): ${validation.description}\n affected: ${validation.nodes.join(', ')}`).join('\n'),
|
||||
)
|
||||
.join('\n\n');
|
||||
|
||||
@@ -33,4 +31,4 @@ declare module 'vitest' {
|
||||
interface Assertion {
|
||||
toHaveNoA11yViolations(): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
"allowUnreachableCode": false,
|
||||
"declaration": false,
|
||||
"experimentalDecorators": true,
|
||||
"lib": [
|
||||
"dom",
|
||||
"es2022"
|
||||
],
|
||||
"lib": ["dom", "es2022"],
|
||||
"moduleResolution": "bundler",
|
||||
"module": "esnext",
|
||||
"target": "es2022",
|
||||
@@ -18,14 +15,8 @@
|
||||
"jsx": "react",
|
||||
"jsxFactory": "h",
|
||||
"jsxFragmentFactory": "h.Fragment",
|
||||
"types": [
|
||||
"@stencil/vitest/globals"
|
||||
]
|
||||
"types": ["@stencil/vitest/globals"]
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineCustomElements } from "./loader";
|
||||
import { defineCustomElements } from './loader';
|
||||
import './src/testing/a11y/matchers';
|
||||
|
||||
defineCustomElements();
|
||||
defineCustomElements();
|
||||
|
||||
Reference in New Issue
Block a user