@commercelayer/app-elements 0.0.77 → 0.0.79

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 (109) hide show
  1. package/dist/{Async-eb36604c.js → Async-2e9c3da2.js} +5 -3
  2. package/dist/{InputDateComponent-3a568d05.js → InputDateComponent-fe3ffd00.js} +4 -2
  3. package/dist/{Select-9ad06632.js → Select-be90391b.js} +5 -3
  4. package/dist/helpers/appsNavigation.d.ts +1 -0
  5. package/dist/hooks/useOverlayNavigation.d.ts +1 -0
  6. package/dist/{main-237699b9.js → main-bd408fbe.js} +12509 -10957
  7. package/dist/main.d.ts +18 -0
  8. package/dist/main.js +151 -127
  9. package/dist/{overrides-1089f4f3.js → overrides-684ed062.js} +2 -2
  10. package/dist/providers/TokenProvider/MockTokenProvider.d.ts +1 -0
  11. package/dist/style.css +1 -1
  12. package/dist/ui/atoms/A.d.ts +1 -0
  13. package/dist/ui/atoms/Avatar.d.ts +1 -0
  14. package/dist/ui/atoms/AvatarLetter.d.ts +1 -0
  15. package/dist/ui/atoms/BlockCode.d.ts +1 -0
  16. package/dist/ui/atoms/ButtonFilter.d.ts +1 -0
  17. package/dist/ui/atoms/Card.d.ts +2 -0
  18. package/dist/ui/atoms/Container.d.ts +1 -0
  19. package/dist/ui/atoms/CopyToClipboard.d.ts +1 -0
  20. package/dist/ui/atoms/Hr.d.ts +1 -0
  21. package/dist/ui/atoms/Icon.d.ts +1 -0
  22. package/dist/ui/atoms/Pagination.d.ts +1 -0
  23. package/dist/ui/atoms/Progress.d.ts +1 -0
  24. package/dist/ui/atoms/StatusDot.d.ts +1 -0
  25. package/dist/ui/atoms/Steps.d.ts +1 -0
  26. package/dist/ui/atoms/dropdown/DropdownMenu.d.ts +1 -0
  27. package/dist/ui/atoms/dropdown/DropdownMenuDivider.d.ts +1 -0
  28. package/dist/ui/atoms/dropdown/DropdownMenuItem.d.ts +1 -0
  29. package/dist/ui/atoms/tables/Td.d.ts +1 -0
  30. package/dist/ui/atoms/tables/Th.d.ts +1 -0
  31. package/dist/ui/atoms/tables/Tr.d.ts +1 -0
  32. package/dist/ui/composite/ContextMenu.d.ts +1 -0
  33. package/dist/ui/composite/PageError.d.ts +1 -0
  34. package/dist/ui/composite/PageSkeleton.d.ts +1 -0
  35. package/dist/ui/composite/SearchBar.d.ts +12 -5
  36. package/dist/ui/forms/Input.d.ts +1 -0
  37. package/dist/ui/forms/InputCheckbox.d.ts +1 -0
  38. package/dist/ui/forms/InputCurrency/index.d.ts +1 -0
  39. package/dist/ui/forms/InputCurrencyRange.d.ts +1 -0
  40. package/dist/ui/forms/InputDate/InputDateComponent.d.ts +1 -0
  41. package/dist/ui/forms/InputDate/index.d.ts +1 -0
  42. package/dist/ui/forms/InputDateRange.d.ts +1 -0
  43. package/dist/ui/forms/InputFeedback.d.ts +1 -0
  44. package/dist/ui/forms/InputFile.d.ts +1 -0
  45. package/dist/ui/forms/InputJson.d.ts +1 -0
  46. package/dist/ui/forms/InputReadonly.d.ts +1 -0
  47. package/dist/ui/forms/InputSelect/Async.d.ts +1 -0
  48. package/dist/ui/forms/InputSelect/Select.d.ts +1 -0
  49. package/dist/ui/forms/InputSelect/overrides.d.ts +1 -0
  50. package/dist/ui/forms/InputSpinner.d.ts +1 -0
  51. package/dist/ui/forms/InputTextArea.d.ts +1 -0
  52. package/dist/ui/forms/InputToggleBox.d.ts +1 -0
  53. package/dist/ui/forms/InputToggleListBox.d.ts +1 -0
  54. package/dist/ui/forms/Label.d.ts +1 -0
  55. package/dist/ui/forms/ToggleButtons.d.ts +1 -0
  56. package/dist/ui/hook-form/HookedForm.d.ts +34 -0
  57. package/dist/ui/hook-form/HookedInput.d.ts +17 -0
  58. package/dist/ui/hook-form/HookedInputCheckbox.d.ts +17 -0
  59. package/dist/ui/hook-form/HookedInputCurrency.d.ts +18 -0
  60. package/dist/ui/hook-form/HookedInputDate.d.ts +18 -0
  61. package/dist/ui/hook-form/HookedInputDateRange.d.ts +19 -0
  62. package/dist/ui/hook-form/HookedInputMetadata.d.ts +19 -0
  63. package/dist/ui/hook-form/HookedInputSelect.d.ts +34 -0
  64. package/dist/ui/hook-form/HookedInputSpinner.d.ts +17 -0
  65. package/dist/ui/hook-form/HookedInputToggleBox.d.ts +21 -0
  66. package/dist/ui/hook-form/HookedInputToggleListBox.d.ts +21 -0
  67. package/dist/ui/hook-form/HookedRelationshipSelector.d.ts +18 -0
  68. package/dist/ui/hook-form/HookedToggleButtons.d.ts +18 -0
  69. package/dist/ui/hook-form/HookedValidationApiError.d.ts +22 -0
  70. package/dist/ui/hook-form/HookedValidationError.d.ts +12 -0
  71. package/dist/ui/hook-form/setApiFormErrors.d.ts +19 -0
  72. package/dist/ui/hook-form/setApiFormErrors.test.d.ts +1 -0
  73. package/dist/ui/hook-form/useValidationFeedback.d.ts +4 -0
  74. package/dist/ui/internals/InputWrapper.d.ts +1 -0
  75. package/dist/ui/resources/Filters/FieldCurrencyRange.d.ts +7 -0
  76. package/dist/ui/resources/Filters/FieldItem.d.ts +7 -0
  77. package/dist/ui/resources/Filters/FieldTimeRange.d.ts +7 -0
  78. package/dist/ui/resources/Filters/FiltersForm.d.ts +17 -0
  79. package/dist/ui/resources/Filters/FiltersNav.d.ts +25 -0
  80. package/dist/ui/resources/Filters/FiltersSearchBar.d.ts +28 -0
  81. package/dist/ui/resources/Filters/adaptFormValuesToSdk.d.ts +19 -0
  82. package/dist/ui/resources/Filters/adaptFormValuesToSdk.test.d.ts +1 -0
  83. package/dist/ui/resources/Filters/adaptFormValuesToUrlQuery.d.ts +11 -0
  84. package/dist/ui/resources/Filters/adaptFormValuesToUrlQuery.test.d.ts +1 -0
  85. package/dist/ui/resources/Filters/adaptUrlQueryToFormValues.d.ts +11 -0
  86. package/dist/ui/resources/Filters/adaptUrlQueryToFormValues.test.d.ts +1 -0
  87. package/dist/ui/resources/Filters/adaptUrlQueryToSdk.d.ts +14 -0
  88. package/dist/ui/resources/Filters/adaptUrlQueryToSdk.test.d.ts +1 -0
  89. package/dist/ui/resources/Filters/adaptUrlQueryToUrlQuery.d.ts +11 -0
  90. package/dist/ui/resources/Filters/adaptUrlQueryToUrlQuery.test.d.ts +1 -0
  91. package/dist/ui/resources/Filters/adapters.d.ts +2 -0
  92. package/dist/ui/resources/Filters/adapters.types.d.ts +20 -0
  93. package/dist/ui/resources/Filters/index.d.ts +5 -0
  94. package/dist/ui/resources/Filters/mockedInstructions.d.ts +2 -0
  95. package/dist/ui/resources/Filters/timeUtils.d.ts +36 -0
  96. package/dist/ui/resources/Filters/timeUtils.test.d.ts +1 -0
  97. package/dist/ui/resources/Filters/types.d.ts +130 -0
  98. package/dist/ui/resources/Filters/useFilters.d.ts +59 -0
  99. package/dist/ui/resources/Filters/utils.d.ts +29 -0
  100. package/dist/ui/resources/Filters/utils.test.d.ts +1 -0
  101. package/dist/ui/resources/OrderSummary.d.ts +1 -0
  102. package/dist/ui/resources/RelationshipSelector/Checkbox.d.ts +1 -0
  103. package/dist/ui/resources/RelationshipSelector/FullList.d.ts +1 -0
  104. package/dist/ui/resources/RelationshipSelector/index.d.ts +1 -0
  105. package/dist/ui/resources/ResourceList/utils.d.ts +1 -0
  106. package/dist/ui/tables/TableData.d.ts +1 -0
  107. package/dist/{unsupportedIterableToArray-35997f1b.js → unsupportedIterableToArray-a4407b22.js} +1 -1
  108. package/dist/utils/htmltags.d.ts +1 -0
  109. package/package.json +8 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type SetRequired } from 'type-fest';
