@instructure/ui-text-input
Advanced tools
Comparing version 5.47.1-rc.0 to 5.47.1-rc.1
@@ -24,24 +24,54 @@ /* | ||
*/ | ||
import IconSearch from '@instructure/ui-icons/lib/Line/IconSearch'; | ||
import generateMessages from '../../../__tests__/generateMessages'; | ||
import React from 'react'; | ||
import { IconSearchLine } from '@instructure/ui-icons'; | ||
import { Badge, Tag } from '@instructure/ui-elements'; | ||
var _ref = | ||
/*#__PURE__*/ | ||
React.createElement(Tag, { | ||
text: React.createElement("span", null, React.createElement(Badge, { | ||
type: "notification", | ||
variant: "primary", | ||
standalone: true, | ||
margin: "0 xx-small xxx-small 0" | ||
}), "Dismissible tag"), | ||
dismissible: true, | ||
margin: "0 xx-small 0 0" | ||
}); | ||
var renderBeforeInput = function renderBeforeInput() { | ||
return _ref; | ||
}; | ||
/* eslint-disable no-undefined */ | ||
export default { | ||
sections: 'layout', | ||
maxExamplesPerPage: 50, | ||
permutations: ['layout', 'size', 'disabled', 'textAlign', { | ||
placeholder: [null, 'Some placeholder content'] | ||
}, { | ||
defaultValue: [null, 'A text input value'] | ||
}, { | ||
icon: [null, IconSearch] | ||
}, { | ||
messages: generateMessages() | ||
}], | ||
renderProps: function renderProps(props) { | ||
propValues: { | ||
placeholder: [undefined, 'Some placeholder content'], | ||
value: [undefined, 'A text input value'], | ||
renderBeforeInput: [undefined, renderBeforeInput], | ||
renderAfterInput: [undefined, IconSearchLine], | ||
width: [undefined, '4em'], | ||
messages: [undefined, [{ | ||
type: 'hint', | ||
text: 'hint text' | ||
}]] | ||
}, | ||
getComponentProps: function getComponentProps(props) { | ||
return { | ||
componentProps: { | ||
label: 'A text input' | ||
}, | ||
filter: props.placeholder && props.defaultValue | ||
label: 'A text input', | ||
readOnly: false, | ||
required: false, | ||
type: 'text', | ||
textAlign: 'start', | ||
onChange: function onChange() {}, | ||
layout: 'stacked' | ||
}; | ||
}, | ||
filter: function filter(props) { | ||
return props.layout === 'inline' && props.inline === true && !props.width || props.renderBeforeInput && props.width || props.renderAfterInput && props.width; | ||
} | ||
/* eslint-enable no-undefined */ | ||
}; |
@@ -274,3 +274,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
*/ | ||
renderBeforeInput: PropTypes.func, | ||
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
@@ -280,3 +280,3 @@ /** | ||
*/ | ||
renderAfterInput: PropTypes.func, | ||
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
onChange: PropTypes.func, | ||
@@ -283,0 +283,0 @@ onBlur: PropTypes.func, |
@@ -10,6 +10,8 @@ "use strict"; | ||
var _IconSearch = _interopRequireDefault(require("@instructure/ui-icons/lib/Line/IconSearch")); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _generateMessages = _interopRequireDefault(require("../../../__tests__/generateMessages")); | ||
var _uiIcons = require("@instructure/ui-icons"); | ||
var _uiElements = require("@instructure/ui-elements"); | ||
/* | ||
@@ -38,23 +40,51 @@ * The MIT License (MIT) | ||
*/ | ||
var _ref = | ||
/*#__PURE__*/ | ||
_react.default.createElement(_uiElements.Tag, { | ||
text: _react.default.createElement("span", null, _react.default.createElement(_uiElements.Badge, { | ||
type: "notification", | ||
variant: "primary", | ||
standalone: true, | ||
margin: "0 xx-small xxx-small 0" | ||
}), "Dismissible tag"), | ||
dismissible: true, | ||
margin: "0 xx-small 0 0" | ||
}); | ||
var renderBeforeInput = function renderBeforeInput() { | ||
return _ref; | ||
}; | ||
/* eslint-disable no-undefined */ | ||
var _default = { | ||
sections: 'layout', | ||
maxExamplesPerPage: 50, | ||
permutations: ['layout', 'size', 'disabled', 'textAlign', { | ||
placeholder: [null, 'Some placeholder content'] | ||
}, { | ||
defaultValue: [null, 'A text input value'] | ||
}, { | ||
icon: [null, _IconSearch.default] | ||
}, { | ||
messages: (0, _generateMessages.default)() | ||
}], | ||
renderProps: function renderProps(props) { | ||
propValues: { | ||
placeholder: [undefined, 'Some placeholder content'], | ||
value: [undefined, 'A text input value'], | ||
renderBeforeInput: [undefined, renderBeforeInput], | ||
renderAfterInput: [undefined, _uiIcons.IconSearchLine], | ||
width: [undefined, '4em'], | ||
messages: [undefined, [{ | ||
type: 'hint', | ||
text: 'hint text' | ||
}]] | ||
}, | ||
getComponentProps: function getComponentProps(props) { | ||
return { | ||
componentProps: { | ||
label: 'A text input' | ||
}, | ||
filter: props.placeholder && props.defaultValue | ||
label: 'A text input', | ||
readOnly: false, | ||
required: false, | ||
type: 'text', | ||
textAlign: 'start', | ||
onChange: function onChange() {}, | ||
layout: 'stacked' | ||
}; | ||
}, | ||
filter: function filter(props) { | ||
return props.layout === 'inline' && props.inline === true && !props.width || props.renderBeforeInput && props.width || props.renderAfterInput && props.width; | ||
} | ||
/* eslint-enable no-undefined */ | ||
}; | ||
exports.default = _default; |
@@ -276,3 +276,3 @@ "use strict"; | ||
*/ | ||
renderBeforeInput: _propTypes.default.func, | ||
renderBeforeInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]), | ||
@@ -282,3 +282,3 @@ /** | ||
*/ | ||
renderAfterInput: _propTypes.default.func, | ||
renderAfterInput: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]), | ||
onChange: _propTypes.default.func, | ||
@@ -285,0 +285,0 @@ onBlur: _propTypes.default.func, |
{ | ||
"name": "@instructure/ui-text-input", | ||
"version": "5.47.1-rc.0+20f39f9b", | ||
"version": "5.47.1-rc.1+19e4cfd7", | ||
"description": "A UI component library made by Instructure Inc.", | ||
@@ -23,14 +23,15 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-babel-preset": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-test-utils": "5.47.1-rc.0+20f39f9b" | ||
"@instructure/ui-babel-preset": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-elements": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-test-utils": "5.47.1-rc.1+19e4cfd7" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7", | ||
"@instructure/ui-form-field": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-icons": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-prop-types": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-testable": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-themeable": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-utils": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/uid": "5.47.1-rc.0+20f39f9b", | ||
"@instructure/ui-form-field": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-icons": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-prop-types": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-testable": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-themeable": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/ui-utils": "5.47.1-rc.1+19e4cfd7", | ||
"@instructure/uid": "5.47.1-rc.1+19e4cfd7", | ||
"classnames": "^2", | ||
@@ -44,3 +45,3 @@ "prop-types": "^15", | ||
"sideEffects": false, | ||
"gitHead": "20f39f9b643373bf7a5f8ec3eaa83b3ae1d29a85" | ||
"gitHead": "19e4cfd7dd278de85bb63125e88ff0ed5c5ed70f" | ||
} |
@@ -1,49 +0,73 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2015 - present Instructure, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2015 - present Instructure, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
import IconSearch from '@instructure/ui-icons/lib/Line/IconSearch' | ||
import generateMessages from '../../../__tests__/generateMessages' | ||
import React from 'react' | ||
import { IconSearchLine } from '@instructure/ui-icons' | ||
import { Badge, Tag } from '@instructure/ui-elements' | ||
const renderBeforeInput = () => { | ||
return ( | ||
<Tag | ||
text={ | ||
<span> | ||
<Badge type="notification" variant="primary" standalone margin="0 xx-small xxx-small 0" /> | ||
Dismissible tag | ||
</span> | ||
} | ||
dismissible | ||
margin="0 xx-small 0 0" | ||
/> | ||
) | ||
} | ||
/* eslint-disable no-undefined */ | ||
export default { | ||
sections: 'layout', | ||
maxExamplesPerPage: 50, | ||
permutations: [ | ||
'layout', | ||
'size', | ||
'disabled', | ||
'textAlign', | ||
{ placeholder: [null, 'Some placeholder content'] }, | ||
{ defaultValue: [null, 'A text input value'] }, | ||
{ icon: [null, IconSearch] }, | ||
{ messages: generateMessages() } | ||
], | ||
renderProps: (props) => { | ||
return { | ||
componentProps: { | ||
label: 'A text input' | ||
}, | ||
filter: props.placeholder && props.defaultValue | ||
} | ||
} | ||
maxExamplesPerPage: 50, | ||
propValues: { | ||
placeholder: [undefined, 'Some placeholder content'], | ||
value: [undefined, 'A text input value'], | ||
renderBeforeInput: [undefined, renderBeforeInput], | ||
renderAfterInput: [undefined, IconSearchLine], | ||
width: [undefined, '4em'], | ||
messages: [undefined, [{ type: 'hint', text: 'hint text' }]] | ||
}, | ||
getComponentProps: (props) => { | ||
return { | ||
label: 'A text input', | ||
readOnly: false, | ||
required: false, | ||
type: 'text', | ||
textAlign: 'start', | ||
onChange: () => {}, | ||
layout: 'stacked' | ||
} | ||
}, | ||
filter: (props) => { | ||
return (props.layout === 'inline' && props.inline === true && !props.width) || | ||
(props.renderBeforeInput && props.width) || | ||
(props.renderAfterInput && props.width) | ||
} | ||
} | ||
/* eslint-enable no-undefined */ |
@@ -89,7 +89,7 @@ /* | ||
*/ | ||
renderBeforeInput: PropTypes.func, | ||
renderBeforeInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
/** | ||
* Content to display after the input text, such as an icon | ||
*/ | ||
renderAfterInput: PropTypes.func, | ||
renderAfterInput: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | ||
onChange: PropTypes.func, | ||
@@ -96,0 +96,0 @@ onBlur: PropTypes.func, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
78450
1467
3
21