@pushwoosh/dumb-components 2.9.13 → 2.9.15

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.
@@ -54,7 +54,7 @@ type CommonProps<T> = {
54
54
  width?: string;
55
55
  /** Minimum CSS width, useful together with `autosize`. */
56
56
  minWidth?: string;
57
- /** Let the dropdown stretch to the field width instead of capping at the default width (use for wide, full-width fields). */
57
+ /** Make the dropdown exactly as wide as the field instead of capping at the default width. */
58
58
  fullWidth?: boolean;
59
59
  };
60
60
  /**
@@ -57,7 +57,7 @@ export type ComboboxMultiProps<T> = ItemsSource<T> & GetKeyProp<T> & CreatablePr
57
57
  width?: string;
58
58
  /** Minimum CSS width, useful together with `autosize`. */
59
59
  minWidth?: string;
60
- /** Let the dropdown stretch to the field width instead of capping at the default width (use for wide, full-width fields). */
60
+ /** Make the dropdown exactly as wide as the field instead of capping at the default width. */
61
61
  fullWidth?: boolean;
62
62
  };
63
63
  export {};
package/Switch/styles.js CHANGED
@@ -43,7 +43,7 @@ export const Container = styled.div.withConfig({
43
43
  $isDisabled
44
44
  }) => $isDisabled ? 'not-allowed' : 'pointer');
45
45
  export const Box = styled.div.attrs({
46
- tabIndex: '0'
46
+ tabIndex: 0
47
47
  }).withConfig({
48
48
  displayName: "Box",
49
49
  componentId: "sc-csdrg2-1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "2.9.13",
3
+ "version": "2.9.15",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -2,7 +2,7 @@ import { Color } from '@pushwoosh/kit-constants';
2
2
  export declare const LOADING_BORDER_COLORS: readonly [Color.PRIMARY, Color.BRIGHT, Color.BRAND_GREEN, Color.EXCEPTIONAL];
3
3
  export declare const LOADING_BORDER_ANIMATION_MS = 3000;
4
4
  export declare const DROPDOWN_MAX_HEIGHT = 300;
5
- /** Default dropdown width cap. A field wider than this stretches the dropdown to its own width only when the field opts in via `fullWidth`; otherwise the dropdown stays capped here. */
5
+ /** Default dropdown width cap. With `fullWidth` the dropdown matches the field width instead. */
6
6
  export declare const DROPDOWN_DEFAULT_WIDTH = 320;
7
7
  /** Default debounce (ms) before an async `loadItems` call fires after the query changes. */
8
8
  export declare const DEFAULT_DEBOUNCE_MS = 250;
@@ -2,7 +2,7 @@ import { Color } from '@pushwoosh/kit-constants';
2
2
  export const LOADING_BORDER_COLORS = [Color.PRIMARY, Color.BRIGHT, Color.BRAND_GREEN, Color.EXCEPTIONAL];
3
3
  export const LOADING_BORDER_ANIMATION_MS = 3000;
4
4
  export const DROPDOWN_MAX_HEIGHT = 300;
5
- /** Default dropdown width cap. A field wider than this stretches the dropdown to its own width only when the field opts in via `fullWidth`; otherwise the dropdown stays capped here. */
5
+ /** Default dropdown width cap. With `fullWidth` the dropdown matches the field width instead. */
6
6
  export const DROPDOWN_DEFAULT_WIDTH = 320;
7
7
  /** Default debounce (ms) before an async `loadItems` call fires after the query changes. */
8
8
  export const DEFAULT_DEBOUNCE_MS = 250;
@@ -6,7 +6,7 @@ type Args = {
6
6
  /**
7
7
  * Positions the dropdown relative to the field via floating-ui (flip, offset,
8
8
  * width/height sizing) and wires click-outside to `onClickOutside`. With
9
- * `fullWidth` the dropdown stretches to the field width instead of capping at
9
+ * `fullWidth` the dropdown is exactly as wide as the field instead of capping at
10
10
  * `DROPDOWN_DEFAULT_WIDTH`.
11
11
  */
12
12
  export declare function useDropdownPosition({ isOpen, onClickOutside, fullWidth }: Args): {
@@ -4,7 +4,7 @@ import { useOnClickOutside } from '../../hooks';
4
4
  /**
5
5
  * Positions the dropdown relative to the field via floating-ui (flip, offset,
6
6
  * width/height sizing) and wires click-outside to `onClickOutside`. With
7
- * `fullWidth` the dropdown stretches to the field width instead of capping at
7
+ * `fullWidth` the dropdown is exactly as wide as the field instead of capping at
8
8
  * `DROPDOWN_DEFAULT_WIDTH`.
9
9
  */
10
10
  export function useDropdownPosition({
@@ -27,7 +27,7 @@ export function useDropdownPosition({
27
27
  availableHeight
28
28
  }) {
29
29
  const fieldWidth = rects.reference.width;
30
- const maxWidth = fullWidth ? Math.min(Math.max(fieldWidth, DROPDOWN_DEFAULT_WIDTH), availableWidth) : Math.min(DROPDOWN_DEFAULT_WIDTH, availableWidth);
30
+ const maxWidth = Math.min(fullWidth ? fieldWidth : DROPDOWN_DEFAULT_WIDTH, availableWidth);
31
31
  const minWidth = Math.min(fieldWidth, maxWidth);
32
32
  Object.assign(elements.floating.style, {
33
33
  minWidth: `${minWidth}px`,