2
3
  export type Props = SetRequired<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { presets } from './Avatar.utils';
2
3
  export interface AvatarProps {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AvatarLetterProps {
2
3
  /**
3
4
  * text to be used to generate initials
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface BlockCodeProps {
2
3
  /**
3
4
  * Object to render as pre-formatted block
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type IconProps } from './Icon';
2
3
  interface ButtonFilterProps extends React.HTMLAttributes<HTMLDivElement> {
3
4
  onClick?: () => void;
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+ /// <reference types="react" />
1
3
  export declare const Card: import("./SkeletonTemplate").SkeletonTemplateComponent<{
2
4
  gap?: "1" | "4" | "6" | undefined;
3
5
  footer?: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface ContainerProps {
2
3
  /**
3
4
  * set min height as screen size. Default is `true`.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface CopyToClipboardProps {
2
3
  /**
3
4
  * text to display that will be copied on button click
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = Omit<React.HTMLProps<HTMLHRElement>, 'children'>;
2
3
  export declare function Hr({ className, ...rest }: Props): JSX.Element;
3
4
  export declare namespace Hr {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as phosphor from '@phosphor-icons/react';
2
3
  export interface IconProps extends React.HTMLAttributes<HTMLDivElement> {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface PaginationProps {
2
3
  /**
3
4
  * CSS classes
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface ProgressProps {
2
3
  /**
3
4
  * This attribute describes how much work the task indicated by the `progress` element requires.
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type DotVariant = 'success' | 'danger' | 'warning';
2
3
  export interface StatusDotProps {
3
4
  variant: DotVariant;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Step {
2
3
  label: string;
3
4
  active?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.HTMLAttributes<HTMLElement> {
2
3
  children?: React.ReactNode;
3
4
  arrow?: 'none';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.HTMLAttributes<HTMLElement> {
2
3
  children?: React.ReactNode;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.HTMLAttributes<HTMLElement> {
2
3
  label: string;
3
4
  icon?: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.TdHTMLAttributes<HTMLElement> {
2
3
  children?: React.ReactNode;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.ThHTMLAttributes<HTMLElement> {
2
3
  children?: React.ReactNode;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.HTMLAttributes<HTMLElement> {
2
3
  children?: React.ReactNode;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props {
2
3
  menuLabel?: React.ReactNode;
3
4
  menuItems: React.ReactNode;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface PageErrorProps {
2
3
  /**
3
4
  * Main page title wrapped in a h1 element
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface PageSkeletonProps {
2
3
  layout?: 'list' | 'details';
3
4
  hasHeaderDescription?: boolean;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface SearchBarProps {
2
3
  /**
3
4
  * Initial value of the search bar. When changed, the search bar will be updated.
@@ -25,9 +26,15 @@ interface SearchBarProps {
25
26
  * Placeholder text for the input element
26
27
  */
27
28
  placeholder?: string;
29
+ /**
30
+ * Enable auto focus on the input element
31
+ */
32
+ autoFocus?: boolean;
28
33
  }
29
- declare function SearchBar({ initialValue, onSearch, onClear, debounceMs, className, placeholder, ...rest }: SearchBarProps): JSX.Element;
30
- declare namespace SearchBar {
31
- var displayName: string;
32
- }
33
- export { SearchBar };
34
+ /**
35
+ * This component renders a search bar with a clear button with debounced `onSearch` callback.
36
+ * <blockquote type='info'>In this way the `onSearch` callback will be triggered only when the user stops typing
37
+ * for the specified value of `debounceMs` (default 500ms).</blockquote>
38
+ */
39
+ export declare const SearchBar: import("react").ForwardRefExoticComponent<SearchBarProps & import("react").RefAttributes<HTMLInputElement>>;
40
+ export {};
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  export interface InputProps extends InputWrapperBaseProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  export interface InputCheckboxProps extends Omit<InputWrapperBaseProps, 'label'>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value'> {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../../internals/InputWrapper';
2
3
  import { type CurrencyInputProps } from 'react-currency-input-field';
3
4
  import { type CurrencyCode } from './currencies';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type CurrencyCode } from '../forms/InputCurrency/currencies';
