@servicetitan/assist-ui
Version:
ServiceTitan Atlas UI Components
80 lines (79 loc) • 3.66 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button, Card, Flex, Icon, Radio, RadioGroup, Text } from '@servicetitan/anvil2';
import IconAtlasLogo from '@servicetitan/anvil2/assets/icons/st/atlas_logo.svg';
import { core } from '@servicetitan/anvil2/token';
export const SystemMessage = ({ message, radioOptions, onRadioChange, buttonText, onSubmit, buttonDisabled = false })=>{
return /*#__PURE__*/ _jsxs(Flex, {
direction: "column",
children: [
/*#__PURE__*/ _jsxs(Flex, {
children: [
/*#__PURE__*/ _jsx("span", {
className: "m-inline-end-2",
style: {
color: core.semantic.ForegroundColorPrimary.value
},
children: /*#__PURE__*/ _jsx(Icon, {
svg: IconAtlasLogo,
size: "large",
inherit: true
})
}),
/*#__PURE__*/ _jsx(Text, {
inline: true,
children: /*#__PURE__*/ _jsx("b", {
children: "Atlas"
})
})
]
}),
/*#__PURE__*/ _jsx(Text, {
size: "medium",
children: message
}),
/*#__PURE__*/ _jsx(Card, {
children: /*#__PURE__*/ _jsxs(Flex, {
direction: "column",
gap: 2,
children: [
/*#__PURE__*/ _jsx(RadioGroup, {
onChange: (e)=>onRadioChange(e.target.value),
children: radioOptions.map((option)=>/*#__PURE__*/ _jsx(Radio, {
name: "action",
value: option.value,
label: /*#__PURE__*/ _jsxs(Flex, {
direction: "column",
gap: "0",
grow: 1,
children: [
/*#__PURE__*/ _jsx(Text, {
children: /*#__PURE__*/ _jsx("b", {
children: option.label
})
}),
option.description && /*#__PURE__*/ _jsx(Text, {
subdued: true,
size: "small",
children: option.description
})
]
})
}, option.value))
}),
/*#__PURE__*/ _jsx(Button, {
appearance: "primary",
style: {
width: '100%'
},
className: "m-inline-start-auto",
onClick: onSubmit,
disabled: buttonDisabled,
children: buttonText
})
]
})
})
]
});
};
//# sourceMappingURL=system-message.js.map