@storybook/web-components 8.3.0-alpha.5 → 8.3.0-alpha.7
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/dist/index.d.ts +1 -3
- package/package.json +6 -6
- package/template/cli/js/Button.js +1 -3
- package/template/cli/ts-3-8/Button.ts +6 -18
- package/template/cli/ts-4-9/Button.ts +6 -18
- package/template/components/Button.js +2 -4
- package/template/components/Html.js +1 -4
- package/template/components/Pre.js +1 -4
- package/template/stories/demo-wc-card/DemoWcCard.js +4 -10
- package/template/stories/preview.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,9 +28,7 @@ type Preview = ProjectAnnotations<WebComponentsRenderer>;
|
|
|
28
28
|
|
|
29
29
|
declare function isValidComponent(tagName: string): boolean;
|
|
30
30
|
declare function isValidMetaData(customElements: any): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @param customElements any for now as spec is not super stable yet
|
|
33
|
-
*/
|
|
31
|
+
/** @param customElements `any` for now as spec is not super stable yet */
|
|
34
32
|
declare function setCustomElements(customElements: any): void;
|
|
35
33
|
declare function setCustomElementsManifest(customElements: any): void;
|
|
36
34
|
declare function getCustomElements(): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/web-components",
|
|
3
|
-
"version": "8.3.0-alpha.
|
|
3
|
+
"version": "8.3.0-alpha.7",
|
|
4
4
|
"description": "Storybook web-components renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lit",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"prep": "jiti ../../../scripts/prepare/bundle.ts"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@storybook/components": "^8.3.0-alpha.
|
|
53
|
+
"@storybook/components": "^8.3.0-alpha.7",
|
|
54
54
|
"@storybook/global": "^5.0.0",
|
|
55
|
-
"@storybook/manager-api": "^8.3.0-alpha.
|
|
56
|
-
"@storybook/preview-api": "^8.3.0-alpha.
|
|
57
|
-
"@storybook/theming": "^8.3.0-alpha.
|
|
55
|
+
"@storybook/manager-api": "^8.3.0-alpha.7",
|
|
56
|
+
"@storybook/preview-api": "^8.3.0-alpha.7",
|
|
57
|
+
"@storybook/theming": "^8.3.0-alpha.7",
|
|
58
58
|
"tiny-invariant": "^1.3.1",
|
|
59
59
|
"ts-dedent": "^2.0.0"
|
|
60
60
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"lit": "^2.0.0 || ^3.0.0",
|
|
71
|
-
"storybook": "^8.3.0-alpha.
|
|
71
|
+
"storybook": "^8.3.0-alpha.7"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=18.0.0"
|
|
@@ -3,9 +3,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
3
3
|
|
|
4
4
|
import './button.css';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* Primary UI component for user interaction
|
|
8
|
-
*/
|
|
6
|
+
/** Primary UI component for user interaction */
|
|
9
7
|
export const Button = ({ primary, backgroundColor = null, size, label, onClick }) => {
|
|
10
8
|
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
11
9
|
|
|
@@ -4,30 +4,18 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
4
4
|
import './button.css';
|
|
5
5
|
|
|
6
6
|
export interface ButtonProps {
|
|
7
|
-
/**
|
|
8
|
-
* Is this the principal call to action on the page?
|
|
9
|
-
*/
|
|
7
|
+
/** Is this the principal call to action on the page? */
|
|
10
8
|
primary?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* What background color to use
|
|
13
|
-
*/
|
|
9
|
+
/** What background color to use */
|
|
14
10
|
backgroundColor?: string;
|
|
15
|
-
/**
|
|
16
|
-
* How large should the button be?
|
|
17
|
-
*/
|
|
11
|
+
/** How large should the button be? */
|
|
18
12
|
size?: 'small' | 'medium' | 'large';
|
|
19
|
-
/**
|
|
20
|
-
* Button contents
|
|
21
|
-
*/
|
|
13
|
+
/** Button contents */
|
|
22
14
|
label: string;
|
|
23
|
-
/**
|
|
24
|
-
* Optional click handler
|
|
25
|
-
*/
|
|
15
|
+
/** Optional click handler */
|
|
26
16
|
onClick?: () => void;
|
|
27
17
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Primary UI component for user interaction
|
|
30
|
-
*/
|
|
18
|
+
/** Primary UI component for user interaction */
|
|
31
19
|
export const Button = ({ primary, backgroundColor, size, label, onClick }: ButtonProps) => {
|
|
32
20
|
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
33
21
|
|
|
@@ -4,30 +4,18 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
4
4
|
import './button.css';
|
|
5
5
|
|
|
6
6
|
export interface ButtonProps {
|
|
7
|
-
/**
|
|
8
|
-
* Is this the principal call to action on the page?
|
|
9
|
-
*/
|
|
7
|
+
/** Is this the principal call to action on the page? */
|
|
10
8
|
primary?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* What background color to use
|
|
13
|
-
*/
|
|
9
|
+
/** What background color to use */
|
|
14
10
|
backgroundColor?: string;
|
|
15
|
-
/**
|
|
16
|
-
* How large should the button be?
|
|
17
|
-
*/
|
|
11
|
+
/** How large should the button be? */
|
|
18
12
|
size?: 'small' | 'medium' | 'large';
|
|
19
|
-
/**
|
|
20
|
-
* Button contents
|
|
21
|
-
*/
|
|
13
|
+
/** Button contents */
|
|
22
14
|
label: string;
|
|
23
|
-
/**
|
|
24
|
-
* Optional click handler
|
|
25
|
-
*/
|
|
15
|
+
/** Optional click handler */
|
|
26
16
|
onClick?: () => void;
|
|
27
17
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Primary UI component for user interaction
|
|
30
|
-
*/
|
|
18
|
+
/** Primary UI component for user interaction */
|
|
31
19
|
export const Button = ({ primary, backgroundColor, size, label, onClick }: ButtonProps) => {
|
|
32
20
|
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
33
21
|
|
|
@@ -5,14 +5,12 @@ import { LitElement, html } from 'lit';
|
|
|
5
5
|
const { CustomEvent, customElements } = globalThis;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* @property {boolean} primary - Set button in primary mode
|
|
8
9
|
* @attr {string} label - Label of the button
|
|
9
10
|
* @attr {string} size - Size of the button, can be "small", "medium" or "large"; default is "medium".
|
|
10
11
|
* @attr {string} backgroundColor - Color of the button's background
|
|
11
12
|
*
|
|
12
|
-
* @cssprop [--sb-primary-color=#1ea7fd] - Controls the color of bar
|
|
13
|
-
*
|
|
14
|
-
* @prop {boolean} primary - Set button in primary mode
|
|
15
|
-
*
|
|
13
|
+
* @cssprop [--sb-primary-color=#1ea7fd] - Controls the color of bar. Default is `#1ea7fd`
|
|
16
14
|
* @event {CustomEvent} sb-button:click - Custom event send when the button is clicked
|
|
17
15
|
*
|
|
18
16
|
* @summary This is a simple Storybook Button
|
|
@@ -5,10 +5,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
5
5
|
|
|
6
6
|
const { customElements } = globalThis;
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @tag sb-pre
|
|
11
|
-
*/
|
|
8
|
+
/** @tag sb-pre */
|
|
12
9
|
export class SbPre extends LitElement {
|
|
13
10
|
// Currently TS decorators are not reflected so we have to use static `properties` function
|
|
14
11
|
// https://github.com/Polymer/lit-html/issues/1476
|
|
@@ -9,8 +9,8 @@ const { CustomEvent } = global;
|
|
|
9
9
|
/**
|
|
10
10
|
* This is a container looking like a card with a back and front side you can switch
|
|
11
11
|
*
|
|
12
|
-
* @slot - This is an unnamed slot (the default slot)
|
|
13
12
|
* @fires side-changed - Fires whenever it switches between front/back
|
|
13
|
+
* @slot - This is an unnamed slot (the default slot)
|
|
14
14
|
* @cssprop --demo-wc-card-header-font-size - Header font size
|
|
15
15
|
* @cssprop --demo-wc-card-front-color - Font color for front
|
|
16
16
|
* @cssprop --demo-wc-card-back-color - Font color for back
|
|
@@ -37,19 +37,13 @@ export class DemoWcCard extends LitElement {
|
|
|
37
37
|
constructor() {
|
|
38
38
|
super();
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* Indicates that the back of the card is shown
|
|
42
|
-
*/
|
|
40
|
+
/** Indicates that the back of the card is shown */
|
|
43
41
|
this.backSide = false;
|
|
44
42
|
|
|
45
|
-
/**
|
|
46
|
-
* Header message
|
|
47
|
-
*/
|
|
43
|
+
/** Header message */
|
|
48
44
|
this.header = 'Your Message';
|
|
49
45
|
|
|
50
|
-
/**
|
|
51
|
-
* Data rows
|
|
52
|
-
*/
|
|
46
|
+
/** Data rows */
|
|
53
47
|
this.rows = [];
|
|
54
48
|
}
|
|
55
49
|
|