@swr-data-lab/components 1.5.0 → 1.5.2
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/.storybook/main.ts
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
|
+
import { dirname, join } from "path";
|
|
1
2
|
import type { StorybookConfig } from "@storybook/sveltekit";
|
|
2
3
|
|
|
4
|
+
function getAbsolutePath(value: string): any {
|
|
5
|
+
return dirname(require.resolve(join(value, "package.json")));
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
const config: StorybookConfig = {
|
|
4
|
-
stories: [
|
|
9
|
+
stories: [
|
|
10
|
+
"../src/**/*.stories.@(js|ts|svelte)",
|
|
11
|
+
"../src/**/*.mdx",
|
|
12
|
+
],
|
|
13
|
+
|
|
5
14
|
addons: [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
{
|
|
16
|
+
name: '@storybook/addon-svelte-csf',
|
|
17
|
+
options: {
|
|
18
|
+
legacyTemplate: true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getAbsolutePath("@storybook/addon-links"),
|
|
22
|
+
getAbsolutePath("@storybook/addon-essentials"),
|
|
23
|
+
getAbsolutePath("@chromatic-com/storybook"),
|
|
24
|
+
getAbsolutePath("@storybook/addon-interactions"),
|
|
25
|
+
getAbsolutePath("@storybook/addon-mdx-gfm")
|
|
11
26
|
],
|
|
12
27
|
framework: {
|
|
13
|
-
name: "@storybook/sveltekit",
|
|
28
|
+
name: getAbsolutePath("@storybook/sveltekit"),
|
|
14
29
|
options: {},
|
|
15
30
|
},
|
|
16
|
-
|
|
17
|
-
|
|
31
|
+
|
|
32
|
+
docs: {
|
|
33
|
+
autodocs: true
|
|
18
34
|
}
|
|
19
35
|
};
|
|
20
|
-
|
|
36
|
+
|
|
37
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -26,28 +26,29 @@
|
|
|
26
26
|
"@semantic-release/changelog": "^6.0.3",
|
|
27
27
|
"@semantic-release/git": "^10.0.1",
|
|
28
28
|
"@semantic-release/npm": "^12.0.1",
|
|
29
|
-
"@storybook/addon-essentials": "^8.4
|
|
30
|
-
"@storybook/addon-interactions": "^8.4
|
|
31
|
-
"@storybook/addon-links": "^8.4
|
|
32
|
-
"@storybook/addon-
|
|
33
|
-
"@storybook/
|
|
34
|
-
"@storybook/
|
|
35
|
-
"@storybook/
|
|
36
|
-
"@storybook/
|
|
37
|
-
"@storybook/
|
|
29
|
+
"@storybook/addon-essentials": "^8.6.4",
|
|
30
|
+
"@storybook/addon-interactions": "^8.6.4",
|
|
31
|
+
"@storybook/addon-links": "^8.6.4",
|
|
32
|
+
"@storybook/addon-mdx-gfm": "^8.6.4",
|
|
33
|
+
"@storybook/addon-svelte-csf": "^5.0.0-next.27",
|
|
34
|
+
"@storybook/blocks": "^8.6.4",
|
|
35
|
+
"@storybook/docs-tools": "^8.6.4",
|
|
36
|
+
"@storybook/svelte": "^8.6.4",
|
|
37
|
+
"@storybook/sveltekit": "^8.6.4",
|
|
38
|
+
"@storybook/test": "^8.6.4",
|
|
38
39
|
"@storybook/test-runner": "^0.19.1",
|
|
39
40
|
"@sveltejs/adapter-auto": "^3.0.0",
|
|
40
41
|
"@sveltejs/kit": "^2.0.0",
|
|
41
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
42
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
42
43
|
"concurrently": "^9.0.1",
|
|
43
44
|
"http-server": "^14.1.1",
|
|
44
45
|
"sass-embedded": "^1.78.0",
|
|
45
46
|
"semantic-release": "^24.1.2",
|
|
46
|
-
"storybook": "^8.4
|
|
47
|
-
"svelte": "^
|
|
47
|
+
"storybook": "^8.6.4",
|
|
48
|
+
"svelte": "^5.23.0",
|
|
48
49
|
"svelte-check": "^4.0.0",
|
|
49
50
|
"typescript": "^5.0.0",
|
|
50
|
-
"vite": "^
|
|
51
|
+
"vite": "^6.0.0",
|
|
51
52
|
"wait-on": "^8.0.1"
|
|
52
53
|
},
|
|
53
54
|
"type": "module",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"svelte": "./src/index.js"
|
|
64
65
|
}
|
|
65
66
|
},
|
|
66
|
-
"version": "1.5.
|
|
67
|
+
"version": "1.5.2"
|
|
67
68
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { userEvent, within, expect, fn } from "@storybook/test"
|
|
2
|
-
import AutoComplete from "."
|
|
2
|
+
import AutoComplete from "./index.js"
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: "Example/Autocomplete",
|
|
@@ -23,10 +23,6 @@ export const Basic = {
|
|
|
23
23
|
},
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const onSelect = fn((e) => {
|
|
27
|
-
return e.detail
|
|
28
|
-
})
|
|
29
|
-
|
|
30
26
|
export const Test = {
|
|
31
27
|
parameters: {
|
|
32
28
|
docs: {
|
|
@@ -39,9 +35,8 @@ export const Test = {
|
|
|
39
35
|
data: testData,
|
|
40
36
|
query: "",
|
|
41
37
|
placeholder: "Select a fruit",
|
|
42
|
-
event_select: onSelect,
|
|
43
38
|
},
|
|
44
|
-
play: async ({
|
|
39
|
+
play: async ({ canvasElement, step }) => {
|
|
45
40
|
const canvas = within(canvasElement)
|
|
46
41
|
const input = canvas.getByTestId("autocomplete-input")
|
|
47
42
|
await step("Select using the mouse", async () => {
|
|
@@ -51,7 +46,6 @@ export const Test = {
|
|
|
51
46
|
const bananasOption = canvas.getByText("Bananas")
|
|
52
47
|
await userEvent.click(bananasOption)
|
|
53
48
|
expect(input).toHaveValue("Bananas")
|
|
54
|
-
expect(onSelect).toHaveReturnedWith({ item: { label: "Bananas", value: "Bananas", details: {} } })
|
|
55
49
|
})
|
|
56
50
|
await userEvent.clear(input)
|
|
57
51
|
await step("Select using the keyboard", async () => {
|
|
@@ -61,7 +55,6 @@ export const Test = {
|
|
|
61
55
|
await userEvent.keyboard("{ArrowDown}")
|
|
62
56
|
await userEvent.keyboard("{Enter}")
|
|
63
57
|
expect(input).toHaveValue("Apples")
|
|
64
|
-
expect(onSelect).toHaveReturnedWith({ item: { label: "Apples", value: "Apples", details: {} } })
|
|
65
58
|
})
|
|
66
59
|
await userEvent.clear(input)
|
|
67
60
|
},
|
package/src/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { default as Button } from './Button/Button.svelte';
|
|
|
7
7
|
export { default as Select } from './Select/Select.svelte';
|
|
8
8
|
export { default as DesignTokens } from './DesignTokens/DesignTokens.svelte';
|
|
9
9
|
export { default as ChartHeader } from './ChartHeader/ChartHeader.svelte';
|
|
10
|
+
export { default as ChartFooter } from './ChartFooter/ChartFooter.svelte';
|