@spectrum-web-components/swatch 0.1.4-devmode.0 → 0.2.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/package.json +7 -7
- package/sp-swatch-group.js +1 -2
- package/sp-swatch-group.js.map +1 -1
- package/sp-swatch.js +1 -2
- package/sp-swatch.js.map +1 -1
- package/src/Swatch.js +9 -183
- package/src/Swatch.js.map +1 -1
- package/src/SwatchGroup.js +2 -215
- package/src/SwatchGroup.js.map +1 -1
- package/src/index.js +1 -2
- package/src/index.js.map +1 -1
- package/src/spectrum-swatch-group.css.js +2 -4
- package/src/spectrum-swatch-group.css.js.map +1 -1
- package/src/spectrum-swatch.css.js +2 -4
- package/src/spectrum-swatch.css.js.map +1 -1
- package/src/swatch-group.css.js +2 -4
- package/src/swatch-group.css.js.map +1 -1
- package/src/swatch.css.js +2 -4
- package/src/swatch.css.js.map +1 -1
- package/stories/swatch-group.stories.js +16 -166
- package/stories/swatch-group.stories.js.map +1 -1
- package/stories/swatch-sizes.stories.js +12 -27
- package/stories/swatch-sizes.stories.js.map +1 -1
- package/stories/swatch.stories.js +8 -97
- package/stories/swatch.stories.js.map +1 -1
- package/test/benchmark/basic-test.js +1 -4
- package/test/benchmark/basic-test.js.map +1 -1
- package/test/swatch-group.test-vrt.js +1 -3
- package/test/swatch-group.test-vrt.js.map +1 -1
- package/test/swatch-group.test.js +4 -234
- package/test/swatch-group.test.js.map +1 -1
- package/test/swatch-sizes.test-vrt.js +1 -3
- package/test/swatch-sizes.test-vrt.js.map +1 -1
- package/test/swatch.test-vrt.js +1 -3
- package/test/swatch.test-vrt.js.map +1 -1
- package/test/swatch.test.js +3 -138
- package/test/swatch.test.js.map +1 -1
package/src/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
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*/\nexport * from './Swatch.js';\nexport * from './SwatchGroup.js';\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,yBACA",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as s}from"@spectrum-web-components/base";const e=s`
|
|
3
2
|
:host{align-items:flex-start;display:inline-flex;flex-direction:row;flex-wrap:wrap;gap:var(--spectrum-global-dimension-size-50);justify-content:flex-start}:host([density=compact]){gap:var(
|
|
4
3
|
--spectrum-global-dimension-size-25
|
|
5
4
|
)}:host([density=spacious]){gap:var(
|
|
6
5
|
--spectrum-global-dimension-size-100
|
|
7
6
|
)}
|
|
8
|
-
`;
|
|
9
|
-
export default styles;
|
|
7
|
+
`;export default e;
|
|
10
8
|
//# sourceMappingURL=spectrum-swatch-group.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-swatch-group.css.ts"],
|
|
4
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{align-items:flex-start;display:inline-flex;flex-direction:row;flex-wrap:wrap;gap:var(--spectrum-global-dimension-size-50);justify-content:flex-start}:host([density=compact]){gap:var(\n--spectrum-global-dimension-size-25\n)}:host([density=spacious]){gap:var(\n--spectrum-global-dimension-size-100\n)}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as e}from"@spectrum-web-components/base";const r=e`
|
|
3
2
|
:host{--spectrum-swatch-size-xs:var(
|
|
4
3
|
--spectrum-global-dimension-size-200
|
|
5
4
|
);--spectrum-swatch-size-s:var(--spectrum-global-dimension-size-300);--spectrum-swatch-size-m:var(--spectrum-global-dimension-size-400);--spectrum-swatch-size-l:var(--spectrum-global-dimension-size-500);--spectrum-swatch-disabled-icon-size-xs:var(
|
|
@@ -61,6 +60,5 @@ const styles = css`
|
|
|
61
60
|
)}:host([size=l]){height:var(--spectrum-swatch-size-l);width:var(--spectrum-swatch-size-l)}:host([size=l]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-l);width:var(
|
|
62
61
|
--spectrum-swatch-disabled-icon-size-l
|
|
63
62
|
)}:host([shape=rectangle][size=xs]){width:calc(var(--spectrum-swatch-size-xs)*2)}:host([shape=rectangle][size=s]){width:calc(var(--spectrum-swatch-size-s)*2)}:host([shape=rectangle][size=m]){width:calc(var(--spectrum-swatch-size-m)*2)}:host([shape=rectangle][size=l]){width:calc(var(--spectrum-swatch-size-l)*2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before{border-radius:0}:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before,:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before{border-radius:100%}::slotted([slot=image]){height:100%;object-fit:contain;transition:width var(--spectrum-global-animation-duration-100,.13s) ease-in-out,height var(--spectrum-global-animation-duration-100,.13s) ease-in-out;width:100%}@media (forced-colors:active){.fill{forced-color-adjust:none}:host{--spectrum-swatch-disabled-icon-color:grayText;--spectrum-alias-focus-ring-color:ButtonText;--spectrum-swatch-selection-indicator-border-color:Highlight;--spectrum-swatch-fill-border-color:ButtonText;--spectrum-swatch-fill-border-color-light:ButtonText;--spectrum-swatch-background-color-selected:ButtonFace}:host([disabled]) .fill{forced-color-adjust:auto}:host([nothing]) .fill:after{background:ButtonText}}
|
|
64
|
-
`;
|
|
65
|
-
export default styles;
|
|
63
|
+
`;export default r;
|
|
66
64
|
//# sourceMappingURL=spectrum-swatch.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-swatch.css.ts"],
|
|
4
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-swatch-size-xs:var(\n--spectrum-global-dimension-size-200\n);--spectrum-swatch-size-s:var(--spectrum-global-dimension-size-300);--spectrum-swatch-size-m:var(--spectrum-global-dimension-size-400);--spectrum-swatch-size-l:var(--spectrum-global-dimension-size-500);--spectrum-swatch-disabled-icon-size-xs:var(\n--spectrum-global-dimension-size-150\n);--spectrum-swatch-disabled-icon-size-s:var(\n--spectrum-global-dimension-size-200\n);--spectrum-swatch-disabled-icon-size-m:var(\n--spectrum-global-dimension-size-225\n);--spectrum-swatch-disabled-icon-size-l:var(\n--spectrum-global-dimension-size-250\n);--spectrum-swatch-disabled-icon-color:var(\n--spectrum-global-color-static-gray-50,rgb(var(--spectrum-global-color-static-gray-50-rgb))\n);--spectrum-swatch-disabled-icon-stroke-color:rgba(var(--spectrum-global-color-static-black-rgb,0,0,0),0.51);--spectrum-swatch-selection-padding:var(\n--spectrum-global-dimension-size-100\n);--spectrum-swatch-selection-indicator-border-width:var(\n--spectrum-global-dimension-size-25\n);--spectrum-swatch-selection-indicator-border-color:var(\n--spectrum-global-color-gray-900\n);--spectrum-swatch-background-color-selected:var(\n--spectrum-global-color-gray-50\n);--spectrum-swatch-border-radius:var(\n--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50)\n);--spectrum-swatch-fill-border-radius-selected:var(\n--spectrum-alias-border-radius-small,var(--spectrum-global-dimension-size-25)\n);--spectrum-swatch-fill-border-width:var(\n--spectrum-alias-border-size-thin,var(--spectrum-global-dimension-static-size-10)\n);--spectrum-swatch-fill-border-color:rgba(var(--spectrum-global-color-gray-900-rgb),0.51);--spectrum-swatch-fill-border-color-light:rgba(var(--spectrum-global-color-gray-900-rgb),0.2);--spectrum-swatch-background-offset:0px;--spectrum-swatch-checkerboard-size:var(\n--spectrum-global-dimension-static-size-100,8px\n);align-items:center;display:flex;justify-content:center;outline:none;position:relative;-webkit-user-select:none;user-select:none}:host,:host:before{border-radius:var(\n--spectrum-swatch-border-radius\n)}:host([selected]){--spectrum-swatch-background-offset:-4px;background-color:var(\n--spectrum-swatch-background-color-selected\n)}:host([selected]) .fill{border-radius:var(--spectrum-swatch-fill-border-radius-selected);height:calc(100% - var(--spectrum-swatch-selection-padding));width:calc(100% - var(--spectrum-swatch-selection-padding))}:host([selected]) .fill:before{border-radius:var(\n--spectrum-swatch-fill-border-radius-selected\n);box-shadow:none}:host([selected]):before{opacity:1}:host([mixed-value]) .fill{background:var(\n--spectrum-swatch-background-color-selected\n)}:host([mixed-value]) .mixedValueIcon{visibility:visible}:host([nothing]) .fill{background:var(\n--spectrum-swatch-background-color-selected\n)}:host([nothing]) .fill:after{background:var(--spectrum-global-color-red-500);content:\"\";position:absolute;transform:rotate(-45deg);width:200%}:host([nothing][shape=rectangle]) .fill:after{transform:rotate(-25deg)}:host([nothing][size=xs]) .fill:after{height:2px}:host([nothing][size=s]) .fill:after{height:3px}:host([nothing][size=m]) .fill:after{height:4px}:host([nothing][size=l]) .fill:after{height:5px}:host([disabled]) .disabledIcon,:host([disabled]) .disabledIcon{visibility:visible}:host(.focus-visible):after{opacity:1}:host(:focus-visible):after{opacity:1}:host:before{border:var(--spectrum-swatch-selection-indicator-border-width) solid var(--spectrum-swatch-selection-indicator-border-color);bottom:0;content:\"\";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}:host:after{border:var(--spectrum-global-dimension-static-size-25,2px) solid var(\n--spectrum-alias-focus-ring-color,var(--spectrum-alias-focus-color)\n);border-radius:var(--spectrum-alias-focus-ring-border-radius-regular);bottom:calc(var(--spectrum-global-dimension-size-50)*-1);content:\"\";left:calc(var(--spectrum-global-dimension-size-50)*-1);opacity:0;position:absolute;right:calc(var(--spectrum-global-dimension-size-50)*-1);top:calc(var(--spectrum-global-dimension-size-50)*-1);transition:opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out}.fill{align-items:center;background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%);background-position:var(--spectrum-swatch-background-offset) var(--spectrum-swatch-background-offset),var(--spectrum-swatch-background-offset) calc(var(--spectrum-swatch-checkerboard-size) + var(--spectrum-swatch-background-offset)),calc(var(--spectrum-swatch-checkerboard-size) + var(--spectrum-swatch-background-offset)) calc(var(--spectrum-swatch-checkerboard-size)*-1 + var(--spectrum-swatch-background-offset)),calc(var(--spectrum-swatch-checkerboard-size)*-1 + var(--spectrum-swatch-background-offset)) var(--spectrum-swatch-background-offset);background-size:calc(var(--spectrum-swatch-checkerboard-size)*2) calc(var(--spectrum-swatch-checkerboard-size)*2);border-radius:var(--spectrum-swatch-border-radius);box-sizing:border-box;display:flex;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.fill:before{background-color:var(--spectrum-picked-color,transparent);border-radius:var(--spectrum-swatch-border-radius);bottom:0;box-shadow:inset 0 0 0 var(--spectrum-swatch-fill-border-width) var(--spectrum-swatch-fill-border-color);content:\"\";left:0;position:absolute;right:0;top:0;z-index:0}:host([border=light]) .fill:before{box-shadow:inset 0 0 0 var(--spectrum-swatch-fill-border-width) var(--spectrum-swatch-fill-border-color-light)}:host([border=none]) .fill:before{box-shadow:none}.mixedValueIcon{color:var(\n--spectrum-global-color-gray-700\n)}.disabledIcon,.mixedValueIcon{pointer-events:none;visibility:hidden}.disabledIcon{stroke:var(--spectrum-swatch-disabled-icon-stroke-color);color:var(--spectrum-swatch-disabled-icon-color);position:relative;z-index:2}:host([size=xs]){height:var(--spectrum-swatch-size-xs);width:var(--spectrum-swatch-size-xs)}:host([size=xs]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-xs);width:var(\n--spectrum-swatch-disabled-icon-size-xs\n)}:host([size=s]){height:var(--spectrum-swatch-size-s);width:var(--spectrum-swatch-size-s)}:host([size=s]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-s);width:var(\n--spectrum-swatch-disabled-icon-size-s\n)}:host([size=m]){height:var(--spectrum-swatch-size-m);width:var(--spectrum-swatch-size-m)}:host([size=m]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-m);width:var(\n--spectrum-swatch-disabled-icon-size-m\n)}:host([size=l]){height:var(--spectrum-swatch-size-l);width:var(--spectrum-swatch-size-l)}:host([size=l]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-l);width:var(\n--spectrum-swatch-disabled-icon-size-l\n)}:host([shape=rectangle][size=xs]){width:calc(var(--spectrum-swatch-size-xs)*2)}:host([shape=rectangle][size=s]){width:calc(var(--spectrum-swatch-size-s)*2)}:host([shape=rectangle][size=m]){width:calc(var(--spectrum-swatch-size-m)*2)}:host([shape=rectangle][size=l]){width:calc(var(--spectrum-swatch-size-l)*2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before{border-radius:0}:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before,:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before{border-radius:100%}::slotted([slot=image]){height:100%;object-fit:contain;transition:width var(--spectrum-global-animation-duration-100,.13s) ease-in-out,height var(--spectrum-global-animation-duration-100,.13s) ease-in-out;width:100%}@media (forced-colors:active){.fill{forced-color-adjust:none}:host{--spectrum-swatch-disabled-icon-color:grayText;--spectrum-alias-focus-ring-color:ButtonText;--spectrum-swatch-selection-indicator-border-color:Highlight;--spectrum-swatch-fill-border-color:ButtonText;--spectrum-swatch-fill-border-color-light:ButtonText;--spectrum-swatch-background-color-selected:ButtonFace}:host([disabled]) .fill{forced-color-adjust:auto}:host([nothing]) .fill:after{background:ButtonText}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA+Df,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/swatch-group.css.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as s}from"@spectrum-web-components/base";const e=s`
|
|
3
2
|
:host{align-items:flex-start;display:inline-flex;flex-direction:row;flex-wrap:wrap;gap:var(--spectrum-global-dimension-size-50);justify-content:flex-start}:host([density=compact]){gap:var(
|
|
4
3
|
--spectrum-global-dimension-size-25
|
|
5
4
|
)}:host([density=spacious]){gap:var(
|
|
6
5
|
--spectrum-global-dimension-size-100
|
|
7
6
|
)}
|
|
8
|
-
`;
|
|
9
|
-
export default styles;
|
|
7
|
+
`;export default e;
|
|
10
8
|
//# sourceMappingURL=swatch-group.css.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-group.css.ts"],
|
|
4
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{align-items:flex-start;display:inline-flex;flex-direction:row;flex-wrap:wrap;gap:var(--spectrum-global-dimension-size-50);justify-content:flex-start}:host([density=compact]){gap:var(\n--spectrum-global-dimension-size-25\n)}:host([density=spacious]){gap:var(\n--spectrum-global-dimension-size-100\n)}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/swatch.css.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const styles = css`
|
|
1
|
+
import{css as e}from"@spectrum-web-components/base";const r=e`
|
|
3
2
|
:host{--spectrum-swatch-size-xs:var(
|
|
4
3
|
--spectrum-global-dimension-size-200
|
|
5
4
|
);--spectrum-swatch-size-s:var(--spectrum-global-dimension-size-300);--spectrum-swatch-size-m:var(--spectrum-global-dimension-size-400);--spectrum-swatch-size-l:var(--spectrum-global-dimension-size-500);--spectrum-swatch-disabled-icon-size-xs:var(
|
|
@@ -61,6 +60,5 @@ const styles = css`
|
|
|
61
60
|
)}:host([size=l]){height:var(--spectrum-swatch-size-l);width:var(--spectrum-swatch-size-l)}:host([size=l]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-l);width:var(
|
|
62
61
|
--spectrum-swatch-disabled-icon-size-l
|
|
63
62
|
)}:host([shape=rectangle][size=xs]){width:calc(var(--spectrum-swatch-size-xs)*2)}:host([shape=rectangle][size=s]){width:calc(var(--spectrum-swatch-size-s)*2)}:host([shape=rectangle][size=m]){width:calc(var(--spectrum-swatch-size-m)*2)}:host([shape=rectangle][size=l]){width:calc(var(--spectrum-swatch-size-l)*2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before{border-radius:0}:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before,:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before{border-radius:100%}::slotted([slot=image]){height:100%;object-fit:contain;transition:width var(--spectrum-global-animation-duration-100,.13s) ease-in-out,height var(--spectrum-global-animation-duration-100,.13s) ease-in-out;width:100%}@media (forced-colors:active){.fill{forced-color-adjust:none}:host{--spectrum-swatch-disabled-icon-color:grayText;--spectrum-alias-focus-ring-color:ButtonText;--spectrum-swatch-selection-indicator-border-color:Highlight;--spectrum-swatch-fill-border-color:ButtonText;--spectrum-swatch-fill-border-color-light:ButtonText;--spectrum-swatch-background-color-selected:ButtonFace}:host([disabled]) .fill{forced-color-adjust:auto}:host([nothing]) .fill:after{background:ButtonText}}
|
|
64
|
-
`;
|
|
65
|
-
export default styles;
|
|
63
|
+
`;export default r;
|
|
66
64
|
//# sourceMappingURL=swatch.css.js.map
|
package/src/swatch.css.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch.css.ts"],
|
|
4
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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-swatch-size-xs:var(\n--spectrum-global-dimension-size-200\n);--spectrum-swatch-size-s:var(--spectrum-global-dimension-size-300);--spectrum-swatch-size-m:var(--spectrum-global-dimension-size-400);--spectrum-swatch-size-l:var(--spectrum-global-dimension-size-500);--spectrum-swatch-disabled-icon-size-xs:var(\n--spectrum-global-dimension-size-150\n);--spectrum-swatch-disabled-icon-size-s:var(\n--spectrum-global-dimension-size-200\n);--spectrum-swatch-disabled-icon-size-m:var(\n--spectrum-global-dimension-size-225\n);--spectrum-swatch-disabled-icon-size-l:var(\n--spectrum-global-dimension-size-250\n);--spectrum-swatch-disabled-icon-color:var(\n--spectrum-global-color-static-gray-50,rgb(var(--spectrum-global-color-static-gray-50-rgb))\n);--spectrum-swatch-disabled-icon-stroke-color:rgba(var(--spectrum-global-color-static-black-rgb,0,0,0),0.51);--spectrum-swatch-selection-padding:var(\n--spectrum-global-dimension-size-100\n);--spectrum-swatch-selection-indicator-border-width:var(\n--spectrum-global-dimension-size-25\n);--spectrum-swatch-selection-indicator-border-color:var(\n--spectrum-global-color-gray-900\n);--spectrum-swatch-background-color-selected:var(\n--spectrum-global-color-gray-50\n);--spectrum-swatch-border-radius:var(\n--spectrum-alias-border-radius-regular,var(--spectrum-global-dimension-size-50)\n);--spectrum-swatch-fill-border-radius-selected:var(\n--spectrum-alias-border-radius-small,var(--spectrum-global-dimension-size-25)\n);--spectrum-swatch-fill-border-width:var(\n--spectrum-alias-border-size-thin,var(--spectrum-global-dimension-static-size-10)\n);--spectrum-swatch-fill-border-color:rgba(var(--spectrum-global-color-gray-900-rgb),0.51);--spectrum-swatch-fill-border-color-light:rgba(var(--spectrum-global-color-gray-900-rgb),0.2);--spectrum-swatch-background-offset:0px;--spectrum-swatch-checkerboard-size:var(\n--spectrum-global-dimension-static-size-100,8px\n);align-items:center;display:flex;justify-content:center;outline:none;position:relative;-webkit-user-select:none;user-select:none}:host,:host:before{border-radius:var(\n--spectrum-swatch-border-radius\n)}:host([selected]){--spectrum-swatch-background-offset:-4px;background-color:var(\n--spectrum-swatch-background-color-selected\n)}:host([selected]) .fill{border-radius:var(--spectrum-swatch-fill-border-radius-selected);height:calc(100% - var(--spectrum-swatch-selection-padding));width:calc(100% - var(--spectrum-swatch-selection-padding))}:host([selected]) .fill:before{border-radius:var(\n--spectrum-swatch-fill-border-radius-selected\n);box-shadow:none}:host([selected]):before{opacity:1}:host([mixed-value]) .fill{background:var(\n--spectrum-swatch-background-color-selected\n)}:host([mixed-value]) .mixedValueIcon{visibility:visible}:host([nothing]) .fill{background:var(\n--spectrum-swatch-background-color-selected\n)}:host([nothing]) .fill:after{background:var(--spectrum-global-color-red-500);content:\"\";position:absolute;transform:rotate(-45deg);width:200%}:host([nothing][shape=rectangle]) .fill:after{transform:rotate(-25deg)}:host([nothing][size=xs]) .fill:after{height:2px}:host([nothing][size=s]) .fill:after{height:3px}:host([nothing][size=m]) .fill:after{height:4px}:host([nothing][size=l]) .fill:after{height:5px}:host([disabled]) .disabledIcon,:host([disabled]) .disabledIcon{visibility:visible}:host(.focus-visible):after{opacity:1}:host(:focus-visible):after{opacity:1}:host:before{border:var(--spectrum-swatch-selection-indicator-border-width) solid var(--spectrum-swatch-selection-indicator-border-color);bottom:0;content:\"\";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}:host:after{border:var(--spectrum-global-dimension-static-size-25,2px) solid var(\n--spectrum-alias-focus-ring-color,var(--spectrum-alias-focus-color)\n);border-radius:var(--spectrum-alias-focus-ring-border-radius-regular);bottom:calc(var(--spectrum-global-dimension-size-50)*-1);content:\"\";left:calc(var(--spectrum-global-dimension-size-50)*-1);opacity:0;position:absolute;right:calc(var(--spectrum-global-dimension-size-50)*-1);top:calc(var(--spectrum-global-dimension-size-50)*-1);transition:opacity var(--spectrum-global-animation-duration-100,.13s) ease-in-out}.fill{align-items:center;background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%);background-position:var(--spectrum-swatch-background-offset) var(--spectrum-swatch-background-offset),var(--spectrum-swatch-background-offset) calc(var(--spectrum-swatch-checkerboard-size) + var(--spectrum-swatch-background-offset)),calc(var(--spectrum-swatch-checkerboard-size) + var(--spectrum-swatch-background-offset)) calc(var(--spectrum-swatch-checkerboard-size)*-1 + var(--spectrum-swatch-background-offset)),calc(var(--spectrum-swatch-checkerboard-size)*-1 + var(--spectrum-swatch-background-offset)) var(--spectrum-swatch-background-offset);background-size:calc(var(--spectrum-swatch-checkerboard-size)*2) calc(var(--spectrum-swatch-checkerboard-size)*2);border-radius:var(--spectrum-swatch-border-radius);box-sizing:border-box;display:flex;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.fill:before{background-color:var(--spectrum-picked-color,transparent);border-radius:var(--spectrum-swatch-border-radius);bottom:0;box-shadow:inset 0 0 0 var(--spectrum-swatch-fill-border-width) var(--spectrum-swatch-fill-border-color);content:\"\";left:0;position:absolute;right:0;top:0;z-index:0}:host([border=light]) .fill:before{box-shadow:inset 0 0 0 var(--spectrum-swatch-fill-border-width) var(--spectrum-swatch-fill-border-color-light)}:host([border=none]) .fill:before{box-shadow:none}.mixedValueIcon{color:var(\n--spectrum-global-color-gray-700\n)}.disabledIcon,.mixedValueIcon{pointer-events:none;visibility:hidden}.disabledIcon{stroke:var(--spectrum-swatch-disabled-icon-stroke-color);color:var(--spectrum-swatch-disabled-icon-color);position:relative;z-index:2}:host([size=xs]){height:var(--spectrum-swatch-size-xs);width:var(--spectrum-swatch-size-xs)}:host([size=xs]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-xs);width:var(\n--spectrum-swatch-disabled-icon-size-xs\n)}:host([size=s]){height:var(--spectrum-swatch-size-s);width:var(--spectrum-swatch-size-s)}:host([size=s]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-s);width:var(\n--spectrum-swatch-disabled-icon-size-s\n)}:host([size=m]){height:var(--spectrum-swatch-size-m);width:var(--spectrum-swatch-size-m)}:host([size=m]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-m);width:var(\n--spectrum-swatch-disabled-icon-size-m\n)}:host([size=l]){height:var(--spectrum-swatch-size-l);width:var(--spectrum-swatch-size-l)}:host([size=l]) .disabledIcon{height:var(--spectrum-swatch-disabled-icon-size-l);width:var(\n--spectrum-swatch-disabled-icon-size-l\n)}:host([shape=rectangle][size=xs]){width:calc(var(--spectrum-swatch-size-xs)*2)}:host([shape=rectangle][size=s]){width:calc(var(--spectrum-swatch-size-s)*2)}:host([shape=rectangle][size=m]){width:calc(var(--spectrum-swatch-size-m)*2)}:host([shape=rectangle][size=l]){width:calc(var(--spectrum-swatch-size-l)*2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before{border-radius:0}:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before,:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before{border-radius:100%}::slotted([slot=image]){height:100%;object-fit:contain;transition:width var(--spectrum-global-animation-duration-100,.13s) ease-in-out,height var(--spectrum-global-animation-duration-100,.13s) ease-in-out;width:100%}@media (forced-colors:active){.fill{forced-color-adjust:none}:host{--spectrum-swatch-disabled-icon-color:grayText;--spectrum-alias-focus-ring-color:ButtonText;--spectrum-swatch-selection-indicator-border-color:Highlight;--spectrum-swatch-fill-border-color:ButtonText;--spectrum-swatch-fill-border-color-light:ButtonText;--spectrum-swatch-background-color-selected:ButtonFace}:host([disabled]) .fill{forced-color-adjust:auto}:host([nothing]) .fill:after{background:ButtonText}}\n`;\nexport default styles;"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,oDACA,KAAM,GAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA+Df,cAAe",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,177 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
3
|
-
import "../sp-swatch-group.js";
|
|
4
|
-
import "../sp-swatch.js";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Swatch group",
|
|
7
|
-
component: "sp-swatch-group",
|
|
8
|
-
args: {},
|
|
9
|
-
argTypes: {
|
|
10
|
-
border: {
|
|
11
|
-
name: "border",
|
|
12
|
-
type: { name: "string", required: false },
|
|
13
|
-
description: "The border to apply to the Swatch children.",
|
|
14
|
-
table: {
|
|
15
|
-
defaultValue: { summary: "" }
|
|
16
|
-
},
|
|
17
|
-
control: {
|
|
18
|
-
type: "inline-radio",
|
|
19
|
-
options: ["normal", "light", "none"]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
density: {
|
|
23
|
-
name: "density",
|
|
24
|
-
type: { name: "string", required: false },
|
|
25
|
-
description: "The density at which to display the Swatch children.",
|
|
26
|
-
table: {
|
|
27
|
-
defaultValue: { summary: "" }
|
|
28
|
-
},
|
|
29
|
-
control: {
|
|
30
|
-
type: "inline-radio",
|
|
31
|
-
options: ["normal", "compact", "spacious"]
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
rounding: {
|
|
35
|
-
name: "rounding",
|
|
36
|
-
type: { name: "string", required: false },
|
|
37
|
-
description: "The rounding to apply to the Swatch children.",
|
|
38
|
-
table: {
|
|
39
|
-
defaultValue: { summary: "" }
|
|
40
|
-
},
|
|
41
|
-
control: {
|
|
42
|
-
type: "inline-radio",
|
|
43
|
-
options: ["normal", "none", "full"]
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
selects: {
|
|
47
|
-
name: "selects",
|
|
48
|
-
type: { name: "string", required: false },
|
|
49
|
-
description: "Whether the Swatch Group manages a selection, and whether it is a sinlge or multiple selection.",
|
|
50
|
-
table: {
|
|
51
|
-
defaultValue: { summary: "" }
|
|
52
|
-
},
|
|
53
|
-
control: {
|
|
54
|
-
type: "inline-radio",
|
|
55
|
-
options: ["none", "single", "multiple"]
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
shape: {
|
|
59
|
-
name: "shape",
|
|
60
|
-
type: { name: "string", required: false },
|
|
61
|
-
description: "The shape to apply to the Swatch children.",
|
|
62
|
-
table: {
|
|
63
|
-
defaultValue: { summary: "" }
|
|
64
|
-
},
|
|
65
|
-
control: {
|
|
66
|
-
type: "inline-radio",
|
|
67
|
-
options: ["normal", "rectangle"]
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
decorators: [
|
|
72
|
-
(story) => html`
|
|
1
|
+
import{html as n}from"@spectrum-web-components/base";import{ifDefined as o}from"@spectrum-web-components/base/src/directives.js";import"../sp-swatch-group.js";import"../sp-swatch.js";export default{title:"Swatch group",component:"sp-swatch-group",args:{},argTypes:{border:{name:"border",type:{name:"string",required:!1},description:"The border to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","light","none"]}},density:{name:"density",type:{name:"string",required:!1},description:"The density at which to display the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","compact","spacious"]}},rounding:{name:"rounding",type:{name:"string",required:!1},description:"The rounding to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","none","full"]}},selects:{name:"selects",type:{name:"string",required:!1},description:"Whether the Swatch Group manages a selection, and whether it is a sinlge or multiple selection.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["none","single","multiple"]}},shape:{name:"shape",type:{name:"string",required:!1},description:"The shape to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","rectangle"]}}},decorators:[e=>n`
|
|
73
2
|
<div
|
|
74
|
-
@change=${async (
|
|
75
|
-
await 0;
|
|
76
|
-
if (event.defaultPrevented)
|
|
77
|
-
return;
|
|
78
|
-
const next = event.target.nextElementSibling;
|
|
79
|
-
next.textContent = `Selected: ${JSON.stringify(event.target.selected)}`;
|
|
80
|
-
}}
|
|
3
|
+
@change=${async r=>{if(await 0,r.defaultPrevented)return;const l=r.target.nextElementSibling;l.textContent=`Selected: ${JSON.stringify(r.target.selected)}`}}
|
|
81
4
|
>
|
|
82
|
-
${
|
|
5
|
+
${e()}
|
|
83
6
|
<div>Selected: []</div>
|
|
84
7
|
</div>
|
|
85
|
-
`
|
|
86
|
-
]
|
|
87
|
-
};
|
|
88
|
-
const colors = [
|
|
89
|
-
"--spectrum-global-color-gray-500",
|
|
90
|
-
"--spectrum-global-color-red-500",
|
|
91
|
-
"--spectrum-global-color-orange-500",
|
|
92
|
-
"--spectrum-global-color-yellow-500",
|
|
93
|
-
"--spectrum-global-color-chartreuse-500",
|
|
94
|
-
"--spectrum-global-color-celery-500",
|
|
95
|
-
"--spectrum-global-color-green-500",
|
|
96
|
-
"--spectrum-global-color-seafoam-500",
|
|
97
|
-
"--spectrum-global-color-blue-500",
|
|
98
|
-
"--spectrum-global-color-indigo-500",
|
|
99
|
-
"--spectrum-global-color-purple-500",
|
|
100
|
-
"--spectrum-global-color-fuchsia-500",
|
|
101
|
-
"--spectrum-global-color-magenta-500"
|
|
102
|
-
];
|
|
103
|
-
const template = ({
|
|
104
|
-
border,
|
|
105
|
-
density,
|
|
106
|
-
rounding,
|
|
107
|
-
selects,
|
|
108
|
-
selected = [],
|
|
109
|
-
shape
|
|
110
|
-
}) => {
|
|
111
|
-
const groupLabel = !!selects ? selects === "single" ? "Select a color" : "Selects color(s)" : void 0;
|
|
112
|
-
return html`
|
|
8
|
+
`]};const u=["--spectrum-global-color-gray-500","--spectrum-global-color-red-500","--spectrum-global-color-orange-500","--spectrum-global-color-yellow-500","--spectrum-global-color-chartreuse-500","--spectrum-global-color-celery-500","--spectrum-global-color-green-500","--spectrum-global-color-seafoam-500","--spectrum-global-color-blue-500","--spectrum-global-color-indigo-500","--spectrum-global-color-purple-500","--spectrum-global-color-fuchsia-500","--spectrum-global-color-magenta-500"],t=({border:e,density:r,rounding:l,selects:a,selected:i=[],shape:p})=>{const c=a?a==="single"?"Select a color":"Selects color(s)":void 0;return n`
|
|
113
9
|
<sp-swatch-group
|
|
114
|
-
border=${
|
|
115
|
-
density=${
|
|
116
|
-
rounding=${
|
|
117
|
-
selects=${
|
|
118
|
-
.selected=${
|
|
119
|
-
shape=${
|
|
120
|
-
aria-label=${
|
|
10
|
+
border=${o(e==="normal"?void 0:e)}
|
|
11
|
+
density=${o(r==="normal"?void 0:r)}
|
|
12
|
+
rounding=${o(l==="normal"?void 0:l)}
|
|
13
|
+
selects=${o(a==="none"?void 0:a)}
|
|
14
|
+
.selected=${i}
|
|
15
|
+
shape=${o(p==="normal"?void 0:p)}
|
|
16
|
+
aria-label=${o(c)}
|
|
121
17
|
>
|
|
122
|
-
${
|
|
18
|
+
${u.map(s=>n`
|
|
123
19
|
<sp-swatch
|
|
124
|
-
color="var(${
|
|
125
|
-
label=${
|
|
126
|
-
value=${
|
|
20
|
+
color="var(${s})"
|
|
21
|
+
label=${s}
|
|
22
|
+
value=${s}
|
|
127
23
|
></sp-swatch>
|
|
128
24
|
`)}
|
|
129
25
|
</sp-swatch-group>
|
|
130
|
-
|
|
131
|
-
};
|
|
132
|
-
export const Default = (args) => template(args);
|
|
133
|
-
Default.args = {};
|
|
134
|
-
export const densityCompact = (args) => template(args);
|
|
135
|
-
densityCompact.args = {
|
|
136
|
-
density: "compact"
|
|
137
|
-
};
|
|
138
|
-
export const densitySpacious = (args) => template(args);
|
|
139
|
-
densitySpacious.args = {
|
|
140
|
-
density: "spacious"
|
|
141
|
-
};
|
|
142
|
-
export const selectsSingle = (args) => template(args);
|
|
143
|
-
selectsSingle.args = {
|
|
144
|
-
selects: "single",
|
|
145
|
-
selected: ["--spectrum-global-color-yellow-500"]
|
|
146
|
-
};
|
|
147
|
-
export const selectsMultiple = (args) => template(args);
|
|
148
|
-
selectsMultiple.args = {
|
|
149
|
-
selects: "multiple",
|
|
150
|
-
selected: [
|
|
151
|
-
"--spectrum-global-color-celery-500",
|
|
152
|
-
"--spectrum-global-color-red-500",
|
|
153
|
-
"--spectrum-global-color-purple-500",
|
|
154
|
-
"--spectrum-global-color-blue-500"
|
|
155
|
-
]
|
|
156
|
-
};
|
|
157
|
-
export const borderLight = (args) => template(args);
|
|
158
|
-
borderLight.args = {
|
|
159
|
-
border: "light"
|
|
160
|
-
};
|
|
161
|
-
export const borderNone = (args) => template(args);
|
|
162
|
-
borderNone.args = {
|
|
163
|
-
border: "none"
|
|
164
|
-
};
|
|
165
|
-
export const roundingNone = (args) => template(args);
|
|
166
|
-
roundingNone.args = {
|
|
167
|
-
rounding: "none"
|
|
168
|
-
};
|
|
169
|
-
export const roundingFull = (args) => template(args);
|
|
170
|
-
roundingFull.args = {
|
|
171
|
-
rounding: "full"
|
|
172
|
-
};
|
|
173
|
-
export const shapeRectangle = (args) => template(args);
|
|
174
|
-
shapeRectangle.args = {
|
|
175
|
-
shape: "rectangle"
|
|
176
|
-
};
|
|
26
|
+
`};export const Default=e=>t(e);Default.args={};export const densityCompact=e=>t(e);densityCompact.args={density:"compact"};export const densitySpacious=e=>t(e);densitySpacious.args={density:"spacious"};export const selectsSingle=e=>t(e);selectsSingle.args={selects:"single",selected:["--spectrum-global-color-yellow-500"]};export const selectsMultiple=e=>t(e);selectsMultiple.args={selects:"multiple",selected:["--spectrum-global-color-celery-500","--spectrum-global-color-red-500","--spectrum-global-color-purple-500","--spectrum-global-color-blue-500"]};export const borderLight=e=>t(e);borderLight.args={border:"light"};export const borderNone=e=>t(e);borderNone.args={border:"none"};export const roundingNone=e=>t(e);roundingNone.args={rounding:"none"};export const roundingFull=e=>t(e);roundingFull.args={rounding:"full"};export const shapeRectangle=e=>t(e);shapeRectangle.args={shape:"rectangle"};
|
|
177
27
|
//# sourceMappingURL=swatch-group.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-group.stories.ts"],
|
|
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch-group.js';\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\nimport { SwatchGroup } from '../src/SwatchGroup.js';\n\ntype Properties = {\n border: SwatchBorder | 'normal';\n density?: 'normal' | 'spacious' | 'compact';\n rounding?: SwatchRounding | 'normal';\n selected?: string[];\n selects?: 'none' | 'single' | 'multiple';\n shape?: SwatchShape | 'normal';\n};\n\nexport default {\n title: 'Swatch group',\n component: 'sp-swatch-group',\n args: {},\n argTypes: {\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n density: {\n name: 'density',\n type: { name: 'string', required: false },\n description: 'The density at which to display the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'compact', 'spacious'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n selects: {\n name: 'selects',\n type: { name: 'string', required: false },\n description:\n 'Whether the Swatch Group manages a selection, and whether it is a sinlge or multiple selection.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['none', 'single', 'multiple'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n decorators: [\n (story: () => TemplateResult): TemplateResult => html`\n <div\n @change=${async (event: Event & { target: SwatchGroup }) => {\n await 0;\n if (event.defaultPrevented) return;\n const next = event.target\n .nextElementSibling as HTMLDivElement;\n next.textContent = `Selected: ${JSON.stringify(\n event.target.selected\n )}`;\n }}\n >\n ${story()}\n <div>Selected: []</div>\n </div>\n `,\n ],\n};\n\nconst colors = [\n '--spectrum-global-color-gray-500',\n '--spectrum-global-color-red-500',\n '--spectrum-global-color-orange-500',\n '--spectrum-global-color-yellow-500',\n '--spectrum-global-color-chartreuse-500',\n '--spectrum-global-color-celery-500',\n '--spectrum-global-color-green-500',\n '--spectrum-global-color-seafoam-500',\n '--spectrum-global-color-blue-500',\n '--spectrum-global-color-indigo-500',\n '--spectrum-global-color-purple-500',\n '--spectrum-global-color-fuchsia-500',\n '--spectrum-global-color-magenta-500',\n];\n\nconst template = ({\n border,\n density,\n rounding,\n selects,\n selected = [],\n shape,\n}: Properties): TemplateResult => {\n const groupLabel = !!selects\n ? selects === 'single'\n ? 'Select a color'\n : 'Selects color(s)'\n : undefined;\n return html`\n <sp-swatch-group\n border=${ifDefined(border === 'normal' ? undefined : border)}\n density=${ifDefined(density === 'normal' ? undefined : density)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n selects=${ifDefined(selects === 'none' ? undefined : selects)}\n .selected=${selected}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n aria-label=${ifDefined(groupLabel)}\n >\n ${colors.map(\n (color) => html`\n <sp-swatch\n color=\"var(${color})\"\n label=${color}\n value=${color}\n ></sp-swatch>\n `\n )}\n </sp-swatch-group>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nDefault.args = {} as Properties;\nexport const densityCompact = (args: Properties): TemplateResult =>\n template(args);\ndensityCompact.args = {\n density: 'compact',\n} as Properties;\nexport const densitySpacious = (args: Properties): TemplateResult =>\n template(args);\ndensitySpacious.args = {\n density: 'spacious',\n} as Properties;\nexport const selectsSingle = (args: Properties): TemplateResult =>\n template(args);\nselectsSingle.args = {\n selects: 'single',\n selected: ['--spectrum-global-color-yellow-500'],\n} as Properties;\nexport const selectsMultiple = (args: Properties): TemplateResult =>\n template(args);\nselectsMultiple.args = {\n selects: 'multiple',\n selected: [\n '--spectrum-global-color-celery-500',\n '--spectrum-global-color-red-500',\n '--spectrum-global-color-purple-500',\n '--spectrum-global-color-blue-500',\n ],\n} as Properties;\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n} as Properties;\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n} as Properties;\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n} as Properties;\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n} as Properties;\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args);\nshapeRectangle.args = {\n shape: 'rectangle',\n} as Properties;\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,qDACA,4EAEA,8BACA,wBAiBA,cAAe,CACX,MAAO,eACP,UAAW,kBACX,KAAM,CAAC,EACP,SAAU,CACN,OAAQ,CACJ,KAAM,SACN,KAAM,CAAE,KAAM,SAAU,SAAU,EAAM,EACxC,YAAa,8CACb,MAAO,CACH,aAAc,CAAE,QAAS,EAAG,CAChC,EACA,QAAS,CACL,KAAM,eACN,QAAS,CAAC,SAAU,QAAS,MAAM,CACvC,CACJ,EACA,QAAS,CACL,KAAM,UACN,KAAM,CAAE,KAAM,SAAU,SAAU,EAAM,EACxC,YAAa,uDACb,MAAO,CACH,aAAc,CAAE,QAAS,EAAG,CAChC,EACA,QAAS,CACL,KAAM,eACN,QAAS,CAAC,SAAU,UAAW,UAAU,CAC7C,CACJ,EACA,SAAU,CACN,KAAM,WACN,KAAM,CAAE,KAAM,SAAU,SAAU,EAAM,EACxC,YAAa,gDACb,MAAO,CACH,aAAc,CAAE,QAAS,EAAG,CAChC,EACA,QAAS,CACL,KAAM,eACN,QAAS,CAAC,SAAU,OAAQ,MAAM,CACtC,CACJ,EACA,QAAS,CACL,KAAM,UACN,KAAM,CAAE,KAAM,SAAU,SAAU,EAAM,EACxC,YACI,kGACJ,MAAO,CACH,aAAc,CAAE,QAAS,EAAG,CAChC,EACA,QAAS,CACL,KAAM,eACN,QAAS,CAAC,OAAQ,SAAU,UAAU,CAC1C,CACJ,EACA,MAAO,CACH,KAAM,QACN,KAAM,CAAE,KAAM,SAAU,SAAU,EAAM,EACxC,YAAa,6CACb,MAAO,CACH,aAAc,CAAE,QAAS,EAAG,CAChC,EACA,QAAS,CACL,KAAM,eACN,QAAS,CAAC,SAAU,WAAW,CACnC,CACJ,CACJ,EACA,WAAY,CACR,AAAC,GAAgD;AAAA;AAAA,0BAE/B,KAAO,IAA2C,CAExD,GADA,KAAM,GACF,EAAM,iBAAkB,OAC5B,KAAM,GAAO,EAAM,OACd,mBACL,EAAK,YAAc,aAAa,KAAK,UACjC,EAAM,OAAO,QACjB,GACJ;AAAA;AAAA,kBAEE,EAAM;AAAA;AAAA;AAAA,SAIpB,CACJ,EAEA,KAAM,GAAS,CACX,mCACA,kCACA,qCACA,qCACA,yCACA,qCACA,oCACA,sCACA,mCACA,qCACA,qCACA,sCACA,qCACJ,EAEM,EAAW,CAAC,CACd,SACA,UACA,WACA,UACA,WAAW,CAAC,EACZ,WAC8B,CAC9B,KAAM,GAAa,AAAE,EACf,IAAY,SACR,iBACA,mBACJ,OACN,MAAO;AAAA;AAAA,qBAEU,EAAU,IAAW,SAAW,OAAY,CAAM;AAAA,sBACjD,EAAU,IAAY,SAAW,OAAY,CAAO;AAAA,uBACnD,EAAU,IAAa,SAAW,OAAY,CAAQ;AAAA,sBACvD,EAAU,IAAY,OAAS,OAAY,CAAO;AAAA,wBAChD;AAAA,oBACJ,EAAU,IAAU,SAAW,OAAY,CAAK;AAAA,yBAC3C,EAAU,CAAU;AAAA;AAAA,cAE/B,EAAO,IACL,AAAC,GAAU;AAAA;AAAA,qCAEU;AAAA,gCACL;AAAA,gCACA;AAAA;AAAA,iBAGpB;AAAA;AAAA,KAGZ,EAEO,YAAM,SAAU,AAAC,GAAqC,EAAS,CAAI,EAC1E,QAAQ,KAAO,CAAC,EACT,YAAM,gBAAiB,AAAC,GAC3B,EAAS,CAAI,EACjB,eAAe,KAAO,CAClB,QAAS,SACb,EACO,YAAM,iBAAkB,AAAC,GAC5B,EAAS,CAAI,EACjB,gBAAgB,KAAO,CACnB,QAAS,UACb,EACO,YAAM,eAAgB,AAAC,GAC1B,EAAS,CAAI,EACjB,cAAc,KAAO,CACjB,QAAS,SACT,SAAU,CAAC,oCAAoC,CACnD,EACO,YAAM,iBAAkB,AAAC,GAC5B,EAAS,CAAI,EACjB,gBAAgB,KAAO,CACnB,QAAS,WACT,SAAU,CACN,qCACA,kCACA,qCACA,kCACJ,CACJ,EACO,YAAM,aAAc,AAAC,GAAqC,EAAS,CAAI,EAC9E,YAAY,KAAO,CACf,OAAQ,OACZ,EACO,YAAM,YAAa,AAAC,GAAqC,EAAS,CAAI,EAC7E,WAAW,KAAO,CACd,OAAQ,MACZ,EACO,YAAM,cAAe,AAAC,GACzB,EAAS,CAAI,EACjB,aAAa,KAAO,CAChB,SAAU,MACd,EACO,YAAM,cAAe,AAAC,GACzB,EAAS,CAAI,EACjB,aAAa,KAAO,CAChB,SAAU,MACd,EACO,YAAM,gBAAiB,AAAC,GAC3B,EAAS,CAAI,EACjB,eAAe,KAAO,CAClB,MAAO,WACX",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,39 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
html
|
|
3
|
-
} from "@spectrum-web-components/base";
|
|
4
|
-
import "../sp-swatch.js";
|
|
5
|
-
export default {
|
|
6
|
-
title: "Swatch/Sizes",
|
|
7
|
-
component: "sp-swatch"
|
|
8
|
-
};
|
|
9
|
-
const template = ({
|
|
10
|
-
size,
|
|
11
|
-
color = "rgb(255 0 0 / 0.7)"
|
|
12
|
-
}) => html`
|
|
1
|
+
import{html as a}from"@spectrum-web-components/base";import"../sp-swatch.js";export default{title:"Swatch/Sizes",component:"sp-swatch"};const p=({size:t,color:e="rgb(255 0 0 / 0.7)"})=>a`
|
|
13
2
|
<div style="display: flex; gap: 5px;">
|
|
14
|
-
<sp-swatch color=${
|
|
15
|
-
<sp-swatch color=${
|
|
16
|
-
<sp-swatch color=${
|
|
17
|
-
<sp-swatch color=${
|
|
18
|
-
<sp-swatch color=${
|
|
19
|
-
<sp-swatch nothing size=${
|
|
20
|
-
<sp-swatch color=${
|
|
3
|
+
<sp-swatch color=${e} size=${t}></sp-swatch>
|
|
4
|
+
<sp-swatch color=${e} rounding="none" size=${t}></sp-swatch>
|
|
5
|
+
<sp-swatch color=${e} rounding="full" size=${t}></sp-swatch>
|
|
6
|
+
<sp-swatch color=${e} border="light" size=${t}></sp-swatch>
|
|
7
|
+
<sp-swatch color=${e} border="none" size=${t}></sp-swatch>
|
|
8
|
+
<sp-swatch nothing size=${t}></sp-swatch>
|
|
9
|
+
<sp-swatch color=${e} shape="rectangle" size=${t}></sp-swatch>
|
|
21
10
|
<sp-swatch
|
|
22
|
-
color=${
|
|
11
|
+
color=${e}
|
|
23
12
|
shape="rectangle"
|
|
24
|
-
size=${
|
|
13
|
+
size=${t}
|
|
25
14
|
disabled
|
|
26
15
|
></sp-swatch>
|
|
27
16
|
<sp-swatch
|
|
28
17
|
rounding="full"
|
|
29
18
|
shape="rectangle"
|
|
30
|
-
size=${
|
|
19
|
+
size=${t}
|
|
31
20
|
mixed-value
|
|
32
21
|
></sp-swatch>
|
|
33
22
|
</div>
|
|
34
|
-
`;
|
|
35
|
-
export const XS = () => template({ size: "xs" });
|
|
36
|
-
export const s = () => template({ size: "s" });
|
|
37
|
-
export const m = () => template({ size: "m" });
|
|
38
|
-
export const l = () => template({ size: "l" });
|
|
23
|
+
`;export const XS=()=>p({size:"xs"}),s=()=>p({size:"s"}),m=()=>p({size:"m"}),l=()=>p({size:"l"});
|
|
39
24
|
//# sourceMappingURL=swatch-sizes.stories.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["swatch-sizes.stories.ts"],
|
|
4
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*/\nimport {\n ElementSize,\n html,\n TemplateResult,\n} from '@spectrum-web-components/base';\n\nimport '../sp-swatch.js';\n\nexport default {\n title: 'Swatch/Sizes',\n component: 'sp-swatch',\n};\n\nconst template = ({\n size,\n color = 'rgb(255 0 0 / 0.7)',\n}: {\n size: ElementSize;\n color?: string;\n}): TemplateResult => html`\n <div style=\"display: flex; gap: 5px;\">\n <sp-swatch color=${color} size=${size}></sp-swatch>\n <sp-swatch color=${color} rounding=\"none\" size=${size}></sp-swatch>\n <sp-swatch color=${color} rounding=\"full\" size=${size}></sp-swatch>\n <sp-swatch color=${color} border=\"light\" size=${size}></sp-swatch>\n <sp-swatch color=${color} border=\"none\" size=${size}></sp-swatch>\n <sp-swatch nothing size=${size}></sp-swatch>\n <sp-swatch color=${color} shape=\"rectangle\" size=${size}></sp-swatch>\n <sp-swatch\n color=${color}\n shape=\"rectangle\"\n size=${size}\n disabled\n ></sp-swatch>\n <sp-swatch\n rounding=\"full\"\n shape=\"rectangle\"\n size=${size}\n mixed-value\n ></sp-swatch>\n </div>\n`;\n\nexport const XS = (): TemplateResult => template({ size: 'xs' });\n\nexport const s = (): TemplateResult => template({ size: 's' });\n\nexport const m = (): TemplateResult => template({ size: 'm' });\n\nexport const l = (): TemplateResult => template({ size: 'l' });\n"],
|
|
5
|
-
"mappings": "AAWA
|
|
5
|
+
"mappings": "AAWA,qDAMA,wBAEA,cAAe,CACX,MAAO,eACP,UAAW,WACf,EAEA,KAAM,GAAW,CAAC,CACd,OACA,QAAQ,wBAIU;AAAA;AAAA,2BAEK,UAAc;AAAA,2BACd,0BAA8B;AAAA,2BAC9B,0BAA8B;AAAA,2BAC9B,yBAA6B;AAAA,2BAC7B,wBAA4B;AAAA,kCACrB;AAAA,2BACP,4BAAgC;AAAA;AAAA,oBAEvC;AAAA;AAAA,mBAED;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAMA;AAAA;AAAA;AAAA;AAAA,EAMZ,YAAM,IAAK,IAAsB,EAAS,CAAE,KAAM,IAAK,CAAC,EAElD,EAAI,IAAsB,EAAS,CAAE,KAAM,GAAI,CAAC,EAEhD,EAAI,IAAsB,EAAS,CAAE,KAAM,GAAI,CAAC,EAEhD,EAAI,IAAsB,EAAS,CAAE,KAAM,GAAI,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,100 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
3
|
-
import "../sp-swatch.js";
|
|
4
|
-
export default {
|
|
5
|
-
title: "Swatch",
|
|
6
|
-
component: "sp-swatch",
|
|
7
|
-
args: {
|
|
8
|
-
color: "#ff0000"
|
|
9
|
-
},
|
|
10
|
-
argTypes: {
|
|
11
|
-
color: { control: "color" },
|
|
12
|
-
border: {
|
|
13
|
-
name: "border",
|
|
14
|
-
type: { name: "string", required: false },
|
|
15
|
-
description: "The border to apply to the Swatch children.",
|
|
16
|
-
table: {
|
|
17
|
-
defaultValue: { summary: "" }
|
|
18
|
-
},
|
|
19
|
-
control: {
|
|
20
|
-
type: "inline-radio",
|
|
21
|
-
options: ["normal", "light", "none"]
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
rounding: {
|
|
25
|
-
name: "rounding",
|
|
26
|
-
type: { name: "string", required: false },
|
|
27
|
-
description: "The rounding to apply to the Swatch children.",
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: { summary: "" }
|
|
30
|
-
},
|
|
31
|
-
control: {
|
|
32
|
-
type: "inline-radio",
|
|
33
|
-
options: ["normal", "none", "full"]
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
shape: {
|
|
37
|
-
name: "shape",
|
|
38
|
-
type: { name: "string", required: false },
|
|
39
|
-
description: "The shape to apply to the Swatch children.",
|
|
40
|
-
table: {
|
|
41
|
-
defaultValue: { summary: "" }
|
|
42
|
-
},
|
|
43
|
-
control: {
|
|
44
|
-
type: "inline-radio",
|
|
45
|
-
options: ["normal", "rectangle"]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const template = ({
|
|
51
|
-
color,
|
|
52
|
-
border,
|
|
53
|
-
rounding,
|
|
54
|
-
shape,
|
|
55
|
-
mixedValue: mixedValue2,
|
|
56
|
-
nothing: nothing2
|
|
57
|
-
}) => {
|
|
58
|
-
return html`
|
|
1
|
+
import{html as s}from"@spectrum-web-components/base";import{ifDefined as r}from"@spectrum-web-components/base/src/directives.js";import"../sp-swatch.js";export default{title:"Swatch",component:"sp-swatch",args:{color:"#ff0000"},argTypes:{color:{control:"color"},border:{name:"border",type:{name:"string",required:!1},description:"The border to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","light","none"]}},rounding:{name:"rounding",type:{name:"string",required:!1},description:"The rounding to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","none","full"]}},shape:{name:"shape",type:{name:"string",required:!1},description:"The shape to apply to the Swatch children.",table:{defaultValue:{summary:""}},control:{type:"inline-radio",options:["normal","rectangle"]}}}};const t=({color:e,border:o,rounding:n,shape:a,mixedValue:l,nothing:i})=>s`
|
|
59
2
|
<sp-swatch
|
|
60
|
-
border=${
|
|
61
|
-
rounding=${
|
|
62
|
-
shape=${
|
|
63
|
-
color=${
|
|
64
|
-
?mixed-value=${
|
|
65
|
-
?nothing=${
|
|
3
|
+
border=${r(o==="normal"?void 0:o)}
|
|
4
|
+
rounding=${r(n==="normal"?void 0:n)}
|
|
5
|
+
shape=${r(a==="normal"?void 0:a)}
|
|
6
|
+
color=${e}
|
|
7
|
+
?mixed-value=${l}
|
|
8
|
+
?nothing=${i}
|
|
66
9
|
></sp-swatch>
|
|
67
|
-
`;
|
|
68
|
-
};
|
|
69
|
-
export const Default = (args) => template(args);
|
|
70
|
-
export const mixedValue = (args) => template(args);
|
|
71
|
-
mixedValue.args = {
|
|
72
|
-
mixedValue: true,
|
|
73
|
-
color: ""
|
|
74
|
-
};
|
|
75
|
-
export const nothing = (args) => template(args);
|
|
76
|
-
nothing.args = {
|
|
77
|
-
nothing: true,
|
|
78
|
-
color: ""
|
|
79
|
-
};
|
|
80
|
-
export const borderLight = (args) => template(args);
|
|
81
|
-
borderLight.args = {
|
|
82
|
-
border: "light"
|
|
83
|
-
};
|
|
84
|
-
export const borderNone = (args) => template(args);
|
|
85
|
-
borderNone.args = {
|
|
86
|
-
border: "none"
|
|
87
|
-
};
|
|
88
|
-
export const roundingNone = (args) => template(args);
|
|
89
|
-
roundingNone.args = {
|
|
90
|
-
rounding: "none"
|
|
91
|
-
};
|
|
92
|
-
export const roundingFull = (args) => template(args);
|
|
93
|
-
roundingFull.args = {
|
|
94
|
-
rounding: "full"
|
|
95
|
-
};
|
|
96
|
-
export const shapeRectangle = (args) => template(args);
|
|
97
|
-
shapeRectangle.args = {
|
|
98
|
-
shape: "rectangle"
|
|
99
|
-
};
|
|
10
|
+
`;export const Default=e=>t(e),mixedValue=e=>t(e);mixedValue.args={mixedValue:!0,color:""};export const nothing=e=>t(e);nothing.args={nothing:!0,color:""};export const borderLight=e=>t(e);borderLight.args={border:"light"};export const borderNone=e=>t(e);borderNone.args={border:"none"};export const roundingNone=e=>t(e);roundingNone.args={rounding:"none"};export const roundingFull=e=>t(e);roundingFull.args={rounding:"full"};export const shapeRectangle=e=>t(e);shapeRectangle.args={shape:"rectangle"};
|
|
100
11
|
//# sourceMappingURL=swatch.stories.js.map
|