@foodpilot/foods 0.1.63 → 0.1.65
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/dist/components/Checkbox/BaseCheckbox.d.ts +20 -0
- package/dist/components/Checkbox/FoodsCheckbox.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Navigation/Navbar.d.ts +6 -1
- package/dist/components/Popover/AnchoredPopover.d.ts +2 -0
- package/dist/components/Radio/BaseRadio.d.ts +17 -0
- package/dist/components/Radio/FoodsRadioList.d.ts +8 -0
- package/dist/components/Radio/RadioBoolean.d.ts +5 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/main.js +11124 -10894
- package/dist/main.umd.cjs +98 -98
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CheckboxProps } from "@mui/material";
|
|
2
|
+
export type CheckboxId = string | number;
|
|
3
|
+
export type CheckboxName = string | number;
|
|
4
|
+
export type CheckboxProperties<T> = Record<CheckboxId, CheckboxPropertyValue<T>>;
|
|
5
|
+
export type CheckboxPropertyValue<T> = {
|
|
6
|
+
name: CheckboxName;
|
|
7
|
+
state: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
rawData: T;
|
|
10
|
+
};
|
|
11
|
+
export type MandatoryFields = {
|
|
12
|
+
id: number;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
type BaseCheckboxProps<T> = Omit<CheckboxProps, "onChange"> & {
|
|
16
|
+
values: CheckboxProperties<T>;
|
|
17
|
+
onChange: (newCheckbox: CheckboxProperties<T>) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const BaseCheckbox: <T>(props: BaseCheckboxProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type FoodsCheckboxProps<T> = {
|
|
2
|
+
selectedItems: T[] | undefined;
|
|
3
|
+
values: T[];
|
|
4
|
+
onChange: (selectedValues: T[]) => void;
|
|
5
|
+
getId?: (item: T) => string | number;
|
|
6
|
+
getName?: (item: T) => string | number;
|
|
7
|
+
};
|
|
8
|
+
export declare const FoodsCheckbox: <T>(props: FoodsCheckboxProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ButtonProps } from "@mui/material";
|
|
2
3
|
export type INavBarLink = {
|
|
3
4
|
icon: React.ReactElement;
|
|
4
5
|
link: string;
|
|
@@ -27,10 +28,14 @@ export type INavBarProps = {
|
|
|
27
28
|
organization: IOrganization;
|
|
28
29
|
navigate: (link: string) => void;
|
|
29
30
|
isCurrent: (link: string) => boolean;
|
|
30
|
-
logout: () => void;
|
|
31
31
|
handleIsOpen: (isOpen: boolean) => void;
|
|
32
32
|
settingsRoute: string;
|
|
33
|
+
userActions: UserActions[];
|
|
33
34
|
};
|
|
35
|
+
export type UserActions = {
|
|
36
|
+
label: string;
|
|
37
|
+
separator?: boolean;
|
|
38
|
+
} & ButtonProps;
|
|
34
39
|
type LayoutNavProps = INavBarProps & {
|
|
35
40
|
isOpen: boolean;
|
|
36
41
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { SxProps } from "@mui/material";
|
|
2
3
|
export interface IAnchoredPopoverProps {
|
|
3
4
|
open: boolean;
|
|
4
5
|
anchor: HTMLElement | null;
|
|
@@ -6,6 +7,7 @@ export interface IAnchoredPopoverProps {
|
|
|
6
7
|
anchorPosition?: "leftside" | "center" | "rightside";
|
|
7
8
|
children: JSX.Element | JSX.Element[];
|
|
8
9
|
variant?: "themed" | "headless";
|
|
10
|
+
sx?: SxProps;
|
|
9
11
|
}
|
|
10
12
|
export declare function AnchoredPopover(props: IAnchoredPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export declare function ThemedPopover(props: IAnchoredPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RadioProps } from "@mui/material";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
3
|
+
export type RadioProperties<T> = Record<string | number, RadioPropertyValue<T>>;
|
|
4
|
+
export type RadioPropertyValue<T> = {
|
|
5
|
+
name: string | number;
|
|
6
|
+
state: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
rawData?: T;
|
|
9
|
+
};
|
|
10
|
+
type BaseRadioProps<T> = Omit<RadioProps, "onChange"> & {
|
|
11
|
+
values: RadioProperties<T>;
|
|
12
|
+
onChange: (newRadio: RadioProperties<T>) => void;
|
|
13
|
+
flexDirection?: CSSProperties["flexDirection"];
|
|
14
|
+
variant?: "primary" | "secondary";
|
|
15
|
+
};
|
|
16
|
+
export declare const BaseRadio: <T>(props: BaseRadioProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type FoodsRadioListProps<T> = {
|
|
2
|
+
selectedId: T | undefined;
|
|
3
|
+
values: T[];
|
|
4
|
+
onChange: (newValue: T) => void;
|
|
5
|
+
getId?: (item: T) => string | number;
|
|
6
|
+
getName?: (item: T) => string | number;
|
|
7
|
+
};
|
|
8
|
+
export declare const FoodsRadioList: <T>(props: FoodsRadioListProps<T>) => import("react/jsx-runtime").JSX.Element;
|