@mw-kit/mw-ui 1.10.1 → 1.10.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.
@@ -1,5 +1,6 @@
1
1
  export { default as useAsyncOptions } from './useAsyncOptions';
2
2
  export { default as useFloatingMenu } from './useFloatingMenu';
3
+ export { default as useInitialPlacement } from './useInitialPlacement';
3
4
  export { default as useListNavigation } from './useListNavigation';
4
5
  export { default as useRuleIndex } from './useRuleIndex';
5
6
  export { default as useVirtualizedOptions } from './useVirtualizedOptions';
@@ -1,8 +1,10 @@
1
+ import type { SelectPlacement } from '../../types';
1
2
  type UseFloatingMenuParams = {
2
3
  open: boolean;
3
4
  onOpenChange: (open: boolean) => void;
5
+ placement?: SelectPlacement;
4
6
  };
5
- declare const useFloatingMenu: ({ open, onOpenChange }: UseFloatingMenuParams) => {
7
+ declare const useFloatingMenu: ({ open, onOpenChange, placement, }: UseFloatingMenuParams) => {
6
8
  floating: {
7
9
  placement: import("@floating-ui/utils").Placement;
8
10
  strategy: import("@floating-ui/utils").Strategy;
@@ -0,0 +1,6 @@
1
+ import type { SelectPlacement, SelectProps } from '../../types';
2
+ declare const useInitialPlacement: (props: SelectProps<unknown>, referenceNode: HTMLButtonElement | null) => {
3
+ placement: SelectPlacement;
4
+ syncPlacement: (node: HTMLButtonElement | null) => void;
5
+ };
6
+ export default useInitialPlacement;
@@ -1,8 +1,10 @@
1
1
  export declare const FloatingWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
2
  type TriggerProps = {
3
3
  $empty: boolean;
4
- $open: boolean;
4
+ $rotate: boolean;
5
5
  $viewMode: boolean | undefined;
6
+ $borderless: boolean | undefined;
7
+ $paddingless: boolean | undefined;
6
8
  };
7
9
  export declare const Trigger: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, TriggerProps>> & string;
8
10
  export declare const TriggerValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { ReactVirtualizerOptions } from '@tanstack/react-virtual';
3
+ import type { Property } from 'csstype';
3
4
  export type SelectOptionsLoader<Option> = (search: string, page: number, cursor: Option | null) => Promise<{
4
5
  options: Option[];
5
6
  last: boolean;
@@ -24,6 +25,7 @@ export type SelectApplyRule<Option, Id extends string = string> = {
24
25
  Component?: SelectApplyRuleComponent<Option>;
25
26
  };
26
27
  export type SelectApplyRules<T> = readonly SelectApplyRule<T, string>[];
28
+ export type SelectPlacement = 'bottom' | 'top';
27
29
  export type SelectOptionComponent<Option> = React.FunctionComponent<{
28
30
  option: Option;
29
31
  isActive: boolean;
@@ -43,6 +45,15 @@ export type CommonSelectProps<Option> = SelectButtonProps & {
43
45
  clearable?: boolean;
44
46
  readOnly?: boolean;
45
47
  viewMode?: boolean;
48
+ borderless?: boolean;
49
+ paddingless?: boolean;
50
+ zIndex?: Property.ZIndex;
51
+ placement?: SelectPlacement;
52
+ /**
53
+ * Defines the element used as the visual boundary when resolving the automatic placement.
54
+ * The viewport is used by default.
55
+ */
56
+ boundRef?: HTMLElement;
46
57
  /**
47
58
  * The number of items to render above and below the visible area.
48
59
  * The default is 2.
package/dist/index.d.mts CHANGED
@@ -6,6 +6,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
7
7
  import * as styled_components_dist_types from 'styled-components/dist/types';
8
8
  import { ReactVirtualizerOptions } from '@tanstack/react-virtual';
9
+ import { Property } from 'csstype';
9
10
  import SignatureCanvas, { SignatureCanvasProps } from 'react-signature-canvas';
10
11
 
11
12
  type TransitionFunction = 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | 'step-start' | 'step-end' | `cubic-bezier(${number}, ${number}, ${number}, ${number})` | `frames(${number})` | `steps(${number})` | `steps(${number}, ${'jump-start' | 'jump-end' | 'jump-none' | 'jump-both' | 'start' | 'end'})`;
@@ -3174,6 +3175,7 @@ type SelectApplyRule<Option, Id extends string = string> = {
3174
3175
  Component?: SelectApplyRuleComponent<Option>;
3175
3176
  };
3176
3177
  type SelectApplyRules<T> = readonly SelectApplyRule<T, string>[];
3178
+ type SelectPlacement = 'bottom' | 'top';
3177
3179
  type SelectOptionComponent<Option> = react__default.FunctionComponent<{
3178
3180
  option: Option;
3179
3181
  isActive: boolean;
@@ -3193,6 +3195,15 @@ type CommonSelectProps<Option> = SelectButtonProps & {
3193
3195
  clearable?: boolean;
3194
3196
  readOnly?: boolean;
3195
3197
  viewMode?: boolean;
3198
+ borderless?: boolean;
3199
+ paddingless?: boolean;
3200
+ zIndex?: Property.ZIndex;
3201
+ placement?: SelectPlacement;
3202
+ /**
3203
+ * Defines the element used as the visual boundary when resolving the automatic placement.
3204
+ * The viewport is used by default.
3205
+ */
3206
+ boundRef?: HTMLElement;
3196
3207
  /**
3197
3208
  * The number of items to render above and below the visible area.
3198
3209
  * The default is 2.