@jobber/components 8.3.0 → 8.5.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.
- package/ActivityIndicator.d.ts +1 -0
- package/ActivityIndicator.js +17 -0
- package/dist/ActivityIndicator/ActivityIndicator.d.ts +38 -0
- package/dist/ActivityIndicator/index.cjs +9 -0
- package/dist/ActivityIndicator/index.d.ts +2 -0
- package/dist/ActivityIndicator/index.mjs +3 -0
- package/dist/ActivityIndicator-cjs.js +27 -0
- package/dist/ActivityIndicator-es.js +25 -0
- package/dist/Autocomplete/Autocomplete.d.ts +6 -4
- package/dist/Autocomplete/Autocomplete.types.d.ts +3 -137
- package/dist/Autocomplete/components/FloatingMenu.d.ts +6 -6
- package/dist/Autocomplete/components/MenuList.d.ts +4 -4
- package/dist/Autocomplete/components/PersistentRegion.d.ts +3 -3
- package/dist/Autocomplete/index.cjs +25 -1658
- package/dist/Autocomplete/index.d.ts +3 -30
- package/dist/Autocomplete/index.mjs +25 -1647
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +15 -15
- package/dist/Autocomplete/useAutocomplete.d.ts +2 -2
- package/dist/Autocomplete-cjs.js +1306 -0
- package/dist/Autocomplete-es.js +1304 -0
- package/dist/Menu-es.js +1 -1
- package/dist/MenuSubmenuTrigger-es.js +1 -1
- package/dist/Spinner/Spinner.d.ts +6 -0
- package/dist/Spinner-cjs.js +3 -0
- package/dist/Spinner-es.js +3 -0
- package/dist/docs/ActivityIndicator/ActivityIndicator.md +67 -0
- package/dist/docs/Autocomplete/{AutocompleteV2.md → Autocomplete.md} +13 -107
- package/dist/docs/Banner/Banner.md +3 -3
- package/dist/docs/Box/Box.md +2 -2
- package/dist/docs/Chips/Chips.md +1 -1
- package/dist/docs/DataList/DataList.md +1 -1
- package/dist/docs/Icon/Icon.md +1 -1
- package/dist/docs/InputGroup/InputGroup.md +1 -1
- package/dist/docs/Menu/Menu.md +1 -1
- package/dist/docs/Modal/Modal.md +3 -3
- package/dist/docs/MultiSelect/MultiSelect.md +1 -1
- package/dist/docs/Spinner/Spinner.md +9 -1
- package/dist/docs/index.md +2 -2
- package/dist/docs/usage-guidelines/usage-guidelines.md +8 -10
- package/dist/floating-ui.react-dom-es.js +1 -1
- package/dist/floating-ui.react-es.js +1 -1
- package/dist/index.cjs +5 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm-es.js +1 -1
- package/dist/index.mjs +3 -2
- package/dist/styles.css +308 -153
- package/dist/utils/meta/meta.json +1 -0
- package/package.json +8 -3
- package/dist/Autocomplete/Autocomplete.rebuilt.d.ts +0 -8
- package/dist/Autocomplete/Autocomplete.utils.d.ts +0 -8
- package/dist/Autocomplete/Menu/DefaultMenu.d.ts +0 -16
- package/dist/Autocomplete/Menu/Menu.d.ts +0 -3
- package/dist/Autocomplete/Menu/MenuWrapper.d.ts +0 -23
- package/dist/Autocomplete/Option.d.ts +0 -78
- package/dist/Autocomplete/V1.docgen.d.ts +0 -4
- package/dist/Autocomplete/V2.docgen.d.ts +0 -6
- package/dist/Autocomplete/useKeyboardNavigation.d.ts +0 -35
- package/dist/Autocomplete/useRepositionMenu.d.ts +0 -10
- package/dist/docs/Autocomplete/AutocompleteV1.md +0 -1328
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type AnyOption, type GroupOption, type Option } from "./Autocomplete.types";
|
|
2
|
-
export declare function isOptionSelected(selectedOption: Option | undefined, option: Option): boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Helper function to determine if the option is a group. This is used to
|
|
5
|
-
* determine if the option contains a list of options for rendering Section
|
|
6
|
-
* Labels in the Autocomplete component.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isOptionGroup<T extends AnyOption>(option: T): option is Extract<T, GroupOption>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type AnyOption, type Option } from "../Autocomplete.types";
|
|
3
|
-
export interface DefaultMenuProps {
|
|
4
|
-
readonly options: AnyOption[];
|
|
5
|
-
readonly selectedOption?: Option;
|
|
6
|
-
/**
|
|
7
|
-
* Element that it's attached to when the menu opens.
|
|
8
|
-
*/
|
|
9
|
-
readonly attachTo: HTMLDivElement | null;
|
|
10
|
-
onOptionSelect(chosenOption?: Option): void;
|
|
11
|
-
readonly visible: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Renders the default Menu for the Autocomplete component.
|
|
15
|
-
*/
|
|
16
|
-
export declare function DefaultMenu({ options, selectedOption, onOptionSelect, attachTo, visible, }: DefaultMenuProps): React.JSX.Element;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { type AnyOption, type MenuProps, type Option } from "../Autocomplete.types";
|
|
3
|
-
export declare function Menu<GenericOption extends AnyOption = AnyOption, GenericOptionValue extends Option = Option>({ options, selectedOption, onOptionSelect, inputFocused, attachTo, inputRef, customRenderMenu, }: MenuProps<GenericOption, GenericOptionValue>): React.JSX.Element | null;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from "react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import type { UseRepositionMenu } from "../useRepositionMenu";
|
|
4
|
-
export interface BaseAutocompleteMenuWrapperInternalProps {
|
|
5
|
-
readonly setMenuRef: UseRepositionMenu["setMenuRef"];
|
|
6
|
-
readonly floatStyles: UseRepositionMenu["styles"];
|
|
7
|
-
readonly targetWidth: UseRepositionMenu["targetWidth"];
|
|
8
|
-
readonly visible?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Provides a wrapper for the Autocomplete menu that handles positioning and visibility.
|
|
12
|
-
* @param attachTo - The element that the menu should be attached to.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useAutocompleteMenu({ attachTo, }: {
|
|
15
|
-
attachTo: HTMLDivElement | null;
|
|
16
|
-
}): {
|
|
17
|
-
MenuWrapper: ({ children, visible, }: {
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
visible: boolean;
|
|
20
|
-
}) => React.ReactElement;
|
|
21
|
-
menuRef: HTMLElement | null;
|
|
22
|
-
};
|
|
23
|
-
export declare function BaseAutocompleteMenuWrapper(props: PropsWithChildren<BaseAutocompleteMenuWrapperInternalProps>): React.JSX.Element;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { PropsWithChildren } from "react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { type AnyOption, type Option } from "./Autocomplete.types";
|
|
4
|
-
export interface MenuOptionProps {
|
|
5
|
-
readonly isHighlighted: boolean;
|
|
6
|
-
readonly option: AnyOption;
|
|
7
|
-
readonly onOptionSelect: (option?: AnyOption) => void;
|
|
8
|
-
/**
|
|
9
|
-
* Whether to add separators between the options.
|
|
10
|
-
*/
|
|
11
|
-
readonly addSeparators: boolean;
|
|
12
|
-
readonly isSelected: boolean;
|
|
13
|
-
readonly UNSAFE_className?: {
|
|
14
|
-
option?: BaseMenuOptionProps["UNSAFE_className"];
|
|
15
|
-
content?: MenuOptionContentProps["UNSAFE_className"];
|
|
16
|
-
groupOption?: MenuGroupOptionProps["UNSAFE_className"];
|
|
17
|
-
};
|
|
18
|
-
readonly UNSAFE_style?: {
|
|
19
|
-
option?: BaseMenuOptionProps["UNSAFE_style"];
|
|
20
|
-
content?: MenuOptionContentProps["UNSAFE_style"];
|
|
21
|
-
groupOption?: MenuGroupOptionProps["UNSAFE_style"];
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The rendering of the default MenuOption
|
|
26
|
-
*/
|
|
27
|
-
export declare function MenuOption({ isHighlighted, option, onOptionSelect, isSelected, addSeparators, UNSAFE_className, UNSAFE_style, }: MenuOptionProps): React.JSX.Element;
|
|
28
|
-
interface MenuOptionContentProps {
|
|
29
|
-
readonly UNSAFE_className?: {
|
|
30
|
-
readonly icon?: string;
|
|
31
|
-
readonly text?: string;
|
|
32
|
-
readonly details?: string;
|
|
33
|
-
readonly label?: string;
|
|
34
|
-
};
|
|
35
|
-
readonly UNSAFE_style?: {
|
|
36
|
-
readonly icon?: React.CSSProperties;
|
|
37
|
-
readonly text?: React.CSSProperties;
|
|
38
|
-
readonly label?: React.CSSProperties;
|
|
39
|
-
readonly details?: React.CSSProperties;
|
|
40
|
-
};
|
|
41
|
-
readonly option: Option;
|
|
42
|
-
readonly isSelected: boolean;
|
|
43
|
-
}
|
|
44
|
-
export declare function MenuOptionContent({ option, isSelected, UNSAFE_className, UNSAFE_style, }: MenuOptionContentProps): React.JSX.Element;
|
|
45
|
-
export interface MenuGroupOptionProps {
|
|
46
|
-
readonly option: AnyOption;
|
|
47
|
-
readonly UNSAFE_className?: {
|
|
48
|
-
heading?: string;
|
|
49
|
-
};
|
|
50
|
-
readonly UNSAFE_style?: {
|
|
51
|
-
heading?: React.CSSProperties;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The rendering of the default MenuGroupOption
|
|
56
|
-
*/
|
|
57
|
-
export declare function MenuGroupOptions({ option, UNSAFE_className, UNSAFE_style, }: MenuGroupOptionProps): React.JSX.Element;
|
|
58
|
-
/**
|
|
59
|
-
* The base component for the MenuGroupOption
|
|
60
|
-
*/
|
|
61
|
-
export interface BaseMenuGroupOptionProps extends PropsWithChildren {
|
|
62
|
-
readonly UNSAFE_className?: string;
|
|
63
|
-
readonly UNSAFE_style?: React.CSSProperties;
|
|
64
|
-
}
|
|
65
|
-
export declare function BaseMenuGroupOption({ children, UNSAFE_className, UNSAFE_style, }: BaseMenuGroupOptionProps): React.JSX.Element;
|
|
66
|
-
export interface BaseMenuOptionProps<GenericOption extends AnyOption = AnyOption> extends PropsWithChildren {
|
|
67
|
-
readonly option?: GenericOption;
|
|
68
|
-
readonly onOptionSelect?: (option?: GenericOption) => void;
|
|
69
|
-
readonly isHighlighted: boolean;
|
|
70
|
-
readonly addSeparators: boolean;
|
|
71
|
-
readonly UNSAFE_className?: string;
|
|
72
|
-
readonly UNSAFE_style?: React.CSSProperties;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Renders the base option component. The component takes children and renders them inside a button.
|
|
76
|
-
*/
|
|
77
|
-
export declare function BaseMenuOption<GenericOption extends AnyOption = AnyOption>({ option, isHighlighted, onOptionSelect, addSeparators, children, UNSAFE_className, UNSAFE_style, }: BaseMenuOptionProps<GenericOption>): React.JSX.Element;
|
|
78
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import type { AnyOption, AutocompleteLegacyProps, Option } from "@jobber/components/Autocomplete";
|
|
3
|
-
export type V1DocgenProps = AutocompleteLegacyProps<AnyOption, Option, AnyOption>;
|
|
4
|
-
export declare const AutocompleteV1Docgen: React.FC<V1DocgenProps>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type React from "react";
|
|
2
|
-
import type { AutocompleteRebuiltProps, OptionLike } from "@jobber/components/Autocomplete";
|
|
3
|
-
type ExtraProps = Record<string, unknown>;
|
|
4
|
-
export type V2DocgenProps = AutocompleteRebuiltProps<OptionLike, boolean, ExtraProps, ExtraProps>;
|
|
5
|
-
export declare const AutocompleteV2Docgen: React.FC<V2DocgenProps>;
|
|
6
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type AnyOption, type Option } from "./Autocomplete.types";
|
|
2
|
-
export declare enum KeyboardAction {
|
|
3
|
-
Previous = -1,
|
|
4
|
-
Next = 1,
|
|
5
|
-
Select = 0
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Hook to handle custom keyboard navigation for the Autocomplete component.
|
|
9
|
-
* Use this hook if you are using components in the menu that aren't MenuOption or BaseMenuOption.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useCustomKeyboardNavigation({ onRequestHighlightChange, }: {
|
|
12
|
-
onRequestHighlightChange?: (event: KeyboardEvent, direction: KeyboardAction) => void;
|
|
13
|
-
}): void;
|
|
14
|
-
/**
|
|
15
|
-
* Hook to handle keyboard navigation for the Menu in the Autocomplete component.
|
|
16
|
-
* If using components in the menu that aren't MenuOption or BaseMenuOption, you should use the `useCustomKeyboardNavigation` hook.
|
|
17
|
-
*/
|
|
18
|
-
export declare function useKeyboardNavigation<GenericOption extends AnyOption = AnyOption, GenericOptionValue extends Option = Option>({ options, onOptionSelect, menuRef, visible, }: {
|
|
19
|
-
options: GenericOption[];
|
|
20
|
-
visible?: boolean;
|
|
21
|
-
menuRef?: HTMLElement | null;
|
|
22
|
-
onOptionSelect: (option?: GenericOptionValue) => void;
|
|
23
|
-
}): {
|
|
24
|
-
highlightedIndex: number;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Function to get the requested index change based on the current highlighted index and the direction of the keyboard action.
|
|
28
|
-
* Accounts for groups in the options array.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getRequestedIndexChange<T extends AnyOption>({ event, options, direction, highlightedIndex, }: {
|
|
31
|
-
event: KeyboardEvent;
|
|
32
|
-
direction: KeyboardAction;
|
|
33
|
-
options: T[];
|
|
34
|
-
highlightedIndex: number;
|
|
35
|
-
}): number;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MenuProps } from "./Autocomplete.types";
|
|
2
|
-
export interface UseRepositionMenu {
|
|
3
|
-
readonly menuRef: HTMLElement | null;
|
|
4
|
-
readonly setMenuRef: (ref: HTMLElement | null) => void;
|
|
5
|
-
readonly targetWidth: number | undefined;
|
|
6
|
-
readonly styles: {
|
|
7
|
-
float: React.CSSProperties;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare function useRepositionMenu(attachTo: MenuProps["attachTo"], visible: boolean, cssManagedVisibility: boolean): UseRepositionMenu;
|