@northlight/ui 2.33.1 → 2.33.3

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.
@@ -27,7 +27,6 @@ import * as _chakra_ui_layout_dist_stack_stack_utils from '@chakra-ui/layout/dis
27
27
  import * as _chakra_ui_radio_dist_radio_group from '@chakra-ui/radio/dist/radio-group';
28
28
  import * as react_select from 'react-select';
29
29
  import * as react_select_dist_declarations_src_types from 'react-select/dist/declarations/src/types';
30
- import * as _chakra_ui_switch_dist_switch from '@chakra-ui/switch/dist/switch';
31
30
  import * as _chakra_ui_textarea_dist_textarea from '@chakra-ui/textarea/dist/textarea';
32
31
  import { Props as Props$1 } from 'react-input-mask';
33
32
  import { NumericFormatProps, NumberFormatValues, SourceInfo } from 'react-number-format';
@@ -146,6 +145,10 @@ interface SelectProps<T, K extends boolean> extends Omit<Props<T, K, GroupBase<T
146
145
  customOption?: ((option: T) => JSX.Element) | null;
147
146
  isMulti?: K;
148
147
  ref?: Ref<SelectInstance<T, K, GroupBase<T>>>;
148
+ /** Should return a unique key that is tracked so when the key changes
149
+ the sub-components for react-select will be recomputed/rerendered
150
+ */
151
+ generateComponentsUpdateKey?: () => unknown;
149
152
  }
150
153
  type SelectFieldProps<T, K extends boolean = false> = SelectProps<T, K> & Omit<InputFieldProps, 'isMulti'> & {
151
154
  direction?: StackDirection;
@@ -2922,11 +2925,11 @@ type SpinnerProps = SpinnerProps$1;
2922
2925
  */
2923
2926
  declare const Spinner: ({ ...rest }: SpinnerProps) => JSX.Element;
2924
2927
 
2925
- type SwitchProps = SwitchProps$1 & {
2928
+ interface SwitchProps extends Omit<SwitchProps$1, 'value'> {
2926
2929
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
2927
2930
  value?: boolean;
2928
- };
2929
- type SwitchFieldProps = SwitchProps$1 & {
2931
+ }
2932
+ interface SwitchFieldProps extends SwitchProps$1 {
2930
2933
  name: string;
2931
2934
  label: string;
2932
2935
  validate?: RegisterOptions;
@@ -2934,7 +2937,7 @@ type SwitchFieldProps = SwitchProps$1 & {
2934
2937
  direction?: StackDirection;
2935
2938
  labelPlacement?: 'left' | 'right';
2936
2939
  labelSize?: '2xs' | 'xs' | 'md' | 'lg';
2937
- };
2940
+ }
2938
2941
 
2939
2942
  /**
2940
2943
  * @see SwitchField
@@ -2982,15 +2985,7 @@ declare const Switch: ({ value, onChange, name, size, ...rest }: SwitchProps) =>
2982
2985
  * ?)
2983
2986
  *
2984
2987
  */
2985
- declare const SwitchField: (props: _chakra_ui_switch_dist_switch.SwitchProps & {
2986
- name: string;
2987
- label: string;
2988
- validate?: react_hook_form.RegisterOptions | undefined;
2989
- isRequired?: boolean | undefined;
2990
- direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
2991
- labelPlacement?: "right" | "left" | undefined;
2992
- labelSize?: "md" | "lg" | "2xs" | "xs" | undefined;
2993
- } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2988
+ declare const SwitchField: (props: SwitchFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2994
2989
 
2995
2990
  interface TableProps extends Omit<TableProps$1, 'variant'> {
2996
2991
  variant?: TableProps$1['variant'] | 'rounded';
@@ -12604,7 +12604,8 @@ const Select = forwardRef$1((_a, ref) => {
12604
12604
  isClearable = false,
12605
12605
  value,
12606
12606
  icon,
12607
- components
12607
+ components,
12608
+ generateComponentsUpdateKey = always(0)
12608
12609
  } = _b, rest = __objRest$n(_b, [
12609
12610
  "options",
12610
12611
  "isMulti",
@@ -12619,7 +12620,8 @@ const Select = forwardRef$1((_a, ref) => {
12619
12620
  "isClearable",
12620
12621
  "value",
12621
12622
  "icon",
12622
- "components"
12623
+ "components",
12624
+ "generateComponentsUpdateKey"
12623
12625
  ]);
12624
12626
  const handleChange = useSelectCallbacks({
12625
12627
  onChange,
@@ -12630,7 +12632,7 @@ const Select = forwardRef$1((_a, ref) => {
12630
12632
  });
12631
12633
  const customComponents = useMemo(
12632
12634
  () => getComponents(components),
12633
- []
12635
+ [generateComponentsUpdateKey()]
12634
12636
  );
12635
12637
  const prevOptions = useRef(
12636
12638
  options