From 9c3ec97696942da43dc2884e5d30ef4349c5e5fa Mon Sep 17 00:00:00 2001 From: robintown Date: Mon, 12 Feb 2024 13:36:31 +0000 Subject: [PATCH] deploy: 14a139d9b3896af9f81a302a43b731198c4e4d33 --- assets/{Action-a9c31ef6.js => Action-b4309dd0.js} | 4 ++-- ...Action-a9c31ef6.js.map => Action-b4309dd0.js.map} | 2 +- ...tories-b26816a7.js => Action.stories-8ce25bfe.js} | 4 ++-- ...26816a7.js.map => Action.stories-8ce25bfe.js.map} | 2 +- ...stories-bd2758e5.js => Alert.stories-e231ff81.js} | 4 ++-- ...bd2758e5.js.map => Alert.stories-e231ff81.js.map} | 2 +- assets/{Button-abe57c7a.js => Button-1d7556c8.js} | 6 +++--- ...Button-abe57c7a.js.map => Button-1d7556c8.js.map} | 2 +- ...tories-635607f4.js => Button.stories-e52e7f44.js} | 4 ++-- ...35607f4.js.map => Button.stories-e52e7f44.js.map} | 2 +- ...NJS4EI-6a674fd6.js => Color-6VNJS4EI-0d7d2eab.js} | 4 ++-- ...a674fd6.js.map => Color-6VNJS4EI-0d7d2eab.js.map} | 2 +- ...b5680dfb.js => DocsRenderer-3PUGWF3O-a600266f.js} | 12 ++++++------ ....js.map => DocsRenderer-3PUGWF3O-a600266f.js.map} | 2 +- ....stories-e5ad6c60.js => Form.stories-1178f28c.js} | 4 ++-- assets/Form.stories-1178f28c.js.map | 1 + assets/Form.stories-e5ad6c60.js.map | 1 - ...s => GlobalScrollAreaStyles-UY5SB7EJ-bfaf48f7.js} | 4 ++-- ... GlobalScrollAreaStyles-UY5SB7EJ-bfaf48f7.js.map} | 2 +- ...IconButton-dea21e21.js => IconButton-3b043bff.js} | 6 +++--- ...on-dea21e21.js.map => IconButton-3b043bff.js.map} | 2 +- ...es-74f840ff.js => IconButton.stories-e5fce0b9.js} | 4 ++-- ...0ff.js.map => IconButton.stories-e5fce0b9.js.map} | 2 +- assets/IndicatorIcon-240b404b.js | 3 --- assets/IndicatorIcon-ec96b47b.js | 3 +++ ...240b404b.js.map => IndicatorIcon-ec96b47b.js.map} | 2 +- ...4de0da7c.js => IndicatorIcon.stories-a3e5b49b.js} | 4 ++-- ....js.map => IndicatorIcon.stories-a3e5b49b.js.map} | 2 +- ....stories-3ff91748.js => Menu.stories-c8c07f07.js} | 4 ++-- ...-3ff91748.js.map => Menu.stories-c8c07f07.js.map} | 2 +- .../{Password-28092254.js => Password-4cefced2.js} | 4 ++-- ...word-28092254.js.map => Password-4cefced2.js.map} | 2 +- ...ries-8938dec6.js => Password.stories-ec34631f.js} | 4 ++-- ...8dec6.js.map => Password.stories-ec34631f.js.map} | 2 +- ...tories-948dc9f2.js => Search.stories-d2fa658f.js} | 4 ++-- ...48dc9f2.js.map => Search.stories-d2fa658f.js.map} | 2 +- assets/{Submit-05384f2c.js => Submit-38973ed3.js} | 6 +++--- ...Submit-05384f2c.js.map => Submit-38973ed3.js.map} | 2 +- assets/Text-67f23194.js | 8 -------- assets/Text-bb8e96d0.js | 8 ++++++++ .../{Text-67f23194.js.map => Text-bb8e96d0.js.map} | 2 +- ....stories-646675f2.js => Text.stories-0a8bfbe0.js} | 4 ++-- ...-646675f2.js.map => Text.stories-0a8bfbe0.js.map} | 2 +- ...ories-d6854e9f.js => Tooltip.stories-7359aa8a.js} | 4 ++-- ...854e9f.js.map => Tooltip.stories-7359aa8a.js.map} | 2 +- assets/UnstyledButton-60dcee3b.js | 2 -- assets/UnstyledButton-60dcee3b.js.map | 1 - assets/UnstyledButton-f4d497aa.js | 2 ++ assets/UnstyledButton-f4d497aa.js.map | 1 + assets/WithTooltip-J57HCPYA-42a4e6c6.js.map | 1 - ...-42a4e6c6.js => WithTooltip-J57HCPYA-b0352c0d.js} | 4 ++-- assets/WithTooltip-J57HCPYA-b0352c0d.js.map | 1 + ...XI-b48ed702.js => formatter-SWP5E3XI-f2cbdb3d.js} | 4 ++-- ...702.js.map => formatter-SWP5E3XI-f2cbdb3d.js.map} | 2 +- assets/{iframe-74b9514d.js => iframe-08fe5eae.js} | 4 ++-- ...iframe-74b9514d.js.map => iframe-08fe5eae.js.map} | 2 +- assets/{preview-20cc6b87.js => preview-2dc6cf34.js} | 4 ++-- ...eview-20cc6b87.js.map => preview-2dc6cf34.js.map} | 2 +- assets/syntaxhighlighter-PONEFOSF-7c1bd358.js.map | 1 - ...358.js => syntaxhighlighter-PONEFOSF-f88dcdbc.js} | 4 ++-- assets/syntaxhighlighter-PONEFOSF-f88dcdbc.js.map | 1 + components/Button/UnstyledButton.d.ts | 4 ++-- components/Button/UnstyledButton.d.ts.map | 2 +- components/Form/Controls/Text/Text.d.ts.map | 2 +- components/Icon/IndicatorIcon/IndicatorIcon.d.ts | 2 +- components/Icon/IndicatorIcon/IndicatorIcon.d.ts.map | 2 +- iframe.html | 2 +- project.json | 2 +- 68 files changed, 103 insertions(+), 103 deletions(-) rename assets/{Action-a9c31ef6.js => Action-b4309dd0.js} (96%) rename assets/{Action-a9c31ef6.js.map => Action-b4309dd0.js.map} (98%) rename assets/{Action.stories-b26816a7.js => Action.stories-8ce25bfe.js} (96%) rename assets/{Action.stories-b26816a7.js.map => Action.stories-8ce25bfe.js.map} (60%) rename assets/{Alert.stories-bd2758e5.js => Alert.stories-e231ff81.js} (95%) rename assets/{Alert.stories-bd2758e5.js.map => Alert.stories-e231ff81.js.map} (98%) rename assets/{Button-abe57c7a.js => Button-1d7556c8.js} (85%) rename assets/{Button-abe57c7a.js.map => Button-1d7556c8.js.map} (98%) rename assets/{Button.stories-635607f4.js => Button.stories-e52e7f44.js} (96%) rename assets/{Button.stories-635607f4.js.map => Button.stories-e52e7f44.js.map} (63%) rename assets/{Color-6VNJS4EI-6a674fd6.js => Color-6VNJS4EI-0d7d2eab.js} (99%) rename assets/{Color-6VNJS4EI-6a674fd6.js.map => Color-6VNJS4EI-0d7d2eab.js.map} (99%) rename assets/{DocsRenderer-3PUGWF3O-b5680dfb.js => DocsRenderer-3PUGWF3O-a600266f.js} (99%) rename assets/{DocsRenderer-3PUGWF3O-b5680dfb.js.map => DocsRenderer-3PUGWF3O-a600266f.js.map} (99%) rename assets/{Form.stories-e5ad6c60.js => Form.stories-1178f28c.js} (88%) create mode 100644 assets/Form.stories-1178f28c.js.map delete mode 100644 assets/Form.stories-e5ad6c60.js.map rename assets/{GlobalScrollAreaStyles-UY5SB7EJ-9f47ec88.js => GlobalScrollAreaStyles-UY5SB7EJ-bfaf48f7.js} (98%) rename assets/{GlobalScrollAreaStyles-UY5SB7EJ-9f47ec88.js.map => GlobalScrollAreaStyles-UY5SB7EJ-bfaf48f7.js.map} (99%) rename assets/{IconButton-dea21e21.js => IconButton-3b043bff.js} (89%) rename assets/{IconButton-dea21e21.js.map => IconButton-3b043bff.js.map} (98%) rename assets/{IconButton.stories-74f840ff.js => IconButton.stories-e5fce0b9.js} (94%) rename assets/{IconButton.stories-74f840ff.js.map => IconButton.stories-e5fce0b9.js.map} (56%) delete mode 100644 assets/IndicatorIcon-240b404b.js create mode 100644 assets/IndicatorIcon-ec96b47b.js rename assets/{IndicatorIcon-240b404b.js.map => IndicatorIcon-ec96b47b.js.map} (55%) rename assets/{IndicatorIcon.stories-4de0da7c.js => IndicatorIcon.stories-a3e5b49b.js} (96%) rename assets/{IndicatorIcon.stories-4de0da7c.js.map => IndicatorIcon.stories-a3e5b49b.js.map} (87%) rename assets/{Menu.stories-3ff91748.js => Menu.stories-c8c07f07.js} (97%) rename assets/{Menu.stories-3ff91748.js.map => Menu.stories-c8c07f07.js.map} (99%) rename assets/{Password-28092254.js => Password-4cefced2.js} (96%) rename assets/{Password-28092254.js.map => Password-4cefced2.js.map} (98%) rename assets/{Password.stories-8938dec6.js => Password.stories-ec34631f.js} (99%) rename assets/{Password.stories-8938dec6.js.map => Password.stories-ec34631f.js.map} (99%) rename assets/{Search.stories-948dc9f2.js => Search.stories-d2fa658f.js} (86%) rename assets/{Search.stories-948dc9f2.js.map => Search.stories-d2fa658f.js.map} (97%) rename assets/{Submit-05384f2c.js => Submit-38973ed3.js} (89%) rename assets/{Submit-05384f2c.js.map => Submit-38973ed3.js.map} (99%) delete mode 100644 assets/Text-67f23194.js create mode 100644 assets/Text-bb8e96d0.js rename assets/{Text-67f23194.js.map => Text-bb8e96d0.js.map} (53%) rename assets/{Text.stories-646675f2.js => Text.stories-0a8bfbe0.js} (97%) rename assets/{Text.stories-646675f2.js.map => Text.stories-0a8bfbe0.js.map} (64%) rename assets/{Tooltip.stories-d6854e9f.js => Tooltip.stories-7359aa8a.js} (95%) rename assets/{Tooltip.stories-d6854e9f.js.map => Tooltip.stories-7359aa8a.js.map} (61%) delete mode 100644 assets/UnstyledButton-60dcee3b.js delete mode 100644 assets/UnstyledButton-60dcee3b.js.map create mode 100644 assets/UnstyledButton-f4d497aa.js create mode 100644 assets/UnstyledButton-f4d497aa.js.map delete mode 100644 assets/WithTooltip-J57HCPYA-42a4e6c6.js.map rename assets/{WithTooltip-J57HCPYA-42a4e6c6.js => WithTooltip-J57HCPYA-b0352c0d.js} (58%) create mode 100644 assets/WithTooltip-J57HCPYA-b0352c0d.js.map rename assets/{formatter-SWP5E3XI-b48ed702.js => formatter-SWP5E3XI-f2cbdb3d.js} (99%) rename assets/{formatter-SWP5E3XI-b48ed702.js.map => formatter-SWP5E3XI-f2cbdb3d.js.map} (99%) rename assets/{iframe-74b9514d.js => iframe-08fe5eae.js} (83%) rename assets/{iframe-74b9514d.js.map => iframe-08fe5eae.js.map} (99%) rename assets/{preview-20cc6b87.js => preview-2dc6cf34.js} (53%) rename assets/{preview-20cc6b87.js.map => preview-2dc6cf34.js.map} (91%) delete mode 100644 assets/syntaxhighlighter-PONEFOSF-7c1bd358.js.map rename assets/{syntaxhighlighter-PONEFOSF-7c1bd358.js => syntaxhighlighter-PONEFOSF-f88dcdbc.js} (58%) create mode 100644 assets/syntaxhighlighter-PONEFOSF-f88dcdbc.js.map diff --git a/assets/Action-a9c31ef6.js b/assets/Action-b4309dd0.js similarity index 96% rename from assets/Action-a9c31ef6.js rename to assets/Action-b4309dd0.js index aefb647f..217aae58 100644 --- a/assets/Action-a9c31ef6.js +++ b/assets/Action-b4309dd0.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-f6d73c06.js";import{c as f}from"./index-e131923d.js";import{r as c}from"./index-8ee6c85d.js";import{a as h}from"./Text-67f23194.js";import{u as b}from"./useId-a94b91a4.js";import{$ as g}from"./index-473717ad.js";import{T as y}from"./Tooltip-7b34be2e.js";const _="_container_1p4gy_17",x="_control_1p4gy_22",C="_action_1p4gy_27",a={container:_,control:x,action:C},i=c.forwardRef(function({Icon:n,className:o,actionLabel:r,onActionClick:u,...p},d){const l=b(),m=f(a.container,o);return e.jsxs("div",{className:m,id:l,children:[e.jsx(h,{ref:d,...p,className:a.control}),e.jsx(y,{label:r,children:e.jsx("button",{type:"button",className:a.action,onClick:u,"aria-controls":l,"aria-label":r,children:e.jsx(n,{"aria-hidden":!0})})})]})}),s=c.forwardRef(function(n,o){return e.jsx(g,{asChild:!0,children:e.jsx(i,{ref:o,...n})})});try{i.displayName="ActionInput",i.__docgenInfo={description:`A generic input with an action icon on the right hand side. +import{j as e}from"./jsx-runtime-f6d73c06.js";import{c as f}from"./index-e131923d.js";import{r as c}from"./index-8ee6c85d.js";import{a as h}from"./Text-bb8e96d0.js";import{u as b}from"./useId-a94b91a4.js";import{$ as g}from"./index-473717ad.js";import{T as y}from"./Tooltip-7b34be2e.js";const _="_container_1p4gy_17",x="_control_1p4gy_22",C="_action_1p4gy_27",a={container:_,control:x,action:C},i=c.forwardRef(function({Icon:n,className:o,actionLabel:r,onActionClick:u,...p},d){const l=b(),m=f(a.container,o);return e.jsxs("div",{className:m,id:l,children:[e.jsx(h,{ref:d,...p,className:a.control}),e.jsx(y,{label:r,children:e.jsx("button",{type:"button",className:a.action,onClick:u,"aria-controls":l,"aria-label":r,children:e.jsx(n,{"aria-hidden":!0})})})]})}),s=c.forwardRef(function(n,o){return e.jsx(g,{asChild:!0,children:e.jsx(i,{ref:o,...n})})});try{i.displayName="ActionInput",i.__docgenInfo={description:`A generic input with an action icon on the right hand side. You should rarely use it directly, but it is powering the likes of "copy to clipboard input", "password reveal", ...`,displayName:"ActionInput",props:{className:{defaultValue:null,description:"The CSS class name.",name:"className",required:!1,type:{name:"string"}},Icon:{defaultValue:null,description:"The React component to display on the right hand side of the icon.",name:"Icon",required:!0,type:{name:"FunctionComponent>"}},enableLigatures:{defaultValue:null,description:`Enable contextual alternate ligatures on input text For example on an in-place editing field @@ -7,4 +7,4 @@ https://github.com/rsms/inter/blob/master/src/features/calt.fea`,name:"enableLig For example on an in-place editing field https://github.com/rsms/inter/issues/222 https://github.com/rsms/inter/blob/master/src/features/calt.fea`,name:"enableLigatures",required:!1,type:{name:"boolean"}},actionLabel:{defaultValue:null,description:'The name of the action to perform (e.g. "Copy to clipboard")',name:"actionLabel",required:!0,type:{name:"string"}},onActionClick:{defaultValue:null,description:"On click callback for the icon on the right hand side",name:"onActionClick",required:!0,type:{name:"(e: MouseEvent) => void"}}}}}catch{}export{i as A}; -//# sourceMappingURL=Action-a9c31ef6.js.map +//# sourceMappingURL=Action-b4309dd0.js.map diff --git a/assets/Action-a9c31ef6.js.map b/assets/Action-b4309dd0.js.map similarity index 98% rename from assets/Action-a9c31ef6.js.map rename to assets/Action-b4309dd0.js.map index dce4c226..f53f8993 100644 --- a/assets/Action-a9c31ef6.js.map +++ b/assets/Action-b4309dd0.js.map @@ -1 +1 @@ -{"version":3,"file":"Action-a9c31ef6.js","sources":["../../src/components/Form/Controls/Action/Action.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport classnames from \"classnames\";\nimport React, { forwardRef, ComponentRef, ComponentProps } from \"react\";\nimport styles from \"./Action.module.css\";\nimport { TextInput } from \"../Text\";\n\nimport useId from \"../../../../utils/useId\";\nimport { Control } from \"@radix-ui/react-form\";\nimport { Tooltip } from \"../../../Tooltip/Tooltip\";\n\ntype Props = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The React component to display on the right hand side of the icon.\n */\n Icon: React.FunctionComponent>;\n /**\n * On click callback for the icon on the right hand side\n */\n onActionClick: (e: React.MouseEvent) => void;\n /**\n * The name of the action to perform (e.g. \"Copy to clipboard\")\n */\n actionLabel: string;\n} & React.ComponentProps;\n\n/**\n * A generic input with an action icon on the right hand side.\n * You should rarely use it directly,\n * but it is powering the likes of \"copy to clipboard input\", \"password reveal\", ...\n */\nexport const ActionInput = forwardRef(\n function ActionControl(\n { Icon, className, actionLabel, onActionClick, ...props },\n ref,\n ) {\n const id = useId();\n const classes = classnames(styles.container, className);\n return (\n
\n \n\n \n \n \n \n \n
\n );\n },\n);\n\n/**\n * A styled text input wrapped in a `Control` component, for use in Radix forms.\n */\nexport const ActionControl = forwardRef<\n ComponentRef,\n ComponentProps\n>(function ActionControl(props, ref) {\n return (\n \n \n \n );\n});\n"],"names":["ActionInput","forwardRef","Icon","className","actionLabel","onActionClick","props","ref","id","useId","classes","classnames","styles","jsxs","jsx","TextInput","Tooltip","ActionControl","Control"],"mappings":"2YAiDOA,EAAAC,EAAA,WAAoB,SAAA,CAAA,KAAAC,EAAA,UAAAC,EAAA,YAAAC,EAAA,cAAAC,EAAA,GAAAC,CAAA,EAAAC,EAAA,CAKvB,MAAAC,EAAAC,IACAC,EAAAC,EAAAC,EAAA,UAAAT,CAAA,EACA,OAAAU,EAAAA,KAAA,MAAA,CAAA,UAAAH,EAAA,GAAAF,EAAA,SAAA,CAEIM,MAAAC,EAAA,CAAA,IAAAR,EAAA,GAAAD,EAAA,UAAAM,EAAA,QAAA,EAA2DE,EAAAA,IAAAE,EAAA,CAAA,MAAAZ,EAAA,SAAAU,EAAA,IAGzD,SAAC,CAAA,KAAA,SACM,UAAAF,EAAA,OACa,QAAAP,EACT,gBAAAG,EACM,aAAAJ,EACH,SAAAU,EAAAA,IAAAZ,EAAA,CAAA,cAAA,EAAA,CAAA,CAEM,CAAA,EAAA,CAEtB,CAAA,CAAA,CACF,CAGN,EAKOe,EAAAhB,EAAAA,WAAA,SAAAK,EAAAC,EAAA,CAIL,OAAAO,EAAA,IAAAI,EAAA,CAAA,QAAA,GAAA,SAAAJ,MAAAd,EAAA,CAAA,IAAAO,EAAA,GAAAD,CAAA,CAAA,CAAA,CAAA,CAKF,CAAA;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Action-b4309dd0.js","sources":["../../src/components/Form/Controls/Action/Action.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport classnames from \"classnames\";\nimport React, { forwardRef, ComponentRef, ComponentProps } from \"react\";\nimport styles from \"./Action.module.css\";\nimport { TextInput } from \"../Text\";\n\nimport useId from \"../../../../utils/useId\";\nimport { Control } from \"@radix-ui/react-form\";\nimport { Tooltip } from \"../../../Tooltip/Tooltip\";\n\ntype Props = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The React component to display on the right hand side of the icon.\n */\n Icon: React.FunctionComponent>;\n /**\n * On click callback for the icon on the right hand side\n */\n onActionClick: (e: React.MouseEvent) => void;\n /**\n * The name of the action to perform (e.g. \"Copy to clipboard\")\n */\n actionLabel: string;\n} & React.ComponentProps;\n\n/**\n * A generic input with an action icon on the right hand side.\n * You should rarely use it directly,\n * but it is powering the likes of \"copy to clipboard input\", \"password reveal\", ...\n */\nexport const ActionInput = forwardRef(\n function ActionControl(\n { Icon, className, actionLabel, onActionClick, ...props },\n ref,\n ) {\n const id = useId();\n const classes = classnames(styles.container, className);\n return (\n
\n \n\n \n \n \n \n \n
\n );\n },\n);\n\n/**\n * A styled text input wrapped in a `Control` component, for use in Radix forms.\n */\nexport const ActionControl = forwardRef<\n ComponentRef,\n ComponentProps\n>(function ActionControl(props, ref) {\n return (\n \n \n \n );\n});\n"],"names":["ActionInput","forwardRef","Icon","className","actionLabel","onActionClick","props","ref","id","useId","classes","classnames","styles","jsxs","jsx","TextInput","Tooltip","ActionControl","Control"],"mappings":"2YAiDOA,EAAAC,EAAA,WAAoB,SAAA,CAAA,KAAAC,EAAA,UAAAC,EAAA,YAAAC,EAAA,cAAAC,EAAA,GAAAC,CAAA,EAAAC,EAAA,CAKvB,MAAAC,EAAAC,IACAC,EAAAC,EAAAC,EAAA,UAAAT,CAAA,EACA,OAAAU,EAAAA,KAAA,MAAA,CAAA,UAAAH,EAAA,GAAAF,EAAA,SAAA,CAEIM,MAAAC,EAAA,CAAA,IAAAR,EAAA,GAAAD,EAAA,UAAAM,EAAA,QAAA,EAA2DE,EAAAA,IAAAE,EAAA,CAAA,MAAAZ,EAAA,SAAAU,EAAA,IAGzD,SAAC,CAAA,KAAA,SACM,UAAAF,EAAA,OACa,QAAAP,EACT,gBAAAG,EACM,aAAAJ,EACH,SAAAU,EAAAA,IAAAZ,EAAA,CAAA,cAAA,EAAA,CAAA,CAEM,CAAA,EAAA,CAEtB,CAAA,CAAA,CACF,CAGN,EAKOe,EAAAhB,EAAAA,WAAA,SAAAK,EAAAC,EAAA,CAIL,OAAAO,EAAA,IAAAI,EAAA,CAAA,QAAA,GAAA,SAAAJ,MAAAd,EAAA,CAAA,IAAAO,EAAA,GAAAD,CAAA,CAAA,CAAA,CAAA,CAKF,CAAA;;;;;;;;"} \ No newline at end of file diff --git a/assets/Action.stories-b26816a7.js b/assets/Action.stories-8ce25bfe.js similarity index 96% rename from assets/Action.stories-b26816a7.js rename to assets/Action.stories-8ce25bfe.js index d7c3c8b6..b8097e0f 100644 --- a/assets/Action.stories-b26816a7.js +++ b/assets/Action.stories-8ce25bfe.js @@ -1,4 +1,4 @@ -import{j as s}from"./jsx-runtime-f6d73c06.js";import{C as z}from"./chat-ae65e692.js";import{C as F}from"./check-f848529e.js";import{S as Q}from"./close-e61dae86.js";import{A as i}from"./Action-a9c31ef6.js";import{T as U}from"./TooltipProvider-1374ddd1.js";import"./index-8ee6c85d.js";import"./_commonjsHelpers-de833af9.js";import"./index-e131923d.js";import"./Text-67f23194.js";import"./index-473717ad.js";import"./index-fc9b93e8.js";import"./index-79556c5a.js";import"./index-6e117a6c.js";import"./index-8bf7f4ad.js";import"./useId-a94b91a4.js";import"./Tooltip-7b34be2e.js";import"./index-67f1f257.js";const d={chat:z,check:F,close:Q},Y={title:"Form/Controls/Action",component:i,tags:["autodocs"],parameters:{controls:{include:["onActionClick","defaultValue","placeholder","disabled","autoFocus","readOnly","invalid","actionLabel","Icon"]}},argTypes:{onActionClick:{action:"clicked"},defaultValue:{type:"string"},placeholder:{type:"string"},disabled:{type:"boolean"},autoFocus:{type:"boolean"},readOnly:{type:"boolean"},invalid:{type:"boolean"},actionLabel:{type:"string"},Icon:{options:Object.keys(d),mapping:d,defaultValue:"check",control:{type:"select"}}},render:({invalid:V,...q})=>s.jsx(U,{children:s.jsx(i,{"data-invalid":V||void 0,...q})}),args:{placeholder:"",autoFocus:!1,disabled:!1,readOnly:!1,invalid:!1,actionLabel:"Action",Icon:F}},e={parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4477"}}},a={args:{defaultValue:"Filled"},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4536"}}},o={args:{defaultValue:"Disabled",disabled:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4530"}}},n={args:{defaultValue:"Read only",readOnly:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=2126-21984"}}},r={args:{autoFocus:!0}},t={args:{defaultValue:"Invalid",invalid:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4514"}}};var p,m,l;e.parameters={...e.parameters,docs:{...(p=e.parameters)==null?void 0:p.docs,source:{originalSource:`{ +import{j as s}from"./jsx-runtime-f6d73c06.js";import{C as z}from"./chat-ae65e692.js";import{C as F}from"./check-f848529e.js";import{S as Q}from"./close-e61dae86.js";import{A as i}from"./Action-b4309dd0.js";import{T as U}from"./TooltipProvider-1374ddd1.js";import"./index-8ee6c85d.js";import"./_commonjsHelpers-de833af9.js";import"./index-e131923d.js";import"./Text-bb8e96d0.js";import"./index-473717ad.js";import"./index-fc9b93e8.js";import"./index-79556c5a.js";import"./index-6e117a6c.js";import"./index-8bf7f4ad.js";import"./useId-a94b91a4.js";import"./Tooltip-7b34be2e.js";import"./index-67f1f257.js";const d={chat:z,check:F,close:Q},Y={title:"Form/Controls/Action",component:i,tags:["autodocs"],parameters:{controls:{include:["onActionClick","defaultValue","placeholder","disabled","autoFocus","readOnly","invalid","actionLabel","Icon"]}},argTypes:{onActionClick:{action:"clicked"},defaultValue:{type:"string"},placeholder:{type:"string"},disabled:{type:"boolean"},autoFocus:{type:"boolean"},readOnly:{type:"boolean"},invalid:{type:"boolean"},actionLabel:{type:"string"},Icon:{options:Object.keys(d),mapping:d,defaultValue:"check",control:{type:"select"}}},render:({invalid:V,...q})=>s.jsx(U,{children:s.jsx(i,{"data-invalid":V||void 0,...q})}),args:{placeholder:"",autoFocus:!1,disabled:!1,readOnly:!1,invalid:!1,actionLabel:"Action",Icon:F}},e={parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4477"}}},a={args:{defaultValue:"Filled"},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4536"}}},o={args:{defaultValue:"Disabled",disabled:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4530"}}},n={args:{defaultValue:"Read only",readOnly:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=2126-21984"}}},r={args:{autoFocus:!0}},t={args:{defaultValue:"Invalid",invalid:!0},parameters:{design:{type:"figma",url:"https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=793-4514"}}};var p,m,l;e.parameters={...e.parameters,docs:{...(p=e.parameters)==null?void 0:p.docs,source:{originalSource:`{ parameters: { design: { type: "figma", @@ -53,4 +53,4 @@ import{j as s}from"./jsx-runtime-f6d73c06.js";import{C as z}from"./chat-ae65e692 } } }`,...(L=(E=t.parameters)==null?void 0:E.docs)==null?void 0:L.source}}};const Z=["Empty","Filled","Disabled","ReadOnly","Focused","Invalid"];export{o as Disabled,e as Empty,a as Filled,r as Focused,t as Invalid,n as ReadOnly,Z as __namedExportsOrder,Y as default}; -//# sourceMappingURL=Action.stories-b26816a7.js.map +//# sourceMappingURL=Action.stories-8ce25bfe.js.map diff --git a/assets/Action.stories-b26816a7.js.map b/assets/Action.stories-8ce25bfe.js.map similarity index 60% rename from assets/Action.stories-b26816a7.js.map rename to assets/Action.stories-8ce25bfe.js.map index 23c02595..b4bf7507 100644 --- a/assets/Action.stories-b26816a7.js.map +++ b/assets/Action.stories-8ce25bfe.js.map @@ -1 +1 @@ -{"version":3,"file":"Action.stories-b26816a7.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"Action.stories-8ce25bfe.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/assets/Alert.stories-bd2758e5.js b/assets/Alert.stories-e231ff81.js similarity index 95% rename from assets/Alert.stories-bd2758e5.js rename to assets/Alert.stories-e231ff81.js index f1053e12..488bff4b 100644 --- a/assets/Alert.stories-bd2758e5.js +++ b/assets/Alert.stories-e231ff81.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-f6d73c06.js";import{B as u}from"./Button-abe57c7a.js";import{c as Z}from"./index-e131923d.js";import{r as k}from"./index-8ee6c85d.js";import{S as W}from"./error-a33e3c4a.js";import{S as M}from"./close-e61dae86.js";import{T as p}from"./Text-270962e1.js";import{I as U}from"./IconButton-dea21e21.js";import"./UnstyledButton-60dcee3b.js";import"./_commonjsHelpers-de833af9.js";import"./Typography-1dd46c86.js";import"./IndicatorIcon-240b404b.js";const V=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",className:"cpd-icon",...t,children:e.jsx("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7.95.95 0 0 0 .275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12a9.74 9.74 0 0 1 .788-3.9 10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2a9.74 9.74 0 0 1 3.9.788 10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})}),R=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",className:"cpd-icon",...t,children:[e.jsx("path",{d:"M11.287 7.287A.968.968 0 0 1 12 7c.283 0 .52.096.713.287.191.192.287.43.287.713s-.096.52-.287.713A.968.968 0 0 1 12 9a.968.968 0 0 1-.713-.287A.967.967 0 0 1 11 8c0-.283.096-.52.287-.713Zm0 4A.968.968 0 0 1 12 11c.283 0 .52.096.713.287.191.192.287.43.287.713v4a.97.97 0 0 1-.287.712A.968.968 0 0 1 12 17a.968.968 0 0 1-.713-.288A.968.968 0 0 1 11 16v-4c0-.283.096-.52.287-.713Z"}),e.jsx("path",{fillRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",clipRule:"evenodd"})]}),Y="_alert_1bz08_19",D="_content_1bz08_46",Q="_title_1bz08_57",F="_icon_1bz08_57",G="_actions_1bz08_73",s={alert:Y,content:D,"text-content":"_text-content_1bz08_53",title:Q,icon:F,actions:G},l=({type:t,title:B,children:z,className:T,actions:m,onClose:d,...E})=>{const L=Z(s.alert,T),I=k.useCallback(c=>{switch(t){case"critical":return e.jsx(W,{...c});case"info":return e.jsx(R,{...c});case"success":return e.jsx(V,{...c})}},[t]);return e.jsxs("div",{...E,className:L,"data-type":t,children:[I({width:24,height:24,className:s.icon,"aria-hidden":!0}),e.jsxs("div",{className:s.content,children:[e.jsxs("div",{className:s["text-content"],children:[e.jsx(p,{size:"md",weight:"semibold",children:B}),e.jsx(p,{size:"sm",weight:"regular",children:z})]}),m&&e.jsx("div",{className:s.actions,children:m})]}),d&&e.jsx(U,{onClick:d,"aria-label":"Close",role:"button",className:s.close,children:e.jsx(M,{})})]})};try{l.displayName="Alert",l.__docgenInfo={description:"An alert component component that is dismissable when passing an `onClose`\nproperty.",displayName:"Alert",props:{type:{defaultValue:null,description:"The type of alert",name:"type",required:!0,type:{name:"enum",value:[{value:'"critical"'},{value:'"success"'},{value:'"info"'}]}},title:{defaultValue:null,description:"The headline of the alert.",name:"title",required:!0,type:{name:"string"}},className:{defaultValue:null,description:"The CSS class name.",name:"className",required:!1,type:{name:"string"}},actions:{defaultValue:null,description:`Actions that will be displayed to the right of the content +import{j as e}from"./jsx-runtime-f6d73c06.js";import{B as u}from"./Button-1d7556c8.js";import{c as Z}from"./index-e131923d.js";import{r as k}from"./index-8ee6c85d.js";import{S as W}from"./error-a33e3c4a.js";import{S as M}from"./close-e61dae86.js";import{T as p}from"./Text-270962e1.js";import{I as U}from"./IconButton-3b043bff.js";import"./UnstyledButton-f4d497aa.js";import"./_commonjsHelpers-de833af9.js";import"./Typography-1dd46c86.js";import"./IndicatorIcon-ec96b47b.js";const V=t=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",className:"cpd-icon",...t,children:e.jsx("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7.95.95 0 0 0 .275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12a9.74 9.74 0 0 1 .788-3.9 10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2a9.74 9.74 0 0 1 3.9.788 10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})}),R=t=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 24 24",className:"cpd-icon",...t,children:[e.jsx("path",{d:"M11.287 7.287A.968.968 0 0 1 12 7c.283 0 .52.096.713.287.191.192.287.43.287.713s-.096.52-.287.713A.968.968 0 0 1 12 9a.968.968 0 0 1-.713-.287A.967.967 0 0 1 11 8c0-.283.096-.52.287-.713Zm0 4A.968.968 0 0 1 12 11c.283 0 .52.096.713.287.191.192.287.43.287.713v4a.97.97 0 0 1-.287.712A.968.968 0 0 1 12 17a.968.968 0 0 1-.713-.288A.968.968 0 0 1 11 16v-4c0-.283.096-.52.287-.713Z"}),e.jsx("path",{fillRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z",clipRule:"evenodd"})]}),Y="_alert_1bz08_19",D="_content_1bz08_46",Q="_title_1bz08_57",F="_icon_1bz08_57",G="_actions_1bz08_73",s={alert:Y,content:D,"text-content":"_text-content_1bz08_53",title:Q,icon:F,actions:G},l=({type:t,title:B,children:z,className:T,actions:m,onClose:d,...E})=>{const L=Z(s.alert,T),I=k.useCallback(c=>{switch(t){case"critical":return e.jsx(W,{...c});case"info":return e.jsx(R,{...c});case"success":return e.jsx(V,{...c})}},[t]);return e.jsxs("div",{...E,className:L,"data-type":t,children:[I({width:24,height:24,className:s.icon,"aria-hidden":!0}),e.jsxs("div",{className:s.content,children:[e.jsxs("div",{className:s["text-content"],children:[e.jsx(p,{size:"md",weight:"semibold",children:B}),e.jsx(p,{size:"sm",weight:"regular",children:z})]}),m&&e.jsx("div",{className:s.actions,children:m})]}),d&&e.jsx(U,{onClick:d,"aria-label":"Close",role:"button",className:s.close,children:e.jsx(M,{})})]})};try{l.displayName="Alert",l.__docgenInfo={description:"An alert component component that is dismissable when passing an `onClose`\nproperty.",displayName:"Alert",props:{type:{defaultValue:null,description:"The type of alert",name:"type",required:!0,type:{name:"enum",value:[{value:'"critical"'},{value:'"success"'},{value:'"info"'}]}},title:{defaultValue:null,description:"The headline of the alert.",name:"title",required:!0,type:{name:"string"}},className:{defaultValue:null,description:"The CSS class name.",name:"className",required:!1,type:{name:"string"}},actions:{defaultValue:null,description:`Actions that will be displayed to the right of the content Wraps and stacks actions under content when alert's size is <=600px eg \`\`\` @@ -37,4 +37,4 @@ eg onClose: undefined } }`,...(N=(S=r.parameters)==null?void 0:S.docs)==null?void 0:N.source}}};const ie=["Success","Critical","Info","WithActions","WithoutClose"];export{n as Critical,a as Info,o as Success,i as WithActions,r as WithoutClose,ie as __namedExportsOrder,ae as default}; -//# sourceMappingURL=Alert.stories-bd2758e5.js.map +//# sourceMappingURL=Alert.stories-e231ff81.js.map diff --git a/assets/Alert.stories-bd2758e5.js.map b/assets/Alert.stories-e231ff81.js.map similarity index 98% rename from assets/Alert.stories-bd2758e5.js.map rename to assets/Alert.stories-e231ff81.js.map index 231023ee..5000e357 100644 --- a/assets/Alert.stories-bd2758e5.js.map +++ b/assets/Alert.stories-e231ff81.js.map @@ -1 +1 @@ -{"version":3,"file":"Alert.stories-bd2758e5.js","sources":["../../node_modules/@vector-im/compound-design-tokens/icons/check-circle.svg","../../node_modules/@vector-im/compound-design-tokens/icons/info.svg","../../src/components/Alert/Alert.tsx"],"sourcesContent":["export default \"__VITE_ASSET__efbc4172__\"","export default \"__VITE_ASSET__98ffb9cc__\"","/*\nCopyright 2023 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport classNames from \"classnames\";\nimport React, { PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/icons/check-circle.svg\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/icons/error.svg\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/icons/info.svg\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/icons/close.svg\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * Yes}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps) => {\n switch (type) {\n case \"critical\":\n return ;\n case \"info\":\n return ;\n case \"success\":\n return ;\n }\n },\n [type],\n );\n\n return (\n
\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n
\n
\n \n {title}\n \n \n {children}\n \n
\n {actions &&
{actions}
}\n
\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n \n \n \n )}\n
\n );\n};\n"],"names":["SvgCheckCircle","props","jsx","SvgInfo","jsxs","Alert","type","title","children","className","actions","onClose","classes","classNames","styles","renderIcon","useCallback","props2","ErrorIcon","InfoIcon","CheckCircleIcon","Text","IconButton","CloseIcon"],"mappings":"4dAEA,MAAMA,EAAkBC,GAA0BC,EAAG,IAAC,MAAO,CAAE,MAAO,6BAA8B,MAAO,MAAO,OAAQ,MAAO,KAAM,eAAgB,QAAS,YAAa,UAAW,WAAY,GAAGD,EAAO,SAA0BC,EAAG,IAAC,OAAQ,CAAE,EAAG,k7BAAk7B,CAAE,CAAC,CAAE,ECA1qCC,EAAWF,GAA0BG,OAAK,MAAO,CAAE,MAAO,6BAA8B,MAAO,MAAO,OAAQ,MAAO,KAAM,eAAgB,QAAS,YAAa,UAAW,WAAY,GAAGH,EAAO,SAAU,CAChMC,EAAAA,IAAI,OAAQ,CAAE,EAAG,2XAA2X,CAAE,EAC9YA,MAAI,OAAQ,CAAE,SAAU,UAAW,EAAG,+GAAgH,SAAU,UAAW,CAC7L,EAAG,gMC4DIG,EAAA,CAAA,CAAwD,KAAAC,EAC7D,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,QAAAC,EACA,GAAAV,CAEF,IAAA,CACE,MAAAW,EAAAC,EAAAC,EAAA,MAAAL,CAAA,EAEAM,EAAAC,EAAA,YAAmBC,GAAA,CAEf,OAAAX,EAAA,CAAc,IAAA,WAEV,OAAAJ,EAAA,IAAAgB,EAAA,CAAA,GAAAD,CAAA,CAAA,EAA6B,IAAA,OAE7B,OAAAf,EAAA,IAAAiB,EAAA,CAAA,GAAAF,CAAA,CAAA,EAA4B,IAAA,UAE5B,OAAAf,EAAA,IAAAkB,EAAA,CAAA,GAAAH,CAAA,CAAA,CAAmC,CACvC,EACF,CAAAX,CAAA,CACK,EAGP,OAAAF,EAAA,KAAA,MAAA,CAAA,GAAAH,EAAA,UAAAW,EAAA,YAAAN,EAAA,SAAA,CAEKS,EAAA,CAAW,MAAA,GACH,OAAA,GACC,UAAAD,EAAA,KACU,cAAA,EACH,CAAA,EAChBV,EAAA,KAAA,MAAA,CAAA,UAAAU,EAAA,QAAA,SAAA,CAECV,EAAA,KAAA,MAAA,CAAA,UAAAU,EAAA,cAAA,EAAA,SAAA,CACEZ,MAAAmB,EAAA,CAAA,KAAA,KAAA,OAAA,WAAA,SAAAd,EAAA,EAEAL,EAAA,IAAAmB,EAAA,CAAA,KAAA,KAAA,OAAA,UAAA,SAAAb,EAAA,CAGA,EAAA,EACFE,GAAAR,EAAAA,IAAA,MAAA,CAAA,UAAAY,EAAA,QAAA,SAAAJ,EAAA,CACqD,EAAA,EACvDC,GAAAT,EAAA,IAGEoB,EAAC,CAAA,QAAAX,EACU,aAAA,QACE,KAAA,SACN,UAAAG,EAAA,MACa,SAAAZ,EAAAA,IAAAqB,EAAA,EAAA,CAEP,CAAA,CACb,CAAA,CAAA,CAIR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]} \ No newline at end of file +{"version":3,"file":"Alert.stories-e231ff81.js","sources":["../../node_modules/@vector-im/compound-design-tokens/icons/check-circle.svg","../../node_modules/@vector-im/compound-design-tokens/icons/info.svg","../../src/components/Alert/Alert.tsx"],"sourcesContent":["export default \"__VITE_ASSET__efbc4172__\"","export default \"__VITE_ASSET__98ffb9cc__\"","/*\nCopyright 2023 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport classNames from \"classnames\";\nimport React, { PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/icons/check-circle.svg\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/icons/error.svg\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/icons/info.svg\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/icons/close.svg\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * Yes}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps) => {\n switch (type) {\n case \"critical\":\n return ;\n case \"info\":\n return ;\n case \"success\":\n return ;\n }\n },\n [type],\n );\n\n return (\n
\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n
\n
\n \n {title}\n \n \n {children}\n \n
\n {actions &&
{actions}
}\n
\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n \n \n \n )}\n
\n );\n};\n"],"names":["SvgCheckCircle","props","jsx","SvgInfo","jsxs","Alert","type","title","children","className","actions","onClose","classes","classNames","styles","renderIcon","useCallback","props2","ErrorIcon","InfoIcon","CheckCircleIcon","Text","IconButton","CloseIcon"],"mappings":"4dAEA,MAAMA,EAAkBC,GAA0BC,EAAG,IAAC,MAAO,CAAE,MAAO,6BAA8B,MAAO,MAAO,OAAQ,MAAO,KAAM,eAAgB,QAAS,YAAa,UAAW,WAAY,GAAGD,EAAO,SAA0BC,EAAG,IAAC,OAAQ,CAAE,EAAG,k7BAAk7B,CAAE,CAAC,CAAE,ECA1qCC,EAAWF,GAA0BG,OAAK,MAAO,CAAE,MAAO,6BAA8B,MAAO,MAAO,OAAQ,MAAO,KAAM,eAAgB,QAAS,YAAa,UAAW,WAAY,GAAGH,EAAO,SAAU,CAChMC,EAAAA,IAAI,OAAQ,CAAE,EAAG,2XAA2X,CAAE,EAC9YA,MAAI,OAAQ,CAAE,SAAU,UAAW,EAAG,+GAAgH,SAAU,UAAW,CAC7L,EAAG,gMC4DIG,EAAA,CAAA,CAAwD,KAAAC,EAC7D,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,QAAAC,EACA,QAAAC,EACA,GAAAV,CAEF,IAAA,CACE,MAAAW,EAAAC,EAAAC,EAAA,MAAAL,CAAA,EAEAM,EAAAC,EAAA,YAAmBC,GAAA,CAEf,OAAAX,EAAA,CAAc,IAAA,WAEV,OAAAJ,EAAA,IAAAgB,EAAA,CAAA,GAAAD,CAAA,CAAA,EAA6B,IAAA,OAE7B,OAAAf,EAAA,IAAAiB,EAAA,CAAA,GAAAF,CAAA,CAAA,EAA4B,IAAA,UAE5B,OAAAf,EAAA,IAAAkB,EAAA,CAAA,GAAAH,CAAA,CAAA,CAAmC,CACvC,EACF,CAAAX,CAAA,CACK,EAGP,OAAAF,EAAA,KAAA,MAAA,CAAA,GAAAH,EAAA,UAAAW,EAAA,YAAAN,EAAA,SAAA,CAEKS,EAAA,CAAW,MAAA,GACH,OAAA,GACC,UAAAD,EAAA,KACU,cAAA,EACH,CAAA,EAChBV,EAAA,KAAA,MAAA,CAAA,UAAAU,EAAA,QAAA,SAAA,CAECV,EAAA,KAAA,MAAA,CAAA,UAAAU,EAAA,cAAA,EAAA,SAAA,CACEZ,MAAAmB,EAAA,CAAA,KAAA,KAAA,OAAA,WAAA,SAAAd,EAAA,EAEAL,EAAA,IAAAmB,EAAA,CAAA,KAAA,KAAA,OAAA,UAAA,SAAAb,EAAA,CAGA,EAAA,EACFE,GAAAR,EAAAA,IAAA,MAAA,CAAA,UAAAY,EAAA,QAAA,SAAAJ,EAAA,CACqD,EAAA,EACvDC,GAAAT,EAAA,IAGEoB,EAAC,CAAA,QAAAX,EACU,aAAA,QACE,KAAA,SACN,UAAAG,EAAA,MACa,SAAAZ,EAAAA,IAAAqB,EAAA,EAAA,CAEP,CAAA,CACb,CAAA,CAAA,CAIR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/assets/Button-abe57c7a.js b/assets/Button-1d7556c8.js similarity index 85% rename from assets/Button-abe57c7a.js rename to assets/Button-1d7556c8.js index 121e5ef3..be0f8cd1 100644 --- a/assets/Button-abe57c7a.js +++ b/assets/Button-1d7556c8.js @@ -1,4 +1,4 @@ -import{j as n}from"./jsx-runtime-f6d73c06.js";import{c as h}from"./index-e131923d.js";import{r as v}from"./index-8ee6c85d.js";import{U as _}from"./UnstyledButton-60dcee3b.js";const g="_button_dyfp8_17",k="_destructive_dyfp8_99",e={button:g,"has-icon":"_has-icon_dyfp8_55",destructive:k},s=v.forwardRef(function({as:r,kind:a="primary",size:o="lg",children:u,className:d,Icon:t,destructive:l,disabled:c,...p},m){const[b,f]=a==="destructive"?["secondary",!0]:[a,l],y=h(e.button,d,{[e["has-icon"]]:t,[e.destructive]:f});return n.jsxs(_,{...p,as:r||"button",ref:m,className:y,"data-size":o,"data-kind":b,tabIndex:0,disabled:c,children:[t&&n.jsx(t,{width:20,height:20,className:e.icon,"aria-hidden":!0}),u]})});try{s.displayName="Button",s.__docgenInfo={description:"A button component that can be transformed into a link, but keep the button\nstyling using the `as` property.",displayName:"Button",props:{as:{defaultValue:null,description:"",name:"as",required:!0,type:{name:"ElementType"}},kind:{defaultValue:null,description:`The type of button. +import{j as n}from"./jsx-runtime-f6d73c06.js";import{c as h}from"./index-e131923d.js";import{r as v}from"./index-8ee6c85d.js";import{U as _}from"./UnstyledButton-f4d497aa.js";const g="_button_dyfp8_17",k="_destructive_dyfp8_99",e={button:g,"has-icon":"_has-icon_dyfp8_55",destructive:k},s=v.forwardRef(function({as:r,kind:a="primary",size:o="lg",children:u,className:d,Icon:t,destructive:l,disabled:c,...p},m){const[b,f]=a==="destructive"?["secondary",!0]:[a,l],y=h(e.button,d,{[e["has-icon"]]:t,[e.destructive]:f});return n.jsxs(_,{...p,as:r||"button",ref:m,className:y,"data-size":o,"data-kind":b,tabIndex:0,disabled:c,children:[t&&n.jsx(t,{width:20,height:20,className:e.icon,"aria-hidden":!0}),u]})});try{s.displayName="Button",s.__docgenInfo={description:"A button component that can be transformed into a link, but keep the button\nstyling using the `as` property.",displayName:"Button",props:{as:{defaultValue:null,description:"",name:"as",required:!0,type:{name:"ElementType"}},kind:{defaultValue:null,description:`The type of button. Note: "destructive" is deprecated, please use the destructive prop in -conjunction with another button kind.`,name:"kind",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"destructive"'}]}},size:{defaultValue:null,description:"The t-shirt size of the button.",name:"size",required:!1,type:{name:"enum",value:[{value:'"sm"'},{value:'"lg"'}]}},Icon:{defaultValue:null,description:"An icon to display within the button.",name:"Icon",required:!1,type:{name:"ComponentType>"}},destructive:{defaultValue:{value:"false"},description:"Whether this button triggers a destructive action.",name:"destructive",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n`aria-disabled` attribute is used to indicate button is disabled.\nEvent handlers are not passed to disabled buttons (onClick, onSubmit).",name:"disabled",required:!1,type:{name:"boolean"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"Ref>"}}}}}catch{}export{s as B}; -//# sourceMappingURL=Button-abe57c7a.js.map +conjunction with another button kind.`,name:"kind",required:!1,type:{name:"enum",value:[{value:'"primary"'},{value:'"secondary"'},{value:'"tertiary"'},{value:'"destructive"'}]}},size:{defaultValue:null,description:"The t-shirt size of the button.",name:"size",required:!1,type:{name:"enum",value:[{value:'"sm"'},{value:'"lg"'}]}},Icon:{defaultValue:null,description:"An icon to display within the button.",name:"Icon",required:!1,type:{name:"ComponentType>"}},destructive:{defaultValue:{value:"false"},description:"Whether this button triggers a destructive action.",name:"destructive",required:!1,type:{name:"boolean"}},disabled:{defaultValue:null,description:"Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n`aria-disabled` attribute is used to indicate button is disabled.\nEvent handlers are not passed to disabled buttons (onClick, onSubmit, etc.)",name:"disabled",required:!1,type:{name:"boolean"}},ref:{defaultValue:null,description:"",name:"ref",required:!1,type:{name:"Ref>"}}}}}catch{}export{s as B}; +//# sourceMappingURL=Button-1d7556c8.js.map diff --git a/assets/Button-abe57c7a.js.map b/assets/Button-1d7556c8.js.map similarity index 98% rename from assets/Button-abe57c7a.js.map rename to assets/Button-1d7556c8.js.map index a033f6c3..9a0487ca 100644 --- a/assets/Button-abe57c7a.js.map +++ b/assets/Button-1d7556c8.js.map @@ -1 +1 @@ -{"version":3,"file":"Button-abe57c7a.js","sources":["../../src/components/Button/Button.tsx"],"sourcesContent":["/*\nCopyright 2023-2024 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport classNames from \"classnames\";\nimport React, {\n ComponentType,\n PropsWithChildren,\n forwardRef,\n ForwardedRef,\n Ref,\n} from \"react\";\nimport styles from \"./Button.module.css\";\nimport { UnstyledButton, UnstyledButtonPropsFor } from \"./UnstyledButton\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n (\n props: { as: C } & ButtonPropsFor,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a