@react-spectrum/form
Advanced tools
Comparing version 3.0.0-rc.2 to 3.0.0-rc.3
139
dist/main.js
@@ -1,27 +0,30 @@ | ||
require("./main.css"); | ||
var _react2 = require("react"); | ||
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends")); | ||
var _react = $parcel$interopDefault(_react2); | ||
var _babelRuntimeHelpersObjectWithoutProperties = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var { | ||
useContext | ||
} = _react2; | ||
var _babelRuntimeHelpersObjectSpread = $parcel$interopDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var { | ||
Provider, | ||
useProviderProps | ||
} = require("@react-spectrum/provider"); | ||
var _temp = require("@react-spectrum/utils"); | ||
var { | ||
filterDOMProps | ||
} = require("@react-aria/utils"); | ||
var classNames = _temp.classNames; | ||
var filterDOMProps = _temp.filterDOMProps; | ||
var useDOMRef = _temp.useDOMRef; | ||
var useStyleProps = _temp.useStyleProps; | ||
var { | ||
classNames, | ||
useDOMRef, | ||
useStyleProps | ||
} = require("@react-spectrum/utils"); | ||
var _temp2 = require("@react-spectrum/provider"); | ||
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends")); | ||
var Provider = _temp2.Provider; | ||
var useProviderProps = _temp2.useProviderProps; | ||
var _babelRuntimeHelpersObjectWithoutPropertiesLoose = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); | ||
var _react2 = require("react"); | ||
require("./main.css"); | ||
var _react = $parcel$interopDefault(_react2); | ||
var useContext = _react2.useContext; | ||
function $parcel$interopDefault(a) { | ||
@@ -31,64 +34,65 @@ return a && a.__esModule ? a.default : a; | ||
// ASSET: /Users/govett/dev/react-spectrum/node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css | ||
var $ce2ba76b00945bd966a5f95584cdaaee$exports = {}; | ||
$ce2ba76b00945bd966a5f95584cdaaee$exports = { | ||
"spectrum-FieldLabel": "_spectrum-FieldLabel_3fb22", | ||
"spectrum-FieldLabel--positionSide": "_spectrum-FieldLabel--positionSide_3fb22", | ||
"spectrum-FieldLabel-requiredIcon": "_spectrum-FieldLabel-requiredIcon_3fb22", | ||
"spectrum-FieldLabel--alignEnd": "_spectrum-FieldLabel--alignEnd_3fb22", | ||
"spectrum-Field": "_spectrum-Field_3fb22", | ||
"spectrum-Field--positionTop": "_spectrum-Field--positionTop_3fb22", | ||
"spectrum-Field-field": "_spectrum-Field-field_3fb22", | ||
"spectrum-Field--positionSide": "_spectrum-Field--positionSide_3fb22", | ||
"spectrum-Form": "_spectrum-Form_3fb22", | ||
"spectrum-Form--positionSide": "_spectrum-Form--positionSide_3fb22", | ||
"spectrum-Form--positionTop": "_spectrum-Form--positionTop_3fb22", | ||
"spectrum-Form-itemLabel": "_spectrum-Form-itemLabel_3fb22", | ||
"is-disabled": "_is-disabled_3fb22" | ||
// ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css | ||
var $a0bedb1888ff92cb3407d1a60d76e$exports = {}; | ||
$a0bedb1888ff92cb3407d1a60d76e$exports = { | ||
"spectrum-FieldLabel": "_spectrum-FieldLabel_36b9b", | ||
"spectrum-FieldLabel--positionSide": "_spectrum-FieldLabel--positionSide_36b9b", | ||
"spectrum-FieldLabel-requiredIcon": "_spectrum-FieldLabel-requiredIcon_36b9b", | ||
"spectrum-FieldLabel--alignEnd": "_spectrum-FieldLabel--alignEnd_36b9b", | ||
"spectrum-Field": "_spectrum-Field_36b9b", | ||
"spectrum-Field--positionTop": "_spectrum-Field--positionTop_36b9b", | ||
"spectrum-Field-field": "_spectrum-Field-field_36b9b", | ||
"spectrum-Field--positionSide": "_spectrum-Field--positionSide_36b9b", | ||
"spectrum-Form": "_spectrum-Form_36b9b", | ||
"spectrum-Form--positionSide": "_spectrum-Form--positionSide_36b9b", | ||
"spectrum-Form--positionTop": "_spectrum-Form--positionTop_36b9b", | ||
"spectrum-Form-itemLabel": "_spectrum-Form-itemLabel_36b9b", | ||
"is-disabled": "_is-disabled_36b9b" | ||
}; | ||
var $ec21c63dc85db6e3c496ffb42$var$FormContext = _react.createContext({}); | ||
let $a04c1031b5e1cab168e087a6837ba8be$var$FormContext = _react.createContext({}); | ||
function useFormProps(props) { | ||
var ctx = useContext($ec21c63dc85db6e3c496ffb42$var$FormContext); | ||
return _babelRuntimeHelpersObjectSpread({}, props, {}, ctx); | ||
let ctx = useContext($a04c1031b5e1cab168e087a6837ba8be$var$FormContext); | ||
return _babelRuntimeHelpersExtends({}, ctx, {}, props); | ||
} | ||
exports.useFormProps = useFormProps; | ||
var $ce2ba76b00945bd966a5f95584cdaaee$$interop$default = $parcel$interopDefault($ce2ba76b00945bd966a5f95584cdaaee$exports); | ||
var $a0bedb1888ff92cb3407d1a60d76e$$interop$default = $parcel$interopDefault($a0bedb1888ff92cb3407d1a60d76e$exports); | ||
function $ec21c63dc85db6e3c496ffb42$var$Form(props, ref) { | ||
function $a04c1031b5e1cab168e087a6837ba8be$var$Form(props, ref) { | ||
props = useProviderProps(props); | ||
var _props = props, | ||
children = _props.children, | ||
_props$labelPosition = _props.labelPosition, | ||
labelPosition = _props$labelPosition === void 0 ? 'top' : _props$labelPosition, | ||
_props$labelAlign = _props.labelAlign, | ||
labelAlign = _props$labelAlign === void 0 ? 'start' : _props$labelAlign, | ||
isRequired = _props.isRequired, | ||
necessityIndicator = _props.necessityIndicator, | ||
isQuiet = _props.isQuiet, | ||
isEmphasized = _props.isEmphasized, | ||
isDisabled = _props.isDisabled, | ||
isReadOnly = _props.isReadOnly, | ||
validationState = _props.validationState, | ||
otherProps = _babelRuntimeHelpersObjectWithoutProperties(_props, ["children", "labelPosition", "labelAlign", "isRequired", "necessityIndicator", "isQuiet", "isEmphasized", "isDisabled", "isReadOnly", "validationState"]); | ||
let { | ||
children, | ||
labelPosition = 'top', | ||
labelAlign = 'start', | ||
isRequired, | ||
necessityIndicator, | ||
isQuiet, | ||
isEmphasized, | ||
isDisabled, | ||
isReadOnly, | ||
validationState | ||
} = props, | ||
otherProps = _babelRuntimeHelpersObjectWithoutPropertiesLoose(props, ["children", "labelPosition", "labelAlign", "isRequired", "necessityIndicator", "isQuiet", "isEmphasized", "isDisabled", "isReadOnly", "validationState"]); | ||
var _useStyleProps = useStyleProps(otherProps), | ||
styleProps = _useStyleProps.styleProps; | ||
var domRef = useDOMRef(ref); | ||
var ctx = { | ||
labelPosition: labelPosition, | ||
labelAlign: labelAlign, | ||
necessityIndicator: necessityIndicator | ||
let { | ||
styleProps | ||
} = useStyleProps(otherProps); | ||
let domRef = useDOMRef(ref); | ||
let ctx = { | ||
labelPosition, | ||
labelAlign, | ||
necessityIndicator | ||
}; | ||
return (/*#__PURE__*/_react.createElement("form", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps), styleProps, { | ||
return (/*#__PURE__*/_react.createElement("form", _babelRuntimeHelpersExtends({}, filterDOMProps(otherProps, { | ||
labelable: true | ||
}), styleProps, { | ||
ref: domRef, | ||
className: classNames($ce2ba76b00945bd966a5f95584cdaaee$$interop$default, 'spectrum-Form', { | ||
className: classNames($a0bedb1888ff92cb3407d1a60d76e$$interop$default, 'spectrum-Form', { | ||
'spectrum-Form--positionSide': labelPosition === 'side', | ||
'spectrum-Form--positionTop': labelPosition === 'top' | ||
}, styleProps.className) | ||
}), /*#__PURE__*/_react.createElement($ec21c63dc85db6e3c496ffb42$var$FormContext.Provider, { | ||
}), /*#__PURE__*/_react.createElement($a04c1031b5e1cab168e087a6837ba8be$var$FormContext.Provider, { | ||
value: ctx | ||
@@ -105,5 +109,10 @@ }, /*#__PURE__*/_react.createElement(Provider, { | ||
} | ||
/** | ||
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields. | ||
*/ | ||
var Form = _react.forwardRef($ec21c63dc85db6e3c496ffb42$var$Form); | ||
exports.Form = Form; | ||
const Form = _react.forwardRef($a04c1031b5e1cab168e087a6837ba8be$var$Form); | ||
exports.Form = Form; | ||
//# sourceMappingURL=main.js.map |
@@ -0,8 +1,8 @@ | ||
import _react, { useContext } from "react"; | ||
import { Provider, useProviderProps } from "@react-spectrum/provider"; | ||
import { filterDOMProps } from "@react-aria/utils"; | ||
import { classNames, useDOMRef, useStyleProps } from "@react-spectrum/utils"; | ||
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
import _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
import "./main.css"; | ||
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends"; | ||
import _babelRuntimeHelpersEsmObjectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
import _babelRuntimeHelpersEsmObjectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
import { classNames, filterDOMProps, useDOMRef, useStyleProps } from "@react-spectrum/utils"; | ||
import { Provider, useProviderProps } from "@react-spectrum/provider"; | ||
import _react, { useContext } from "react"; | ||
@@ -13,29 +13,29 @@ function $parcel$interopDefault(a) { | ||
// ASSET: /Users/govett/dev/react-spectrum/node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css | ||
var $c356388cc3519f2d617e9a5ee79a$exports = {}; | ||
$c356388cc3519f2d617e9a5ee79a$exports = { | ||
"spectrum-FieldLabel": "_spectrum-FieldLabel_3fb22", | ||
"spectrum-FieldLabel--positionSide": "_spectrum-FieldLabel--positionSide_3fb22", | ||
"spectrum-FieldLabel-requiredIcon": "_spectrum-FieldLabel-requiredIcon_3fb22", | ||
"spectrum-FieldLabel--alignEnd": "_spectrum-FieldLabel--alignEnd_3fb22", | ||
"spectrum-Field": "_spectrum-Field_3fb22", | ||
"spectrum-Field--positionTop": "_spectrum-Field--positionTop_3fb22", | ||
"spectrum-Field-field": "_spectrum-Field-field_3fb22", | ||
"spectrum-Field--positionSide": "_spectrum-Field--positionSide_3fb22", | ||
"spectrum-Form": "_spectrum-Form_3fb22", | ||
"spectrum-Form--positionSide": "_spectrum-Form--positionSide_3fb22", | ||
"spectrum-Form--positionTop": "_spectrum-Form--positionTop_3fb22", | ||
"spectrum-Form-itemLabel": "_spectrum-Form-itemLabel_3fb22", | ||
"is-disabled": "_is-disabled_3fb22" | ||
// ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/fieldlabel/vars.css | ||
var $c9fb1f4220ea2c59cb2e10f0e9828c6e$exports = {}; | ||
$c9fb1f4220ea2c59cb2e10f0e9828c6e$exports = { | ||
"spectrum-FieldLabel": "_spectrum-FieldLabel_36b9b", | ||
"spectrum-FieldLabel--positionSide": "_spectrum-FieldLabel--positionSide_36b9b", | ||
"spectrum-FieldLabel-requiredIcon": "_spectrum-FieldLabel-requiredIcon_36b9b", | ||
"spectrum-FieldLabel--alignEnd": "_spectrum-FieldLabel--alignEnd_36b9b", | ||
"spectrum-Field": "_spectrum-Field_36b9b", | ||
"spectrum-Field--positionTop": "_spectrum-Field--positionTop_36b9b", | ||
"spectrum-Field-field": "_spectrum-Field-field_36b9b", | ||
"spectrum-Field--positionSide": "_spectrum-Field--positionSide_36b9b", | ||
"spectrum-Form": "_spectrum-Form_36b9b", | ||
"spectrum-Form--positionSide": "_spectrum-Form--positionSide_36b9b", | ||
"spectrum-Form--positionTop": "_spectrum-Form--positionTop_36b9b", | ||
"spectrum-Form-itemLabel": "_spectrum-Form-itemLabel_36b9b", | ||
"is-disabled": "_is-disabled_36b9b" | ||
}; | ||
let $f2742115939d8dea25a9b7ab0f4f0$var$FormContext = _react.createContext({}); | ||
let $d618213cd07bac427c632ce5c90d7$var$FormContext = _react.createContext({}); | ||
export function useFormProps(props) { | ||
let ctx = useContext($f2742115939d8dea25a9b7ab0f4f0$var$FormContext); | ||
return _babelRuntimeHelpersEsmObjectSpread({}, props, {}, ctx); | ||
let ctx = useContext($d618213cd07bac427c632ce5c90d7$var$FormContext); | ||
return _babelRuntimeHelpersEsmExtends({}, ctx, {}, props); | ||
} | ||
var $c356388cc3519f2d617e9a5ee79a$$interop$default = $parcel$interopDefault($c356388cc3519f2d617e9a5ee79a$exports); | ||
var $c9fb1f4220ea2c59cb2e10f0e9828c6e$$interop$default = $parcel$interopDefault($c9fb1f4220ea2c59cb2e10f0e9828c6e$exports); | ||
function $f2742115939d8dea25a9b7ab0f4f0$var$Form(props, ref) { | ||
function $d618213cd07bac427c632ce5c90d7$var$Form(props, ref) { | ||
props = useProviderProps(props); | ||
@@ -55,3 +55,3 @@ | ||
} = props, | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutProperties(props, ["children", "labelPosition", "labelAlign", "isRequired", "necessityIndicator", "isQuiet", "isEmphasized", "isDisabled", "isReadOnly", "validationState"]); | ||
otherProps = _babelRuntimeHelpersEsmObjectWithoutPropertiesLoose(props, ["children", "labelPosition", "labelAlign", "isRequired", "necessityIndicator", "isQuiet", "isEmphasized", "isDisabled", "isReadOnly", "validationState"]); | ||
@@ -67,9 +67,11 @@ let { | ||
}; | ||
return (/*#__PURE__*/_react.createElement("form", _babelRuntimeHelpersEsmExtends({}, filterDOMProps(otherProps), styleProps, { | ||
return (/*#__PURE__*/_react.createElement("form", _babelRuntimeHelpersEsmExtends({}, filterDOMProps(otherProps, { | ||
labelable: true | ||
}), styleProps, { | ||
ref: domRef, | ||
className: classNames($c356388cc3519f2d617e9a5ee79a$$interop$default, 'spectrum-Form', { | ||
className: classNames($c9fb1f4220ea2c59cb2e10f0e9828c6e$$interop$default, 'spectrum-Form', { | ||
'spectrum-Form--positionSide': labelPosition === 'side', | ||
'spectrum-Form--positionTop': labelPosition === 'top' | ||
}, styleProps.className) | ||
}), /*#__PURE__*/_react.createElement($f2742115939d8dea25a9b7ab0f4f0$var$FormContext.Provider, { | ||
}), /*#__PURE__*/_react.createElement($d618213cd07bac427c632ce5c90d7$var$FormContext.Provider, { | ||
value: ctx | ||
@@ -86,3 +88,8 @@ }, /*#__PURE__*/_react.createElement(Provider, { | ||
} | ||
/** | ||
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields. | ||
*/ | ||
export const Form = _react.forwardRef($f2742115939d8dea25a9b7ab0f4f0$var$Form); | ||
export const Form = _react.forwardRef($d618213cd07bac427c632ce5c90d7$var$Form); | ||
//# sourceMappingURL=module.js.map |
import { SpectrumLabelableProps } from "@react-types/shared"; | ||
import { SpectrumFormProps } from "@react-types/form"; | ||
export function useFormProps<T extends SpectrumLabelableProps>(props: T): T; | ||
/** | ||
* Forms allow users to enter data that can be submitted while providing alignment and styling for form fields. | ||
*/ | ||
export const Form: React.ForwardRefExoticComponent<SpectrumFormProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLFormElement>>>; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "@react-spectrum/form", | ||
"version": "3.0.0-rc.2", | ||
"version": "3.0.0-rc.3", | ||
"description": "Spectrum UI components in React", | ||
@@ -32,5 +32,6 @@ "license": "Apache-2.0", | ||
"@babel/runtime": "^7.6.2", | ||
"@react-spectrum/utils": "^3.0.0-rc.2", | ||
"@react-types/form": "^3.0.0-rc.2", | ||
"@react-types/shared": "^3.0.0-rc.2" | ||
"@react-aria/utils": "3.0.0-rc.3", | ||
"@react-spectrum/utils": "3.0.0-rc.3", | ||
"@react-types/form": "3.0.0-rc.3", | ||
"@react-types/shared": "3.0.0-rc.3" | ||
}, | ||
@@ -47,3 +48,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "207e6ee9076905c96638a7f81a367758872e1410" | ||
"gitHead": "461d6321126ae9b4f1508aa912f7b36bf8a603f8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
44148
11
310
7
1
80
+ Added@react-aria/utils@3.0.0-rc.3
+ Added@react-aria/i18n@3.0.0-rc.3(transitive)
+ Added@react-aria/utils@3.0.0-rc.3(transitive)
+ Added@react-spectrum/utils@3.0.0-rc.3(transitive)
+ Added@react-types/form@3.0.0-rc.3(transitive)
+ Added@react-types/shared@3.0.0-rc.3(transitive)
+ Addedclassnames@2.5.1(transitive)
+ Addedintl-messageformat@2.2.0(transitive)
+ Addedintl-messageformat-parser@1.4.0(transitive)
- Removed@react-types/form@3.7.8(transitive)
Updated@react-types/form@3.0.0-rc.3