@commercelayer/app-elements 1.8.3 → 1.9.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.
@@ -9,6 +9,8 @@ export declare const iconMapping: {
9
9
  readonly arrowsLeftRight: phosphor.Icon;
10
10
  readonly arrowUpRight: phosphor.Icon;
11
11
  readonly asterisk: phosphor.Icon;
12
+ readonly buildings: phosphor.Icon;
13
+ readonly caretDown: phosphor.Icon;
12
14
  readonly caretRight: phosphor.Icon;
13
15
  readonly chatCircle: phosphor.Icon;
14
16
  readonly check: phosphor.Icon;
@@ -23,20 +25,24 @@ export declare const iconMapping: {
23
25
  readonly google: phosphor.Icon;
24
26
  readonly home: phosphor.Icon;
25
27
  readonly hourglass: phosphor.Icon;
28
+ readonly lifebuoy: phosphor.Icon;
26
29
  readonly magnifyingGlass: phosphor.Icon;
27
30
  readonly minus: phosphor.Icon;
28
31
  readonly minusCircle: phosphor.Icon;
29
32
  readonly package: phosphor.Icon;
30
33
  readonly pencilSimple: phosphor.Icon;
31
34
  readonly printer: phosphor.Icon;
35
+ readonly plus: phosphor.Icon;
32
36
  readonly pulse: phosphor.Icon;
33
37
  readonly resources: phosphor.Icon;
34
38
  readonly settings: phosphor.Icon;
35
39
  readonly shoppingBag: phosphor.Icon;
40
+ readonly signOut: phosphor.Icon;
36
41
  readonly team: phosphor.Icon;
37
42
  readonly truck: phosphor.Icon;
38
43
  readonly upload: phosphor.Icon;
39
44
  readonly user: phosphor.Icon;
45
+ readonly userCircle: phosphor.Icon;
40
46
  readonly warning: phosphor.Icon;
41
47
  readonly warningCircle: phosphor.Icon;
42
48
  readonly x: phosphor.Icon;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- export interface DropdownProps {
2
+ import { type DropdownMenuProps } from '../../composite/Dropdown/DropdownMenu';
3
+ export interface DropdownProps extends Pick<DropdownMenuProps, 'menuHeader' | 'menuPosition'> {
3
4
  /** The trigger for the dropdown menu. Can be a JSX Element or simply a `string`. */
4
5
  dropdownLabel?: React.ReactNode;
5
6
  /** List of links and actions. You can use a combination of `DropdownItem` and `DropdownDivider` components. */
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,5 @@
1
- /// <reference types="react" />
1
+ import { type FC } from 'react';
2
2
  export interface DropdownDividerProps extends React.HTMLAttributes<HTMLElement> {
3
3
  children?: React.ReactNode;
4
4
  }
5
- export declare function DropdownDivider({ children, ...rest }: DropdownDividerProps): JSX.Element;
6
- export declare namespace DropdownDivider {
7
- var displayName: string;
8
- }
5
+ export declare const DropdownDivider: FC<DropdownDividerProps>;
@@ -1,9 +1,7 @@
1
- /// <reference types="react" />
1
+ import { type IconProps } from '../../atoms/Icon/Icon';
2
+ import { type FC } from 'react';
2
3
  export interface DropdownItemProps extends React.HTMLAttributes<HTMLElement> {
3
4
  label: string;
4
- icon?: React.ReactNode;
5
- }
6
- export declare function DropdownItem({ label, icon, ...rest }: DropdownItemProps): JSX.Element;
7
- export declare namespace DropdownItem {
8
- var displayName: string;
5
+ icon?: IconProps['name'] | 'keep-space';
9
6
  }
7
+ export declare const DropdownItem: FC<DropdownItemProps>;
@@ -1,10 +1,20 @@
1
- /// <reference types="react" />
2
- interface Props extends React.HTMLAttributes<HTMLElement> {
1
+ import { type FC } from 'react';
2
+ export interface DropdownMenuProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** Menu content */
3
4
  children?: React.ReactNode;
5
+ /** Set to `none` to hide the top arrow */
4
6
  arrow?: 'none';
7
+ /** Optional header for the dropdown menu */
8
+ menuHeader?: string;
9
+ /**
10
+ * Opening position of the dropdown menu
11
+ * @default bottom-right
12
+ */
13
+ menuPosition?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
14
+ /**
15
+ * If set, the arrow will be centered when trigger button is smaller than 50px
16
+ * Otherwise it will fallback to a default centering based on 32px trigger button
17
+ */
18
+ parentElementRef?: React.RefObject<HTMLDivElement>;
5
19
  }
6
- export declare function DropdownMenu({ children, arrow, ...rest }: Props): JSX.Element;
7
- export declare namespace DropdownMenu {
8
- var displayName: string;
9
- }
10
- export {};
20
+ export declare const DropdownMenu: FC<DropdownMenuProps>;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ export interface DropdownSearchProps {
3
+ /**
4
+ * Callback triggered when the user types in the search input.
5
+ * By default, this callback is debounced by 500ms.
6
+ */
7
+ onSearch: (hint: string) => void;
8
+ /**
9
+ * Debounce time in ms for the onSearch callback. Set to 0 to disable debounce.
10
+ * @default 500
11
+ */
12
+ debounceMs?: number;
13
+ /**
14
+ * Placeholder text for the input element
15
+ */
16
+ placeholder?: string;
17
+ /**
18
+ * Enable auto focus on the input element
19
+ */
20
+ autoFocus?: boolean;
21
+ }
22
+ /**
23
+ * This component renders an input as dropdown menu item with debounced `onSearch` callback.
24
+ */
25
+ export declare const DropdownSearch: import("react").ForwardRefExoticComponent<DropdownSearchProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,4 @@
1
1
  export { Dropdown, type DropdownProps } from './Dropdown';
2
2
  export { DropdownDivider, type DropdownDividerProps } from './DropdownDivider';
3
3
  export { DropdownItem, type DropdownItemProps } from './DropdownItem';
4
+ export { DropdownSearch, type DropdownSearchProps } from './DropdownSearch';
@@ -8,7 +8,7 @@ export declare const ListItemDescription: import('../../atoms/SkeletonTemplate')
8
8
  }>;
9
9
  export declare const ListItemIcon: import('../../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
10
10
  color: "none" | "green" | "orange" | "red" | "gray" | "teal" | "white" | "black" | undefined;
11
- icon: "download" | "package" | "settings" | "x" | "arrowBendDownRight" | "apps" | "arrowCircleDown" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowsLeftRight" | "arrowUpRight" | "asterisk" | "caretRight" | "chatCircle" | "check" | "cloud" | "credentials" | "creditCard" | "eye" | "flag" | "funnel" | "github" | "google" | "home" | "hourglass" | "magnifyingGlass" | "minus" | "minusCircle" | "pencilSimple" | "printer" | "pulse" | "resources" | "shoppingBag" | "team" | "truck" | "upload" | "user" | "warning" | "warningCircle" | "xCircle";
11
+ icon: "download" | "package" | "settings" | "x" | "arrowBendDownRight" | "apps" | "arrowCircleDown" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowsLeftRight" | "arrowUpRight" | "asterisk" | "buildings" | "caretDown" | "caretRight" | "chatCircle" | "check" | "cloud" | "credentials" | "creditCard" | "eye" | "flag" | "funnel" | "github" | "google" | "home" | "hourglass" | "lifebuoy" | "magnifyingGlass" | "minus" | "minusCircle" | "pencilSimple" | "printer" | "plus" | "pulse" | "resources" | "shoppingBag" | "signOut" | "team" | "truck" | "upload" | "user" | "userCircle" | "warning" | "warningCircle" | "xCircle";
12
12
  delayMs?: number | undefined;
13
13
  isLoading?: boolean | undefined;
14
14
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/app-elements",
3
- "version": "1.8.3",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [