@jobber/components 6.92.0 → 6.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,6 +84,10 @@ interface InputFileProps {
84
84
  * @default "base"
85
85
  */
86
86
  readonly size?: "small" | "base";
87
+ /**
88
+ * Sets the `name` attribute on the underlying `<input>` element.
89
+ */
90
+ readonly name?: string;
87
91
  /**
88
92
  * Label for the InputFile's button.
89
93
  * @default Automatic
@@ -162,7 +166,7 @@ interface InputFileProps {
162
166
  */
163
167
  readonly validator?: <T extends File>(file: T) => FileError | FileError[] | null;
164
168
  }
165
- export declare function InputFile({ variation, size, buttonLabel: providedButtonLabel, allowMultiple, allowedTypes, description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }: InputFileProps): React.JSX.Element;
169
+ export declare function InputFile({ variation, size, name, buttonLabel: providedButtonLabel, allowMultiple, allowedTypes, description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }: InputFileProps): React.JSX.Element;
166
170
  export declare namespace InputFile {
167
171
  var Button: typeof InputFileButton;
168
172
  var Description: typeof InputFileDescription;
@@ -1538,7 +1538,7 @@ function InputFileValidationErrors({ validationErrors, }) {
1538
1538
  }
1539
1539
 
1540
1540
  /* eslint-disable max-statements */
1541
- function InputFile({ variation = "dropzone", size = "base", buttonLabel: providedButtonLabel, allowMultiple = false, allowedTypes = "all", description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }) {
1541
+ function InputFile({ variation = "dropzone", size = "base", name, buttonLabel: providedButtonLabel, allowMultiple = false, allowedTypes = "all", description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }) {
1542
1542
  const maxFiles = (maxFilesValidation === null || maxFilesValidation === void 0 ? void 0 : maxFilesValidation.maxFiles) || 0;
1543
1543
  const numberOfCurrentFiles = (maxFilesValidation === null || maxFilesValidation === void 0 ? void 0 : maxFilesValidation.numberOfCurrentFiles) || 0;
1544
1544
  const handleValidation = React.useCallback((file) => {
@@ -1635,7 +1635,7 @@ function InputFile({ variation = "dropzone", size = "base", buttonLabel: provide
1635
1635
  variation === "button" && React.createElement(InputFile.Button, { fullWidth: true })));
1636
1636
  return (React.createElement(React.Fragment, null,
1637
1637
  React.createElement("div", Object.assign({}, getRootProps({ className: dropZone }), { tabIndex: variation === "button" ? -1 : 0 }),
1638
- React.createElement("input", Object.assign({}, getInputProps(), { "data-testid": "input-file-input" })),
1638
+ React.createElement("input", Object.assign({}, getInputProps(), { "data-testid": "input-file-input", name: name })),
1639
1639
  React.createElement(InputFileContentContext.Provider, { value: contentContext }, children || defaultContent)),
1640
1640
  React.createElement(InputFileValidationErrors, { validationErrors: validationErrors })));
1641
1641
  function handleDrop(acceptedFiles) {
@@ -1536,7 +1536,7 @@ function InputFileValidationErrors({ validationErrors, }) {
1536
1536
  }
1537
1537
 
1538
1538
  /* eslint-disable max-statements */
1539
- function InputFile({ variation = "dropzone", size = "base", buttonLabel: providedButtonLabel, allowMultiple = false, allowedTypes = "all", description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }) {
1539
+ function InputFile({ variation = "dropzone", size = "base", name, buttonLabel: providedButtonLabel, allowMultiple = false, allowedTypes = "all", description, hintText, maxFilesValidation, getUploadParams, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, validator, children, }) {
1540
1540
  const maxFiles = (maxFilesValidation === null || maxFilesValidation === void 0 ? void 0 : maxFilesValidation.maxFiles) || 0;
1541
1541
  const numberOfCurrentFiles = (maxFilesValidation === null || maxFilesValidation === void 0 ? void 0 : maxFilesValidation.numberOfCurrentFiles) || 0;
1542
1542
  const handleValidation = useCallback((file) => {
@@ -1633,7 +1633,7 @@ function InputFile({ variation = "dropzone", size = "base", buttonLabel: provide
1633
1633
  variation === "button" && React__default.createElement(InputFile.Button, { fullWidth: true })));
1634
1634
  return (React__default.createElement(React__default.Fragment, null,
1635
1635
  React__default.createElement("div", Object.assign({}, getRootProps({ className: dropZone }), { tabIndex: variation === "button" ? -1 : 0 }),
1636
- React__default.createElement("input", Object.assign({}, getInputProps(), { "data-testid": "input-file-input" })),
1636
+ React__default.createElement("input", Object.assign({}, getInputProps(), { "data-testid": "input-file-input", name: name })),
1637
1637
  React__default.createElement(InputFileContentContext.Provider, { value: contentContext }, children || defaultContent)),
1638
1638
  React__default.createElement(InputFileValidationErrors, { validationErrors: validationErrors })));
1639
1639
  function handleDrop(acceptedFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.92.0",
3
+ "version": "6.93.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -541,5 +541,5 @@
541
541
  "> 1%",
542
542
  "IE 10"
543
543
  ],
544
- "gitHead": "a623e4d884e7089cce658fd1e7948923ee8553f5"
544
+ "gitHead": "d480a80ad2846af668deb353e70c9604b1343e0b"
545
545
  }