@buildbase/sdk 0.0.1
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/README.md +304 -0
- package/dist/index.d.ts +310 -0
- package/dist/index.esm.js +30 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/saas-os.css +3 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/types.d.ts +49 -0
- package/dist/types/components/beta/BetaForm.d.ts +24 -0
- package/dist/types/components/beta/api.d.ts +49 -0
- package/dist/types/components/beta/hooks.d.ts +11 -0
- package/dist/types/components/beta/schema.d.ts +6 -0
- package/dist/types/components/beta/types.d.ts +8 -0
- package/dist/types/components/dropdowns/country/countries.d.ts +7 -0
- package/dist/types/components/dropdowns/country/selectCountry.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/currencies.d.ts +6 -0
- package/dist/types/components/dropdowns/currency/selectCurrency.d.ts +6 -0
- package/dist/types/components/dropdowns/language/languages.d.ts +6 -0
- package/dist/types/components/dropdowns/language/selectLanguage.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/selectTimeZone.d.ts +6 -0
- package/dist/types/components/dropdowns/timezone/timezones.d.ts +8 -0
- package/dist/types/components/features/index.d.ts +7 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +20 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/button.d.ts +18 -0
- package/dist/types/components/ui/buttonIcon.d.ts +9 -0
- package/dist/types/components/ui/calendar.d.ts +8 -0
- package/dist/types/components/ui/card.d.ts +8 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/command.d.ts +82 -0
- package/dist/types/components/ui/context-menu.d.ts +27 -0
- package/dist/types/components/ui/dateRangePicker.d.ts +9 -0
- package/dist/types/components/ui/dialog.d.ts +19 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/form.d.ts +23 -0
- package/dist/types/components/ui/heading.d.ts +10 -0
- package/dist/types/components/ui/hover-card.d.ts +6 -0
- package/dist/types/components/ui/input.d.ts +5 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/menubar.d.ts +33 -0
- package/dist/types/components/ui/navigation-menu.d.ts +12 -0
- package/dist/types/components/ui/popover.d.ts +6 -0
- package/dist/types/components/ui/progress.d.ts +4 -0
- package/dist/types/components/ui/radio-group.d.ts +5 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +11 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +28 -0
- package/dist/types/components/ui/skeleton.d.ts +3 -0
- package/dist/types/components/ui/slider.d.ts +4 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/table.d.ts +10 -0
- package/dist/types/components/ui/tabs.d.ts +7 -0
- package/dist/types/components/ui/textarea.d.ts +5 -0
- package/dist/types/components/ui/toast.d.ts +15 -0
- package/dist/types/components/ui/toaster.d.ts +1 -0
- package/dist/types/components/ui/toggle.d.ts +12 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/components/ui/use-toast.d.ts +44 -0
- package/dist/types/components/user/auth.d.ts +6 -0
- package/dist/types/components/user/role.d.ts +8 -0
- package/dist/types/contexts/AuthContext.d.ts +9 -0
- package/dist/types/contexts/OSContext.d.ts +9 -0
- package/dist/types/contexts/SDKContextProvider.d.ts +15 -0
- package/dist/types/contexts/WorkspaceContext.d.ts +8 -0
- package/dist/types/contexts/actionCreators.d.ts +29 -0
- package/dist/types/contexts/createContext.d.ts +27 -0
- package/dist/types/contexts/index.d.ts +10 -0
- package/dist/types/contexts/reducers/authReducer.d.ts +13 -0
- package/dist/types/contexts/reducers/index.d.ts +3 -0
- package/dist/types/contexts/reducers/osReducer.d.ts +11 -0
- package/dist/types/contexts/reducers/workspaceReducer.d.ts +10 -0
- package/dist/types/contexts/types.d.ts +74 -0
- package/dist/types/contexts/useAppDispatch.d.ts +28 -0
- package/dist/types/contexts/useAppSelector.d.ts +36 -0
- package/dist/types/contexts/utils/reducerHelpers.d.ts +11 -0
- package/dist/types/contexts/utils/storage.d.ts +23 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/lib/api-client.d.ts +29 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/providers/ContextConfigProvider.d.ts +15 -0
- package/dist/types/providers/PortalContainer.d.ts +8 -0
- package/dist/types/providers/SaaSOSProvider.d.ts +7 -0
- package/dist/types/providers/auth/hooks.d.ts +10 -0
- package/dist/types/providers/auth/provider.d.ts +8 -0
- package/dist/types/providers/auth/types.d.ts +38 -0
- package/dist/types/providers/auth/utils.d.ts +10 -0
- package/dist/types/providers/os/types.d.ts +9 -0
- package/dist/types/providers/workspace/api.d.ts +33 -0
- package/dist/types/providers/workspace/hooks.d.ts +30 -0
- package/dist/types/providers/workspace/provider.d.ts +9 -0
- package/dist/types/providers/workspace/types.d.ts +38 -0
- package/dist/types/providers/workspace/ui/SettingsDialog.d.ts +8 -0
- package/dist/types/providers/workspace/ui/SettingsFeatures.d.ts +5 -0
- package/dist/types/providers/workspace/ui/SettingsGeneral.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsProfile.d.ts +6 -0
- package/dist/types/providers/workspace/ui/SettingsUsers.d.ts +6 -0
- package/dist/types/providers/workspace/ui/Sidebar.d.ts +10 -0
- package/dist/types/providers/workspace/ui/utils.d.ts +2 -0
- package/dist/types/providers/workspace/utils.d.ts +8 -0
- package/package.json +122 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const useFormField: () => {
|
|
7
|
+
invalid: boolean;
|
|
8
|
+
isDirty: boolean;
|
|
9
|
+
isTouched: boolean;
|
|
10
|
+
isValidating: boolean;
|
|
11
|
+
error?: import("react-hook-form").FieldError;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
formItemId: string;
|
|
15
|
+
formDescriptionId: string;
|
|
16
|
+
formMessageId: string;
|
|
17
|
+
};
|
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const headingVariants: (props?: ({
|
|
4
|
+
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | null | undefined;
|
|
5
|
+
padding?: "default" | "sm" | "lg" | "none" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement>, VariantProps<typeof headingVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
export { Heading, headingVariants };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const MenubarMenu: {
|
|
4
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
5
|
+
__scopeMenubar?: import("@radix-ui/react-context").Scope;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
declare const MenubarGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const MenubarPortal: React.FC<MenubarPrimitive.MenubarPortalProps>;
|
|
11
|
+
declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
|
|
12
|
+
declare const MenubarRadioGroup: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const Menubar: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const MenubarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const MenubarShortcut: {
|
|
30
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayname: string;
|
|
32
|
+
};
|
|
33
|
+
export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
5
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
6
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
+
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
10
|
+
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Progress };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
|
+
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SheetPortal: {
|
|
8
|
+
({ ...props }: SheetPrimitive.DialogPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const sheetVariants: (props?: ({
|
|
13
|
+
side?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
14
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
|
+
}
|
|
17
|
+
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const SheetHeader: {
|
|
19
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
declare const SheetFooter: {
|
|
23
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
declare const SheetTitle: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
27
|
+
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
28
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
|
+
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
9
|
+
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
14
|
+
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
15
|
+
export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, type ToastActionElement, type ToastProps, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Toaster(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
9
|
+
variant?: "default" | "outline" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
4
|
+
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
5
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ToastActionElement, ToastProps } from './toast';
|
|
3
|
+
type ToasterToast = ToastProps & {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
action?: ToastActionElement;
|
|
8
|
+
};
|
|
9
|
+
declare const actionTypes: {
|
|
10
|
+
readonly ADD_TOAST: "ADD_TOAST";
|
|
11
|
+
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
12
|
+
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
13
|
+
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
14
|
+
};
|
|
15
|
+
type ActionType = typeof actionTypes;
|
|
16
|
+
type Action = {
|
|
17
|
+
type: ActionType['ADD_TOAST'];
|
|
18
|
+
toast: ToasterToast;
|
|
19
|
+
} | {
|
|
20
|
+
type: ActionType['UPDATE_TOAST'];
|
|
21
|
+
toast: Partial<ToasterToast>;
|
|
22
|
+
} | {
|
|
23
|
+
type: ActionType['DISMISS_TOAST'];
|
|
24
|
+
toastId?: ToasterToast['id'];
|
|
25
|
+
} | {
|
|
26
|
+
type: ActionType['REMOVE_TOAST'];
|
|
27
|
+
toastId?: ToasterToast['id'];
|
|
28
|
+
};
|
|
29
|
+
interface State {
|
|
30
|
+
toasts: ToasterToast[];
|
|
31
|
+
}
|
|
32
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
33
|
+
type Toast = Omit<ToasterToast, 'id'>;
|
|
34
|
+
declare function toast({ ...props }: Toast): {
|
|
35
|
+
id: string;
|
|
36
|
+
dismiss: () => void;
|
|
37
|
+
update: (props: ToasterToast) => void;
|
|
38
|
+
};
|
|
39
|
+
declare function useToast(): {
|
|
40
|
+
toast: typeof toast;
|
|
41
|
+
dismiss: (toastId?: string) => void;
|
|
42
|
+
toasts: ToasterToast[];
|
|
43
|
+
};
|
|
44
|
+
export { toast, useToast };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
roles: string[];
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
fallback?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const WhenRoles: (props: IProps) => import("react").ReactNode;
|
|
7
|
+
export declare const WhenWorkspaceRoles: (props: IProps) => import("react").ReactNode;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAuthState } from '../providers/auth/types';
|
|
2
|
+
import type { AuthAction, AuthContextValue } from './types';
|
|
3
|
+
export declare const AuthProvider: import("react").FC<{
|
|
4
|
+
children: import("react").ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useAuthContext: () => AuthContextValue;
|
|
7
|
+
export declare const useAuthState: () => IAuthState;
|
|
8
|
+
export declare const useAuthDispatch: () => import("react").Dispatch<AuthAction>;
|
|
9
|
+
export declare const useAuthSelector: <Selected = IAuthState>(selector?: ((state: IAuthState) => Selected) | undefined, equalityFn?: ((a: Selected, b: Selected) => boolean) | undefined) => Selected;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IOsState } from '../providers/os/types';
|
|
2
|
+
import type { OSAction, OSContextValue } from './types';
|
|
3
|
+
export declare const OSProvider: import("react").FC<{
|
|
4
|
+
children: import("react").ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useOSContext: () => OSContextValue;
|
|
7
|
+
export declare const useOSState: () => IOsState;
|
|
8
|
+
export declare const useOSDispatch: () => import("react").Dispatch<OSAction>;
|
|
9
|
+
export declare const useOSSelector: <Selected = IOsState>(selector?: ((state: IOsState) => Selected) | undefined, equalityFn?: ((a: Selected, b: Selected) => boolean) | undefined) => Selected;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SDK Context Provider
|
|
4
|
+
* Combines all context providers in the correct order
|
|
5
|
+
*
|
|
6
|
+
* Provider hierarchy:
|
|
7
|
+
* 1. OSProvider - Base configuration (serverUrl, version, orgId)
|
|
8
|
+
* 2. AuthProvider - Authentication state
|
|
9
|
+
* 3. WorkspaceProvider - Workspace management (depends on auth)
|
|
10
|
+
*
|
|
11
|
+
* This order ensures dependencies are available when needed.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SDKContextProvider: React.FC<{
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WorkspaceAction, WorkspaceContextValue, WorkspaceState } from './types';
|
|
2
|
+
export declare const WorkspaceProvider: import("react").FC<{
|
|
3
|
+
children: import("react").ReactNode;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const useWorkspaceContext: () => WorkspaceContextValue;
|
|
6
|
+
export declare const useWorkspaceState: () => WorkspaceState;
|
|
7
|
+
export declare const useWorkspaceDispatch: () => import("react").Dispatch<WorkspaceAction>;
|
|
8
|
+
export declare const useWorkspaceSelector: <Selected = WorkspaceState>(selector?: ((state: WorkspaceState) => Selected) | undefined, equalityFn?: ((a: Selected, b: Selected) => boolean) | undefined) => Selected;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action creators for Context API
|
|
3
|
+
* These functions create actions for use with Context API reducers
|
|
4
|
+
*/
|
|
5
|
+
import type { AuthSession } from '../providers/auth/types';
|
|
6
|
+
import type { IOsState } from '../providers/os/types';
|
|
7
|
+
import type { IWorkspace, IWorkspaceFeature } from '../providers/workspace/types';
|
|
8
|
+
import type { AuthAction, OSAction, WorkspaceAction } from './types';
|
|
9
|
+
export declare const authActions: {
|
|
10
|
+
authenticationStarted: () => AuthAction;
|
|
11
|
+
authenticationFailed: () => AuthAction;
|
|
12
|
+
setSession: (session: AuthSession) => AuthAction;
|
|
13
|
+
removeSession: () => AuthAction;
|
|
14
|
+
};
|
|
15
|
+
export declare const workspaceActions: {
|
|
16
|
+
setWorkspaces: (workspaces: IWorkspace[]) => WorkspaceAction;
|
|
17
|
+
setAllFeatures: (features: IWorkspaceFeature[]) => WorkspaceAction;
|
|
18
|
+
setCurrentWorkspace: (workspace: IWorkspace) => WorkspaceAction;
|
|
19
|
+
resetCurrentWorkspace: () => WorkspaceAction;
|
|
20
|
+
setIsInitialized: (isInitialized: boolean) => WorkspaceAction;
|
|
21
|
+
setLoading: (loading: boolean) => WorkspaceAction;
|
|
22
|
+
setError: (error: string | null) => WorkspaceAction;
|
|
23
|
+
setRefreshing: (refreshing: boolean) => WorkspaceAction;
|
|
24
|
+
setSwitching: (switching: boolean) => WorkspaceAction;
|
|
25
|
+
};
|
|
26
|
+
export declare const osActions: {
|
|
27
|
+
setSaaSOSConfig: (config: IOsState) => OSAction;
|
|
28
|
+
removeSaaSOSConfig: () => OSAction;
|
|
29
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { type Dispatch, type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Generic context factory with performance optimizations
|
|
4
|
+
* Creates a context, provider, and hooks with minimal boilerplate
|
|
5
|
+
*
|
|
6
|
+
* Optimizations:
|
|
7
|
+
* - Memoized context value to prevent unnecessary re-renders
|
|
8
|
+
* - Stable dispatch reference (already stable from useReducer)
|
|
9
|
+
* - Split state/dispatch for selective subscriptions
|
|
10
|
+
*/
|
|
11
|
+
export declare function createContextProvider<State, Action>({ name, initialState, reducer, initializer, }: {
|
|
12
|
+
name: string;
|
|
13
|
+
initialState: State;
|
|
14
|
+
reducer: (state: State, action: Action) => State;
|
|
15
|
+
initializer?: (initialState: State) => State;
|
|
16
|
+
}): {
|
|
17
|
+
Provider: React.FC<{
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}>;
|
|
20
|
+
useContext: () => {
|
|
21
|
+
state: State;
|
|
22
|
+
dispatch: Dispatch<Action>;
|
|
23
|
+
};
|
|
24
|
+
useState: () => State;
|
|
25
|
+
useDispatch: () => React.Dispatch<Action>;
|
|
26
|
+
useSelector: <Selected = State>(selector?: (state: State) => Selected, equalityFn?: (a: Selected, b: Selected) => boolean) => Selected;
|
|
27
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AuthProvider, useAuthContext, useAuthDispatch, useAuthSelector, useAuthState, } from './AuthContext';
|
|
2
|
+
export { OSProvider, useOSContext, useOSDispatch, useOSSelector, useOSState } from './OSContext';
|
|
3
|
+
export { SDKContextProvider } from './SDKContextProvider';
|
|
4
|
+
export { WorkspaceProvider, useWorkspaceContext, useWorkspaceDispatch, useWorkspaceSelector, useWorkspaceState, } from './WorkspaceContext';
|
|
5
|
+
export type { AuthAction, AuthContextValue, OSAction, OSContextValue, SDKContextValue, WorkspaceAction, WorkspaceContextValue, WorkspaceState, } from './types';
|
|
6
|
+
export { authReducer, getInitialAuthState, getInitialOSState, getInitialWorkspaceState, osReducer, workspaceReducer, } from './reducers';
|
|
7
|
+
export { useAppSelector } from './useAppSelector';
|
|
8
|
+
export type { SDKState } from './useAppSelector';
|
|
9
|
+
export { useAppDispatch } from './useAppDispatch';
|
|
10
|
+
export type { SDKDispatch } from './useAppDispatch';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IAuthState } from '../../providers/auth/types';
|
|
2
|
+
import type { AuthAction } from '../types';
|
|
3
|
+
export declare const AUTH_TOKEN_KEY = "saas_os_auth_token";
|
|
4
|
+
/**
|
|
5
|
+
* Initial state for auth context
|
|
6
|
+
* Loads session from localStorage if available
|
|
7
|
+
*/
|
|
8
|
+
export declare const getInitialAuthState: () => IAuthState;
|
|
9
|
+
/**
|
|
10
|
+
* Auth reducer for Context API
|
|
11
|
+
* Handles all auth state updates with proper immutability
|
|
12
|
+
*/
|
|
13
|
+
export declare const authReducer: (state: IAuthState, action: AuthAction) => IAuthState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IOsState } from '../../providers/os/types';
|
|
2
|
+
import type { OSAction } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Initial state for OS context
|
|
5
|
+
*/
|
|
6
|
+
export declare const getInitialOSState: () => IOsState;
|
|
7
|
+
/**
|
|
8
|
+
* OS reducer for Context API
|
|
9
|
+
* Handles OS configuration state updates with proper immutability
|
|
10
|
+
*/
|
|
11
|
+
export declare const osReducer: (state: IOsState, action: OSAction) => IOsState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkspaceAction, WorkspaceState } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Initial state for workspace context
|
|
4
|
+
*/
|
|
5
|
+
export declare const getInitialWorkspaceState: () => WorkspaceState;
|
|
6
|
+
/**
|
|
7
|
+
* Workspace reducer for Context API
|
|
8
|
+
* Handles all workspace state updates with proper immutability
|
|
9
|
+
*/
|
|
10
|
+
export declare const workspaceReducer: (state: WorkspaceState, action: WorkspaceAction) => WorkspaceState;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Dispatch } from 'react';
|
|
2
|
+
import type { AuthSession, IAuthState } from '../providers/auth/types';
|
|
3
|
+
import type { IOsState } from '../providers/os/types';
|
|
4
|
+
import type { IWorkspace, IWorkspaceFeature } from '../providers/workspace/types';
|
|
5
|
+
export type AuthAction = {
|
|
6
|
+
type: 'AUTHENTICATION_STARTED';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'AUTHENTICATION_FAILED';
|
|
9
|
+
} | {
|
|
10
|
+
type: 'SET_SESSION';
|
|
11
|
+
payload: AuthSession;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'REMOVE_SESSION';
|
|
14
|
+
};
|
|
15
|
+
export interface AuthContextValue {
|
|
16
|
+
state: IAuthState;
|
|
17
|
+
dispatch: Dispatch<AuthAction>;
|
|
18
|
+
}
|
|
19
|
+
export type WorkspaceAction = {
|
|
20
|
+
type: 'SET_WORKSPACES';
|
|
21
|
+
payload: IWorkspace[];
|
|
22
|
+
} | {
|
|
23
|
+
type: 'SET_ALL_FEATURES';
|
|
24
|
+
payload: IWorkspaceFeature[];
|
|
25
|
+
} | {
|
|
26
|
+
type: 'SET_CURRENT_WORKSPACE';
|
|
27
|
+
payload: IWorkspace;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'RESET_CURRENT_WORKSPACE';
|
|
30
|
+
} | {
|
|
31
|
+
type: 'SET_IS_INITIALIZED';
|
|
32
|
+
payload: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'SET_LOADING';
|
|
35
|
+
payload: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'SET_ERROR';
|
|
38
|
+
payload: string | null;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'SET_REFRESHING';
|
|
41
|
+
payload: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'SET_SWITCHING';
|
|
44
|
+
payload: boolean;
|
|
45
|
+
};
|
|
46
|
+
export interface WorkspaceState {
|
|
47
|
+
workspaces: IWorkspace[];
|
|
48
|
+
loading: boolean;
|
|
49
|
+
error: string | null;
|
|
50
|
+
currentWorkspace: IWorkspace | null;
|
|
51
|
+
refreshing: boolean;
|
|
52
|
+
switching: boolean;
|
|
53
|
+
isInitialized: boolean;
|
|
54
|
+
allFeatures: IWorkspaceFeature[];
|
|
55
|
+
}
|
|
56
|
+
export interface WorkspaceContextValue {
|
|
57
|
+
state: WorkspaceState;
|
|
58
|
+
dispatch: Dispatch<WorkspaceAction>;
|
|
59
|
+
}
|
|
60
|
+
export type OSAction = {
|
|
61
|
+
type: 'SET_SAAS_OS_CONFIG';
|
|
62
|
+
payload: IOsState;
|
|
63
|
+
} | {
|
|
64
|
+
type: 'REMOVE_SAAS_OS_CONFIG';
|
|
65
|
+
};
|
|
66
|
+
export interface OSContextValue {
|
|
67
|
+
state: IOsState;
|
|
68
|
+
dispatch: Dispatch<OSAction>;
|
|
69
|
+
}
|
|
70
|
+
export interface SDKContextValue {
|
|
71
|
+
auth: AuthContextValue;
|
|
72
|
+
workspace: WorkspaceContextValue;
|
|
73
|
+
os: OSContextValue;
|
|
74
|
+
}
|