@yusr_systems/ui 2.4.0 → 3.1.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/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import { ClassValue } from 'clsx';
13
13
  import { ColumnName } from '@yusr_systems/core';
14
14
  import { Combobox as Combobox_2 } from '@base-ui/react/combobox';
15
15
  import { Command as Command_2 } from 'cmdk';
16
+ import { Context } from 'react';
16
17
  import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
17
18
  import { DayButton } from 'react-day-picker';
18
19
  import { DayPicker } from 'react-day-picker';
@@ -28,6 +29,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
28
29
  import { FilterCondition } from '@yusr_systems/core';
29
30
  import { FilterResult } from '@yusr_systems/core';
30
31
  import { JSX } from 'react/jsx-runtime';
32
+ import { JSX as JSX_2 } from 'react';
31
33
  import * as LabelPrimitive from '@radix-ui/react-label';
32
34
  import { Locale } from 'react-day-picker';
33
35
  import { PayloadAction } from '@reduxjs/toolkit';
@@ -991,6 +993,8 @@ export declare function SideBarCompanyData({ company }: {
991
993
 
992
994
  export declare function SidebarContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
993
995
 
996
+ export declare const SidebarContext: Context<YusrSidBarProps | null>;
997
+
994
998
  declare type SidebarContextProps = {
995
999
  state: "expanded" | "collapsed";
996
1000
  open: boolean;
@@ -1090,7 +1094,7 @@ export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenCha
1090
1094
 
1091
1095
  export declare function SidebarRail({ className, ...props }: React_2.ComponentProps<"button">): JSX.Element;
1092
1096
 
1093
- export declare function SideBarSecondaryMenu({ items, onLogout, ...props }: SideBarSecondaryMenuProps): JSX.Element;
1097
+ export declare function SideBarSecondaryMenu({ items, onLogout, LinkComponent, ...props }: SideBarSecondaryMenuProps): JSX.Element;
1094
1098
 
1095
1099
  export declare interface SideBarSecondaryMenuProps extends React_2.ComponentPropsWithoutRef<typeof SidebarGroup> {
1096
1100
  items: {
@@ -1099,6 +1103,7 @@ export declare interface SideBarSecondaryMenuProps extends React_2.ComponentProp
1099
1103
  icon: React_2.ReactNode;
1100
1104
  }[];
1101
1105
  onLogout: () => void;
1106
+ LinkComponent?: React_2.ElementType;
1102
1107
  }
1103
1108
 
1104
1109
  export declare function SidebarSeparator({ className, ...props }: React_2.ComponentProps<typeof Separator>): JSX.Element;
@@ -1297,6 +1302,13 @@ declare interface UsernameObject {
1297
1302
 
1298
1303
  export declare function useSidebar(): SidebarContextProps;
1299
1304
 
1305
+ /**
1306
+ * Returns the props of the nearest SidebarProvider.
1307
+ * Must be used within a SidebarProvider.
1308
+ * @returns {YusrSidBarProps} The props of the nearest SidebarProvider.
1309
+ */
1310
+ export declare const useSidebarContext: () => YusrSidBarProps;
1311
+
1300
1312
  export declare function useStorageFile<T>(setFormData: React.Dispatch<React.SetStateAction<T>>, fieldName: keyof T): {
1301
1313
  fileInputRef: RefObject<HTMLInputElement | null>;
1302
1314
  handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
@@ -1310,6 +1322,31 @@ export declare const useTheme: () => ThemeProviderState;
1310
1322
 
1311
1323
  export declare function YusrBusBackground(): JSX.Element;
1312
1324
 
1325
+ export declare type YusrSidBarProps = {
1326
+ LinkComponent?: React.ElementType;
1327
+ logos: {
1328
+ logoFullDark: string;
1329
+ logoFullLight: string;
1330
+ logoOnlyDark: string;
1331
+ logoOnlyLight: string;
1332
+ };
1333
+ displayCompany?: {
1334
+ name: string;
1335
+ logo: string;
1336
+ };
1337
+ navMain?: {
1338
+ title: string;
1339
+ url: string;
1340
+ icon: JSX_2.Element;
1341
+ hasAuth: boolean;
1342
+ }[];
1343
+ navSecondary?: {
1344
+ title: string;
1345
+ url: string;
1346
+ icon: JSX_2.Element;
1347
+ }[];
1348
+ };
1349
+
1313
1350
  export declare function YusrSideBarMainMenu({ items, LinkComponent, }: {
1314
1351
  items: {
1315
1352
  title: string;