@jobber/components 6.63.0 → 6.63.2

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.
@@ -35,9 +35,8 @@ export declare namespace FormatFile {
35
35
  readonly children: React.ReactNode;
36
36
  readonly className?: string;
37
37
  }) => React.JSX.Element;
38
- var DeleteButton: ({ onDelete, size, children, }: {
38
+ var DeleteButton: ({ onDelete, children, }: {
39
39
  readonly onDelete?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
40
- readonly size?: "base" | "large";
41
40
  readonly children?: React.ReactNode;
42
41
  }) => React.JSX.Element;
43
42
  }
@@ -9,7 +9,7 @@ var ProgressBar = require('./ProgressBar-cjs.js');
9
9
  var Button = require('./Button-cjs.js');
10
10
  var ConfirmationModal = require('./ConfirmationModal-cjs.js');
11
11
 
12
- var styles = {"formatFile":"y9T1gWK9SHY-","expanded":"_6qcLC0nLki0-","compact":"cSm0ukEQcOU-","wrapper":"TEarBLxe1QY-","large":"rha7bX0NCtI-","base":"_7kv4ujgaxNk-","thumbnail":"Km0E9H-xb-M-","deleteButton":"d2l80-AKBiU-","clickable":"f7xR4ZcqlLo-","hoverable":"LxLX5kFFkfI-","progress":"_121nzRvOA-0-","contentBlock":"cyiC2EalTkQ-","deleteable":"qwQuqw4uODY-","spinning":"dR8gWEecWxc-"};
12
+ var styles = {"formatFile":"y9T1gWK9SHY-","expanded":"_6qcLC0nLki0-","compact":"cSm0ukEQcOU-","wrapper":"TEarBLxe1QY-","large":"rha7bX0NCtI-","base":"_7kv4ujgaxNk-","thumbnail":"Km0E9H-xb-M-","deleteButton":"d2l80-AKBiU-","customDeleteButton":"qDKY-J4vHJA-","clickable":"f7xR4ZcqlLo-","hoverable":"LxLX5kFFkfI-","progress":"_121nzRvOA-0-","contentBlock":"cyiC2EalTkQ-","deleteable":"qwQuqw4uODY-","spinning":"dR8gWEecWxc-"};
13
13
 
14
14
  const useFormatFile = ({ file }) => {
15
15
  const isComplete = file.progress >= 1;
@@ -105,10 +105,11 @@ FormatFile.Expanded = function FormatFileExpanded({ file, fileSize, isVisible, }
105
105
  FormatFile.Wrapper = function FormatFileWrapper({ children, className, }) {
106
106
  return React.createElement("div", { className: className }, children);
107
107
  };
108
- FormatFile.DeleteButton = function FormatFileDeleteButton({ onDelete, size = "base", children, }) {
109
- const buttonSize = size === "base" ? "small" : "base";
108
+ FormatFile.DeleteButton = function FormatFileDeleteButton({ onDelete, children, }) {
110
109
  return (React.createElement(React.Fragment, null,
111
- React.createElement(Button.Button, { onClick: onDelete, variation: "destructive", type: "tertiary", icon: "trash", ariaLabel: "Delete File", size: buttonSize }),
110
+ React.createElement(Button.Button, { UNSAFE_className: {
111
+ container: styles.customDeleteButton,
112
+ }, onClick: onDelete, variation: "destructive", type: "tertiary", icon: "trash", ariaLabel: "Delete File", size: "small" }),
112
113
  children));
113
114
  };
114
115
 
@@ -7,7 +7,7 @@ import { P as ProgressBar } from './ProgressBar-es.js';
7
7
  import { B as Button } from './Button-es.js';
8
8
  import { C as ConfirmationModal } from './ConfirmationModal-es.js';
9
9
 
10
- var styles = {"formatFile":"y9T1gWK9SHY-","expanded":"_6qcLC0nLki0-","compact":"cSm0ukEQcOU-","wrapper":"TEarBLxe1QY-","large":"rha7bX0NCtI-","base":"_7kv4ujgaxNk-","thumbnail":"Km0E9H-xb-M-","deleteButton":"d2l80-AKBiU-","clickable":"f7xR4ZcqlLo-","hoverable":"LxLX5kFFkfI-","progress":"_121nzRvOA-0-","contentBlock":"cyiC2EalTkQ-","deleteable":"qwQuqw4uODY-","spinning":"dR8gWEecWxc-"};
10
+ var styles = {"formatFile":"y9T1gWK9SHY-","expanded":"_6qcLC0nLki0-","compact":"cSm0ukEQcOU-","wrapper":"TEarBLxe1QY-","large":"rha7bX0NCtI-","base":"_7kv4ujgaxNk-","thumbnail":"Km0E9H-xb-M-","deleteButton":"d2l80-AKBiU-","customDeleteButton":"qDKY-J4vHJA-","clickable":"f7xR4ZcqlLo-","hoverable":"LxLX5kFFkfI-","progress":"_121nzRvOA-0-","contentBlock":"cyiC2EalTkQ-","deleteable":"qwQuqw4uODY-","spinning":"dR8gWEecWxc-"};
11
11
 
12
12
  const useFormatFile = ({ file }) => {
13
13
  const isComplete = file.progress >= 1;
@@ -103,10 +103,11 @@ FormatFile.Expanded = function FormatFileExpanded({ file, fileSize, isVisible, }
103
103
  FormatFile.Wrapper = function FormatFileWrapper({ children, className, }) {
104
104
  return React__default.createElement("div", { className: className }, children);
105
105
  };
106
- FormatFile.DeleteButton = function FormatFileDeleteButton({ onDelete, size = "base", children, }) {
107
- const buttonSize = size === "base" ? "small" : "base";
106
+ FormatFile.DeleteButton = function FormatFileDeleteButton({ onDelete, children, }) {
108
107
  return (React__default.createElement(React__default.Fragment, null,
109
- React__default.createElement(Button, { onClick: onDelete, variation: "destructive", type: "tertiary", icon: "trash", ariaLabel: "Delete File", size: buttonSize }),
108
+ React__default.createElement(Button, { UNSAFE_className: {
109
+ container: styles.customDeleteButton,
110
+ }, onClick: onDelete, variation: "destructive", type: "tertiary", icon: "trash", ariaLabel: "Delete File", size: "small" }),
110
111
  children));
111
112
  };
112
113
 
@@ -126,25 +126,24 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
126
126
  };
127
127
  }
128
128
 
129
- const InputDateRebuilt = React.forwardRef(function InputDateInternal(props, inputRefs) {
129
+ const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
130
130
  const { onChange } = props;
131
131
  return (React.createElement(DatePicker.DatePicker, { selected: props.value, onChange: newValue => {
132
132
  onChange(newValue);
133
133
  }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator }));
134
134
  function InputDateActivator(activatorProps) {
135
135
  const { onClick, value } = activatorProps;
136
- const newActivatorProps = omit.omit(activatorProps, ["activator", "fullWidth"]);
137
136
  const { handleChange, handleFocus, handleBlur, isFocused } = useInputDateActivatorActions({
138
- onChange: newActivatorProps.onChange,
137
+ onChange: activatorProps.onChange,
139
138
  onFocus: event => {
140
139
  var _a, _b;
141
140
  (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
142
- (_b = newActivatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(newActivatorProps);
141
+ (_b = activatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
143
142
  },
144
143
  onBlur: event => {
145
144
  var _a, _b;
146
145
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
147
- (_b = newActivatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(newActivatorProps);
146
+ (_b = activatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
148
147
  },
149
148
  });
150
149
  const suffix = props.showIcon !== false
@@ -158,15 +157,16 @@ const InputDateRebuilt = React.forwardRef(function InputDateInternal(props, inpu
158
157
  return (
159
158
  // We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
160
159
  React.createElement("div", { onClick: onClick },
161
- React.createElement(InputText_index.InputText, Object.assign({}, newActivatorProps, props, { version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: inputRefs, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
160
+ React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-invalid": activatorProps.ariaInvalid === "true" ? true : false, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
162
161
  var _a, _b;
163
162
  if (props.showIcon === false && event.key === "ArrowDown") {
164
163
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
165
164
  }
166
165
  (_b = props.onKeyDown) === null || _b === void 0 ? void 0 : _b.call(props, event);
167
- }, onChange: handleChange }))));
166
+ }, onChange: handleChange })));
168
167
  }
169
168
  });
169
+ InputDateRebuilt.displayName = "InputDateRebuilt";
170
170
 
171
171
  function isNewInputDateProps(props) {
172
172
  return props.version === 2;
@@ -124,25 +124,24 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
124
124
  };
125
125
  }
126
126
 
127
- const InputDateRebuilt = forwardRef(function InputDateInternal(props, inputRefs) {
127
+ const InputDateRebuilt = forwardRef((props, forwardedRef) => {
128
128
  const { onChange } = props;
129
129
  return (React__default.createElement(DatePicker, { selected: props.value, onChange: newValue => {
130
130
  onChange(newValue);
131
131
  }, disabled: props.disabled, readonly: props.readOnly, fullWidth: !props.inline, minDate: props.minDate, maxDate: props.maxDate, smartAutofocus: false, activator: InputDateActivator }));
132
132
  function InputDateActivator(activatorProps) {
133
133
  const { onClick, value } = activatorProps;
134
- const newActivatorProps = omit(activatorProps, ["activator", "fullWidth"]);
135
134
  const { handleChange, handleFocus, handleBlur, isFocused } = useInputDateActivatorActions({
136
- onChange: newActivatorProps.onChange,
135
+ onChange: activatorProps.onChange,
137
136
  onFocus: event => {
138
137
  var _a, _b;
139
138
  (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
140
- (_b = newActivatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(newActivatorProps);
139
+ (_b = activatorProps.onFocus) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
141
140
  },
142
141
  onBlur: event => {
143
142
  var _a, _b;
144
143
  (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
145
- (_b = newActivatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(newActivatorProps);
144
+ (_b = activatorProps.onBlur) === null || _b === void 0 ? void 0 : _b.call(activatorProps);
146
145
  },
147
146
  });
148
147
  const suffix = props.showIcon !== false
@@ -156,15 +155,16 @@ const InputDateRebuilt = forwardRef(function InputDateInternal(props, inputRefs)
156
155
  return (
157
156
  // We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
158
157
  React__default.createElement("div", { onClick: onClick },
159
- React__default.createElement(InputText, Object.assign({}, newActivatorProps, props, { version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: inputRefs, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
158
+ React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-invalid": activatorProps.ariaInvalid === "true" ? true : false, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
160
159
  var _a, _b;
161
160
  if (props.showIcon === false && event.key === "ArrowDown") {
162
161
  (_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
163
162
  }
164
163
  (_b = props.onKeyDown) === null || _b === void 0 ? void 0 : _b.call(props, event);
165
- }, onChange: handleChange }))));
164
+ }, onChange: handleChange })));
166
165
  }
167
166
  });
167
+ InputDateRebuilt.displayName = "InputDateRebuilt";
168
168
 
169
169
  function isNewInputDateProps(props) {
170
170
  return props.version === 2;
@@ -211,7 +211,7 @@ function InputTimeRebuilt(_a) {
211
211
  const { inputStyle } = FormField.useFormFieldWrapperStyles(params);
212
212
  const id = getId(params);
213
213
  return (React.createElement(FormField.FormFieldWrapper, { disabled: params.disabled, size: params.size, align: params.align, inline: params.inline, name: params.name, error: params.error || "", identifier: id, descriptionIdentifier: `descriptionUUID--${id}`, invalid: Boolean(params.invalid), description: params.description, clearable: (_c = params.clearable) !== null && _c !== void 0 ? _c : "never", onClear: handleClear, type: "time", readonly: params.readonly, placeholder: params.placeholder, value: dateToTimeString(value) },
214
- React.createElement("input", { ref: ref, type: "time", name: params.name, className: inputStyle, onBlur: handleBlur, disabled: params.disabled, readOnly: params.readonly, onChange: handleChangeEvent, onFocus: handleFocus, "data-testid": "ATL-InputTime-input", onKeyUp: e => {
214
+ React.createElement("input", { ref: ref, type: "time", name: params.name, className: inputStyle, onBlur: handleBlur, id: id, disabled: params.disabled, readOnly: params.readonly, onChange: handleChangeEvent, onFocus: handleFocus, "data-testid": "ATL-InputTime-input", onKeyUp: e => {
215
215
  if (params.disabled || params.readonly)
216
216
  return;
217
217
  !isNaN(parseInt(e.key, 10)) && setTypedTime(prev => prev + e.key);
@@ -209,7 +209,7 @@ function InputTimeRebuilt(_a) {
209
209
  const { inputStyle } = useFormFieldWrapperStyles(params);
210
210
  const id = getId(params);
211
211
  return (React__default.createElement(FormFieldWrapper, { disabled: params.disabled, size: params.size, align: params.align, inline: params.inline, name: params.name, error: params.error || "", identifier: id, descriptionIdentifier: `descriptionUUID--${id}`, invalid: Boolean(params.invalid), description: params.description, clearable: (_c = params.clearable) !== null && _c !== void 0 ? _c : "never", onClear: handleClear, type: "time", readonly: params.readonly, placeholder: params.placeholder, value: dateToTimeString(value) },
212
- React__default.createElement("input", { ref: ref, type: "time", name: params.name, className: inputStyle, onBlur: handleBlur, disabled: params.disabled, readOnly: params.readonly, onChange: handleChangeEvent, onFocus: handleFocus, "data-testid": "ATL-InputTime-input", onKeyUp: e => {
212
+ React__default.createElement("input", { ref: ref, type: "time", name: params.name, className: inputStyle, onBlur: handleBlur, id: id, disabled: params.disabled, readOnly: params.readonly, onChange: handleChangeEvent, onFocus: handleFocus, "data-testid": "ATL-InputTime-input", onKeyUp: e => {
213
213
  if (params.disabled || params.readonly)
214
214
  return;
215
215
  !isNaN(parseInt(e.key, 10)) && setTypedTime(prev => prev + e.key);
package/dist/styles.css CHANGED
@@ -7456,6 +7456,16 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
7456
7456
  z-index: var(--elevation-base);
7457
7457
  }
7458
7458
 
7459
+ .cSm0ukEQcOU- .qDKY-J4vHJA- {
7460
+ border-radius: 4px;
7461
+ border-radius: var(--radius-small);
7462
+ }
7463
+
7464
+ .cSm0ukEQcOU-._7kv4ujgaxNk- .qDKY-J4vHJA- {
7465
+ max-width: 24px;
7466
+ min-height: 24px;
7467
+ }
7468
+
7459
7469
  ._6qcLC0nLki0- .Km0E9H-xb-M- {
7460
7470
  border-right: none;
7461
7471
  border-bottom-left-radius: 8px;
@@ -7520,22 +7530,18 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
7520
7530
  top: var(--space-smaller);
7521
7531
  right: 4px;
7522
7532
  right: var(--space-smaller);
7533
+ box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
7534
+ box-shadow: var(--shadow-base);
7523
7535
  }
7524
7536
 
7525
- @media (min-width: 768px) {
7526
- .qwQuqw4uODY- ~ .d2l80-AKBiU- {
7527
- visibility: hidden;
7528
- }
7529
-
7530
- .d2l80-AKBiU-:focus-within,
7531
- .d2l80-AKBiU-:hover,
7532
- .qwQuqw4uODY-:hover ~ .d2l80-AKBiU-,
7533
- .qwQuqw4uODY-:focus ~ .d2l80-AKBiU- {
7534
- visibility: visible;
7535
- }
7537
+ .cSm0ukEQcOU-.rha7bX0NCtI- .d2l80-AKBiU- {
7538
+ top: 8px;
7539
+ top: var(--space-small);
7540
+ right: 8px;
7541
+ right: var(--space-small);
7536
7542
  }
7537
7543
 
7538
- @media (--medium-screens-and-up) {
7544
+ @media (any-pointer: fine) {
7539
7545
  .qwQuqw4uODY- ~ .d2l80-AKBiU- {
7540
7546
  visibility: hidden;
7541
7547
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.63.0",
3
+ "version": "6.63.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -542,5 +542,5 @@
542
542
  "> 1%",
543
543
  "IE 10"
544
544
  ],
545
- "gitHead": "d297fd78aac12e2d69ae1692d49df59721ded766"
545
+ "gitHead": "1d09b31023be41c83ba1824bf4202ae6dbbcd8ff"
546
546
  }