@vacano/ui 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ChangeEventHandler } from 'react';
2
- import { CSSProperties } from 'react';
3
2
  import { HTMLAttributes } from 'react';
4
3
  import { InputHTMLAttributes } from 'react';
5
4
  import { JSX } from '@emotion/react/jsx-runtime';
@@ -154,26 +153,24 @@ export declare type ChipProps = VacanoComponentProps<HTMLSpanElement, ChipClassN
154
153
 
155
154
  export declare type ChipVariant = 'gray' | 'red' | 'blue' | 'black';
156
155
 
157
- export declare const Confirmation: ({ cancelBindings, cancelLabel, className, classnames, confirmLabel, loading, message, onCancel, onConfirm, open, ref, submitBindings, ...rest }: ConfirmationProps) => JSX.Element | null;
158
-
159
- export declare type ConfirmationClassNames = {
160
- message?: string;
161
- actions?: string;
162
- confirmButton?: string;
163
- cancelButton?: string;
156
+ export declare type ConfirmationContextValue = {
157
+ show: (message: ReactNode, onConfirm: () => void | Promise<void>, onCancel?: () => void, options?: ConfirmationOptions) => void;
158
+ hide: () => void;
164
159
  };
165
160
 
166
- export declare type ConfirmationProps = VacanoComponentProps<HTMLDivElement, ConfirmationClassNames> & {
167
- cancelBindings?: KeyboardEventKey[];
168
- cancelLabel?: string;
161
+ export declare type ConfirmationOptions = {
169
162
  confirmLabel?: string;
170
- loading?: boolean;
163
+ cancelLabel?: string;
164
+ };
165
+
166
+ export declare const ConfirmationProvider: ({ children }: PropsWithChildren) => JSX.Element;
167
+
168
+ export declare type ConfirmationState = {
169
+ open: boolean;
171
170
  message: ReactNode;
172
- onCancel?: () => void;
173
- onConfirm?: () => void;
174
- open?: boolean;
175
- style?: CSSProperties;
176
- submitBindings?: KeyboardEventKey[];
171
+ onConfirm: () => void | Promise<void>;
172
+ onCancel: () => void;
173
+ options: ConfirmationOptions;
177
174
  };
178
175
 
179
176
  export declare const Container: ({ children, className, ref, ...rest }: PropsWithChildren<ContainerProps>) => JSX.Element;
@@ -268,6 +265,20 @@ export declare type DropdownProps = VacanoComponentProps<HTMLDivElement, Dropdow
268
265
  trigger: ReactElement;
269
266
  };
270
267
 
268
+ export declare const EditableText: ({ value, onChange, disabled, placeholder, className, classnames, "data-test-id": dataTestId, }: EditableTextProps) => JSX.Element;
269
+
270
+ export declare type EditableTextClassNames = {
271
+ text?: string;
272
+ button?: string;
273
+ };
274
+
275
+ export declare type EditableTextProps = VacanoComponentProps<HTMLDivElement, EditableTextClassNames> & {
276
+ value: string;
277
+ onChange: (value: string) => void;
278
+ disabled?: boolean;
279
+ placeholder?: string;
280
+ };
281
+
271
282
  export declare const FieldLabel: ({ children, className, ref, required, variant, ...rest }: FieldLabelProps) => JSX.Element | null;
272
283
 
273
284
  export declare type FieldLabelProps = VacanoComponentProps<HTMLSpanElement> & {
@@ -811,6 +822,8 @@ export declare type TooltipProps = VacanoComponentProps<HTMLDivElement, TooltipC
811
822
 
812
823
  export declare type TooltipVariant = 'dark' | 'light' | 'success' | 'warning' | 'danger';
813
824
 
825
+ export declare const useConfirmation: () => ConfirmationContextValue;
826
+
814
827
  export declare const useImageCropper: (options?: UseImageCropperOptions) => UseImageCropperReturn;
815
828
 
816
829
  export declare type UseImageCropperOptions = {