@spectrum-web-components/accordion 0.6.6 → 0.6.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/accordion",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"lit-html"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@spectrum-web-components/base": "^0.5.
|
|
50
|
-
"@spectrum-web-components/icon": "^0.11.
|
|
51
|
-
"@spectrum-web-components/icons-ui": "^0.8.
|
|
52
|
-
"@spectrum-web-components/reactive-controllers": "^0.2.
|
|
53
|
-
"@spectrum-web-components/shared": "^0.13.
|
|
49
|
+
"@spectrum-web-components/base": "^0.5.4",
|
|
50
|
+
"@spectrum-web-components/icon": "^0.11.5",
|
|
51
|
+
"@spectrum-web-components/icons-ui": "^0.8.5",
|
|
52
|
+
"@spectrum-web-components/reactive-controllers": "^0.2.2",
|
|
53
|
+
"@spectrum-web-components/shared": "^0.13.6",
|
|
54
54
|
"tslib": "^2.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"sideEffects": [
|
|
62
62
|
"./sp-*.js"
|
|
63
63
|
],
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "caf12727e7f91dcf961e1fadacc727eea9ece27b"
|
|
65
65
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { html } from '@spectrum-web-components/base';
|
|
13
|
+
import '../sp-accordion.js';
|
|
14
|
+
import '../sp-accordion-item.js';
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Accordion',
|
|
17
|
+
component: 'sp-accordion',
|
|
18
|
+
args: {
|
|
19
|
+
open: false,
|
|
20
|
+
},
|
|
21
|
+
argTypes: {
|
|
22
|
+
open: {
|
|
23
|
+
name: 'open',
|
|
24
|
+
type: { name: 'boolean', required: false },
|
|
25
|
+
description: 'Whether the second accordion item is open.',
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: 'boolean' },
|
|
28
|
+
defaultValue: { summary: false },
|
|
29
|
+
},
|
|
30
|
+
control: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const Template = ({ allowMultiple, disabled, open } = {
|
|
37
|
+
allowMultiple: false,
|
|
38
|
+
disabled: false,
|
|
39
|
+
open: false,
|
|
40
|
+
}) => {
|
|
41
|
+
return html `
|
|
42
|
+
<sp-accordion
|
|
43
|
+
?allow-multiple=${allowMultiple}
|
|
44
|
+
style="color: var(--spectrum-global-color-gray-800)"
|
|
45
|
+
>
|
|
46
|
+
<sp-accordion-item label="Heading 1" ?disabled=${disabled}>
|
|
47
|
+
<div>Item 1</div>
|
|
48
|
+
</sp-accordion-item>
|
|
49
|
+
<sp-accordion-item label="Heading 2" ?open=${open}>
|
|
50
|
+
Item 2
|
|
51
|
+
</sp-accordion-item>
|
|
52
|
+
<sp-accordion-item label="Heading 3">Item 3</sp-accordion-item>
|
|
53
|
+
</sp-accordion>
|
|
54
|
+
`;
|
|
55
|
+
};
|
|
56
|
+
export const Default = (args) => Template(args);
|
|
57
|
+
export const Open = (args) => Template(args);
|
|
58
|
+
Open.args = {
|
|
59
|
+
open: true,
|
|
60
|
+
allowMultiple: false,
|
|
61
|
+
disabled: false,
|
|
62
|
+
};
|
|
63
|
+
export const AllowMultiple = (args) => Template(args);
|
|
64
|
+
AllowMultiple.args = {
|
|
65
|
+
allowMultiple: true,
|
|
66
|
+
};
|
|
67
|
+
export const Disabled = (args) => Template(args);
|
|
68
|
+
Disabled.args = {
|
|
69
|
+
disabled: true,
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=accordion.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.stories.js","sourceRoot":"","sources":["accordion.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AAErE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,yBAAyB,CAAC;AAEjC,eAAe;IACX,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE;QACF,IAAI,EAAE,KAAK;KACd;IACD,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EAAE,4CAA4C;YACzD,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;KACJ;CACJ,CAAC;AAQF,MAAM,QAAQ,GAAG,CACb,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,KAAiB;IAC5C,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;CACd,EACa,EAAE;IAChB,OAAO,IAAI,CAAA;;8BAEe,aAAa;;;6DAGkB,QAAQ;;;yDAGZ,IAAI;;;;;KAKxD,CAAC;AACN,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAiB,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAiB,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC1E,IAAI,CAAC,IAAI,GAAG;IACR,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,KAAK;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAiB,EAAkB,EAAE,CAC/D,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnB,aAAa,CAAC,IAAI,GAAG;IACjB,aAAa,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAiB,EAAkB,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC9E,QAAQ,CAAC,IAAI,GAAG;IACZ,QAAQ,EAAE,IAAI;CACjB,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '../sp-accordion.js';\nimport '../sp-accordion-item.js';\n\nexport default {\n title: 'Accordion',\n component: 'sp-accordion',\n args: {\n open: false,\n },\n argTypes: {\n open: {\n name: 'open',\n type: { name: 'boolean', required: false },\n description: 'Whether the second accordion item is open.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n },\n};\n\ntype Properties = {\n allowMultiple?: boolean;\n disabled?: boolean;\n open?: boolean;\n};\n\nconst Template = (\n { allowMultiple, disabled, open }: Properties = {\n allowMultiple: false,\n disabled: false,\n open: false,\n }\n): TemplateResult => {\n return html`\n <sp-accordion\n ?allow-multiple=${allowMultiple}\n style=\"color: var(--spectrum-global-color-gray-800)\"\n >\n <sp-accordion-item label=\"Heading 1\" ?disabled=${disabled}>\n <div>Item 1</div>\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 2\" ?open=${open}>\n Item 2\n </sp-accordion-item>\n <sp-accordion-item label=\"Heading 3\">Item 3</sp-accordion-item>\n </sp-accordion>\n `;\n};\nexport const Default = (args?: Properties): TemplateResult => Template(args);\n\nexport const Open = (args?: Properties): TemplateResult => Template(args);\nOpen.args = {\n open: true,\n allowMultiple: false,\n disabled: false,\n};\n\nexport const AllowMultiple = (args?: Properties): TemplateResult =>\n Template(args);\nAllowMultiple.args = {\n allowMultiple: true,\n};\n\nexport const Disabled = (args?: Properties): TemplateResult => Template(args);\nDisabled.args = {\n disabled: true,\n};\n"]}
|