From 7cf3ec2996e2a68bc70d0159516d3bc5c875aa03 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Fri, 20 Dec 2024 17:44:33 +0100 Subject: [PATCH] Add VisualList component --- ...st-VisualList-Default-1-chromium-linux.png | Bin 0 -> 9659 bytes ...isualListItem-Default-1-chromium-linux.png | Bin 0 -> 6054 bytes ...lListItem-Destructive-1-chromium-linux.png | Bin 0 -> 6049 bytes ...ualListItem-Multiline-1-chromium-linux.png | Bin 0 -> 8574 bytes ...isualListItem-Success-1-chromium-linux.png | Bin 0 -> 6069 bytes .../VisualList/VisualList.module.css | 26 ++++ .../VisualList/VisualList.stories.tsx | 46 +++++++ src/components/VisualList/VisualList.test.tsx | 30 +++++ src/components/VisualList/VisualList.tsx | 41 +++++++ .../VisualList/VisualListItem.module.css | 36 ++++++ .../VisualList/VisualListItem.stories.tsx | 56 +++++++++ .../VisualList/VisualListItem.test.tsx | 42 +++++++ src/components/VisualList/VisualListItem.tsx | 63 ++++++++++ .../__snapshots__/VisualList.test.tsx.snap | 79 ++++++++++++ .../VisualListItem.test.tsx.snap | 113 ++++++++++++++++++ src/components/VisualList/index.tsx | 18 +++ src/index.ts | 1 + 17 files changed, 551 insertions(+) create mode 100644 playwright/visual.test.ts-snapshots/VisualList-VisualList-Default-1-chromium-linux.png create mode 100644 playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Default-1-chromium-linux.png create mode 100644 playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Destructive-1-chromium-linux.png create mode 100644 playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Multiline-1-chromium-linux.png create mode 100644 playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Success-1-chromium-linux.png create mode 100644 src/components/VisualList/VisualList.module.css create mode 100644 src/components/VisualList/VisualList.stories.tsx create mode 100644 src/components/VisualList/VisualList.test.tsx create mode 100644 src/components/VisualList/VisualList.tsx create mode 100644 src/components/VisualList/VisualListItem.module.css create mode 100644 src/components/VisualList/VisualListItem.stories.tsx create mode 100644 src/components/VisualList/VisualListItem.test.tsx create mode 100644 src/components/VisualList/VisualListItem.tsx create mode 100644 src/components/VisualList/__snapshots__/VisualList.test.tsx.snap create mode 100644 src/components/VisualList/__snapshots__/VisualListItem.test.tsx.snap create mode 100644 src/components/VisualList/index.tsx diff --git a/playwright/visual.test.ts-snapshots/VisualList-VisualList-Default-1-chromium-linux.png b/playwright/visual.test.ts-snapshots/VisualList-VisualList-Default-1-chromium-linux.png new file mode 100644 index 0000000000000000000000000000000000000000..8d0d08774e253cf1ebc40bdf75b0d547667ac235 GIT binary patch literal 9659 zcmeI2c~H|?y7zyGN_W$Mb8SRq>mEnxAd4HjKr5}ZVbg?w7(-MBXoRruA&IRGw6e8r z5RpyAfUIFnAdsM_;8yl}EguQ%j=2>rC}wUUjUH62;g!9hKr zXLAjdzW?lp9fhBX6SnmI`LKm^SpR^HaXl-#_Mp4Cl~Joc51JaJ+MgWBv!p?lYqqG zR(`Xz2+;9bGa}l^{<>Y}0yTI0n4U=xYD=AEz&%yVlbm%js%yi## znf3|qXYqZ>Oe}dkHc87zDhl;^SAsvBkC~n;!Cc4fW+A>|en1Q)-azqAqrU^JJaic^ zYlK`@E!#KIBVPiX)ZIF|ZLu01#0awuW_$e+R>$Dr zVqjgrgSG5nbaZS_ZtK>HUxyxgait?ukMS*GVu6^g(~~P*S3X1^;cY^;7wch_Lid( z%@v!a;=dSeicW$Qlb)2464?GCPK42Pb7a$_U<8H~@mP5&ypEF?f}nZ8xYhj`w#lZv z$e=aCqheVNni)O43Stj=Anj(kT7Y^&+gG|~vX=5K9PW9gHHimpF4&uucAakYT3n9_Z{Nw1|*;fJRv@Ak8z(g{#il7FT*7AX~1Yn!?4I`ZtJ2 zqDI1bUiym(b_6`c--8~_Ex=q8FV(9q!LuO=;~8samyYsm9h$1*A1hmYS?wJ$K0$mWCic@BC95liKe~Y`-%)i>60UdDj+9z*p#(>Kg0IG$>&bhx$|Uhdh`N-QEj+5XATvf&wC+hO63p9bPXO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ttIc><%%PQmMm=Lh{7RYj?m2zjOBqWVLhy*swo>u zsUN>Zl1}UjqNn%c)-RwDMiq^`PMv)*noxy5bEhBPsjQdKar(a{GB;}eT7b_9VN-#E z!2ISf(@vo`@yVSivrOw7`jWG%&AW{=_y<@9mtvsK z;GC7Zf=ipdnq45xe*}369Rv9jtD2*zHGTBNJzGPALZsEk8rP`7p*oo7yJi~XhES!| zM7;nhOblOziLqU-0|EP<(}=?OYPA2k4n*KiqtzE(j;ledfJyxljMAF`F!JE_n{6%Lc(APKErC_ z>qbN^t;W92iuqxHJqXEH;COe&6>I*=I}RC7F3fu#8vNGS$IF|^8XUo$DeIVwc>%y}0=Y^wYXWK~Xdl8b%O{C@$+%>1EP#CByjW(f3u zU7O;?*Qs!)4P(l+X{ly@)0LUuY>N>QFGcFiG>m$`+&2d zWd&ht+jXqkrY0}UxKx!Ew(%;l?X2*90mSxHzsk*6_P=A(+(xf>ReyA3x*7f|;aMdN z__r{BZUQyFlzida;+kb3!|Nf{j-I#~>{|GG8 zEUv$P?0dD>Htp16^~e%THI=FSLY2c-0I>NA-Kq39PSd}FDxcc?tvB~+Ha^Y9UtQWynE;3rjDG-tU4b9} x3-GC`{KdQflog-q!>9W2X&3ze*adO}$Fy71HoTt|BnJTJ&$@kIb>`}={{#in2;Kky literal 0 HcmV?d00001 diff --git a/playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Default-1-chromium-linux.png b/playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Default-1-chromium-linux.png new file mode 100644 index 0000000000000000000000000000000000000000..e95904329ccc1ffc497d00e9e419a90ff3e72313 GIT binary patch literal 6054 zcmeI0c~sL^7RP^;8L_oWJB$s=)*f3CsYThsj+QDT7@}c-Dun1D!)6FuAP_=aT98%~ zElU(xN;Mz?L4_oc1R_#EK^A2XNmwF@0g`|r3E3z9Kg*f^%^&Z)ciy?@zH{FF-upi9 z7M%(W+VRnzj{pGJapG^^!2n>($osKvi)qKhePqBieUJeQ`WB!J*@y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Bk|0U@h8 zwIGfU2|rFGNq#nxUz9`X%l$}!&qjLR_uk7BS5vGeY0Dqi`yo72$n5BWq4C8QnyEFm z;{EIQ#`o+k@FmfUgVuGr!EKC-VV>JkR3=R6yQfmuvv8xOUl?!UqTc!>B05cM+TOmr z)$4+kzmqP8)0wabPFI$i7J|-F`5{Z5ru7m&_ThAW!BhiweRrd+{4$#R66A_jE3bi{ zCU)EsGtnJ<=8-(`5M-bf7duQ*joG)R>3K4Q>D0CP5=O3TK6nu06H@U7D~*$lmI$w@ zi$WtASS~NSCZeys_z(r!91mCXjEn7C<9pi+C&XNjxiHI90;B}x@1@YW+l%^v_8!su znZ&CckdUU;f;T!#lUd4Y#i3(?hD2JGAkZsyx+REXC&y|X18I_}Px&kNiU z#`KHg6Jh)`l?mBABMSMe_HVkMOVVNBcEqLu#&S7jK!{fzmB6evD#WvSe8j?CMzIUD z@vmLBUMXqY;q!Tls#BtL;1#^m8qU`s)`>Y7>lzwfvzeH>`Jq@RF5&DZ2a4RD&>*Y*P4W zY50yuUDs&B&7w|2cMt^~S(mvoH$9z>o}kN5f~1qKDcT6CLR?Z+RgxK7#RsmN=a}g+n_CV7 z#}tXw*e1}>QhN`o<~ubd4?IETVLbE~O4^jw>FiS}><#BP=bU%DQ6T zWUR;z)~XuV+N!uRw`Wtj4_N8*0B@UU3=}65I`0L_oBm4^{ZEcqcAs$YH$Y1L<=Ow< zh5u86|J%#&WZ5~o|K;zugO?q=?BL};6i9YRvO|&`lI)P=|EjL;h{yjT9$I{?vg63S U)ozRJnmge8O~BWbucB`J9Y)b-8~^|S literal 0 HcmV?d00001 diff --git a/playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Multiline-1-chromium-linux.png b/playwright/visual.test.ts-snapshots/VisualList-VisualListItem-Multiline-1-chromium-linux.png new file mode 100644 index 0000000000000000000000000000000000000000..c966df3c59d86699f81b11eb802a66ea8d20174c GIT binary patch literal 8574 zcmeI2X;f3$md8`ivMDE6)s})Xq+at%Dk4N>C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ei;Mu{mkx8=r2CzNobpaNmZ}GxCAPBLS5d3G9mc)TODoPUnHVPv zC_CJTj_YhJU2(l6xYHdu_+9MA)6y2v_O@ud*e@)QbZNfsg!88$2Loa3qkY3{93-0c zk`6n3I@CFy>un4kYjcUe}RZO{yoO&xu77fRvnO#Q>-pO~(yMn4EVMol`Zn>D3& zYUXDlDp%Z_gqu1l?~B-KKg};Xujd==)~FKaTcwpJL7G!e#<rmTbJkJW8a?mD zX_A-Z;aomF5ND$r7T++19nq{hc3qpMRV?VB4~%atdz5u$y24tT zax7`)o_mccfKK)huI2fG2Av3{i+@M;=e>BgpKQ6o(6fmx&T}+ar`1N7pz|# zxCvuOw}_vs6b||tWtHwXjmpOIUKQA4GWl;T+Z3-P(F8BeKotNa6L)T?X`jcwIHa`+ zK=}Ii)%3rG@PD|Zy#U=c0X$BV|GOOj{Q!SN)Ne-lzyCv + First item + Second item + Third item + + ), + }, +} as Meta; + +const Template: StoryFn = ( + args: ComponentProps, +) => { + return ; +}; + +export const Default = Template.bind({}); +Default.args = {}; diff --git a/src/components/VisualList/VisualList.test.tsx b/src/components/VisualList/VisualList.test.tsx new file mode 100644 index 00000000..81689692 --- /dev/null +++ b/src/components/VisualList/VisualList.test.tsx @@ -0,0 +1,30 @@ +/* + * Copyright 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { composeStories } from "@storybook/react"; +import * as stories from "./VisualList.stories"; +import { describe, expect, it } from "vitest"; +import { render } from "@testing-library/react"; +import React from "react"; + +const { Default } = composeStories(stories); + +describe("VisualList", () => { + it("renders a Default VisualList", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/src/components/VisualList/VisualList.tsx b/src/components/VisualList/VisualList.tsx new file mode 100644 index 00000000..10638470 --- /dev/null +++ b/src/components/VisualList/VisualList.tsx @@ -0,0 +1,41 @@ +/* +Copyright 2024 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React, { JSX, PropsWithChildren } from "react"; +import styles from "./VisualList.module.css"; +import classNames from "classnames"; + +interface VisualListProps extends React.HTMLProps { + /** + * The CSS class name. + */ + className?: string; +} + +/** + * A list component. + */ +export function VisualList({ + className, + children, + ...props +}: PropsWithChildren): JSX.Element { + return ( +
    + {children} +
