@ws-ui/ui-components 1.0.9 → 1.0.12

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
@@ -20,11 +20,12 @@ export declare type BreadcrumbColorConfig = {
20
20
  hover: string;
21
21
  };
22
22
 
23
- export declare interface BreadcrumbItem {
23
+ export declare interface BreadcrumbItem extends Omit<React.HTMLAttributes<HTMLElement>, 'onClick'> {
24
24
  label: ReactNode;
25
25
  href?: string;
26
26
  onClick?: () => void;
27
27
  icon?: ReactNode;
28
+ ref?: React.Ref<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>;
28
29
  }
29
30
 
30
31
  export declare const Breadcrumbs: default_2.FC<BreadcrumbsProps>;
@@ -2663,23 +2664,15 @@ export declare interface IMultilineMessage {
2663
2664
  }
2664
2665
 
2665
2666
  export declare const Input: {
2666
- Root: ({ size, color, isInvalid, isDisabled, className, children, ...props }: InputRootProps) => JSX_2.Element;
2667
- Group: ({ className, children, ...props }: InputGroupProps) => JSX_2.Element;
2667
+ Root: ForwardRefExoticComponent<InputRootProps & RefAttributes<HTMLDivElement>>;
2668
+ Group: ForwardRefExoticComponent<InputGroupProps & RefAttributes<HTMLDivElement>>;
2668
2669
  Field: ForwardRefExoticComponent<InputFieldProps & RefAttributes<HTMLInputElement>>;
2669
2670
  Area: ForwardRefExoticComponent<InputAreaProps & RefAttributes<HTMLTextAreaElement>>;
2670
- Icon: {
2671
- ({ isAction, className, isDisabled, style, children, ...props }: InputIconProps): JSX_2.Element;
2672
- displayName: string;
2673
- };
2674
- Message: {
2675
- ({ icon, className, children, ...props }: InputMessageProps): JSX_2.Element;
2676
- displayName: string;
2677
- };
2671
+ Icon: ForwardRefExoticComponent<InputIconProps & RefAttributes<HTMLDivElement>>;
2672
+ Message: ForwardRefExoticComponent<InputMessageProps & RefAttributes<HTMLDivElement>>;
2678
2673
  };
2679
2674
 
2680
2675
  export declare interface InputAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
2681
- value?: string;
2682
- defaultValue?: string;
2683
2676
  placeholder?: string;
2684
2677
  isDisabled?: boolean;
2685
2678
  isRequired?: boolean;
@@ -2726,6 +2719,7 @@ export declare interface InputContextValue {
2726
2719
  color: InputColor;
2727
2720
  isInvalid: boolean;
2728
2721
  isDisabled: boolean;
2722
+ isReadOnly: boolean;
2729
2723
  hasMessage: boolean;
2730
2724
  setHasMessage: React.Dispatch<React.SetStateAction<boolean>>;
2731
2725
  hasArea: boolean;
@@ -2733,8 +2727,6 @@ export declare interface InputContextValue {
2733
2727
  }
2734
2728
 
2735
2729
  export declare interface InputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
2736
- value?: string;
2737
- defaultValue?: string;
2738
2730
  placeholder?: string;
2739
2731
  type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search';
2740
2732
  isDisabled?: boolean;
@@ -2780,6 +2772,7 @@ export declare interface InputRootProps extends React.HTMLAttributes<HTMLDivElem
2780
2772
  color?: 'primary' | 'positive' | 'warning' | 'negative';
2781
2773
  isInvalid?: boolean;
2782
2774
  isDisabled?: boolean;
2775
+ isReadOnly?: boolean;
2783
2776
  className?: string;
2784
2777
  children: ReactNode;
2785
2778
  }
@@ -2926,7 +2919,7 @@ export declare interface PanelProps extends Omit<React.HTMLAttributes<HTMLDivEle
2926
2919
  /**
2927
2920
  * the type of border to apply diferent border color bor tabs and normal panel
2928
2921
  */
2929
- contentType?: 'tabs' | 'primary' | 'light' | 'default';
2922
+ borderType?: 'tabs' | 'primary' | 'negative' | 'positive' | 'light' | 'default';
2930
2923
  /**
2931
2924
  * Whether the panel is disabled.
2932
2925
  * If true, changes text color to inactive-text.
@@ -3315,12 +3308,49 @@ export declare const Select: {
3315
3308
  ({ icon, className, children, ...props }: SelectMessageProps): JSX_2.Element;
3316
3309
  displayName: string;
3317
3310
  };
3318
- Field: {
3319
- <T = unknown>({ placeholder, noOptionsMessage, hideNoOptions, loadingMessage, isClearable, isSearchClearable, isLoading, isRequired, hideIndicators, hideDropdownIndicator, searchPlacement, hideSelectedOptions, onFocus, onBlur, renderMenuHeader, formatOptionLabel, displayFormattedOption, isOptionDisabled, inputRef: propInputRef, controlShouldRenderValue, name, id, onSelectionComplete, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, children, usePortal, ...props }: SelectFieldProps<T>): JSX_2.Element;
3320
- displayName: string;
3321
- };
3311
+ Field: <T = unknown>(props: SelectFieldProps<T> & {
3312
+ ref?: React.Ref<HTMLDivElement>;
3313
+ }) => React.ReactElement;
3322
3314
  };
3323
3315
 
3316
+ /**
3317
+ * Adapter component to usage the system Select with the legacy interface.
3318
+ * Original interface:
3319
+ * {
3320
+ * value: string;
3321
+ * onChange: (val: string) => void;
3322
+ * options: { name: string }[];
3323
+ * errorMessage?: string;
3324
+ * onBlur?: () => void;
3325
+ * }
3326
+ */
3327
+ export declare const SelectAdapter: ({ value, onChange, options, errorMessage, onBlur, }: SelectAdapterProps) => JSX_2.Element;
3328
+
3329
+ declare interface SelectAdapterProps {
3330
+ /**
3331
+ * The current value of the select (name property of the option)
3332
+ */
3333
+ value: string;
3334
+ /**
3335
+ * Callback when value changes. Returns the name property.
3336
+ */
3337
+ onChange: (val: string) => void;
3338
+ /**
3339
+ * List of options. Each option must have a name property.
3340
+ */
3341
+ options: {
3342
+ name: string;
3343
+ }[];
3344
+ /**
3345
+ * Error message to display. If provided, shows error state.
3346
+ */
3347
+ errorMessage?: string;
3348
+ /**
3349
+ * Blur handler
3350
+ */
3351
+ onBlur?: () => void;
3352
+ }
3353
+
3324
3354
  export declare interface SelectClearIndicatorProps extends default_2.HTMLAttributes<HTMLDivElement> {
3325
3355
  color?: SelectColor;
3326
3356
  className?: string;
@@ -3680,7 +3710,6 @@ export declare interface TabsProps<T = unknown> {
3680
3710
  disabled?: boolean;
3681
3711
  className?: string;
3682
3712
  tabListClassName?: string;
3683
- contentClassName?: string;
3684
3713
  onTabChange?: (value: string) => void;
3685
3714
  onReorder?: (tabs: T[], droppedTab?: T) => void;
3686
3715
  renderTab?: (props: {
@@ -3733,14 +3762,11 @@ export declare const ToastProvider: ({ children }: {
3733
3762
  children: React.ReactNode;
3734
3763
  }) => JSX_2.Element;
3735
3764
 
3736
- export declare const Toggle: {
3737
- ({ label, checked, defaultChecked, disabled, size, color, icons, onChange, className, id, name, ...rest }: ToggleProps): JSX_2.Element;
3738
- displayName: string;
3739
- };
3765
+ export declare const Toggle: ForwardRefExoticComponent<ToggleProps & RefAttributes<HTMLButtonElement>>;
3740
3766
 
3741
3767
  export declare type ToggleColor = 'primary' | 'positive' | 'negative' | 'warning';
3742
3768
 
3743
- export declare interface ToggleProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
3769
+ export declare interface ToggleProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange'> {
3744
3770
  label?: string;
3745
3771
  checked?: boolean;
3746
3772
  defaultChecked?: boolean;
@@ -3748,8 +3774,8 @@ export declare interface ToggleProps extends Omit<React.HTMLAttributes<HTMLDivEl
3748
3774
  size?: ToggleSize;
3749
3775
  color?: ToggleColor;
3750
3776
  icons?: {
3751
- checked: React.ReactNode;
3752
- unchecked: React.ReactNode;
3777
+ checked: ReactNode;
3778
+ unchecked: ReactNode;
3753
3779
  };
3754
3780
  onChange?: (checked: boolean) => void;
3755
3781
  name?: string;