@agilant/toga-blox 1.0.318-beta.13 → 1.0.318-beta.14

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.
Files changed (67) hide show
  1. package/dist/components/AdvancedSelect/AdvancedSelect.js +1 -1
  2. package/dist/components/AdvancedSelect/AdvancedSelect.module.css +19 -18
  3. package/dist/components/BaseAddress/BaseAddress.module.css +1 -2
  4. package/dist/components/BaseDetailField/BaseDetailField.js +2 -2
  5. package/dist/components/BaseDetailField/BaseDetailField.module.css +2 -3
  6. package/dist/components/BaseDetailField/renderBaseDetailFieldLabel.d.ts +1 -1
  7. package/dist/components/BaseDetailField/renderBaseDetailFieldLabel.js +4 -2
  8. package/dist/components/BaseDetailField/types.d.ts +1 -0
  9. package/dist/components/BaseInput/BaseCheckbox.d.ts +1 -0
  10. package/dist/components/BaseInput/BaseCheckbox.js +2 -2
  11. package/dist/components/BaseInput/BaseInput.js +8 -8
  12. package/dist/components/BaseInput/BaseInput.module.css +22 -8
  13. package/dist/components/BaseInput/BaseInput.types.d.ts +1 -0
  14. package/dist/components/BaseInput/BaseRadio.d.ts +1 -0
  15. package/dist/components/BaseInput/BaseRadio.js +2 -2
  16. package/dist/components/BaseInput/BaseTextInput.d.ts +1 -0
  17. package/dist/components/BaseInput/BaseTextInput.js +21 -8
  18. package/dist/components/BaseInput/BaseTextareaInput.d.ts +1 -0
  19. package/dist/components/BaseInput/BaseTextareaInput.js +2 -2
  20. package/dist/components/BaseInput/BaseToggle.d.ts +1 -0
  21. package/dist/components/BaseInput/BaseToggle.js +2 -2
  22. package/dist/components/BaseToolTip/BaseToolTip.module.css +5 -2
  23. package/dist/components/BaseTotals/BaseTotals.js +6 -2
  24. package/dist/components/BaseTotals/BaseTotals.module.css +17 -2
  25. package/dist/components/BaseTotals/types.d.ts +4 -1
  26. package/dist/components/EnvironmentBadge/EnvironmentBadge.css +55 -0
  27. package/dist/components/EnvironmentBadge/EnvironmentBadge.d.ts +4 -0
  28. package/dist/components/EnvironmentBadge/EnvironmentBadge.js +19 -0
  29. package/dist/components/EnvironmentBadge/index.d.ts +1 -0
  30. package/dist/components/EnvironmentBadge/index.js +1 -0
  31. package/dist/components/Table/components/cellTypes/CopyableCell.d.ts +2 -1
  32. package/dist/components/Table/components/cellTypes/CopyableCell.js +4 -3
  33. package/dist/components/Table/components/cellTypes/ImageCell.d.ts +4 -0
  34. package/dist/components/Table/components/cellTypes/ImageCell.js +4 -0
  35. package/dist/components/Table/hooks/index.d.ts +1 -0
  36. package/dist/components/Table/hooks/index.js +1 -0
  37. package/dist/components/Table/hooks/useAssignTableFieldLabels.d.ts +16 -0
  38. package/dist/components/Table/hooks/useAssignTableFieldLabels.js +39 -0
  39. package/dist/components/Table/index.d.ts +1 -0
  40. package/dist/components/Table/index.js +1 -0
  41. package/dist/components/Table/themeConfig/toga.module.css +39 -0
  42. package/dist/components/Table/utils/buildTanstackColumns.js +26 -6
  43. package/dist/components/Table/utils/resolveCellType.d.ts +1 -1
  44. package/dist/components/Table/utils/resolveCellType.js +13 -9
  45. package/dist/components/TableRecordModal/TableRecordModal.d.ts +2 -1
  46. package/dist/components/TableRecordModal/TableRecordModal.js +2 -2
  47. package/dist/components/TableRecordModal/tableRecordModal.module.css +105 -115
  48. package/dist/components/ToggleButton/ToggleButton.js +2 -2
  49. package/dist/components/ToggleButton/ToggleButton.module.css +15 -7
  50. package/dist/components/ToggleButton/ToggleButton.types.d.ts +1 -0
  51. package/dist/components/index.d.ts +1 -1
  52. package/dist/components/index.js +1 -1
  53. package/dist/main.css +1 -3
  54. package/dist/reactQuery/queryHelpers.js +8 -4
  55. package/dist/templates/AddNotes/AddNotes.module.css +5 -1
  56. package/dist/templates/PrimaryTable/PrimaryTable.js +1 -1
  57. package/dist/utils/getEndpointFromEnvironment.d.ts +18 -0
  58. package/dist/utils/getEndpointFromEnvironment.js +46 -0
  59. package/package.json +1 -1
  60. package/dist/components/BaseInput/BaseCheckBox.module.css +0 -48
  61. package/dist/components/ModalTag/ModalTag.d.ts +0 -4
  62. package/dist/components/ModalTag/ModalTag.js +0 -9
  63. package/dist/components/ModalTag/ModalTag.module.css +0 -22
  64. package/dist/components/ModalTag/index.d.ts +0 -3
  65. package/dist/components/ModalTag/index.js +0 -2
  66. package/dist/components/ModalTag/types.d.ts +0 -7
  67. package/dist/components/ModalTag/types.js +0 -1
