Skip to content

Commit 6acef0b

Browse files
Add data-object icon (#1738)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 941a0fe commit 6acef0b

13 files changed

Lines changed: 500 additions & 211 deletions

File tree

.changeset/add-data-object-icon.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@getflip/swirl-components": minor
3+
"@getflip/swirl-icons": minor
4+
---
5+
6+
Add data-object icon

packages/swirl-components/custom-elements.manifest.json

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18346,6 +18346,117 @@
1834618346
}
1834718347
]
1834818348
},
18349+
{
18350+
"kind": "javascript-module",
18351+
"path": "src/components/swirl-icon/icons/swirl-icon-data-object.tsx",
18352+
"declarations": [
18353+
{
18354+
"kind": "class",
18355+
"customElement": true,
18356+
"tagName": "swirl-icon-data-object",
18357+
"name": "SwirlIconDataObject",
18358+
"attributes": [
18359+
{
18360+
"name": "color",
18361+
"type": {
18362+
"text": "\"critical\" | \"default\" | \"disabled\" | \"highlight\" | \"info\" | \"on-action-primary\" | \"on-image\" | \"on-status\" | \"on-surface-highlight\" | \"on-surface-highlight-subdued\" | \"strong\" | \"success\" | \"warning\"",
18363+
"references": [
18364+
{
18365+
"name": "SwirlIconColor",
18366+
"module": "../swirl-icon"
18367+
}
18368+
]
18369+
},
18370+
"fieldName": "color"
18371+
},
18372+
{
18373+
"name": "label",
18374+
"type": {
18375+
"text": "string"
18376+
},
18377+
"fieldName": "label"
18378+
},
18379+
{
18380+
"name": "size",
18381+
"type": {
18382+
"text": "16 | 20 | 24 | 28",
18383+
"references": [
18384+
{
18385+
"name": "SwirlIconSize",
18386+
"module": "../swirl-icon.types"
18387+
}
18388+
]
18389+
},
18390+
"default": "24",
18391+
"fieldName": "size"
18392+
}
18393+
],
18394+
"members": [
18395+
{
18396+
"kind": "field",
18397+
"name": "color",
18398+
"type": {
18399+
"text": "\"critical\" | \"default\" | \"disabled\" | \"highlight\" | \"info\" | \"on-action-primary\" | \"on-image\" | \"on-status\" | \"on-surface-highlight\" | \"on-surface-highlight-subdued\" | \"strong\" | \"success\" | \"warning\"",
18400+
"references": [
18401+
{
18402+
"name": "SwirlIconColor",
18403+
"module": "../swirl-icon"
18404+
}
18405+
]
18406+
},
18407+
"readonly": true,
18408+
"attribute": "color"
18409+
},
18410+
{
18411+
"kind": "field",
18412+
"name": "label",
18413+
"type": {
18414+
"text": "string"
18415+
},
18416+
"readonly": true,
18417+
"attribute": "label"
18418+
},
18419+
{
18420+
"kind": "field",
18421+
"name": "size",
18422+
"type": {
18423+
"text": "16 | 20 | 24 | 28",
18424+
"references": [
18425+
{
18426+
"name": "SwirlIconSize",
18427+
"module": "../swirl-icon.types"
18428+
}
18429+
]
18430+
},
18431+
"default": "24",
18432+
"readonly": true,
18433+
"attribute": "size"
18434+
}
18435+
],
18436+
"cssParts": [
18437+
{
18438+
"name": "icon"
18439+
}
18440+
]
18441+
}
18442+
],
18443+
"exports": [
18444+
{
18445+
"kind": "js",
18446+
"name": "SwirlIconDataObject",
18447+
"declaration": {
18448+
"name": "SwirlIconDataObject"
18449+
}
18450+
},
18451+
{
18452+
"kind": "custom-element-definition",
18453+
"name": "swirl-icon-data-object",
18454+
"declaration": {
18455+
"name": "SwirlIconDataObject"
18456+
}
18457+
}
18458+
]
18459+
},
1834918460
{
1835018461
"kind": "javascript-module",
1835118462
"path": "src/components/swirl-icon/icons/swirl-icon-date-range.tsx",

packages/swirl-components/icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/swirl-components/src/components.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,14 @@ export namespace Components {
18231823
*/
18241824
"size": SwirlIconSize;
18251825
}
1826+
interface SwirlIconDataObject {
1827+
"color"?: SwirlIconColor1;
1828+
"label"?: string;
1829+
/**
1830+
* @default 24
1831+
*/
1832+
"size": SwirlIconSize;
1833+
}
18261834
interface SwirlIconDateRange {
18271835
"color"?: SwirlIconColor1;
18281836
"label"?: string;
@@ -7019,6 +7027,12 @@ declare global {
70197027
prototype: HTMLSwirlIconDarkModeElement;
70207028
new (): HTMLSwirlIconDarkModeElement;
70217029
};
7030+
interface HTMLSwirlIconDataObjectElement extends Components.SwirlIconDataObject, HTMLStencilElement {
7031+
}
7032+
var HTMLSwirlIconDataObjectElement: {
7033+
prototype: HTMLSwirlIconDataObjectElement;
7034+
new (): HTMLSwirlIconDataObjectElement;
7035+
};
70227036
interface HTMLSwirlIconDateRangeElement extends Components.SwirlIconDateRange, HTMLStencilElement {
70237037
}
70247038
var HTMLSwirlIconDateRangeElement: {
@@ -9889,6 +9903,7 @@ declare global {
98899903
"swirl-icon-copy": HTMLSwirlIconCopyElement;
98909904
"swirl-icon-crop": HTMLSwirlIconCropElement;
98919905
"swirl-icon-dark-mode": HTMLSwirlIconDarkModeElement;
9906+
"swirl-icon-data-object": HTMLSwirlIconDataObjectElement;
98929907
"swirl-icon-date-range": HTMLSwirlIconDateRangeElement;
98939908
"swirl-icon-delete": HTMLSwirlIconDeleteElement;
98949909
"swirl-icon-deployed-code": HTMLSwirlIconDeployedCodeElement;
@@ -11871,6 +11886,14 @@ declare namespace LocalJSX {
1187111886
*/
1187211887
"size"?: SwirlIconSize;
1187311888
}
11889+
interface SwirlIconDataObject {
11890+
"color"?: SwirlIconColor1;
11891+
"label"?: string;
11892+
/**
11893+
* @default 24
11894+
*/
11895+
"size"?: SwirlIconSize;
11896+
}
1187411897
interface SwirlIconDateRange {
1187511898
"color"?: SwirlIconColor1;
1187611899
"label"?: string;
@@ -16536,6 +16559,11 @@ declare namespace LocalJSX {
1653616559
"label": string;
1653716560
"size": SwirlIconSize;
1653816561
}
16562+
interface SwirlIconDataObjectAttributes {
16563+
"color": SwirlIconColor;
16564+
"label": string;
16565+
"size": SwirlIconSize;
16566+
}
1653916567
interface SwirlIconDateRangeAttributes {
1654016568
"color": SwirlIconColor;
1654116569
"label": string;
@@ -18702,6 +18730,7 @@ declare namespace LocalJSX {
1870218730
"swirl-icon-copy": Omit<SwirlIconCopy, keyof SwirlIconCopyAttributes> & { [K in keyof SwirlIconCopy & keyof SwirlIconCopyAttributes]?: SwirlIconCopy[K] } & { [K in keyof SwirlIconCopy & keyof SwirlIconCopyAttributes as `attr:${K}`]?: SwirlIconCopyAttributes[K] } & { [K in keyof SwirlIconCopy & keyof SwirlIconCopyAttributes as `prop:${K}`]?: SwirlIconCopy[K] };
1870318731
"swirl-icon-crop": Omit<SwirlIconCrop, keyof SwirlIconCropAttributes> & { [K in keyof SwirlIconCrop & keyof SwirlIconCropAttributes]?: SwirlIconCrop[K] } & { [K in keyof SwirlIconCrop & keyof SwirlIconCropAttributes as `attr:${K}`]?: SwirlIconCropAttributes[K] } & { [K in keyof SwirlIconCrop & keyof SwirlIconCropAttributes as `prop:${K}`]?: SwirlIconCrop[K] };
1870418732
"swirl-icon-dark-mode": Omit<SwirlIconDarkMode, keyof SwirlIconDarkModeAttributes> & { [K in keyof SwirlIconDarkMode & keyof SwirlIconDarkModeAttributes]?: SwirlIconDarkMode[K] } & { [K in keyof SwirlIconDarkMode & keyof SwirlIconDarkModeAttributes as `attr:${K}`]?: SwirlIconDarkModeAttributes[K] } & { [K in keyof SwirlIconDarkMode & keyof SwirlIconDarkModeAttributes as `prop:${K}`]?: SwirlIconDarkMode[K] };
18733+
"swirl-icon-data-object": Omit<SwirlIconDataObject, keyof SwirlIconDataObjectAttributes> & { [K in keyof SwirlIconDataObject & keyof SwirlIconDataObjectAttributes]?: SwirlIconDataObject[K] } & { [K in keyof SwirlIconDataObject & keyof SwirlIconDataObjectAttributes as `attr:${K}`]?: SwirlIconDataObjectAttributes[K] } & { [K in keyof SwirlIconDataObject & keyof SwirlIconDataObjectAttributes as `prop:${K}`]?: SwirlIconDataObject[K] };
1870518734
"swirl-icon-date-range": Omit<SwirlIconDateRange, keyof SwirlIconDateRangeAttributes> & { [K in keyof SwirlIconDateRange & keyof SwirlIconDateRangeAttributes]?: SwirlIconDateRange[K] } & { [K in keyof SwirlIconDateRange & keyof SwirlIconDateRangeAttributes as `attr:${K}`]?: SwirlIconDateRangeAttributes[K] } & { [K in keyof SwirlIconDateRange & keyof SwirlIconDateRangeAttributes as `prop:${K}`]?: SwirlIconDateRange[K] };
1870618735
"swirl-icon-delete": Omit<SwirlIconDelete, keyof SwirlIconDeleteAttributes> & { [K in keyof SwirlIconDelete & keyof SwirlIconDeleteAttributes]?: SwirlIconDelete[K] } & { [K in keyof SwirlIconDelete & keyof SwirlIconDeleteAttributes as `attr:${K}`]?: SwirlIconDeleteAttributes[K] } & { [K in keyof SwirlIconDelete & keyof SwirlIconDeleteAttributes as `prop:${K}`]?: SwirlIconDelete[K] };
1870718736
"swirl-icon-deployed-code": Omit<SwirlIconDeployedCode, keyof SwirlIconDeployedCodeAttributes> & { [K in keyof SwirlIconDeployedCode & keyof SwirlIconDeployedCodeAttributes]?: SwirlIconDeployedCode[K] } & { [K in keyof SwirlIconDeployedCode & keyof SwirlIconDeployedCodeAttributes as `attr:${K}`]?: SwirlIconDeployedCodeAttributes[K] } & { [K in keyof SwirlIconDeployedCode & keyof SwirlIconDeployedCodeAttributes as `prop:${K}`]?: SwirlIconDeployedCode[K] };
@@ -19218,6 +19247,7 @@ declare module "@stencil/core" {
1921819247
"swirl-icon-copy": LocalJSX.IntrinsicElements["swirl-icon-copy"] & JSXBase.HTMLAttributes<HTMLSwirlIconCopyElement>;
1921919248
"swirl-icon-crop": LocalJSX.IntrinsicElements["swirl-icon-crop"] & JSXBase.HTMLAttributes<HTMLSwirlIconCropElement>;
1922019249
"swirl-icon-dark-mode": LocalJSX.IntrinsicElements["swirl-icon-dark-mode"] & JSXBase.HTMLAttributes<HTMLSwirlIconDarkModeElement>;
19250+
"swirl-icon-data-object": LocalJSX.IntrinsicElements["swirl-icon-data-object"] & JSXBase.HTMLAttributes<HTMLSwirlIconDataObjectElement>;
1922119251
"swirl-icon-date-range": LocalJSX.IntrinsicElements["swirl-icon-date-range"] & JSXBase.HTMLAttributes<HTMLSwirlIconDateRangeElement>;
1922219252
"swirl-icon-delete": LocalJSX.IntrinsicElements["swirl-icon-delete"] & JSXBase.HTMLAttributes<HTMLSwirlIconDeleteElement>;
1922319253
"swirl-icon-deployed-code": LocalJSX.IntrinsicElements["swirl-icon-deployed-code"] & JSXBase.HTMLAttributes<HTMLSwirlIconDeployedCodeElement>;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// DO NOT EDIT. THIS FILE GETS GENERATED VIA "yarn generate".
2+
3+
import { Component, Fragment, h, Prop } from "@stencil/core";
4+
import { SwirlIconSize } from "../swirl-icon.types";
5+
import { SwirlIconColor } from "../swirl-icon";
6+
import classnames from "classnames";
7+
8+
@Component({
9+
shadow: true,
10+
styleUrl: "../swirl-icon.css",
11+
tag: "swirl-icon-data-object",
12+
})
13+
export class SwirlIconDataObject {
14+
@Prop() color?: SwirlIconColor;
15+
@Prop() label?: string;
16+
@Prop() size: SwirlIconSize = 24;
17+
18+
render() {
19+
const viewBoxSize = this.size === 20 ? 24 : this.size;
20+
21+
const styles = {
22+
color: Boolean(this.color) ? `var(--s-icon-${this.color})` : undefined,
23+
};
24+
25+
const className = classnames("swirl-icon", `swirl-icon--size-${this.size}`);
26+
27+
const hasLabel = Boolean(this.label);
28+
29+
return (
30+
<svg
31+
aria-hidden={hasLabel ? undefined : "true"}
32+
class={className}
33+
fill="none"
34+
height={this.size}
35+
part="icon"
36+
role={hasLabel ? "img" : undefined}
37+
style={styles}
38+
viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
39+
width={this.size}
40+
xmlns="http://www.w3.org/2000/svg"
41+
>
42+
{hasLabel && <title>{this.label}</title>}
43+
{this.size === 16 && (
44+
<Fragment>
45+
<path
46+
d="M10 13.3333q-0.2833 0-0.475-0.1916T9.3333 12.6667q0-0.2833 0.1917-0.475T10 12h1.3333q0.2833 0 0.475-0.1917T12 11.3333v-1.3333q0-0.6333 0.3667-1.15t0.9666-0.7333v-0.2334q-0.6-0.2167-0.9666-0.7333t-0.3667-1.15v-1.3333q0-0.2833-0.1917-0.475T11.3333 4h-1.3333q-0.2833 0-0.475-0.1917T9.3333 3.3333q0-0.2833 0.1917-0.475T10 2.6667h1.3333q0.8333 0 1.4167 0.5833t0.5833 1.4167v1.3333q0 0.2833 0.1917 0.475T14 6.6667t0.475 0.1916Q14.6667 7.05 14.6667 7.3333v1.3334q0 0.2833-0.1917 0.475T14 9.3333t-0.475 0.1917Q13.3333 9.7167 13.3333 10v1.3333q0 0.8333-0.5833 1.4167t-1.4167 0.5833h-1.3333Zm-5.3333 0q-0.8333 0-1.4167-0.5833t-0.5833-1.4167v-1.3333q0-0.2833-0.1917-0.475T2 9.3333t-0.475-0.1916Q1.3333 8.95 1.3333 8.6667v-1.3334q0-0.2833 0.1917-0.475T2 6.6667t0.475-0.1917Q2.6667 6.2833 2.6667 6v-1.3333q0-0.8333 0.5833-1.4167t1.4167-0.5833h1.3333q0.2833 0 0.475 0.1916T6.6667 3.3333q0 0.2833-0.1917 0.475T6 4h-1.3333q-0.2833 0-0.475 0.1917T4 4.6667v1.3333q0 0.6333-0.3667 1.15t-0.9666 0.7333v0.2334q0.6 0.2167 0.9666 0.7333t0.3667 1.15v1.3333q0 0.2833 0.1917 0.475T4.6667 12h1.3333q0.2833 0 0.475 0.1917T6.6667 12.6667q0 0.2833-0.1917 0.475T6 13.3333h-1.3333Z"
47+
fill="currentColor"
48+
/>
49+
</Fragment>
50+
)}
51+
{(this.size === 20 || this.size === 24) && (
52+
<Fragment>
53+
<path
54+
d="M15 20q-0.425 0-0.7125-0.2875T14 19q0-0.425 0.2875-0.7125T15 18h2q0.425 0 0.7125-0.2875T18 17v-2q0-0.95 0.55-1.725t1.45-1.1v-0.35q-0.9-0.325-1.45-1.1t-0.55-1.725v-2q0-0.425-0.2875-0.7125T17 6h-2q-0.425 0-0.7125-0.2875T14 5q0-0.425 0.2875-0.7125T15 4h2q1.25 0 2.125 0.875t0.875 2.125v2q0 0.425 0.2875 0.7125T21 10t0.7125 0.2875Q22 10.575 22 11v2q0 0.425-0.2875 0.7125T21 14t-0.7125 0.2875Q20 14.575 20 15v2q0 1.25-0.875 2.125t-2.125 0.875h-2Zm-8 0q-1.25 0-2.125-0.875t-0.875-2.125v-2q0-0.425-0.2875-0.7125T3 14t-0.7125-0.2875Q2 13.425 2 13v-2q0-0.425 0.2875-0.7125T3 10t0.7125-0.2875Q4 9.425 4 9v-2q0-1.25 0.875-2.125t2.125-0.875h2q0.425 0 0.7125 0.2875T10 5q0 0.425-0.2875 0.7125T9 6h-2q-0.425 0-0.7125 0.2875T6 7v2q0 0.95-0.55 1.725t-1.45 1.1v0.35q0.9 0.325 1.45 1.1t0.55 1.725v2q0 0.425 0.2875 0.7125T7 18h2q0.425 0 0.7125 0.2875T10 19q0 0.425-0.2875 0.7125T9 20h-2Z"
55+
fill="currentColor"
56+
/>
57+
</Fragment>
58+
)}
59+
{this.size === 28 && (
60+
<Fragment>
61+
<path
62+
d="M17.5 23.3333q-0.4958 0-0.8313-0.3354T16.3333 22.1667q0-0.4958 0.3354-0.8313T17.5 21h2.3333q0.4958 0 0.8313-0.3354T21 19.8333v-2.3333q0-1.1083 0.6417-2.0125t1.6916-1.2833v-0.4084q-1.05-0.3792-1.6916-1.2833t-0.6417-2.0125v-2.3333q0-0.4958-0.3354-0.8313T19.8333 7h-2.3333q-0.4958 0-0.8313-0.3354T16.3333 5.8333q0-0.4958 0.3354-0.8312T17.5 4.6667h2.3333q1.4583 0 2.4792 1.0208t1.0208 2.4792v2.3333q0 0.4958 0.3355 0.8313T24.5 11.6667t0.8313 0.3354Q25.6667 12.3375 25.6667 12.8333v2.3334q0 0.4958-0.3354 0.8312T24.5 16.3333t-0.8313 0.3355Q23.3333 17.0042 23.3333 17.5v2.3333q0 1.4583-1.0208 2.4792t-2.4792 1.0208h-2.3333Zm-9.3333 0q-1.4583 0-2.4792-1.0208t-1.0208-2.4792v-2.3333q0-0.4958-0.3355-0.8313T3.5 16.3333t-0.8313-0.3354Q2.3333 15.6625 2.3333 15.1667v-2.3334q0-0.4958 0.3355-0.8312T3.5 11.6667t0.8313-0.3354Q4.6667 10.9958 4.6667 10.5v-2.3333q0-1.4583 1.0208-2.4792t2.4792-1.0208h2.3333q0.4958 0 0.8313 0.3354T11.6667 5.8333q0 0.4958-0.3355 0.8313T10.5 7h-2.3333q-0.4958 0-0.8313 0.3354T7 8.1667v2.3333q0 1.1083-0.6417 2.0125t-1.6916 1.2833v0.4084q1.05 0.3792 1.6916 1.2833t0.6417 2.0125v2.3333q0 0.4958 0.3354 0.8313T8.1667 21h2.3333q0.4958 0 0.8312 0.3354T11.6667 22.1667q0 0.4958-0.3355 0.8312T10.5 23.3333h-2.3333Z"
63+
fill="currentColor"
64+
/>
65+
</Fragment>
66+
)}
67+
</svg>
68+
);
69+
}
70+
}

packages/swirl-components/vscode-data.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7628,6 +7628,68 @@
76287628
}
76297629
]
76307630
},
7631+
{
7632+
"name": "swirl-icon-data-object",
7633+
"description": {
7634+
"kind": "markdown",
7635+
"value": ""
7636+
},
7637+
"attributes": [
7638+
{
7639+
"name": "color",
7640+
"description": "",
7641+
"values": [
7642+
{
7643+
"name": "critical"
7644+
},
7645+
{
7646+
"name": "default"
7647+
},
7648+
{
7649+
"name": "disabled"
7650+
},
7651+
{
7652+
"name": "highlight"
7653+
},
7654+
{
7655+
"name": "info"
7656+
},
7657+
{
7658+
"name": "on-action-primary"
7659+
},
7660+
{
7661+
"name": "on-image"
7662+
},
7663+
{
7664+
"name": "on-status"
7665+
},
7666+
{
7667+
"name": "on-surface-highlight"
7668+
},
7669+
{
7670+
"name": "on-surface-highlight-subdued"
7671+
},
7672+
{
7673+
"name": "strong"
7674+
},
7675+
{
7676+
"name": "success"
7677+
},
7678+
{
7679+
"name": "warning"
7680+
}
7681+
]
7682+
},
7683+
{
7684+
"name": "label",
7685+
"description": ""
7686+
},
7687+
{
7688+
"name": "size",
7689+
"description": ""
7690+
}
7691+
]
7692+
},
76317693
{
76327694
"name": "swirl-icon-date-range",
76337695
"description": {

packages/swirl-icons/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ have to be named in PascalCase followed by the size, e.g. `AddPhoto16.svg`!**
5959

6060
1. Modify the icon files in a new branch
6161
2. Run `yarn generate`, select "icons" when prompted
62-
3. Run `yarn changeset` to create a corresponding changelog item
63-
4. Run `yarn build`
62+
3. Run `yarn build`
63+
4. Run `yarn changeset` to create a corresponding changelog item
6464
5. Check, commit and push all changes and create a PR
0 Bytes
Binary file not shown.
2.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)