)
}
@@ -48,4 +63,23 @@ TextInput.defaultProps = {
onChange: () => {}
}
+TextInput.propTypes = {
+ /**
+ * The difference from `disabled` is that instead of showing disabled input
+ * we show value using
which let us position something immediately after the value
+ */
+ readonly: PT.bool,
+
+ /**
+ * Show help icon next to the label with the tooltip defined by this prop
+ */
+ labelHelpTooltip: PT.node,
+
+ /**
+ * Show help icon next to the value with the tooltip defined by this prop
+ * This only has any effect if `readonly` is set to `true`
+ */
+ readonlyValueTooltip: PT.node
+}
+
export default hoc(TextInput)
diff --git a/components/Formsy/TextInput.scss b/components/Formsy/TextInput.scss
new file mode 100644
index 000000000..4e21c403e
--- /dev/null
+++ b/components/Formsy/TextInput.scss
@@ -0,0 +1,17 @@
+@import '~tc-ui/src/styles/tc-includes';
+
+.readonly-wrapper {
+ :global(input.tc-file-field__inputs) {
+ display: none;
+ }
+}
+
+.readonly-value {
+ color: $tc-gray-60;
+ display: block;
+ height: 40px;
+ line-height: 40px;
+ margin-bottom: 2 * $base-unit;
+ padding: 0 2 * $base-unit;
+ width: 100%;
+}
\ No newline at end of file
diff --git a/components/HelpIcon/HelpIcon.jsx b/components/HelpIcon/HelpIcon.jsx
new file mode 100644
index 000000000..633e0cbc4
--- /dev/null
+++ b/components/HelpIcon/HelpIcon.jsx
@@ -0,0 +1,40 @@
+/**
+ * Help icon with tooltip
+ */
+import React from 'react'
+import _ from 'lodash'
+import PT from 'prop-types'
+import cn from 'classnames'
+
+import HelpIconSvg from '../icons/round-e-help.svg'
+import Tooltip from '../Tooltip/Tooltip'
+
+import styles from './HelpIcon.scss'
+
+const HELP_TOOLTIP_SHOW_DELAY = 300
+
+const HelpIcon = ({
+ className,
+ showTooltipDelay,
+ tooltip
+}) => {
+ const delay = !_.isNumber(showTooltipDelay) ? showTooltipDelay : HELP_TOOLTIP_SHOW_DELAY
+
+ return (
+
+
+
{tooltip}
+
+ )
+}
+
+HelpIcon.propTypes = {
+ className: PT.string,
+ showTooltipDelay: PT.number,
+ tooltip: PT.node
+}
+
+export default HelpIcon
\ No newline at end of file
diff --git a/components/HelpIcon/HelpIcon.scss b/components/HelpIcon/HelpIcon.scss
new file mode 100644
index 000000000..0eb45a69b
--- /dev/null
+++ b/components/HelpIcon/HelpIcon.scss
@@ -0,0 +1,16 @@
+@import '~tc-ui/src/styles/tc-includes';
+
+.label-help-icon {
+ display: inline-block;
+ line-height: normal;
+ margin-left: $base-unit;
+ position: relative;
+ top: 3px;
+ text-transform: none;
+
+ svg {
+ g {
+ fill: $tc-gray-50;
+ }
+ }
+}
\ No newline at end of file
diff --git a/components/Icons/round-e-help.svg b/components/Icons/round-e-help.svg
new file mode 100644
index 000000000..27c35df4c
--- /dev/null
+++ b/components/Icons/round-e-help.svg
@@ -0,0 +1 @@
+
\ No newline at end of file