@@ -239,7 +239,7 @@ function AdvancedSelect(props) {
239
239
  }, onFocus: openMenu, onKeyDown: onKeyDown })] }), _jsxs("div", { className: classes.indicators, children: [hasAnyValue && (_jsx("button", { type: "button", className: classes.indicatorBtn, disabled: disabled, onClick: (e) => {
240
240
  e.stopPropagation();
241
241
  clearAll();
242
- }, "aria-label": "Clear", children: getFontAwesomeIcon("xmark", "regular") })), _jsx("button", { type: "button", className: classes.indicatorBtn, disabled: disabled, onClick: (e) => {
242
+ }, "aria-label": "Clear", children: _jsx("span", { className: classes.clearSingleInput, children: getFontAwesomeIcon("xmark", "regular") }) })), _jsx("button", { type: "button", className: classes.indicatorBtn, disabled: disabled, onClick: (e) => {
243
243
  e.stopPropagation();
244
244
  if (open)
245
245
  closeMenu();
@@ -27,6 +27,7 @@
27
27
 
28
28
  &.multi {
29
29
  min-height: var(--advancedSelect-row-min-height);
30
+ padding: var(--advancedSelect-row-padding);
30
31
  }
31
32
 
32
33
  &:hover {
@@ -161,7 +162,7 @@
161
162
 
162
163
  .input::placeholder {
163
164
  color: var(--baseInput-placeholder-text-default);
164
- font-size: var(--baseInput-font-size-small, 0.875rem);
165
+ font-size: var(--baseInput-font-size-default, 0.875rem);
165
166
  }
166
167
 
167
168
  .chip {
@@ -172,8 +173,12 @@
172
173
  border-radius: var(--baseInputMultiSelect-border-radius, 0.25rem);
173
174
  background: var(--baseInputMultiSelect-bg-default);
174
175
  color: var(--baseInputMultiSelect-text-default);
175
- font-size: var(--baseInput-font-size-small, 0.875rem);
176
+ font-size: var(--baseInput-font-size-default, 0.875rem);
176
177
  line-height: 1.2;
178
+
179
+ &:hover {
180
+ background: var(--baseInputMultiSelect-bg-hover);
181
+ }
177
182
  }
178
183
 
179
184
  .chipRemove {
@@ -182,18 +187,9 @@
182
187
  justify-content: center;
183
188
  background: transparent;
184
189
  border: none;
185
- padding: 0;
190
+ padding: 1px;
186
191
  cursor: pointer;
187
192
  color: inherit;
188
- opacity: 0.7;
189
-
190
- svg {
191
- color: #FFF;
192
- }
193
- }
194
-
195
- .chipRemove:hover {
196
- opacity: 1;
197
193
  }
198
194
 
199
195
  .indicators {
@@ -210,16 +206,20 @@
210
206
  background: transparent;
211
207
  border: none;
212
208
  cursor: pointer;
213
- color: var(--baseInput-dropdownIndicator-default);
209
+ color: var(--baseInput-dropdownIndicator-text-default);
214
210
  line-height: 1;
215
-
216
- svg {
217
- color: #677FD5;
211
+
212
+ &:hover {
213
+ color: var(--baseInput-dropdownIndicator-text-focusAndHover);
218
214
  }
219
215
  }
220
216
 
221
- .indicatorBtn:hover {
222
- color: var(--baseInput-dropdownIndicator-text-focusAndHover);
217
+ .clearSingleInput {
218
+ color: var(--baseInput-clearIndicator-text-default);
219
+
220
+ &:hover {
221
+ color: var(--baseInput-clearIndicator-text-hover);
222
+ }
223
223
  }
224
224
 
225
225
  .indicatorBtn:disabled {
@@ -298,6 +298,7 @@
298
298
  border-radius: var(--baseInputOptionCheckbox-border-radius);
299
299
  border: var(--baseInputOptionCheckbox-border);
300
300
  padding: var(--baseInputOptionCheckbox-padding);
301
+ flex-shrink: 0;
301
302
  cursor: pointer;
302
303
  }
303
304
 
@@ -2,8 +2,7 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: flex-start;
5
- gap: var(--address-line-gap, 0.125rem);
6
- }
5
+ }
7
6
 
8
7
  .addressee {
9
8
  font-size: var(--address-line-font-size, 0.875rem);
@@ -5,10 +5,10 @@ import renderBaseDetailFieldLabel from "./renderBaseDetailFieldLabel.js";
5
5
  import styles from "./BaseDetailField.module.css";
6
6
  const IconWrapper = ({ icon, weight, }) => (_jsx("div", { className: styles.icon, children: getFontAwesomeIcon(icon, weight ?? "regular") }));
7
7
  const ValueImage = ({ src, alt }) => (_jsx("div", { className: styles.valueImage, children: _jsx("img", { src: src, alt: alt || "" }) }));
8
- const BaseDetailField = ({ dataItem, field, allFields, allData, iconStyle = "solid", isDisabled, dataTestId, currencyCharacter, labelSuffixValue, showSecondValue, }) => {
8
+ const BaseDetailField = ({ dataItem, field, allFields, allData, iconStyle = "solid", isDisabled, dataTestId, currencyCharacter, labelSuffixValue, showSecondValue, dtLabelClassName }) => {
9
9
  if (!field)
10
10
  return null;
11
11
  const { uuid, hasBottomBorder, hasTopBorder, hideLabel, hasValueLeftIconOne, valueIconOneWeight, hasValueLeftIconTwo, valueIconTwoWeight, hasValueImage, valueImageAlt, hasValueRightIcon, valueType, colSpan, } = field;
12
- return (_jsx("div", { className: styles.container, style: { "--field-col-span": colSpan ?? 1 }, "data-testid": dataTestId ?? "base-detail-field", "data-disabled": isDisabled || undefined, "data-has-bottom-border": hasBottomBorder || undefined, "data-has-top-border": hasTopBorder || undefined, children: _jsxs("dl", { className: styles.inner, children: [_jsx("dt", { className: hideLabel ? styles.labelHidden : styles.label, children: renderBaseDetailFieldLabel(field, labelSuffixValue) }), _jsxs("dd", { className: styles.value, children: [hasValueLeftIconOne && (_jsx(IconWrapper, { icon: hasValueLeftIconOne, weight: valueIconOneWeight })), hasValueLeftIconTwo && (_jsx(IconWrapper, { icon: hasValueLeftIconTwo, weight: valueIconTwoWeight })), hasValueImage && dataItem !== "—" && (_jsx(ValueImage, { src: hasValueImage, alt: valueImageAlt })), renderBaseDetailFieldValue(field, dataItem, isDisabled, allFields, allData, currencyCharacter, showSecondValue), hasValueRightIcon && (_jsx(IconWrapper, { icon: hasValueRightIcon, weight: iconStyle }))] })] }) }, uuid));
12
+ return (_jsx("div", { className: styles.container, style: { "--field-col-span": colSpan ?? 1 }, "data-testid": dataTestId ?? "base-detail-field", "data-disabled": isDisabled || undefined, "data-has-bottom-border": hasBottomBorder || undefined, "data-has-top-border": hasTopBorder || undefined, children: _jsxs("dl", { className: styles.inner, children: [_jsx("dt", { className: hideLabel ? styles.labelHidden : styles.label, children: renderBaseDetailFieldLabel(field, labelSuffixValue, dtLabelClassName) }), _jsxs("dd", { className: styles.value, children: [hasValueLeftIconOne && (_jsx(IconWrapper, { icon: hasValueLeftIconOne, weight: valueIconOneWeight })), hasValueLeftIconTwo && (_jsx(IconWrapper, { icon: hasValueLeftIconTwo, weight: valueIconTwoWeight })), hasValueImage && dataItem !== "—" && (_jsx(ValueImage, { src: hasValueImage, alt: valueImageAlt })), renderBaseDetailFieldValue(field, dataItem, isDisabled, allFields, allData, currencyCharacter, showSecondValue), hasValueRightIcon && (_jsx(IconWrapper, { icon: hasValueRightIcon, weight: iconStyle }))] })] }) }, uuid));
13
13
  };
14
14
  export default BaseDetailField;
@@ -7,7 +7,7 @@
7
7
 
8
8
  .inner {
9
9
  display: flex;
10
- gap: 0.5rem;
10
+ gap: var(--field-label-gap, 2px);
11
11
  width: 100%;
12
12
  flex-wrap: wrap;
13
13
  flex-direction: var(--field-flex-direction, row);
@@ -29,7 +29,7 @@
29
29
  white-space: var(--field-label-white-space, nowrap);
30
30
  color: var(--field-label-color, inherit);
31
31
  font-size: var(--field-label-font-size, 0.875rem);
32
- font-family: var(--field-label-fontFamily-default, inherit)
32
+ font-family: var(--field-label-fontFamily-default, inherit);
33
33
  }
34
34
 
35
35
  .labelHidden {
@@ -126,7 +126,6 @@
126
126
  pointer-events: none;
127
127
  }
128
128
 
129
-
130
129
  .labelWithBadge {
131
130
  display: flex;
132
131
  align-items: center;
@@ -1,3 +1,3 @@
1
1
  import { FieldConfig } from "../DetailSection/types.js";
2
- declare const renderBaseDetailFieldLabel: (field: FieldConfig, labelSuffixValue?: string) => import("react/jsx-runtime").JSX.Element;
2
+ declare const renderBaseDetailFieldLabel: (field: FieldConfig, labelSuffixValue?: string, dtLabelClassName?: string) => import("react/jsx-runtime").JSX.Element;
3
3
  export default renderBaseDetailFieldLabel;
@@ -1,12 +1,14 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // renderBaseDetailFieldLabel.tsx
3
+ import clsx from "clsx";
2
4
  import { BaseToolTip } from "../index.js";
3
5
  // import { renderBadge } from "../../utils/index.js";
4
6
  import styles from "./BaseDetailField.module.css";
5
- const renderBaseDetailFieldLabel = (field, labelSuffixValue) => {
7
+ const renderBaseDetailFieldLabel = (field, labelSuffixValue, dtLabelClassName) => {
6
8
  const { label, labelSuffix, labelTooltip } = field || {};
7
9
  const labelHasBadge = labelSuffix?.type === "badge" && labelSuffixValue;
8
10
  if (!label)
9
11
  return null;
10
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: labelHasBadge ? styles.labelWithBadge : styles.label, children: label }), labelTooltip && (_jsx(BaseToolTip, { message: labelTooltip, icon: "circleInfo", toolTipPlacement: "right" }))] }));
12
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: clsx(labelHasBadge ? styles.labelWithBadge : styles.label, dtLabelClassName), children: label }), labelTooltip && (_jsx(BaseToolTip, { message: labelTooltip, icon: "circleInfo", toolTipPlacement: "right" }))] }));
11
13
  };
