UNPKG

@contentstack/live-preview-utils

Version:

Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.

1 lines 1.85 kB
{"version":3,"sources":["../../../../../../src/visualBuilder/components/Collab/ButtonGroup/ButtonGroup.tsx"],"sourcesContent":["/** @jsxImportSource preact */\nimport React from \"preact/compat\";\nimport cn from \"classnames\";\nimport { collabStyles } from \"../../../collab.style\";\n\nexport type ButtonGroupProps = {\n /**\n * Provides the class names to be appended to this prop.\n */\n className?: string;\n /**\n * Add child elements defined within a component.\n */\n children?: React.ReactNode;\n /**\n * Pass the CSS properties for the button group.\n */\n style?: React.CSSProperties;\n /**\n * Pass an ID that you can use for testing purposes. It is applied as a data attribute (data-testid).\n */\n testId?: string;\n};\n\nconst ButtonGroup = (props: ButtonGroupProps) => {\n const { className, children, style, testId, ...otherProps } = props;\n const classNames = cn(\n \"collab-button-group\",\n collabStyles()[\"collab-button-group\"],\n className\n );\n\n return (\n <div\n className={classNames}\n style={style}\n data-testid={testId}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nButtonGroup.defaultProps = {\n testId: \"collab-button-group\",\n} as Partial<ButtonGroupProps>;\n\nexport default ButtonGroup;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,wBAAe;AACf,oBAA6B;AA8BrB;AATR,IAAM,cAAc,CAAC,UAA4B;AAC7C,QAAM,EAAE,WAAW,UAAU,OAAO,QAAQ,GAAG,WAAW,IAAI;AAC9D,QAAM,iBAAa,kBAAAA;AAAA,IACf;AAAA,QACA,4BAAa,EAAE,qBAAqB;AAAA,IACpC;AAAA,EACJ;AAEA,SACI;AAAA,IAAC;AAAA;AAAA,MACG,WAAW;AAAA,MACX;AAAA,MACA,eAAa;AAAA,MACZ,GAAG;AAAA,MAEH;AAAA;AAAA,EACL;AAER;AAEA,YAAY,eAAe;AAAA,EACvB,QAAQ;AACZ;AAEA,IAAO,sBAAQ;","names":["cn"]}