@jobber/components 6.26.1 → 6.26.3

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.
@@ -6,5 +6,5 @@ interface ButtonContextProps {
6
6
  export declare function ButtonProvider({ children, size, }: PropsWithChildren<{
7
7
  readonly size?: ButtonSize;
8
8
  }>): JSX.Element;
9
- export declare function useButton(): ButtonContextProps;
9
+ export declare function useButtonContext(): ButtonContextProps;
10
10
  export {};
@@ -12,5 +12,5 @@ require('../Typography-cjs.js');
12
12
 
13
13
 
14
14
  exports.Button = Button.Button;
15
- exports.useButton = Button.useButton;
15
+ exports.useButtonContext = Button.useButtonContext;
16
16
  exports.useButtonStyles = Button.useButtonStyles;
@@ -1,4 +1,4 @@
1
1
  export { Button } from "./Button";
2
2
  export * from "./Button.types";
3
3
  export { useButtonStyles, UseButtonStylesProps } from "./useButtonStyles";
4
- export { useButton } from "./ButtonProvider";
4
+ export { useButtonContext } from "./ButtonProvider";
@@ -1,4 +1,4 @@
1
- export { B as Button, a as useButton, u as useButtonStyles } from '../Button-es.js';
1
+ export { B as Button, a as useButtonContext, u as useButtonStyles } from '../Button-es.js';
2
2
  import 'react';
3
3
  import 'react-router-dom';
4
4
  import 'classnames';
@@ -15,12 +15,12 @@ const ButtonContext = React.createContext({
15
15
  function ButtonProvider({ children, size = "base", }) {
16
16
  return (React.createElement(ButtonContext.Provider, { value: { size } }, children));
17
17
  }
18
- function useButton() {
18
+ function useButtonContext() {
19
19
  return React.useContext(ButtonContext);
20
20
  }
21
21
 
22
22
  function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
23
- const { size: contextSize } = useButton();
23
+ const { size: contextSize } = useButtonContext();
24
24
  const size = sizeProp || contextSize;
25
25
  const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
26
26
  [styles.disabled]: disabled,
@@ -57,13 +57,13 @@ function getTypeSizes(size) {
57
57
  }
58
58
  function ButtonIcon(_a) {
59
59
  var { size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["size"]);
60
- const { size: contextSize } = useButton();
60
+ const { size: contextSize } = useButtonContext();
61
61
  const size = sizeProp || contextSize;
62
62
  return React.createElement(Icon.Icon, Object.assign({}, props, { size: size }));
63
63
  }
64
64
  function ButtonLabel(_a) {
65
65
  var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
66
- const { size: contextSize } = useButton();
66
+ const { size: contextSize } = useButtonContext();
67
67
  const size = sizeProp || contextSize;
68
68
  return (React.createElement(Typography.Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
69
69
  }
@@ -90,5 +90,5 @@ Button.Label = ButtonLabel;
90
90
  Button.Icon = ButtonIcon;
91
91
 
92
92
  exports.Button = Button;
93
- exports.useButton = useButton;
93
+ exports.useButtonContext = useButtonContext;
94
94
  exports.useButtonStyles = useButtonStyles;
package/dist/Button-es.js CHANGED
@@ -13,12 +13,12 @@ const ButtonContext = createContext({
13
13
  function ButtonProvider({ children, size = "base", }) {
14
14
  return (React__default.createElement(ButtonContext.Provider, { value: { size } }, children));
15
15
  }
16
- function useButton() {
16
+ function useButtonContext() {
17
17
  return useContext(ButtonContext);
18
18
  }
19
19
 
20
20
  function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
21
- const { size: contextSize } = useButton();
21
+ const { size: contextSize } = useButtonContext();
22
22
  const size = sizeProp || contextSize;
23
23
  const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
24
24
  [styles.disabled]: disabled,
@@ -55,13 +55,13 @@ function getTypeSizes(size) {
55
55
  }
56
56
  function ButtonIcon(_a) {
57
57
  var { size: sizeProp } = _a, props = __rest(_a, ["size"]);
58
- const { size: contextSize } = useButton();
58
+ const { size: contextSize } = useButtonContext();
59
59
  const size = sizeProp || contextSize;
60
60
  return React__default.createElement(Icon, Object.assign({}, props, { size: size }));
61
61
  }
62
62
  function ButtonLabel(_a) {
63
63
  var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = __rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
64
- const { size: contextSize } = useButton();
64
+ const { size: contextSize } = useButtonContext();
65
65
  const size = sizeProp || contextSize;
66
66
  return (React__default.createElement(Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
67
67
  }
@@ -87,4 +87,4 @@ function ButtonWrapper(props) {
87
87
  Button.Label = ButtonLabel;
88
88
  Button.Icon = ButtonIcon;
89
89
 
90
- export { Button as B, useButton as a, useButtonStyles as u };
90
+ export { Button as B, useButtonContext as a, useButtonStyles as u };
@@ -202,5 +202,11 @@ export interface FormFieldProps extends CommonFormFieldProps {
202
202
  * Determines the visibility of the toolbar.
203
203
  */
204
204
  readonly toolbarVisibility?: "always" | "while-editing";
205
+ /**
206
+ * Pattern is currently only used for the InputPhone type
207
+ * it is used to determine the format of the phone number
208
+ * and the number of digits to expect.
209
+ */
210
+ readonly pattern?: string;
205
211
  }
206
212
  export {};
@@ -1,7 +1,7 @@
1
1
  import { ChangeEvent, FocusEvent, KeyboardEvent } from "react";
2
2
  import { UseControllerReturn } from "react-hook-form";
3
3
  import type { FormFieldProps, KeyBoardTypes } from "../FormFieldTypes";
4
- export interface useAtlantisFormFieldProps extends Pick<FormFieldProps, "description" | "disabled" | "readonly" | "inline" | "autofocus"> {
4
+ export interface useAtlantisFormFieldProps extends Pick<FormFieldProps, "description" | "disabled" | "readonly" | "inline" | "autofocus" | "pattern" | "type" | "value"> {
5
5
  /**
6
6
  * The html id for the field
7
7
  */
@@ -57,7 +57,7 @@ export interface useAtlantisFormFieldProps extends Pick<FormFieldProps, "descrip
57
57
  /**
58
58
  * Provides the props for the html fields rendered by the FormField component
59
59
  */
60
- export declare function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }: useAtlantisFormFieldProps): {
60
+ export declare function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }: useAtlantisFormFieldProps): {
61
61
  textFieldProps: {
62
62
  autoFocus: boolean | undefined;
63
63
  onKeyDown: (event: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
@@ -33,7 +33,7 @@ function useShowClear({ clearable, multiline, focused, hasValue, disabled = fals
33
33
  }
34
34
  }
35
35
 
36
- var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","disabled":"Tz9LK9ABKMk-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","hasAction":"OLE9N3Uem4o-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
36
+ var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","disabled":"Tz9LK9ABKMk-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","hasAction":"OLE9N3Uem4o-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
37
37
 
38
38
  /**
39
39
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
@@ -316,14 +316,19 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
316
316
  /**
317
317
  * Provides the props for the html fields rendered by the FormField component
318
318
  */
319
- function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
319
+ function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
320
320
  const descriptionIdentifier = `descriptionUUID--${id}`;
321
- const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: styles$1.input, name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
321
+ const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(styles$1.input, {
322
+ [styles$1.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
323
+ }), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
322
324
  !inline && { "aria-describedby": descriptionIdentifier }));
323
325
  const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
324
326
  React.useEffect(() => handleValidation(errorMessage), [errorMessage]);
325
327
  return { textFieldProps, fieldProps, descriptionIdentifier };
326
328
  }
329
+ function shouldAddPhoneNumberClass(type, value, pattern) {
330
+ return type === "tel" && !value && pattern && pattern[0] === "(";
331
+ }
327
332
 
328
333
  function useAtlantisFormFieldName({ id, nameProp, }) {
329
334
  /**
@@ -397,7 +402,7 @@ function FormField(props) {
397
402
  return React.createElement(FormFieldInternal, Object.assign({}, props, { id: id }));
398
403
  }
399
404
  function FormFieldInternal(props) {
400
- const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
405
+ const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, pattern, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
401
406
  const { name } = useAtlantisFormFieldName({ id, nameProp });
402
407
  const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
403
408
  actionsRef,
@@ -432,6 +437,9 @@ function FormFieldInternal(props) {
432
437
  readonly,
433
438
  keyboard,
434
439
  autofocus,
440
+ value,
441
+ type,
442
+ pattern,
435
443
  handleChange,
436
444
  handleBlur,
437
445
  handleFocus,
@@ -31,7 +31,7 @@ function useShowClear({ clearable, multiline, focused, hasValue, disabled = fals
31
31
  }
32
32
  }
33
33
 
34
- var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","disabled":"Tz9LK9ABKMk-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","hasAction":"OLE9N3Uem4o-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
34
+ var styles$1 = {"container":"YL-mNv-Bl6g-","wrapper":"_8lhbGTQ-hhg-","horizontalWrapper":"b5mv1x1H7YE-","textarea":"hGr6YW4AeLM-","safari":"QBCWi9GBgMs-","timeInputLabel":"_0pmqVa2zSE4-","miniLabel":"F1t76G6bDKo-","large":"_9tjyT9QUtP8-","text":"QmMiyoAWp-g-","invalid":"XWDSfe6weSY-","disabled":"Tz9LK9ABKMk-","small":"Sw5O4I0lMJg-","inline":"SaORbL7SYWY-","center":"ozy2UoT2vsg-","right":"_3TJdT91YD3c-","maxLength":"W6GrMqLy2qk-","inputWrapper":"-LmjnYRU0r0-","childrenWrapper":"yVXYv6hkuOA-","input":"vtSDcuzNr9Q-","emptyPhoneNumber":"MVhuQuzUBUs-","label":"Dgk00tzlODA-","select":"NwQGiWBWIsc-","externalLabel":"Qb8zQ8n-8vc-","postfix":"yTDzs9h1otI-","affixIcon":"m0YpdssD2dY-","suffix":"_-3mMnjSh6ok-","hasAction":"OLE9N3Uem4o-","affixLabel":"-Wzcb0pBh5I-","description":"DHX5ijY3xIw-","toolbar":"AL-2brNI7dk-","spinning":"_8Rzv7CcDW80-"};
35
35
 
36
36
  /**
37
37
  * @internal Reach out to UX Foundations if using this component since it is possible it might change
@@ -314,14 +314,19 @@ function useAtlantisFormFieldActions({ name, onChange, inputRef, onControllerCha
314
314
  /**
315
315
  * Provides the props for the html fields rendered by the FormField component
316
316
  */
317
- function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
317
+ function useAtlantisFormField({ id, nameProp, name, useControllerField: useControllerField, description, disabled, readonly, keyboard, autofocus, pattern, type, value, handleChange, handleBlur, handleFocus, inline, validations, handleKeyDown, handleValidation, errorMessage, }) {
318
318
  const descriptionIdentifier = `descriptionUUID--${id}`;
319
- const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: styles$1.input, name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
319
+ const fieldProps = Object.assign(Object.assign(Object.assign({}, useControllerField), { id, className: classnames(styles$1.input, {
320
+ [styles$1.emptyPhoneNumber]: shouldAddPhoneNumberClass(type, value, pattern),
321
+ }), name: (validations || nameProp) && name, disabled: disabled, readOnly: readonly, inputMode: keyboard, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, autoFocus: autofocus }), (description &&
320
322
  !inline && { "aria-describedby": descriptionIdentifier }));
321
323
  const textFieldProps = Object.assign(Object.assign({}, fieldProps), { autoFocus: autofocus, onKeyDown: handleKeyDown });
322
324
  useEffect(() => handleValidation(errorMessage), [errorMessage]);
323
325
  return { textFieldProps, fieldProps, descriptionIdentifier };
324
326
  }
327
+ function shouldAddPhoneNumberClass(type, value, pattern) {
328
+ return type === "tel" && !value && pattern && pattern[0] === "(";
329
+ }
325
330
 
326
331
  function useAtlantisFormFieldName({ id, nameProp, }) {
327
332
  /**
@@ -395,7 +400,7 @@ function FormField(props) {
395
400
  return React__default.createElement(FormFieldInternal, Object.assign({}, props, { id: id }));
396
401
  }
397
402
  function FormFieldInternal(props) {
398
- const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
403
+ const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, pattern, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
399
404
  const { name } = useAtlantisFormFieldName({ id, nameProp });
400
405
  const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
401
406
  actionsRef,
@@ -430,6 +435,9 @@ function FormFieldInternal(props) {
430
435
  readonly,
431
436
  keyboard,
432
437
  autofocus,
438
+ value,
439
+ type,
440
+ pattern,
433
441
  handleChange,
434
442
  handleBlur,
435
443
  handleFocus,
@@ -3,11 +3,11 @@
3
3
  var React = require('react');
4
4
  var omit = require('../omit-cjs.js');
5
5
  var FormField = require('../FormField-cjs.js');
6
+ require('classnames');
6
7
  require('../tslib.es6-cjs.js');
7
8
  require('react-hook-form');
8
9
  require('framer-motion');
9
10
  require('@jobber/design');
10
- require('classnames');
11
11
  require('../Button-cjs.js');
12
12
  var DatePicker = require('../DatePicker-cjs.js');
13
13
  var InputText_index = require('../InputText/index.cjs');
@@ -1,11 +1,11 @@
1
1
  import React__default, { useRef, useState, useEffect, forwardRef } from 'react';
2
2
  import { o as omit } from '../omit-es.js';
3
3
  import { k as FormField } from '../FormField-es.js';
4
+ import 'classnames';
4
5
  import '../tslib.es6-es.js';
5
6
  import 'react-hook-form';
6
7
  import 'framer-motion';
7
8
  import '@jobber/design';
8
- import 'classnames';
9
9
  import '../Button-es.js';
10
10
  import { D as DatePicker } from '../DatePicker-es.js';
11
11
  import { InputText } from '../InputText/index.mjs';
@@ -2,11 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
  var FormField = require('./FormField-cjs.js');
5
+ require('classnames');
5
6
  require('./tslib.es6-cjs.js');
6
7
  require('react-hook-form');
7
8
  require('framer-motion');
8
9
  require('@jobber/design');
9
- require('classnames');
10
10
  require('./Button-cjs.js');
11
11
 
12
12
  const validationMessage = "Please enter a valid email";
@@ -1,10 +1,10 @@
1
1
  import React__default from 'react';
2
2
  import { k as FormField } from './FormField-es.js';
3
+ import 'classnames';
3
4
  import './tslib.es6-es.js';
4
5
  import 'react-hook-form';
5
6
  import 'framer-motion';
6
7
  import '@jobber/design';
7
- import 'classnames';
8
8
  import './Button-es.js';
9
9
 
10
10
  const validationMessage = "Please enter a valid email";
@@ -2,11 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
  var FormField = require('./FormField-cjs.js');
5
+ require('classnames');
5
6
  require('./tslib.es6-cjs.js');
6
7
  require('react-hook-form');
7
8
  require('framer-motion');
8
9
  require('@jobber/design');
9
- require('classnames');
10
10
  require('./Button-cjs.js');
11
11
 
12
12
  function InputNumberInternal(props, ref) {
@@ -1,10 +1,10 @@
1
1
  import React__default, { forwardRef, createRef, useImperativeHandle } from 'react';
2
2
  import { k as FormField } from './FormField-es.js';
3
+ import 'classnames';
3
4
  import './tslib.es6-es.js';
4
5
  import 'react-hook-form';
5
6
  import 'framer-motion';
6
7
  import '@jobber/design';
7
- import 'classnames';
8
8
  import './Button-es.js';
9
9
 
10
10
  function InputNumberInternal(props, ref) {
@@ -2,11 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
  var FormField = require('./FormField-cjs.js');
5
+ require('classnames');
5
6
  require('./tslib.es6-cjs.js');
6
7
  require('react-hook-form');
7
8
  require('framer-motion');
8
9
  require('@jobber/design');
9
- require('classnames');
10
10
  require('./Button-cjs.js');
11
11
 
12
12
  function InputPassword(props) {
@@ -1,10 +1,10 @@
1
1
  import React__default, { useState } from 'react';
2
2
  import { k as FormField } from './FormField-es.js';
3
+ import 'classnames';
3
4
  import './tslib.es6-es.js';
4
5
  import 'react-hook-form';
5
6
  import 'framer-motion';
6
7
  import '@jobber/design';
7
- import 'classnames';
8
8
  import './Button-es.js';
9
9
 
10
10
  function InputPassword(props) {
@@ -4,9 +4,9 @@ var tslib_es6 = require('./tslib.es6-cjs.js');
4
4
  var React = require('react');
5
5
  var reactHookForm = require('react-hook-form');
6
6
  var FormField = require('./FormField-cjs.js');
7
+ require('classnames');
7
8
  require('framer-motion');
8
9
  require('@jobber/design');
9
- require('classnames');
10
10
  require('./Button-cjs.js');
11
11
 
12
12
  var styles = {"mask":"_78-Lxj78xPg-","hiddenValue":"GoiXVXaU1Qs-","spinning":"T3VvmDmzs-4-"};
@@ -73,7 +73,7 @@ function InputPhoneNumber(_a) {
73
73
  : // If there isn't a Form Context being provided, get a form for this field.
74
74
  reactHookForm.useForm({ mode: "onTouched" });
75
75
  return (React.createElement(InputMask, { pattern: pattern, strict: false },
76
- React.createElement(FormField.FormField, Object.assign({}, props, { type: "tel", validations: Object.assign(Object.assign({ required: {
76
+ React.createElement(FormField.FormField, Object.assign({}, props, { type: "tel", pattern: pattern, validations: Object.assign(Object.assign({ required: {
77
77
  value: Boolean(required),
78
78
  message: `${errorSubject} is required`,
79
79
  } }, validations), { validate: getPhoneNumberValidation }) }))));
@@ -2,9 +2,9 @@ import { _ as __rest } from './tslib.es6-es.js';
2
2
  import React__default, { useState, cloneElement } from 'react';
3
3
  import { useFormContext, useForm } from 'react-hook-form';
4
4
  import { k as FormField } from './FormField-es.js';
5
+ import 'classnames';
5
6
  import 'framer-motion';
6
7
  import '@jobber/design';
7
- import 'classnames';
8
8
  import './Button-es.js';
9
9
 
10
10
  var styles = {"mask":"_78-Lxj78xPg-","hiddenValue":"GoiXVXaU1Qs-","spinning":"T3VvmDmzs-4-"};
@@ -71,7 +71,7 @@ function InputPhoneNumber(_a) {
71
71
  : // If there isn't a Form Context being provided, get a form for this field.
72
72
  useForm({ mode: "onTouched" });
73
73
  return (React__default.createElement(InputMask, { pattern: pattern, strict: false },
74
- React__default.createElement(FormField, Object.assign({}, props, { type: "tel", validations: Object.assign(Object.assign({ required: {
74
+ React__default.createElement(FormField, Object.assign({}, props, { type: "tel", pattern: pattern, validations: Object.assign(Object.assign({ required: {
75
75
  value: Boolean(required),
76
76
  message: `${errorSubject} is required`,
77
77
  } }, validations), { validate: getPhoneNumberValidation }) }))));
@@ -3,11 +3,11 @@
3
3
  var React = require('react');
4
4
  var useSafeLayoutEffect = require('../useSafeLayoutEffect-cjs.js');
5
5
  var FormField = require('../FormField-cjs.js');
6
+ require('classnames');
6
7
  var tslib_es6 = require('../tslib.es6-cjs.js');
7
8
  require('react-hook-form');
8
9
  require('framer-motion');
9
10
  require('@jobber/design');
10
- require('classnames');
11
11
  require('../Button-cjs.js');
12
12
  var omit = require('../omit-cjs.js');
13
13
  require('../Icon-cjs.js');
@@ -1,11 +1,11 @@
1
1
  import React__default, { forwardRef, useRef, useImperativeHandle, useId } from 'react';
2
2
  import { u as useSafeLayoutEffect_1 } from '../useSafeLayoutEffect-es.js';
3
3
  import { k as FormField, s as styles, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix, m as mergeRefs } from '../FormField-es.js';
4
+ import 'classnames';
4
5
  import { _ as __rest } from '../tslib.es6-es.js';
5
6
  import 'react-hook-form';
6
7
  import 'framer-motion';
7
8
  import '@jobber/design';
8
- import 'classnames';
9
9
  import '../Button-es.js';
10
10
  import { o as omit } from '../omit-es.js';
11
11
  import '../Icon-es.js';
@@ -4,10 +4,10 @@ var tslib_es6 = require('./tslib.es6-cjs.js');
4
4
  var React = require('react');
5
5
  var debounce = require('./debounce-cjs.js');
6
6
  var FormField = require('./FormField-cjs.js');
7
+ require('classnames');
7
8
  require('react-hook-form');
8
9
  require('framer-motion');
9
10
  require('@jobber/design');
10
- require('classnames');
11
11
  require('./Button-cjs.js');
12
12
 
13
13
  const DEBOUNCE_TIME = 300;
@@ -2,10 +2,10 @@ import { _ as __rest } from './tslib.es6-es.js';
2
2
  import React__default, { useState, useCallback, useEffect, useRef } from 'react';
3
3
  import { d as debounce } from './debounce-es.js';
4
4
  import { k as FormField } from './FormField-es.js';
5
+ import 'classnames';
5
6
  import 'react-hook-form';
6
7
  import 'framer-motion';
7
8
  import '@jobber/design';
8
- import 'classnames';
9
9
  import './Button-es.js';
10
10
 
11
11
  const DEBOUNCE_TIME = 300;
@@ -2,11 +2,11 @@
2
2
 
3
3
  var React = require('react');
4
4
  var FormField = require('./FormField-cjs.js');
5
+ require('classnames');
5
6
  require('./tslib.es6-cjs.js');
6
7
  require('react-hook-form');
7
8
  require('framer-motion');
8
9
  require('@jobber/design');
9
- require('classnames');
10
10
  require('./Button-cjs.js');
11
11
 
12
12
  function Select(props) {
package/dist/Option-es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import React__default from 'react';
2
2
  import { k as FormField } from './FormField-es.js';
3
+ import 'classnames';
3
4
  import './tslib.es6-es.js';
4
5
  import 'react-hook-form';
5
6
  import 'framer-motion';
6
7
  import '@jobber/design';
7
- import 'classnames';
8
8
  import './Button-es.js';
9
9
 
10
10
  function Select(props) {
@@ -5,6 +5,6 @@ import { FormFieldProps } from "../FormField";
5
5
  * Unfortunately Docz doesn't currently support Omit so it has been reduced to
6
6
  * its component parts.
7
7
  */
8
- type SelectProps = Pick<FormFieldProps, Exclude<keyof FormFieldProps, "type" | "rows" | "keyboard" | "actionsRef" | "clearable">>;
8
+ type SelectProps = Pick<FormFieldProps, Exclude<keyof FormFieldProps, "type" | "rows" | "keyboard" | "actionsRef" | "clearable" | "pattern">>;
9
9
  export declare function Select(props: SelectProps): JSX.Element;
10
10
  export {};
package/dist/index.cjs CHANGED
@@ -197,7 +197,7 @@ exports.Avatar = Avatar.Avatar;
197
197
  exports.Banner = Banner.Banner;
198
198
  exports.Box = Box.Box;
199
199
  exports.Button = Button.Button;
200
- exports.useButton = Button.useButton;
200
+ exports.useButtonContext = Button.useButtonContext;
201
201
  exports.useButtonStyles = Button.useButtonStyles;
202
202
  exports.ButtonDismiss = ButtonDismiss.ButtonDismiss;
203
203
  exports.Card = Card.Card;
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import 'react-dom';
16
16
  export { A as Avatar } from './Avatar-es.js';
17
17
  export { B as Banner } from './Banner-es.js';
18
18
  export { B as Box } from './Box-es.js';
19
- export { B as Button, a as useButton, u as useButtonStyles } from './Button-es.js';
19
+ export { B as Button, a as useButtonContext, u as useButtonStyles } from './Button-es.js';
20
20
  export { B as ButtonDismiss } from './ButtonDismiss-es.js';
21
21
  export { C as Card } from './Card-es.js';
22
22
  export { Checkbox } from './Checkbox/index.mjs';
package/dist/styles.css CHANGED
@@ -877,6 +877,11 @@
877
877
  outline: none;
878
878
  }
879
879
 
880
+ .MVhuQuzUBUs- {
881
+ padding-left: calc(var(--field--padding-left) + 4px);
882
+ padding-left: calc(var(--field--padding-left) + var(--space-smaller));
883
+ }
884
+
880
885
  .hGr6YW4AeLM- .yVXYv6hkuOA- {
881
886
  display: -ms-flexbox;
882
887
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.26.1",
3
+ "version": "6.26.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -490,5 +490,5 @@
490
490
  "> 1%",
491
491
  "IE 10"
492
492
  ],
493
- "gitHead": "c6e2e145a9e31df7d2ae1e70d1b7c4d3ac3b1dbf"
493
+ "gitHead": "c4962eacf97393ea78117f7dc77392f1a694c075"
494
494
  }