@spectrum-web-components/picker-button 0.1.0
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/LICENSE +201 -0
- package/README.md +157 -0
- package/custom-elements.json +106 -0
- package/package.json +60 -0
- package/sp-picker-button.d.ts +6 -0
- package/sp-picker-button.dev.js +4 -0
- package/sp-picker-button.dev.js.map +7 -0
- package/sp-picker-button.js +2 -0
- package/sp-picker-button.js.map +7 -0
- package/src/PickerButton.d.ts +21 -0
- package/src/PickerButton.dev.js +68 -0
- package/src/PickerButton.dev.js.map +7 -0
- package/src/PickerButton.js +18 -0
- package/src/PickerButton.js.map +7 -0
- package/src/index.d.ts +1 -0
- package/src/index.dev.js +3 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -0
- package/src/index.js.map +7 -0
- package/src/picker-button.css.d.ts +2 -0
- package/src/picker-button.css.dev.js +475 -0
- package/src/picker-button.css.dev.js.map +7 -0
- package/src/picker-button.css.js +472 -0
- package/src/picker-button.css.js.map +7 -0
- package/src/spectrum-config.js +123 -0
- package/src/spectrum-picker-button-modifier.css.d.ts +2 -0
- package/src/spectrum-picker-button-modifier.css.dev.js +7 -0
- package/src/spectrum-picker-button-modifier.css.dev.js.map +7 -0
- package/src/spectrum-picker-button-modifier.css.js +4 -0
- package/src/spectrum-picker-button-modifier.css.js.map +7 -0
- package/src/spectrum-picker-button.css.d.ts +2 -0
- package/src/spectrum-picker-button.css.dev.js +443 -0
- package/src/spectrum-picker-button.css.dev.js.map +7 -0
- package/src/spectrum-picker-button.css.js +440 -0
- package/src/spectrum-picker-button.css.js.map +7 -0
- package/stories/index.js +60 -0
- package/stories/index.js.map +7 -0
- package/stories/picker-button-sizes.stories.js +25 -0
- package/stories/picker-button-sizes.stories.js.map +7 -0
- package/stories/picker-button.stories.js +38 -0
- package/stories/picker-button.stories.js.map +7 -0
- package/test/benchmark/basic-test.js +8 -0
- package/test/benchmark/basic-test.js.map +7 -0
- package/test/picker-button-sizes.test-vrt.js +5 -0
- package/test/picker-button-sizes.test-vrt.js.map +7 -0
- package/test/picker-button.test-vrt.js +5 -0
- package/test/picker-button.test-vrt.js.map +7 -0
- package/test/picker-button.test.js +34 -0
- package/test/picker-button.test.js.map +7 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { argTypes, Template } from "./index.js";
|
|
3
|
+
import "../sp-picker-button.js";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Picker Button/Sizes",
|
|
6
|
+
component: "sp-picker-button",
|
|
7
|
+
...argTypes
|
|
8
|
+
};
|
|
9
|
+
export const s = (args) => Template(args);
|
|
10
|
+
s.args = { size: "s" };
|
|
11
|
+
export const m = (args) => Template(args);
|
|
12
|
+
m.args = { size: "m" };
|
|
13
|
+
export const l = (args) => Template(args);
|
|
14
|
+
l.args = { size: "l" };
|
|
15
|
+
export const XL = (args) => Template(args);
|
|
16
|
+
XL.args = { size: "xl" };
|
|
17
|
+
export const sLabel = (args) => Template(args);
|
|
18
|
+
sLabel.args = { size: "s", label: true };
|
|
19
|
+
export const mLabel = (args) => Template(args);
|
|
20
|
+
mLabel.args = { size: "m", label: true };
|
|
21
|
+
export const lLabel = (args) => Template(args);
|
|
22
|
+
lLabel.args = { size: "l", label: true };
|
|
23
|
+
export const XLLabel = (args) => Template(args);
|
|
24
|
+
XLLabel.args = { size: "xl", label: true };
|
|
25
|
+
//# sourceMappingURL=picker-button-sizes.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["picker-button-sizes.stories.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\n\nimport { argTypes, StoryArgs, Template } from './index.js';\nimport '../sp-picker-button.js';\n\nexport default {\n title: 'Picker Button/Sizes',\n component: 'sp-picker-button',\n ...argTypes,\n};\n\nexport const s = (args: StoryArgs): TemplateResult => Template(args);\ns.args = { size: 's' };\n\nexport const m = (args: StoryArgs): TemplateResult => Template(args);\nm.args = { size: 'm' };\n\nexport const l = (args: StoryArgs): TemplateResult => Template(args);\nl.args = { size: 'l' };\n\nexport const XL = (args: StoryArgs): TemplateResult => Template(args);\nXL.args = { size: 'xl' };\n\nexport const sLabel = (args: StoryArgs): TemplateResult => Template(args);\nsLabel.args = { size: 's', label: true };\n\nexport const mLabel = (args: StoryArgs): TemplateResult => Template(args);\nmLabel.args = { size: 'm', label: true };\n\nexport const lLabel = (args: StoryArgs): TemplateResult => Template(args);\nlLabel.args = { size: 'l', label: true };\n\nexport const XLLabel = (args: StoryArgs): TemplateResult => Template(args);\nXLLabel.args = { size: 'xl', label: true };\n"],
|
|
5
|
+
"mappings": ";AAaA,SAAS,UAAqB,gBAAgB;AAC9C,OAAO;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,GAAG;AACP;AAEO,aAAM,IAAI,CAAC,SAAoC,SAAS,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,IAAI,CAAC,SAAoC,SAAS,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,IAAI,CAAC,SAAoC,SAAS,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,KAAK,CAAC,SAAoC,SAAS,IAAI;AACpE,GAAG,OAAO,EAAE,MAAM,KAAK;AAEhB,aAAM,SAAS,CAAC,SAAoC,SAAS,IAAI;AACxE,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK;AAEhC,aAAM,SAAS,CAAC,SAAoC,SAAS,IAAI;AACxE,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK;AAEhC,aAAM,SAAS,CAAC,SAAoC,SAAS,IAAI;AACxE,OAAO,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK;AAEhC,aAAM,UAAU,CAAC,SAAoC,SAAS,IAAI;AACzE,QAAQ,OAAO,EAAE,MAAM,MAAM,OAAO,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import { argTypes, Template } from "./index.js";
|
|
4
|
+
import "../sp-picker-button.js";
|
|
5
|
+
import "@spectrum-web-components/icons-workflow/icons/sp-icon-add.js";
|
|
6
|
+
export default {
|
|
7
|
+
title: "Picker Button",
|
|
8
|
+
component: "sp-picker-button",
|
|
9
|
+
...argTypes
|
|
10
|
+
};
|
|
11
|
+
export const active = (args) => Template(args);
|
|
12
|
+
active.args = { active: true };
|
|
13
|
+
export const customIcon = (args) => Template(args);
|
|
14
|
+
customIcon.args = {
|
|
15
|
+
icon: html`
|
|
16
|
+
<sp-icon-add slot="icon"></sp-icon-add>
|
|
17
|
+
`
|
|
18
|
+
};
|
|
19
|
+
export const invalid = (args) => Template(args);
|
|
20
|
+
invalid.args = { invalid: true };
|
|
21
|
+
export const label = (args) => Template(args);
|
|
22
|
+
label.args = { label: true };
|
|
23
|
+
export const labelCustom = (args) => Template(args);
|
|
24
|
+
labelCustom.args = { label: "Some" };
|
|
25
|
+
export const open = (args) => Template(args);
|
|
26
|
+
open.args = { open: true };
|
|
27
|
+
export const positionLeft = (args) => Template(args);
|
|
28
|
+
positionLeft.args = { position: "left" };
|
|
29
|
+
export const positionRight = (args) => Template(args);
|
|
30
|
+
positionRight.args = { position: "right" };
|
|
31
|
+
export const rounded = (args) => Template(args);
|
|
32
|
+
rounded.args = { rounded: true };
|
|
33
|
+
export const roundedLabel = (args) => Template(args);
|
|
34
|
+
roundedLabel.args = {
|
|
35
|
+
label: true,
|
|
36
|
+
rounded: true
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=picker-button.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["picker-button.stories.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 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 { argTypes, StoryArgs, Template } from './index.js';\nimport '../sp-picker-button.js';\n\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-add.js';\n\nexport default {\n title: 'Picker Button',\n component: 'sp-picker-button',\n ...argTypes,\n};\n\nexport const active = (args: StoryArgs): TemplateResult => Template(args);\nactive.args = { active: true };\n\nexport const customIcon = (args: StoryArgs): TemplateResult => Template(args);\ncustomIcon.args = {\n icon: html`\n <sp-icon-add slot=\"icon\"></sp-icon-add>\n `,\n};\n\nexport const invalid = (args: StoryArgs): TemplateResult => Template(args);\ninvalid.args = { invalid: true };\n\nexport const label = (args: StoryArgs): TemplateResult => Template(args);\nlabel.args = { label: true };\n\nexport const labelCustom = (args: StoryArgs): TemplateResult => Template(args);\nlabelCustom.args = { label: 'Some' };\n\nexport const open = (args: StoryArgs): TemplateResult => Template(args);\nopen.args = { open: true };\n\nexport const positionLeft = (args: StoryArgs): TemplateResult => Template(args);\npositionLeft.args = { position: 'left' };\n\nexport const positionRight = (args: StoryArgs): TemplateResult =>\n Template(args);\npositionRight.args = { position: 'right' };\n\nexport const rounded = (args: StoryArgs): TemplateResult => Template(args);\nrounded.args = { rounded: true };\n\nexport const roundedLabel = (args: StoryArgs): TemplateResult => Template(args);\nroundedLabel.args = {\n label: true,\n rounded: true,\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AAErC,SAAS,UAAqB,gBAAgB;AAC9C,OAAO;AAEP,OAAO;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AAAA,EACX,GAAG;AACP;AAEO,aAAM,SAAS,CAAC,SAAoC,SAAS,IAAI;AACxE,OAAO,OAAO,EAAE,QAAQ,KAAK;AAEtB,aAAM,aAAa,CAAC,SAAoC,SAAS,IAAI;AAC5E,WAAW,OAAO;AAAA,EACd,MAAM;AAAA;AAAA;AAGV;AAEO,aAAM,UAAU,CAAC,SAAoC,SAAS,IAAI;AACzE,QAAQ,OAAO,EAAE,SAAS,KAAK;AAExB,aAAM,QAAQ,CAAC,SAAoC,SAAS,IAAI;AACvE,MAAM,OAAO,EAAE,OAAO,KAAK;AAEpB,aAAM,cAAc,CAAC,SAAoC,SAAS,IAAI;AAC7E,YAAY,OAAO,EAAE,OAAO,OAAO;AAE5B,aAAM,OAAO,CAAC,SAAoC,SAAS,IAAI;AACtE,KAAK,OAAO,EAAE,MAAM,KAAK;AAElB,aAAM,eAAe,CAAC,SAAoC,SAAS,IAAI;AAC9E,aAAa,OAAO,EAAE,UAAU,OAAO;AAEhC,aAAM,gBAAgB,CAAC,SAC1B,SAAS,IAAI;AACjB,cAAc,OAAO,EAAE,UAAU,QAAQ;AAElC,aAAM,UAAU,CAAC,SAAoC,SAAS,IAAI;AACzE,QAAQ,OAAO,EAAE,SAAS,KAAK;AAExB,aAAM,eAAe,CAAC,SAAoC,SAAS,IAAI;AAC9E,aAAa,OAAO;AAAA,EAChB,OAAO;AAAA,EACP,SAAS;AACb;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/picker-button/sp-picker-button.js";
|
|
3
|
+
import { html } from "@spectrum-web-components/base";
|
|
4
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
5
|
+
measureFixtureCreation(html`
|
|
6
|
+
<sp-picker-button></sp-picker-button>
|
|
7
|
+
`);
|
|
8
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["basic-test.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 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*/\nimport '@spectrum-web-components/picker-button/sp-picker-button.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-picker-button></sp-picker-button>\n`);\n"],
|
|
5
|
+
"mappings": ";AAWA,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA,CAEtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["picker-button-sizes.test-vrt.ts"],
|
|
4
|
+
"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 * as stories from '../stories/picker-button-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('PickerButtonSizesStories', stories);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,4BAA4B,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["picker-button.test-vrt.ts"],
|
|
4
|
+
"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 * as stories from '../stories/picker-button.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('PickerButtonStories', stories);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,uBAAuB,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
|
|
3
|
+
import "../sp-picker-button.js";
|
|
4
|
+
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
5
|
+
describe("PickerButton", () => {
|
|
6
|
+
testForLitDevWarnings(
|
|
7
|
+
async () => await fixture(
|
|
8
|
+
html`
|
|
9
|
+
<sp-picker-button label="More"></sp-picker-button>
|
|
10
|
+
`
|
|
11
|
+
)
|
|
12
|
+
);
|
|
13
|
+
it("loads default picker-button accessibly", async () => {
|
|
14
|
+
const el = await fixture(
|
|
15
|
+
html`
|
|
16
|
+
<sp-picker-button label="More"></sp-picker-button>
|
|
17
|
+
`
|
|
18
|
+
);
|
|
19
|
+
await elementUpdated(el);
|
|
20
|
+
await expect(el).to.be.accessible();
|
|
21
|
+
});
|
|
22
|
+
it("loads labeled picker-button accessibly", async () => {
|
|
23
|
+
const el = await fixture(
|
|
24
|
+
html`
|
|
25
|
+
<sp-picker-button>
|
|
26
|
+
<span slot="label">All</span>
|
|
27
|
+
</sp-picker-button>
|
|
28
|
+
`
|
|
29
|
+
);
|
|
30
|
+
await elementUpdated(el);
|
|
31
|
+
await expect(el).to.be.accessible();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=picker-button.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["picker-button.test.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2022 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*/\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '../sp-picker-button.js';\nimport { PickerButton } from '..';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('PickerButton', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<PickerButton>(\n html`\n <sp-picker-button label=\"More\"></sp-picker-button>\n `\n )\n );\n it('loads default picker-button accessibly', async () => {\n const el = await fixture<PickerButton>(\n html`\n <sp-picker-button label=\"More\"></sp-picker-button>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads labeled picker-button accessibly', async () => {\n const el = await fixture<PickerButton>(\n html`\n <sp-picker-button>\n <span slot=\"label\">All</span>\n </sp-picker-button>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,OAAO;AAEP,SAAS,6BAA6B;AAEtC,SAAS,gBAAgB,MAAM;AAC3B;AAAA,IACI,YACI,MAAM;AAAA,MACF;AAAA;AAAA;AAAA,IAGJ;AAAA,EACR;AACA,KAAG,0CAA0C,YAAY;AACrD,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA,IAGJ;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,0CAA0C,YAAY;AACrD,UAAM,KAAK,MAAM;AAAA,MACb;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|