@neovici/cosmoz-dropdown 5.2.0 → 5.4.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.
@@ -1,9 +1,7 @@
1
1
  import { UseFocusOpts } from './use-focus';
2
2
  import { Content } from './cosmoz-dropdown-content';
3
- import { Placement, Strategy } from './use-floating';
4
- export interface Props extends UseFocusOpts {
5
- placement?: Placement;
6
- strategy?: Strategy;
3
+ import { UseFloating } from './use-floating';
4
+ export interface Props extends UseFocusOpts, UseFloating {
7
5
  render: () => unknown;
8
6
  }
9
7
  declare const Dropdown: (host: HTMLElement & Props) => import("lit-html").TemplateResult<1>;
@@ -54,11 +54,12 @@ const style = css `
54
54
  }
55
55
  `;
56
56
  const Dropdown = (host) => {
57
- const { placement, strategy, render } = host;
57
+ const { placement, strategy, middleware, render } = host;
58
58
  const { active, onToggle } = useHostFocus(host);
59
59
  const { styles, setReference, setFloating } = useFloating({
60
60
  placement,
61
61
  strategy,
62
+ middleware,
62
63
  });
63
64
  return html ` <div class="anchor" part="anchor" ${ref(setReference)}>
64
65
  <button
@@ -1,10 +1,11 @@
1
1
  import { ComputePositionConfig, Placement, Strategy } from '@floating-ui/dom';
2
+ export { flip, shift, size } from '@floating-ui/dom';
2
3
  export declare const defaultMiddleware: {
3
4
  name: string;
4
5
  options?: any;
5
6
  fn: (state: import("@floating-ui/dom").MiddlewareState) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
6
7
  }[];
7
- interface UseFloating extends Pick<ComputePositionConfig, 'placement' | 'strategy' | 'middleware'> {
8
+ export interface UseFloating extends Pick<ComputePositionConfig, 'placement' | 'strategy' | 'middleware'> {
8
9
  }
9
10
  export declare const useFloating: ({ placement, strategy, middleware, }: UseFloating) => {
10
11
  setReference: (el?: Element) => void;
@@ -1,5 +1,6 @@
1
1
  import { useCallback, useEffect, useMemo, useState } from '@pionjs/pion';
2
2
  import { autoUpdate, computePosition, flip, shift, } from '@floating-ui/dom';
3
+ export { flip, shift, size } from '@floating-ui/dom';
3
4
  export const defaultMiddleware = [
4
5
  flip({
5
6
  fallbackAxisSideDirection: 'start',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-dropdown",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "A simple dropdown web component",
5
5
  "keywords": [
6
6
  "lit-html",