Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
31bd7c5
feat(swatch, swatch-group): Add new components
macandcheese Jul 25, 2025
e27837c
Clean up
macandcheese Jul 25, 2025
91a2fe7
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 25, 2025
420299e
Clean up
macandcheese Jul 25, 2025
3cc69df
Clean up
macandcheese Jul 25, 2025
368a05f
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 28, 2025
32bff39
Clean up
macandcheese Jul 28, 2025
cc2ee82
Clean up
macandcheese Jul 28, 2025
78b60e7
Clean up
macandcheese Jul 28, 2025
a11a72b
Clean up
macandcheese Jul 28, 2025
2713571
Clean up
macandcheese Jul 29, 2025
815c2ad
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 29, 2025
c5b4ed2
Clean up
macandcheese Jul 29, 2025
fd8d5fd
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 30, 2025
9aef399
Clean up
macandcheese Jul 30, 2025
7e02cf4
Clean up
macandcheese Jul 30, 2025
13dfad4
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 30, 2025
c26b6e2
Clean up
macandcheese Jul 30, 2025
aa9d774
Clean up
macandcheese Jul 30, 2025
e801633
Clean up
macandcheese Jul 30, 2025
e6cad5d
Clean up
macandcheese Jul 30, 2025
05e45fd
Style adjustments
macandcheese Jul 30, 2025
ded88f1
Pr feedback
macandcheese Jul 30, 2025
133ae22
Pr feedback
macandcheese Jul 30, 2025
5f8412d
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Jul 30, 2025
36bbcd1
Pr feedback
macandcheese Jul 30, 2025
40c0edc
Pr feedback
macandcheese Jul 30, 2025
fdc6c9c
Pr feedback
macandcheese Jul 30, 2025
82369d6
Clean up
macandcheese Jul 31, 2025
2e822b9
Story fix
macandcheese Jul 31, 2025
6d37cd0
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Aug 4, 2025
e434374
Pr feedback
macandcheese Aug 4, 2025
f64d698
Pr feedback
macandcheese Aug 4, 2025
28bf513
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Aug 4, 2025
2d98a8b
Merge branch 'dev' into macandcheese/swatch-group
macandcheese Aug 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/calcite-components/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ <h1 id="calcite-demo">Calcite demo</h1>
</calcite-action>
</a>
</div>

<div>
<a href="/src/demos/swatch-group.html">
<calcite-action scale="s" text="Swatch Group / Swatch" alignment="start" text-enabled appearance="solid">
</calcite-action>
</a>
</div>
<div>
<a href="/src/demos/switch.html">
<calcite-action scale="s" text="Switch" alignment="start" text-enabled appearance="solid"> </calcite-action>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# calcite-swatch-group

For comprehensive guidance on using and implementing `calcite-swatch-group`, refer to the [documentation page](https://developers.arcgis.com/calcite-design-system/components/swatch-group/).

<!-- Auto Generated Below -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const CSS = {
container: "container",
};

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-swatch-group-space: Specifies the space between slotted elements.
*/

:host {
@apply flex;
}

.container {
display: flex;
flex-wrap: wrap;
gap: var(--calcite-swatch-group-space, var(--calcite-spacing-sm));
}

:host([scale="s"]) .container {
gap: var(--calcite-swatch-group-space, var(--calcite-spacing-xs));
}
@include base-component();
@include disabled();
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { modesDarkDefault } from "../../../.storybook/utils";
import { html } from "../../../support/formatting";
import { ATTRIBUTES } from "../../../.storybook/resources";
import { placeholderImage } from "../../../.storybook/placeholder-image";
import { SwatchGroup } from "./swatch-group";

const { selectionMode, scale } = ATTRIBUTES;

type SwatchGroupStoryArgs = Pick<SwatchGroup, "selectionMode" | "scale">;

export default {
title: "Components/Swatch Group",
args: { selectionMode: selectionMode.defaultValue, scale: scale.defaultValue },
argTypes: {
selectionMode: {
options: selectionMode.values.filter(
(option) => option !== "children" && option !== "multichildren" && option !== "ancestors",
),
control: { type: "select" },
},
scale: { options: scale.values, control: { type: "select" } },
},
};

export const simple = (args: SwatchGroupStoryArgs): string => html`
<calcite-swatch-group selection-mode="${args.selectionMode}" scale="${args.scale}">
<calcite-swatch value="calcite swatch"></calcite-swatch>
<calcite-swatch color="#ff0000" value="calcite swatch"></calcite-swatch>
<calcite-swatch value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch color="rgba(250,210,150,0.2)" value="calcite swatch"> </calcite-swatch>
<calcite-swatch value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch selected color="rgba(25,25,25,0.1)" value="calcite swatch"></calcite-swatch>
<calcite-swatch disabled color="#ddd" value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch disabled color="#ff00ee" value="calcite swatch"> </calcite-swatch>
</calcite-swatch-group>
`;

export const darkThemeRTL_TestOnly = (): string => html`
<div dir="rtl">
<calcite-swatch-group>
<calcite-swatch value="calcite swatch"></calcite-swatch>
<calcite-swatch color="#ff0000" value="calcite swatch"></calcite-swatch>
<calcite-swatch value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch color="rgba(250,210,150,0.2)" value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch selected color="rgba(25,25,25,0.1)" value="calcite swatch"></calcite-swatch>
<calcite-swatch disabled color="#ddd" value="calcite swatch">
<img
src="${placeholderImage({
width: 24,
height: 24,
})}"
slot="image"
/>
</calcite-swatch>
<calcite-swatch disabled color="#ff00ee" value="calcite swatch"> </calcite-swatch>
</calcite-swatch-group>
</div>
`;

darkThemeRTL_TestOnly.parameters = { themes: modesDarkDefault };
Loading
Loading