@touchtech/baselayer-ui 2.23.2 → 3.0.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.
@@ -15,8 +15,9 @@ declare type ButtonLinkProps = {
15
15
  stretchHorizontally?: boolean;
16
16
  stretchVertically?: boolean;
17
17
  size?: Size;
18
+ disabled?: boolean;
18
19
  offsetSides?: Array<OffsetSide>;
19
20
  align?: "left" | "center";
20
21
  } | any;
21
- declare function ButtonLink({ as: Component, children, className, size, containerRef, inverted, rounded, transparent, noShadow, noPadding, noBorder, stretchHorizontally, stretchVertically, offsetSides, align, ...props }: ButtonLinkProps): JSX.Element;
22
+ declare function ButtonLink({ as: Component, children, className, size, containerRef, inverted, rounded, transparent, noShadow, noPadding, noBorder, stretchHorizontally, stretchVertically, disabled, offsetSides, align, ...props }: ButtonLinkProps): JSX.Element;
22
23
  export default ButtonLink;
@@ -10,6 +10,7 @@ declare type CheckboxProps = {
10
10
  size?: Size;
11
11
  autoFocus?: boolean;
12
12
  indeterminate?: boolean;
13
+ className?: string;
13
14
  };
14
- declare function Checkbox({ label, onChange, placeholder, checked, disabled, name, indeterminate, size, autoFocus, }: CheckboxProps): JSX.Element;
15
+ declare function Checkbox({ label, onChange, placeholder, checked, disabled, name, className, indeterminate, size, autoFocus, }: CheckboxProps): JSX.Element;
15
16
  export default Checkbox;
@@ -0,0 +1,20 @@
1
+ import { ReactChild } from "react";
2
+ export declare type Item = {
3
+ id: number | string;
4
+ name: string;
5
+ };
6
+ export declare type PromptFn<T> = (selectedItem: T | null) => ReactChild;
7
+ export declare type ItemBodyRendererFn<T> = (state: {
8
+ item: T;
9
+ isSelected: boolean;
10
+ }) => ReactChild;
11
+ export interface DropdownProps<T> {
12
+ itemBodyRenderer?: ItemBodyRendererFn<T>;
13
+ items: T[];
14
+ label?: string;
15
+ onSelect: (item: T) => void;
16
+ prompt: string | PromptFn<T>;
17
+ selectedItem: T | null;
18
+ }
19
+ declare function Dropdown<T extends Item>({ items, itemBodyRenderer, label, onSelect: handleSelect, prompt, selectedItem, }: DropdownProps<T>): JSX.Element;
20
+ export default Dropdown;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default as Dropdown, DropdownProps, Item, PromptFn, ItemBodyRendererFn, } from "./Dropdown";
@@ -15,6 +15,7 @@ declare type IconButtonLinkProps = {
15
15
  noBorder?: boolean;
16
16
  size?: Size;
17
17
  offsetSides?: Array<OffsetSide>;
18
+ disabled?: boolean;
18
19
  } | any;
19
- declare function IconButtonLink({ as: Component, containerRef, className, src, alt, badgeContent, inverted, noShadow, noBorder, transparent, rounded, offsetSides, size, ...props }: IconButtonLinkProps): JSX.Element;
20
+ declare function IconButtonLink({ as: Component, containerRef, className, src, alt, badgeContent, inverted, noShadow, noBorder, transparent, rounded, offsetSides, disabled, size, ...props }: IconButtonLinkProps): JSX.Element;
20
21
  export default IconButtonLink;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./components/Checkbox";
5
5
  export * from "./components/ColorPicker";
6
6
  export * from "./components/ColorSwatch";
7
7
  export * from "./components/ConfirmationModal";
8
+ export { Dropdown, DropdownProps, Item as DropdownItem, ItemBodyRendererFn as DropdownItemBodyRendererFn, PromptFn as DropdownPromptFn, } from "./components/Dropdown";
8
9
  export * from "./components/FileInput";
9
10
  export * from "./components/FloatingPanel";
10
11
  export * from "./components/Icon";