12
14
  export default renderBaseDetailFieldLabel;
@@ -10,4 +10,5 @@ export type BaseDetailFieldProps<TData = any> = {
10
10
  labelSuffixValue?: string;
11
11
  dataTestId?: string;
12
12
  showSecondValue?: boolean;
13
+ dtLabelClassName?: string;
13
14
  };
@@ -2,6 +2,7 @@ interface BaseCheckboxProps {
2
2
  control: any;
3
3
  valueKey: string;
4
4
  defaultValue: boolean;
5
+ isDisabled?: boolean;
5
6
  }
6
7
  declare const BaseCheckbox: React.FC<BaseCheckboxProps>;
7
8
  export default BaseCheckbox;
@@ -4,8 +4,8 @@ import { Controller } from "react-hook-form";
4
4
  import styles from "./BaseInput.module.css";
5
5
  import clsx from "clsx";
6
6
  const BaseCheckbox = (props) => {
7
- const { control, valueKey, defaultValue, } = props;
8
- return (_jsx(Controller, { name: valueKey, control: control, defaultValue: defaultValue, render: ({ field }) => (_jsxs("div", { className: styles.checkboxWrapper, children: [_jsx("input", { type: "checkbox", className: clsx(styles.checkbox), id: valueKey, checked: field.value, onChange: (e) => {
7
+ const { control, valueKey, defaultValue, isDisabled, } = props;
8
+ return (_jsx(Controller, { name: valueKey, control: control, defaultValue: defaultValue, render: ({ field }) => (_jsxs("div", { className: styles.checkboxWrapper, children: [_jsx("input", { type: "checkbox", className: clsx(styles.checkbox), disabled: isDisabled, id: valueKey, checked: field.value, onChange: (e) => {
9
9
  field.onChange(e.target.checked);
10
10
  } }), _jsx("span", { className: styles.checkboxIconWrapper, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3.5 w-3.5", viewBox: "0 0 20 20", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) }) })] })) }));
11
11
  };
@@ -10,7 +10,7 @@ import BaseRadioInput from "./BaseRadio.js";
10
10
  import clsx from "clsx";
11
11
  import styles from "./BaseInput.module.css";
12
12
  import BaseTextInput from "./BaseTextInput.js";
13
- const BaseInput = ({ dataItem, field, uuid, dynamicDefaultValue, isArrayValue, onBlur, menuPlacement, valueKey, requireUuidField, afterInputTextClasses, afterInputText, disabledSelectText = "Not Editable", colSpan, onSearchChange, toggleTextPosition = "right", toggleAdditionalClasses, toggleHasDivider = false, toggleActiveLabel = "Yes", toggleInactiveLabel = "No", }) => {
13
+ const BaseInput = ({ dataItem, field, uuid, dynamicDefaultValue, isArrayValue, onBlur, menuPlacement, valueKey, requireUuidField, afterInputTextClasses, afterInputText, disabledSelectText = "Not Editable", colSpan, onSearchChange, toggleTextPosition = "right", toggleAdditionalClasses, toggleHasDivider = false, toggleActiveLabel = "Yes", toggleInactiveLabel = "No", disabled }) => {
14
14
  const input = field;
15
15
  const { register, control, watch, getValues, formState: { errors, dirtyFields }, setValue, } = useFormContext();
16
16
  const handleInputChange = (inputValue) => {
@@ -61,20 +61,20 @@ const BaseInput = ({ dataItem, field, uuid, dynamicDefaultValue, isArrayValue, o
61
61
  return (_jsxs("div", { className: clsx(styles.inputAndLabelWrapper, colSpan && getColSpanClass(colSpan)), children: [_jsxs("label", { htmlFor: input.valueKey, className: clsx(styles.label), children: [input.inputLabel, input.isRequired && input.showRequiredIndicator && (_jsx("span", { className: styles.requiredAsterisk, children: "*" }))] }), (() => {
62
62
  switch (input.inputType) {
63
63
  case "text":
64
- return (_jsx(BaseTextInput, { uuid: input.uuid, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), control: control, onBlur: onBlur, inputHasLeftIcon: input.inputHasLeftIcon, isRequired: input.isRequired, showRequiredIndicator: input.showRequiredIndicator, valueType: input.valueType, valueKey: input.valueKey, requireUuidField: input.requireUuidField, hasTypeCheck: input.hasTypeCheck, placeholder: input.placeholder, errorMessage: errorMessage, isFieldDirty: isFieldDirty, isFieldError: isFieldError }));
64
+ return (_jsx(BaseTextInput, { uuid: input.uuid, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), control: control, onBlur: onBlur, inputHasLeftIcon: input.inputHasLeftIcon, isRequired: input.isRequired, showRequiredIndicator: input.showRequiredIndicator, valueType: input.valueType, valueKey: input.valueKey, requireUuidField: input.requireUuidField, hasTypeCheck: input.hasTypeCheck, placeholder: input.placeholder, errorMessage: errorMessage, isFieldDirty: isFieldDirty, isFieldError: isFieldError, isDisabled: disabled }));
65
65
  case "toggle":
66
66
  return (_jsx(BaseToggle, { control: control, valueKey: input.valueKey, defaultValue: dataItem
67
67
  ? dataItem[input.valueKey]
68
- : "", toggleTextPosition: toggleTextPosition, toggleAdditionalClasses: toggleAdditionalClasses, toggleHasDivider: toggleHasDivider, toggleActiveLabel: toggleActiveLabel, toggleInactiveLabel: toggleInactiveLabel }));
68
+ : "", toggleTextPosition: toggleTextPosition, toggleAdditionalClasses: toggleAdditionalClasses, toggleHasDivider: toggleHasDivider, toggleActiveLabel: toggleActiveLabel, toggleInactiveLabel: toggleInactiveLabel, isDisabled: disabled }));
69
69
  case "textArea":
70
- return (_jsx(BaseTextareaInput, { watch: watch, control: control, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), valueKey: input.valueKey, errorMessage: errorMessage, isFieldDirty: isFieldDirty, isFieldError: isFieldError, placeholder: input.placeholder, characterLimit: input.characterLimit }));
70
+ return (_jsx(BaseTextareaInput, { watch: watch, control: control, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), valueKey: input.valueKey, errorMessage: errorMessage, isFieldDirty: isFieldDirty, isFieldError: isFieldError, placeholder: input.placeholder, characterLimit: input.characterLimit, isDisabled: disabled }));
71
71
  case "disabledSelect":
72
72
  return (_jsx(DisabledSelect, { disabledSelectText: disabledSelectText, labelTextClasses: styles.label }));
73
73
  case "checkbox":
74
- return (_jsx(BaseCheckbox, { control: control, valueKey: input.valueKey, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey) }));
74
+ return (_jsx(BaseCheckbox, { control: control, valueKey: input.valueKey, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), isDisabled: disabled }));
75
75
  case "advancedSelect":
76
76
  case "advancedMultiSelect":
77
- return (_jsx(Controller, { control: control, name: input.valueKey, render: ({ field: rhfField }) => (_jsx(AdvancedSelect, { isFieldDirty: isFieldDirty, isFieldError: isFieldError, mode: input.inputType ===
77
+ return (_jsx(Controller, { control: control, name: input.valueKey, render: ({ field: rhfField }) => (_jsx(AdvancedSelect, { isFieldDirty: isFieldDirty, isFieldError: isFieldError, disabled: disabled, mode: input.inputType ===
78
78
  "advancedMultiSelect"
79
79
  ? "multi"
80
80
  : "single", data: input.data ??
@@ -87,11 +87,11 @@ const BaseInput = ({ dataItem, field, uuid, dynamicDefaultValue, isArrayValue, o
87
87
  i?.label ??
88
88
  String(i)), hasMorePages: input.hasMorePages, isFetchingMore: input.isFetchingMore, fetchMoreData: input.fetchMoreData, findSpecificValue: input.findSpecificValue, placeholder: input.placeholder, valueKey: input.valueKey })) }));
89
89
  case "radio":
90
- return (_jsx(BaseRadioInput, { control: control, valueKey: input.valueKey, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), options: input.options }));
90
+ return (_jsx(BaseRadioInput, { control: control, valueKey: input.valueKey, defaultValue: getDefaultValue(dynamicDefaultValue, input.valueKey), options: input.options, isDisabled: disabled }));
91
91
  default:
92
92
  return null;
93
93
  }
94
- })(), input.afterInputText && (_jsx("div", { className: "flex items-center ml-2 text-nowrap", children: _jsx("p", { className: `${afterInputTextClasses}`, children: afterInputText }) }))] }, input.uuid));
94
+ })(), input.afterInputText && (_jsx("div", { className: styles.afterInputText, children: _jsx("p", { className: `${afterInputTextClasses}`, children: afterInputText }) }))] }, input.uuid));
95
95
  };
96
96
  return input && _jsx(_Fragment, { children: getInput(input) });
97
97
  };
@@ -12,6 +12,7 @@
12
12
  width: var(--baseInputAndWrapper-width);
13
13
  min-height: var(--baseInputAndWrapper-height);
14
14
  display: flex;
15
+ flex-wrap: wrap;
15
16
  align-items: center;
16
17
  gap: var(--baseInputAndWrapper-gap, 0.5rem);
17
18
 
@@ -21,9 +22,8 @@
21
22
  }
22
23
 
23
24
  .label {
24
- color: var(--field-label-color);
25
+ color: var(--baseInput-label-text);
25
26
  letter-spacing: var(--field-label-letter-spacing);
26
- text-wrap: nowrap;
27
27
  }
28
28
 
29
29
  .requiredAsterisk {
@@ -54,11 +54,8 @@
54
54
  background: var(--baseInput-bg-focus);
55
55
  }
56
56
 
57
- &:has(.input:disabled),
58
- &:has(.textarea:disabled),
59
- &:has(.select__control--is-disabled) {
60
- color: var(--baseInput-border-disabled);
61
- background: var(--baseInput-bg-disabled);
57
+ &:has(.inputIcon) .input {
58
+ text-align: end;
62
59
  }
63
60
 
64
61
  /* ask designers if icon needs to change after typing */
@@ -115,7 +112,17 @@
115
112
  &:has(.doubleValue) {
116
113
  /* double the lineheight */
117
114
  min-height: calc(2 * 1lh);
115
+ }
116
+
117
+ &:has(.input:disabled),
118
+ &:has(.textarea:disabled),
119
+ &:has(.checkbox:disabled),
120
+ &:has(.radio:disabled),
121
+ &:has(.select__control--is-disabled) {
122
+ border: var(--baseInput-border-disabled);
123
+ background: var(--baseInput-bg-disabled);
118
124
  }
125
+
119
126
  }
120
127
 
121
128
  .disabledSelect {
@@ -144,7 +151,7 @@
144
151
  }
145
152
 
146
153
  .inputIcon {
147
- color: var(--Gray-gray-500, #8c8e96);
154
+ color: var(--baseInput-dollarIcon);
148
155
  text-align: center;
149
156
  font-size: var(--baseInput-icon-font-size);
150
157
  font-weight: var(--baseInput-icon-font-weight);
@@ -498,3 +505,10 @@ React Select: selectInput from BaseSelect, multiSelectInput from BaseMultiSelect
498
505
  font-size: var(--baseInputRadioLabel-font-default);
499
506
  color: var(--baseInputRadioLabel-font-default);
500
507
  }
508
+
509
+ .afterInputText {
510
+ display: flex;
511
+ align-items: center;
512
+ margin: var(--baseInputAfterInput-margin);
513
+ text-wrap: nowrap;
514
+ }
@@ -102,6 +102,7 @@ export interface BaseInputTypes {
102
102
  characterLimit?: number;
103
103
  disabledSelectContainerClasses?: string;
104
104
  disabledSelectText?: string;
105
+ disabled?: boolean;
105
106
  textAreaHeight?: string;
106
107
  colSpan?: string;
107
108
  dropdownIndicatorColor?: string;
@@ -9,6 +9,7 @@ interface BaseRadioInputProps {
9
9
  }[];
10
10
  radioAndSvgWrapperClassName?: string;
11
11
  radioLabelClassName?: string;
12
+ isDisabled?: boolean;
12
13
  }
13
14
  declare const BaseRadioInput: React.FC<BaseRadioInputProps>;
14
15
  export default BaseRadioInput;
@@ -3,7 +3,7 @@ import { Controller } from "react-hook-form";
3
3
  import styles from "./BaseInput.module.css";
4
4
  import clsx from "clsx";
5
5
  const BaseRadioInput = (props) => {
6
- const { control, valueKey, defaultValue, options, radioAndSvgWrapperClassName, radioLabelClassName, } = props;
7
- return (_jsx(Controller, { name: valueKey, control: control, defaultValue: defaultValue, render: ({ field }) => (_jsx("div", { className: styles.radioContainer, children: options.map((option) => (_jsxs("label", { className: styles.radioLabel, children: [_jsxs("div", { className: clsx(styles.radioAndSvgWrapper, radioAndSvgWrapperClassName), children: [_jsx("input", { type: "radio", className: styles.radio, id: `${valueKey}-${option.value}`, value: option.value, checked: field.value === option.value, onChange: () => field.onChange(option.value) }), _jsx("span", { className: styles.radioIconWrapper, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `${styles.radioSvg}`, viewBox: "0 0 20 20", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", children: _jsx("circle", { cx: "10", cy: "10", r: "7" }) }) })] }), _jsx("span", { className: clsx(styles.radioLabel, radioLabelClassName), children: option.label })] }, option.value))) })) }));
6
+ const { control, valueKey, defaultValue, options, radioAndSvgWrapperClassName, radioLabelClassName, isDisabled, } = props;
7
+ return (_jsx(Controller, { name: valueKey, control: control, defaultValue: defaultValue, render: ({ field }) => (_jsx("div", { className: styles.radioContainer, children: options.map((option) => (_jsxs("label", { className: styles.radioLabel, children: [_jsxs("div", { className: clsx(styles.radioAndSvgWrapper, radioAndSvgWrapperClassName), children: [_jsx("input", { type: "radio", className: styles.radio, disabled: isDisabled, id: `${valueKey}-${option.value}`, value: option.value, checked: field.value === option.value, onChange: () => field.onChange(option.value) }), _jsx("span", { className: styles.radioIconWrapper, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: `${styles.radioSvg}`, viewBox: "0 0 20 20", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", children: _jsx("circle", { cx: "10", cy: "10", r: "7" }) }) })] }), _jsx("span", { className: clsx(styles.radioLabel, radioLabelClassName), children: option.label })] }, option.value))) })) }));
8
8
  };
9
9
  export default BaseRadioInput;
@@ -15,6 +15,7 @@ interface BaseTextInputProps {
15
15
  errorMessage?: string;
16
16
  isFieldDirty?: boolean;
17
17
  isFieldError?: boolean;
18
+ isDisabled?: boolean;
18
19
  }
19
20
  declare const BaseTextInput: React.FC<BaseTextInputProps>;
20
21
  export default BaseTextInput;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Controller } from "react-hook-form";
3
- import { getFontAwesomeIcon, formatPhoneNumber } from "../../utils/index.js";
3
+ import { getFontAwesomeIcon, formatPhoneNumber, formatCurrency } from "../../utils/index.js";
4
4
  import BaseErrorMessage from "./components/BaseErrorMessage.js";
5
5
  import clsx from "clsx";
6
6
  import styles from "./BaseInput.module.css";
7
7
  const BaseTextInput = (props) => {
8
- const { uuid, defaultValue, control, onBlur, inputHasLeftIcon, isRequired, valueType, valueKey, requireUuidField, hasTypeCheck, placeholder, errorMessage, isFieldDirty, isFieldError, } = props;
8
+ const { uuid, defaultValue, control, onBlur, inputHasLeftIcon, isRequired, valueType, valueKey, requireUuidField, hasTypeCheck, placeholder, errorMessage, isFieldDirty, isFieldError, isDisabled, } = props;
9
9
  return (_jsxs("div", { className: styles.inputContainer, children: [inputHasLeftIcon && (_jsx("div", { className: styles.inputIcon, children: getFontAwesomeIcon(inputHasLeftIcon, "solid") })), _jsx(Controller, { name: `${requireUuidField ? uuid : valueKey}`, control: control, defaultValue: defaultValue, rules: {
10
10
  ...(isRequired
11
11
  ? {
@@ -23,12 +23,25 @@ const BaseTextInput = (props) => {
23
23
  },
24
24
  }
25
25
  : {}),
26
- }, render: ({ field }) => (_jsx("input", { ...field, id: valueKey, type: hasTypeCheck === "number" ? "number" : "text", className: clsx(styles.input, isFieldDirty && !isFieldError && styles.dirty, isFieldError && styles.error), placeholder: placeholder, onFocus: (e) => e.target.select(), onBlur: onBlur, onChange: (e) => {
27
- let value = e.target.value;
28
- if (valueType === "phone") {
29
- value = formatPhoneNumber(value);
26
+ ...(hasTypeCheck === "currency"
27
+ ? {
28
+ pattern: {
29
+ value: /^[0-9]+(\.[0-9]{1,2})?$/,
30
+ message: `Enter valid cost.`,
31
+ },
30
32
  }
31
- field.onChange(value);
32
- } })) }), errorMessage && _jsx(BaseErrorMessage, { errorMessage: errorMessage })] }));
33
+ : {}),
34
+ }, render: ({ field, }) => {
35
+ return (_jsx("input", { ...field, id: valueKey, type: "text", className: clsx(styles.input, isFieldDirty && !isFieldError && styles.dirty, isFieldError && styles.error), disabled: isDisabled, placeholder: placeholder, onFocus: (e) => e.target.select(), onBlur: onBlur, onChange: (e) => {
36
+ let value = e.target.value;
37
+ if (valueType === "phone") {
38
+ value = formatPhoneNumber(value);
39
+ }
40
+ if (valueType === "currency") {
41
+ value = formatCurrency(value);
42
+ }
43
+ field.onChange(value);
44
+ } }));
45
+ } }), errorMessage && _jsx(BaseErrorMessage, { errorMessage: errorMessage })] }));
33
46
  };
34
47
  export default BaseTextInput;
@@ -10,6 +10,7 @@ interface BaseTextareaInputProps {
10
10
  placeholder?: string;
11
11
  characterLimit?: number;
12
12
  textareaClassName?: string;
13
+ isDisabled?: boolean;
13
14
  }
14
15
  declare const BaseTextareaInput: React.FC<BaseTextareaInputProps>;
15
16
  export default BaseTextareaInput;
@@ -5,13 +5,13 @@ import CharacterLimitMessage from "./components/CharacterLimitMessage.js";
5
5
  import clsx from "clsx";
6
6
  import styles from "./BaseInput.module.css";
7
7
  const BaseTextareaInput = (props) => {
8
- const { watch, control, defaultValue, valueKey, errorMessage, isFieldDirty, isFieldError, placeholder, characterLimit, textareaClassName, } = props;
8
+ const { watch, control, defaultValue, valueKey, errorMessage, isFieldDirty, isFieldError, placeholder, characterLimit, textareaClassName, isDisabled, } = props;
9
9
  return (_jsx("div", { className: styles.inputContainer, children: _jsx(Controller, { control: control, name: valueKey, defaultValue: defaultValue, render: ({ field }) => {
10
10
  const textAreaValue = watch(valueKey);
11
11
  const characterCount = textAreaValue
12
12
  ? textAreaValue.length
13
13
  : 0;
14
- return (_jsxs("div", { className: styles.textareaAndCharLimitWrapper, children: [_jsx("textarea", { ...field, id: valueKey, placeholder: placeholder, value: field.value || "", className: clsx(styles.textarea, isFieldDirty && !isFieldError && styles.dirty, isFieldError && styles.error, textareaClassName), onFocus: (e) => e.target.select() }), _jsxs("div", { className: clsx(styles.textareaBottomTextContainer, isFieldError && styles.textareaError), children: [errorMessage && (_jsx(BaseErrorMessage, { errorMessage: errorMessage })), characterLimit && (_jsx(CharacterLimitMessage, { isFieldError: isFieldError, isFieldDirty: isFieldDirty, characterLimit: characterLimit, characterCount: characterCount }))] })] }));
14
+ return (_jsxs("div", { className: styles.textareaAndCharLimitWrapper, children: [_jsx("textarea", { ...field, id: valueKey, placeholder: placeholder, disabled: isDisabled, value: field.value || "", className: clsx(styles.textarea, isFieldDirty && !isFieldError && styles.dirty, isFieldError && styles.error, textareaClassName), onFocus: (e) => e.target.select() }), _jsxs("div", { className: clsx(styles.textareaBottomTextContainer, isFieldError && styles.textareaError), children: [errorMessage && (_jsx(BaseErrorMessage, { errorMessage: errorMessage })), characterLimit && (_jsx(CharacterLimitMessage, { isFieldError: isFieldError, isFieldDirty: isFieldDirty, characterLimit: characterLimit, characterCount: characterCount }))] })] }));
15
15
  } }) }));
16
16
  };
17
17
  export default BaseTextareaInput;
@@ -8,6 +8,7 @@ interface BaseToggleProps {
8
8
  toggleHasDivider?: boolean;
9
9
  toggleActiveLabel?: string;
10
10
  toggleInactiveLabel?: string;
11
+ isDisabled?: boolean;
11
12
  }
12
13
  declare const BaseToggle: React.FC<BaseToggleProps>;
13
14
  export default BaseToggle;
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Controller } from "react-hook-form";
3
3
  import { ToggleButton } from "../ToggleButton/index.js";
4
4
  const BaseToggle = (props) => {
5
- const { control, valueKey, defaultValue, toggleTextPosition = "right", toggleAdditionalClasses, toggleHasDivider = false, toggleActiveLabel = "Yes", toggleInactiveLabel = "No", } = props;
6
- return (_jsx("div", { children: _jsx(Controller, { control: control, name: valueKey, defaultValue: defaultValue, render: ({ field: { value, onChange } }) => (_jsx(ToggleButton, { initialStatus: Boolean(value), onClick: () => onChange(!value), textPosition: toggleTextPosition, additionalClasses: toggleAdditionalClasses, hasDivider: toggleHasDivider, activeLabel: toggleActiveLabel, inactiveLabel: toggleInactiveLabel, id: valueKey })) }) }));
5
+ const { control, valueKey, defaultValue, toggleTextPosition = "right", toggleAdditionalClasses, toggleHasDivider = false, toggleActiveLabel = "Yes", toggleInactiveLabel = "No", isDisabled, } = props;
6
+ return (_jsx("div", { children: _jsx(Controller, { control: control, name: valueKey, defaultValue: defaultValue, render: ({ field: { value, onChange } }) => (_jsx(ToggleButton, { initialStatus: Boolean(value), onClick: () => onChange(!value), textPosition: toggleTextPosition, additionalClasses: toggleAdditionalClasses, hasDivider: toggleHasDivider, activeLabel: toggleActiveLabel, inactiveLabel: toggleInactiveLabel, id: valueKey, isDisabled: isDisabled })) }) }));
7
7
  };
8
8
  export default BaseToggle;
@@ -11,6 +11,9 @@
11
11
  align-items: center;
12
12
  justify-content: center;
13
13
  border-radius: 9999px;
14
+ background-color: var(--tooltip-icon-bg);
15
+ color: var(--tooltip-icon-text);
16
+ font-size: 12px;
14
17
  }
15
18
 
16
19
  .childrenTrigger {
@@ -28,10 +31,10 @@
28
31
  font-size: 12px;
29
32
  text-align: left;
30
33
  white-space: nowrap;
31
- background-color: var(--tooltip-bg, #191e2d);
34
+ background-color: var(--tooltip-bg);
32
35
  color: var(--tooltip-text, #ffffff);
33
36
  pointer-events: none;
34
- font-family: var(--tooltip-fontFamily, #ffffff);
37
+ font-family: var(--tooltip-fontFamily);
35
38
  }
36
39
 
37
40
  /* Placement transforms — top/left coords are set via inline style */
@@ -16,9 +16,13 @@ const formatValue = (raw, valueType = "text", currencyCharacter, prefix) => {
16
16
  const FieldRow = ({ field, value, currencyCharacter }) => {
17
17
  const formatted = formatValue(value, field.valueType, currencyCharacter, field.valuePrefix);
18
18
  if (field.isTotal) {
19
- return (_jsxs("div", { className: styles.totalRow, children: [_jsxs("div", { className: styles.labelGroup, children: [_jsx("p", { className: styles.totalLabel, children: field.label }), field.tooltip && (_jsx(BaseToolTip, { message: field.tooltip, icon: "circleInfo", toolTipPlacement: "right" }))] }), _jsx("div", { children: field.loadingState ? (_jsxs("div", { className: styles.loadingGroup, children: [field.loadingState, _jsx("p", { className: styles.totalValue, children: formatted })] })) : (_jsx("p", { className: styles.totalValue, children: formatted })) })] }));
19
+ return (_jsxs("div", { className: styles.totalRow, children: [_jsxs("div", { className: styles.labelGroup, children: [_jsx("p", { className: styles.totalLabel, children: field.label }), field.labelToolTip && (_jsx(BaseToolTip, { message: field.labelToolTip, icon: "circleInfo", toolTipPlacement: field.labelToolTipPlacement }))] }), _jsx("div", { children: field.loadingState ? (_jsxs("div", { className: styles.loadingGroup, children: [field.loadingState, _jsx("p", { className: styles.totalValue, children: formatted })] })) : (_jsx("p", { className: styles.totalValue, children: formatted })) })] }));
20
20
  }
21
- return (_jsxs("div", { className: styles.row, children: [_jsxs("div", { className: styles.labelGroup, children: [_jsx("p", { className: styles.label, children: field.label }), field.tooltip && (_jsx(BaseToolTip, { message: field.tooltip, icon: "circleInfo", toolTipPlacement: "right" }))] }), _jsx("p", { className: styles.value, children: formatted })] }));
21
+ return (_jsxs("div", { className: styles.row, children: [_jsxs("div", { className: styles.labelGroup, children: [_jsx("p", { className: field.valueKey === "_subtotalPurchase"
22
+ ? styles.subTotalLabel
23
+ : styles.label, children: field.label }), field.labelToolTip && (_jsx(BaseToolTip, { message: field.labelToolTip, icon: "circleInfo", toolTipPlacement: field.labelToolTipPlacement }))] }), _jsx("p", { className: field.valueKey === "_subtotalPurchase"
24
+ ? styles.subTotalValue
25
+ : styles.value, children: formatted })] }));
22
26
  };
23
27
  const BaseTotals = ({ fields, recurringFields, recurringTitle = "Recurring Charges", data, currencyCharacter = "$", }) => {
24
28
  const showRecurring = recurringFields &&
@@ -32,6 +32,21 @@
32
32
  font-variant-numeric: tabular-nums;
33
33
  }
34
34
 
35
+ .subTotalLabel {
36
+ font-size: var(--baseTotals-subTotalLabel-font-size, 0.875rem);
37
+ font-weight: var(--baseTotals-subTotalLabel-font-weight, 400);
38
+ color: var(--baseTotals-subTotalLabel-color, inherit);
39
+ font-family: var(--baseTotals-subTotalLabel-fontFamily-default, inherit);
40
+ }
41
+
42
+ .subTotalValue {
43
+ font-size: var(--baseTotals-subTotalValue-font-size, 0.875rem);
44
+ font-weight: var(--baseTotals-subTotalValue-font-weight, inherit);
45
+ color: var(--baseTotals-subTotalValue-color, inherit);
46
+ font-family: var(--baseTotals-subTotalValue-fontFamily-default, inherit);
47
+ font-variant-numeric: tabular-nums;
48
+ }
49
+
35
50
  .totalRow {
36
51
  display: flex;
37
52
  align-items: center;
@@ -44,14 +59,14 @@
44
59
  .totalLabel {
45
60
  font-size: var(--baseTotals-label-font-size, 0.875rem);
46
61
  font-weight: var(--baseTotals-total-label-font-weight, 600);
47
- color: var(--baseTotals-label-color, inherit);
62
+ color: var(--baseTotals-total-label-color, inherit);
48
63
  font-family: var(--baseTotals-label-fontFamily-default, inherit);
49
64
  }
50
65
 
51
66
  .totalValue {
52
67
  font-size: var(--baseTotals-value-font-size, 0.875rem);
53
68
  font-weight: var(--baseTotals-total-value-font-weight, 600);
54
- color: var(--baseTotals-value-color, inherit);
69
+ color: var(--baseTotals-total-value-color, inherit);
55
70
  font-family: var(--baseTotals-value-fontFamily-default, inherit);
56
71
  font-variant-numeric: tabular-nums;
57
72
  }
@@ -7,8 +7,11 @@ export interface TotalsFieldConfig {
7
7
  valueType?: TotalsValueType;
8
8
  /** Marks this field as the total row — rendered with a top border separator */
9
9
  isTotal?: boolean;
10
+ /** Marks this field as a subtotal row — rendered with subtotal label/value styling */
11
+ isSubTotal?: boolean;
10
12
  valuePrefix?: string;
11
- tooltip?: string;
13
+ labelToolTip?: string;
14
+ labelToolTipPlacement?: "top" | "bottom" | "right" | "left";
12
15
  labelClasses?: string;
13
16
  valueClasses?: string;
14
17
  loadingState?: React.ReactNode;
@@ -0,0 +1,55 @@
1
+ .environment-badge {
2
+ --color-env-development-bg: #eafce8;
3
+ --color-env-alpha-bg: #f6e2e4;
4
+ --color-env-beta-bg: #ffd0b9;
5
+ --color-env-gamma-bg: #d3cfff;
6
+ --color-env-sprint-bg: #ffe8b8;
7
+ --color-env-stage-bg: #e6ceff;
8
+ --color-env-test-bg: #fce4ec;
9
+ --color-env-production-bg: #d60027;
10
+ --color-env-production-text: #ffffff;
11
+
12
+ display: flex;
13
+ position: absolute;
14
+ gap: 0.5rem;
15
+ }
16
+
17
+ .badge-container {
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ padding: 0.25rem 0.5rem;
22
+ font-family: var(--color-env-badge-font-family, "Omnes Medium", sans-serif);
23
+ font-size: var(--color-env-badge-font-size, 1rem);
24
+ }
25
+
26
+ .env-development {
27
+ background-color: var(--color-env-development-bg);
28
+ }
29
+ .env-alpha {
30
+ background-color: var(--color-env-alpha-bg);
31
+ }
32
+ .env-beta {
33
+ background-color: var(--color-env-beta-bg);
34
+ }
35
+ .env-gamma {
36
+ background-color: var(--color-env-gamma-bg);
37
+ }
38
+ .env-sprint {
39
+ background-color: var(--color-env-sprint-bg);
40
+ }
41
+ .env-stage {
42
+ background-color: var(--color-env-stage-bg);
43
+ }
44
+ .env-test {
45
+ background-color: var(--color-env-test-bg);
46
+ }
47
+
48
+ .env-dev-sandbox {
49
+ background-color: var(--color-env-beta-bg);
50
+ }
51
+
52
+ .env-production {
53
+ background-color: var(--color-env-production-bg);
54
+ color: var(--color-env-production-text);
55
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import "./EnvironmentBadge.css";
3
+ declare const EnvironmentBadge: React.FC;
4
+ export default EnvironmentBadge;