+ ); +} diff --git a/src/components/VisualList/VisualListItem.module.css b/src/components/VisualList/VisualListItem.module.css new file mode 100644 index 00000000..b083dbe6 --- /dev/null +++ b/src/components/VisualList/VisualListItem.module.css @@ -0,0 +1,36 @@ +/* + * Copyright 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.visual-list-item { + display: flex; + gap: var(--cpd-space-3x); + padding: var(--cpd-space-3x) var(--cpd-space-4x); + background-color: var(--cpd-color-bg-subtle-secondary); + font: var(--cpd-font-body-md-medium); +} + +.visual-list-item-icon { + flex-shrink: 0; + color: var(--cpd-color-icon-secondary); +} + +.visual-list-item-icon-success { + color: var(--cpd-color-icon-success-primary); +} + +.visual-list-item-icon-destructive { + color: var(--cpd-color-icon-critical-primary); +} diff --git a/src/components/VisualList/VisualListItem.stories.tsx b/src/components/VisualList/VisualListItem.stories.tsx new file mode 100644 index 00000000..2d2cbe62 --- /dev/null +++ b/src/components/VisualList/VisualListItem.stories.tsx @@ -0,0 +1,56 @@ +/* + * Copyright 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { VisualListItem as VisualListItemComponent } from "./VisualListItem"; +import { Meta, StoryFn } from "@storybook/react"; +import React, { ComponentProps } from "react"; +import InfoIcon from "@vector-im/compound-design-tokens/assets/web/icons/info"; + +export default { + title: "VisualList/VisualListItem", + component: VisualListItemComponent, + tags: ["autodocs"], + argTypes: {}, + args: { + Icon: InfoIcon, + children: "List item description", + }, +} as Meta; + +const Template: StoryFn = ( + args: ComponentProps, +) => { + return ; +}; + +export const Default = Template.bind({}); +Default.args = {}; + +export const Success = Template.bind({}); +Success.args = { + success: true, +}; + +export const Destructive = Template.bind({}); +Destructive.args = { + destructive: true, +}; + +export const Multiline = Template.bind({}); +Multiline.args = { + children: + "List item with a looooooooooong very looooooooooong loooooooooooooong description", +}; diff --git a/src/components/VisualList/VisualListItem.test.tsx b/src/components/VisualList/VisualListItem.test.tsx new file mode 100644 index 00000000..ed9a97ad --- /dev/null +++ b/src/components/VisualList/VisualListItem.test.tsx @@ -0,0 +1,42 @@ +/* + * Copyright 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { composeStories } from "@storybook/react"; +import * as stories from "./VisualListItem.stories"; +import { describe, expect, it } from "vitest"; +import { render } from "@testing-library/react"; +import React from "react"; + +const { Default, Success, Destructive, Multiline } = composeStories(stories); + +describe("VisualListItem", () => { + it("renders a Default VisualListItem", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); + it("renders a Success VisualListItem", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); + it("renders a Destructive VisualListItem", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); + it("renders a Multiline VisualListItem", () => { + const { container } = render(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/src/components/VisualList/VisualListItem.tsx b/src/components/VisualList/VisualListItem.tsx new file mode 100644 index 00000000..4cfcfcdf --- /dev/null +++ b/src/components/VisualList/VisualListItem.tsx @@ -0,0 +1,63 @@ +/* +Copyright 2024 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import React, { ComponentType, JSX, PropsWithChildren } from "react"; +import styles from "./VisualListItem.module.css"; +import classNames from "classnames"; + +interface VisualListItemProps extends React.HTMLProps { + /** + * The CSS class name. + */ + className?: string; + /** + * The icon component. + */ + Icon: ComponentType>; + + success?: boolean; + destructive?: boolean; +} + +/** + * A list component. + */ +export function VisualListItem({ + className, + children, + Icon, + success = false, + destructive = false, + ...props +}: PropsWithChildren): JSX.Element { + return ( +
  • + + {children} +
  • + ); +} diff --git a/src/components/VisualList/__snapshots__/VisualList.test.tsx.snap b/src/components/VisualList/__snapshots__/VisualList.test.tsx.snap new file mode 100644 index 00000000..83da01c9 --- /dev/null +++ b/src/components/VisualList/__snapshots__/VisualList.test.tsx.snap @@ -0,0 +1,79 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`VisualList > renders a Default VisualList 1`] = ` +
    +
      +
    • + + First item +
    • +
    • + + Second item +
    • +
    • + + Third item +
    • +
    +
    +`; diff --git a/src/components/VisualList/__snapshots__/VisualListItem.test.tsx.snap b/src/components/VisualList/__snapshots__/VisualListItem.test.tsx.snap new file mode 100644 index 00000000..07031320 --- /dev/null +++ b/src/components/VisualList/__snapshots__/VisualListItem.test.tsx.snap @@ -0,0 +1,113 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`VisualListItem > renders a Default VisualListItem 1`] = ` +
    +
  • + + List item description +
  • +
    +`; + +exports[`VisualListItem > renders a Destructive VisualListItem 1`] = ` +
    +
  • + + List item description +
  • +
    +`; + +exports[`VisualListItem > renders a Multiline VisualListItem 1`] = ` +
    +
  • + + List item with a looooooooooong very looooooooooong loooooooooooooong description +
  • +
    +`; + +exports[`VisualListItem > renders a Success VisualListItem 1`] = ` +
    +
  • + + List item description +
  • +
    +`; diff --git a/src/components/VisualList/index.tsx b/src/components/VisualList/index.tsx new file mode 100644 index 00000000..1a69f4f3 --- /dev/null +++ b/src/components/VisualList/index.tsx @@ -0,0 +1,18 @@ +/* +Copyright 2024 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export { VisualList } from "./VisualList"; +export { VisualListItem } from "./VisualListItem"; diff --git a/src/index.ts b/src/index.ts index 557e658a..0b662cb0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,7 @@ export { Toast } from "./components/Toast/Toast"; export { Dropdown } from "./components/Dropdown"; export { InlineSpinner } from "./components/InlineSpinner"; export { Breadcrumb } from "./components/Breadcrumb"; +export { VisualList, VisualListItem } from "./components/VisualList"; export { TextControl,