2
3
  import { type InputCurrencyProps } from '../forms/InputCurrency/index';
3
4
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import DatePicker from 'react-datepicker';
2
3
  import { type InputWrapperBaseProps } from '../../internals/InputWrapper';
3
4
  export type MaybeDate = Date | null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputDateProps } from './InputDateComponent';
2
3
  import type DatePicker from 'react-datepicker';
3
4
  declare const InputDate: import("react").ForwardRefExoticComponent<InputDateProps & import("react").RefAttributes<DatePicker<never, undefined>>>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  import { type InputDateProps, type MaybeDate } from './InputDate/InputDateComponent';
3
4
  export interface InputDateRangeProps extends Pick<InputDateProps, 'isClearable' | 'format' | 'autoPlaceholder'>, InputWrapperBaseProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type FeedbackVariant = 'danger' | 'success' | 'warning';
2
3
  export interface InputFeedbackProps {
3
4
  message: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  interface InputFileProps extends InputWrapperBaseProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  export interface InputJsonProps<JsonType> extends InputWrapperBaseProps {
3
4
  placeholder: object;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  interface InputReadonlyProps extends InputWrapperBaseProps {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type StylesConfig } from 'react-select';
2
3
  import { type SetRequired } from 'type-fest';
3
4
  import { type InputSelectProps, type SelectValue } from './';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type StylesConfig } from 'react-select';
2
3
  import { type InputSelectProps, type SelectValue } from './';
3
4
  interface SelectComponentProps extends Omit<InputSelectProps, 'loadAsyncValues' | 'label' | 'hint'> {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type ClearIndicatorProps, type DropdownIndicatorProps, type MultiValueRemoveProps } from 'react-select';
2
3
  import { type SelectValue } from '.';
3
4
  declare function DropdownIndicator(props: DropdownIndicatorProps<SelectValue>): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  export interface InputSpinnerProps extends InputWrapperBaseProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'onChange'> {
3
4
  min?: number;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  interface InputTextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, InputWrapperBaseProps {
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface InputToggleBoxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value'> {
2
3
  id: string;
3
4
  label: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface InputToggleListBoxOption {
2
3
  value: string;
3
4
  label: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface Props extends React.LabelHTMLAttributes<HTMLLabelElement> {
2
3
  gap?: boolean;
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type InputWrapperBaseProps } from '../internals/InputWrapper';
2
3
  import { type Simplify } from 'type-fest';
3
4
  export type ToggleButtonValue = string | boolean | number;
@@ -0,0 +1,34 @@
1
+ import { type FieldValues, type FormProviderProps } from 'react-hook-form';
2
+ interface FormProps<T extends FieldValues> extends FormProviderProps<T> {
3
+ /**
4
+ * Callback invoked on submit when form has been successfully validated
5
+ */
6
+ onSubmit: (data: T) => void;
7
+ }
8
+ /**
9
+ * Form component to be used as main provider for the `react-hook-form` context.
10
+ *
11
+ * Example:
12
+ * ```
13
+ * import { useForm } from "react-hook-form"
14
+ * import { zodResolver } from "@hookform/resolvers/zod"
15
+ * import { HookedForm, HookedInput, HookedInputDate} from "@commercelayer/app-elements"
16
+ * function MyForm() {
17
+ * const methods = useForm({
18
+ * resolver: zodResolver(schema),
19
+ * });
20
+ * return (
21
+ * <HookedForm {...methods} onSubmit={(values) => myPostToServer(values)}>
22
+ * <HookedInput name="companyName" label="Company name" />
23
+ * <HookedInputDate name="dateSingle" label="Date" />
24
+ * <Button type='submit'>Submit</Button>
25
+ * </HookedForm>
26
+ * );
27
+ * }
28
+ *```
29
+ */
30
+ export declare const HookedForm: {
31
+ <T extends FieldValues>({ onSubmit, children, handleSubmit, ...rest }: FormProps<T>): JSX.Element;
32
+ displayName: string;
33
+ };
34
+ export {};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { type InputProps } from '../forms/Input';
3
+ interface Props extends InputProps {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `Input` component ready to be used with the `react-hook-form` context.
11
+ * @see InputSelect
12
+ */
13
+ declare function HookedInput({ name, ...props }: Props): JSX.Element;
14
+ declare namespace HookedInput {
15
+ var displayName: string;
16
+ }
17
+ export { HookedInput };
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { type InputCheckboxProps } from '../forms/InputCheckbox';
3
+ interface Props extends InputCheckboxProps {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `InputCheckbox` component ready to be used with the `react-hook-form` context.
11
+ * @see InputCheckbox
12
+ */
13
+ declare function HookedInputCheckbox({ name, ...props }: Props): JSX.Element;
14
+ declare namespace HookedInputCheckbox {
15
+ var displayName: string;
16
+ }
17
+ export { HookedInputCheckbox };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { type InputCurrencyProps } from '../forms/InputCurrency';
3
+ interface Props extends Omit<InputCurrencyProps, 'onChange' | 'onBlur' | 'cents'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `InputCurrency` component ready to be used with the `react-hook-form` context.
11
+ * Value is stored in form state as cents.
12
+ * @see InputCurrency
13
+ */
14
+ declare function HookedInputCurrency({ name, ...props }: Props): JSX.Element;
15
+ declare namespace HookedInputCurrency {
16
+ var displayName: string;
17
+ }
18
+ export { HookedInputCurrency };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { type InputDateProps } from '../forms/InputDate/InputDateComponent';
3
+ interface Props extends Omit<InputDateProps, 'onChange'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `InputDate` component ready to be used with the `react-hook-form` context.
11
+ * Value is stored in form state as iso date string (example: `"2023-08-01T22:00:00.000Z"` ).
12
+ * @see InputDate
13
+ */
14
+ declare function HookedInputDate({ name, ...props }: Props): JSX.Element;
15
+ declare namespace HookedInputDate {
16
+ var displayName: string;
17
+ }
18
+ export { HookedInputDate };
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { type InputDateRangeProps } from '../forms/InputDateRange';
3
+ interface Props extends Omit<InputDateRangeProps, 'onChange' | 'value'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `InputDateRange` component ready to be used with the `react-hook-form` context.
11
+ * Value is stored in form state as tuple of two iso date strings
12
+ * (example: `["2023-08-01T22:00:00.000Z", "2023-08-14T22:00:00.000Z"]` ).
13
+ * @see InputDateRange
14
+ */
15
+ declare function HookedInputDateRange({ name, ...props }: Props): JSX.Element;
16
+ declare namespace HookedInputDateRange {
17
+ var displayName: string;
18
+ }
19
+ export { HookedInputDateRange };
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ /**
4
+ * field name to match hook-form state
5
+ */
6
+ name: string;
7
+ }
8
+ /**
9
+ * `InputMetadata` component ready to be used with the `react-hook-form` context.
10
+ * Metadata is stored in form state as object of strings (example: `{foo: 'bar'}` )
11
+ * and should match the core api metadata structure. Non-string values are ignored and will not appear
12
+ * in the form state.
13
+ * @see InputMetadata
14
+ */
15
+ declare function HookedInputMetadata({ name }: Props): JSX.Element;
16
+ declare namespace HookedInputMetadata {
17
+ var displayName: string;
18
+ }
19
+ export { HookedInputMetadata };
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ import { type InputSelectProps } from '../forms/InputSelect';
3
+ interface Props extends Omit<InputSelectProps, 'onSelect' | 'defaultValue'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ /**
9
+ * Specify the path (in the `SelectValue` object) to reach the value to store in field.
10
+ * @default
11
+ * "value"
12
+ *
13
+ * Example:
14
+ * ```
15
+ * // single mode
16
+ * {value: 'ff0000', label: 'Red'} // set field value as 'ff0000'
17
+ *
18
+ * // multi mode
19
+ * [{value: 'ff0000', label: 'Red'}, {value: 'ffff00', label: 'Yellow'}]
20
+ * // set field value as ['ff0000', 'ffff00']
21
+ * ```
22
+ */
23
+ pathToValue?: string;
24
+ }
25
+ /**
26
+ * `InputSelect` component ready to be used with the `react-hook-form` context.
27
+ * Value to be stored in the field can be controlled from the `pathToValue` prop.
28
+ * @see InputSelect
29
+ */
30
+ declare function HookedInputSelect({ name, pathToValue, ...props }: Props): JSX.Element;
31
+ declare namespace HookedInputSelect {
32
+ var displayName: string;
33
+ }
34
+ export { HookedInputSelect };
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { type InputSpinnerProps } from '../forms/InputSpinner';
3
+ interface Props extends Omit<InputSpinnerProps, 'onChange' | 'defaultValues'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `InputSpinner` component ready to be used with the `react-hook-form` context.
11
+ * @see InputSpinner
12
+ */
13
+ declare function HookedInputSpinner({ name, ...props }: Props): JSX.Element;
14
+ declare namespace HookedInputSpinner {
15
+ var displayName: string;
16
+ }
17
+ export { HookedInputSpinner };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { type InputToggleBoxProps } from '../forms/InputToggleBox';
3
+ interface Props extends InputToggleBoxProps {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ /**
9
+ * show validation error message underneath
10
+ */
11
+ showValidation?: boolean;
12
+ }
13
+ /**
14
+ * `InputToggleBox` component ready to be used with the `react-hook-form` context.
15
+ * @see InputToggleBox
16
+ */
17
+ declare function HookedInputToggleBox({ name, showValidation, ...props }: Props): JSX.Element;
18
+ declare namespace HookedInputToggleBox {
19
+ var displayName: string;
20
+ }
21
+ export { HookedInputToggleBox };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { type InputToggleListBoxProps } from '../forms/InputToggleListBox';
3
+ interface Props extends InputToggleListBoxProps {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ /**
9
+ * show validation error message underneath
10
+ */
11
+ showValidation?: boolean;
12
+ }
13
+ /**
14
+ * `InputToggleListBox` component ready to be used with the `react-hook-form` context.
15
+ * @see InputToggleListBox
16
+ */
17
+ declare function HookedInputToggleListBox({ name, showValidation, ...props }: Props): JSX.Element;
18
+ declare namespace HookedInputToggleListBox {
19
+ var displayName: string;
20
+ }
21
+ export { HookedInputToggleListBox };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { type RelationshipSelectorProps } from '../resources/RelationshipSelector';
3
+ interface Props extends Omit<RelationshipSelectorProps, 'onChange' | 'defaultValues'> {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ }
9
+ /**
10
+ * `RelationshipSelector` component ready to be used with the `react-hook-form` context.
11
+ * Since it will perform api requests to fetch list of options, it also needs to access `CoreSdkProvider` context.
12
+ * @see RelationshipSelector
13
+ */
14
+ declare function HookedRelationshipSelector({ name, ...props }: Props): JSX.Element;
15
+ declare namespace HookedRelationshipSelector {
16
+ var displayName: string;
17
+ }
18
+ export { HookedRelationshipSelector };
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { type ToggleButtonsProps } from '../forms/ToggleButtons';
3
+ type Props = Omit<ToggleButtonsProps, 'value' | 'onChange'> & {
4
+ /**
5
+ * field name to match hook-form state
6
+ */
7
+ name: string;
8
+ };
9
+ /**
10
+ * `ToggleButtons` component ready to be used with the `react-hook-form` context.
11
+ * Stored value will be a string when used as `mode="single"` or an array of strings when `mode="multiple"`.
12
+ * @see ToggleButtons
13
+ */
14
+ declare function HookedToggleButtons({ name, ...props }: Props): JSX.Element;
15
+ declare namespace HookedToggleButtons {
16
+ var displayName: string;
17
+ }
18
+ export { HookedToggleButtons };
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ interface ValidationApiErrorProps {
3
+ /**
4
+ * An error object returned from a failed API request.
5
+ * We expect an object that contain an `errors` property with the Core Api error items shape.
6
+ */
7
+ apiError: any;
8
+ /**
9
+ * Optional map of app field names to API error field names.
10
+ * This is useful when the API returns field names that are different from the app field names.
11
+ * For example, if the API returns `first_name` instead of `firstName`, you can pass `{ first_name: 'firstName' }`.
12
+ *
13
+ * Format is:
14
+ * ```{ apiFieldName: appFieldName }```
15
+ */
16
+ fieldMap?: Record<string, string>;
17
+ }
18
+ declare function HookedValidationApiError({ apiError, fieldMap }: ValidationApiErrorProps): JSX.Element;
19
+ declare namespace HookedValidationApiError {
20
+ var displayName: string;
21
+ }
22
+ export { HookedValidationApiError };
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ interface Props {
3
+ /**
4
+ * field name to match hook-form state
5
+ */
6
+ name: string;
7
+ }
8
+ declare function HookedValidationError({ name }: Props): JSX.Element | null;
9
+ declare namespace HookedValidationError {
10
+ var displayName: string;
11
+ }
12
+ export { HookedValidationError };