ikoncomponents 1.7.6 → 1.8.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.
Files changed (149) hide show
  1. package/dist/ikoncomponents/action-menu/index.d.ts +2 -1
  2. package/dist/ikoncomponents/activity-sheet/index.d.ts +2 -1
  3. package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +1 -1
  4. package/dist/ikoncomponents/app-breadcrumb/index.d.ts +2 -2
  5. package/dist/ikoncomponents/big-calendar/big-calender-event/index.d.ts +1 -1
  6. package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.d.ts +1 -1
  7. package/dist/ikoncomponents/big-calendar/index.d.ts +1 -1
  8. package/dist/ikoncomponents/buttons/index.d.ts +6 -6
  9. package/dist/ikoncomponents/combobox-input/index.d.ts +2 -1
  10. package/dist/ikoncomponents/custom-combo-dropdown/index.d.ts +1 -1
  11. package/dist/ikoncomponents/data-table/datatable-column-filter/index.d.ts +2 -1
  12. package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.d.ts +2 -1
  13. package/dist/ikoncomponents/data-table/datatable-filter-menu/index.d.ts +2 -1
  14. package/dist/ikoncomponents/data-table/datatable-pagination/index.d.ts +2 -1
  15. package/dist/ikoncomponents/data-table/datatable-toolbar/index.d.ts +2 -1
  16. package/dist/ikoncomponents/data-table/index.d.ts +2 -1
  17. package/dist/ikoncomponents/file-input/index.d.ts +2 -1
  18. package/dist/ikoncomponents/fileUpload/index.d.ts +2 -1
  19. package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -1
  20. package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +2 -1
  21. package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -1
  22. package/dist/ikoncomponents/form-fields/file-input/index.d.ts +2 -1
  23. package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -1
  24. package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +2 -1
  25. package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -1
  26. package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +2 -1
  27. package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -1
  28. package/dist/ikoncomponents/glowing-effect/index.d.ts +2 -1
  29. package/dist/ikoncomponents/icon/index.d.ts +2 -1
  30. package/dist/ikoncomponents/image-cropper-upload/cropper-form/index.d.ts +1 -1
  31. package/dist/ikoncomponents/image-cropper-upload/cropper-form-with-modal/index.d.ts +2 -1
  32. package/dist/ikoncomponents/image-cropper-upload/index.d.ts +2 -2
  33. package/dist/ikoncomponents/loading-spinner/index.d.ts +1 -1
  34. package/dist/ikoncomponents/main-layout/RefreshContext.d.ts +1 -1
  35. package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +1 -1
  36. package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +1 -1
  37. package/dist/ikoncomponents/main-layout/app-sidebar.js +4 -1
  38. package/dist/ikoncomponents/main-layout/footer.d.ts +2 -1
  39. package/dist/ikoncomponents/main-layout/footer.js +4 -1
  40. package/dist/ikoncomponents/main-layout/header.d.ts +2 -1
  41. package/dist/ikoncomponents/main-layout/header.js +4 -1
  42. package/dist/ikoncomponents/main-layout/index.d.ts +1 -1
  43. package/dist/ikoncomponents/main-layout/index.js +9 -2
  44. package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +2 -1
  45. package/dist/ikoncomponents/main-layout/main-sidebar.js +39 -22
  46. package/dist/ikoncomponents/main-layout/nav-main.d.ts +1 -1
  47. package/dist/ikoncomponents/main-layout/sidebar-expanded-context.d.ts +20 -0
  48. package/dist/ikoncomponents/main-layout/sidebar-expanded-context.js +25 -0
  49. package/dist/ikoncomponents/multi-combobox/index.d.ts +2 -1
  50. package/dist/ikoncomponents/no-data/index.d.ts +2 -1
  51. package/dist/ikoncomponents/page-wrapper/index.d.ts +2 -2
  52. package/dist/ikoncomponents/password-strength-meter/index.d.ts +2 -1
  53. package/dist/ikoncomponents/phone-input/index.d.ts +2 -1
  54. package/dist/ikoncomponents/provider-wrapper/index.d.ts +1 -1
  55. package/dist/ikoncomponents/reload-component/index.d.ts +1 -1
  56. package/dist/ikoncomponents/search-input/index.d.ts +2 -1
  57. package/dist/ikoncomponents/sheet/index.d.ts +1 -1
  58. package/dist/ikoncomponents/simple-widget/index.d.ts +2 -2
  59. package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +1 -1
  60. package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +1 -1
  61. package/dist/ikoncomponents/table/DataTable/index.d.ts +3 -2
  62. package/dist/ikoncomponents/table/DataTable/index.js +296 -60
  63. package/dist/ikoncomponents/table/DataTableColumn/index.d.ts +3 -0
  64. package/dist/ikoncomponents/table/DataTableColumn/index.js +17 -0
  65. package/dist/ikoncomponents/table/DataTableFilter/index.d.ts +7 -0
  66. package/dist/ikoncomponents/table/DataTableFilter/index.js +95 -0
  67. package/dist/ikoncomponents/table/DataTablePageSize/index.d.ts +1 -1
  68. package/dist/ikoncomponents/table/DataTablePageSize/index.js +2 -0
  69. package/dist/ikoncomponents/table/DataTablePagination/index.d.ts +2 -2
  70. package/dist/ikoncomponents/table/DataTablePagination/index.js +3 -1
  71. package/dist/ikoncomponents/table/DataTableSearch/index.d.ts +1 -1
  72. package/dist/ikoncomponents/table/DataTableSearch/index.js +16 -4
  73. package/dist/ikoncomponents/table/index.d.ts +2 -2
  74. package/dist/ikoncomponents/table/index.js +2 -162
  75. package/dist/ikoncomponents/table/type.d.ts +83 -24
  76. package/dist/ikoncomponents/table/type.js +0 -7
  77. package/dist/ikoncomponents/tabs/index.d.ts +2 -1
  78. package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -1
  79. package/dist/ikoncomponents/title-progress/index.d.ts +2 -1
  80. package/dist/ikoncomponents/tooltip/index.d.ts +1 -1
  81. package/dist/ikoncomponents/twolevel-dropdown/index.d.ts +2 -1
  82. package/dist/ikoncomponents/upload-tab/index.d.ts +1 -1
  83. package/dist/ikoncomponents/widgets/index.d.ts +2 -1
  84. package/dist/ikoncomponents/work-in-progress/index.d.ts +2 -1
  85. package/dist/index.d.ts +1 -1
  86. package/dist/shadcn/accordion.d.ts +4 -4
  87. package/dist/shadcn/alert-dialog.d.ts +2 -2
  88. package/dist/shadcn/alert.d.ts +3 -3
  89. package/dist/shadcn/aspect-ratio.d.ts +1 -1
  90. package/dist/shadcn/avatar.d.ts +3 -3
  91. package/dist/shadcn/badge.d.ts +1 -1
  92. package/dist/shadcn/breadcrumb.d.ts +7 -7
  93. package/dist/shadcn/button.d.ts +1 -1
  94. package/dist/shadcn/calendar.d.ts +2 -2
  95. package/dist/shadcn/card.d.ts +7 -7
  96. package/dist/shadcn/checkbox.d.ts +1 -1
  97. package/dist/shadcn/collapsible.d.ts +3 -3
  98. package/dist/shadcn/command.d.ts +9 -9
  99. package/dist/shadcn/dialog.d.ts +10 -10
  100. package/dist/shadcn/drawer.d.ts +10 -10
  101. package/dist/shadcn/dropdown-menu.d.ts +15 -15
  102. package/dist/shadcn/form.d.ts +7 -7
  103. package/dist/shadcn/hover-card.d.ts +3 -3
  104. package/dist/shadcn/input.d.ts +1 -1
  105. package/dist/shadcn/label.d.ts +1 -1
  106. package/dist/shadcn/navigation-menu.d.ts +8 -8
  107. package/dist/shadcn/popover.d.ts +4 -4
  108. package/dist/shadcn/progress.d.ts +1 -1
  109. package/dist/shadcn/radio-group.d.ts +2 -2
  110. package/dist/shadcn/scroll-area.d.ts +2 -2
  111. package/dist/shadcn/select.d.ts +10 -10
  112. package/dist/shadcn/separator.d.ts +1 -1
  113. package/dist/shadcn/sheet.d.ts +8 -8
  114. package/dist/shadcn/sidebar.d.ts +23 -23
  115. package/dist/shadcn/skeleton.d.ts +1 -1
  116. package/dist/shadcn/slider.d.ts +1 -1
  117. package/dist/shadcn/sonner.d.ts +1 -1
  118. package/dist/shadcn/switch.d.ts +1 -1
  119. package/dist/shadcn/table.d.ts +8 -8
  120. package/dist/shadcn/tabs.d.ts +4 -4
  121. package/dist/shadcn/textarea.d.ts +1 -1
  122. package/dist/shadcn/toggle-group.d.ts +2 -2
  123. package/dist/shadcn/toggle.d.ts +1 -1
  124. package/dist/shadcn/tooltip.d.ts +4 -4
  125. package/dist/shadcn/workflow.d.ts +1 -1
  126. package/dist/styles.css +47 -28
  127. package/dist/tsconfig.build.tsbuildinfo +1 -1
  128. package/dist/utils/border-radius-provider.d.ts +1 -1
  129. package/dist/utils/font-provider.d.ts +1 -1
  130. package/dist/utils/theme-provider/index.d.ts +1 -1
  131. package/package.json +3 -2
  132. package/dist/ikoncomponents/assistant-ui/Assistant.d.ts +0 -28
  133. package/dist/ikoncomponents/assistant-ui/Assistant.js +0 -306
  134. package/dist/ikoncomponents/assistant-ui/agent-dropdown.d.ts +0 -24
  135. package/dist/ikoncomponents/assistant-ui/agent-dropdown.js +0 -16
  136. package/dist/ikoncomponents/assistant-ui/agentTextChatTransport.d.ts +0 -30
  137. package/dist/ikoncomponents/assistant-ui/agentTextChatTransport.js +0 -208
  138. package/dist/ikoncomponents/assistant-ui/attachment.d.ts +0 -4
  139. package/dist/ikoncomponents/assistant-ui/attachment.js +0 -93
  140. package/dist/ikoncomponents/assistant-ui/markdown-text.d.ts +0 -2
  141. package/dist/ikoncomponents/assistant-ui/markdown-text.js +0 -126
  142. package/dist/ikoncomponents/assistant-ui/thread.d.ts +0 -10
  143. package/dist/ikoncomponents/assistant-ui/thread.js +0 -115
  144. package/dist/ikoncomponents/assistant-ui/tool-fallback.d.ts +0 -2
  145. package/dist/ikoncomponents/assistant-ui/tool-fallback.js +0 -18
  146. package/dist/ikoncomponents/assistant-ui/tooltip-icon-button.d.ts +0 -7
  147. package/dist/ikoncomponents/assistant-ui/tooltip-icon-button.js +0 -23
  148. package/dist/utils/userType.d.ts +0 -13
  149. package/dist/utils/userType.js +0 -1
@@ -1,5 +1,6 @@
1
+ import * as React from "react";
1
2
  import type { ActionMenuProps, ExtraActionParams } from "./type";
2
3
  export declare function ActionMenu({ actionMenus, extraActionParams, }: {
3
4
  actionMenus: ActionMenuProps[];
4
5
  extraActionParams?: ExtraActionParams;
5
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  export type ActivityLogProps = {
2
3
  id: string;
3
4
  activity: string;
@@ -8,4 +9,4 @@ export type ActivityLogProps = {
8
9
  };
9
10
  export declare function ActivitySheet({ activityLogs }: {
10
11
  activityLogs?: ActivityLogProps[];
11
- }): import("react/jsx-runtime").JSX.Element;
12
+ }): React.JSX.Element;
@@ -13,6 +13,6 @@ interface BreadcrumbContextType {
13
13
  }
14
14
  export declare function BreadcrumbProvider({ children }: {
15
15
  children: ReactNode;
16
- }): import("react/jsx-runtime").JSX.Element;
16
+ }): import("react").JSX.Element;
17
17
  export declare function useBreadcrumb(): BreadcrumbContextType;
18
18
  export {};
@@ -1,5 +1,5 @@
1
1
  import { BreadcrumbItemProps } from "./BreadcrumbProvider";
2
- export declare function AppBreadcrumb(): import("react/jsx-runtime").JSX.Element | null;
2
+ export declare function AppBreadcrumb(): import("react").JSX.Element | null;
3
3
  export declare function RenderAppBreadcrumb({ breadcrumb, }: {
4
4
  breadcrumb: BreadcrumbItemProps;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
@@ -2,4 +2,4 @@ import { BigCalendarEventProps, ExtraParamsEvent } from "../type";
2
2
  export default function BigCalenderEvent({ event, extraParamsEvent }: {
3
3
  event: BigCalendarEventProps;
4
4
  extraParamsEvent?: ExtraParamsEvent;
5
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { BigCalenderToolbarProps } from "../type";
2
- export default function BigCalenderToolbar({ onNavigate, onView, label, extraTools, view }: BigCalenderToolbarProps): import("react/jsx-runtime").JSX.Element;
2
+ export default function BigCalenderToolbar({ onNavigate, onView, label, extraTools, view }: BigCalenderToolbarProps): import("react").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import "react-big-calendar/lib/css/react-big-calendar.css";
2
2
  import { BigCalendarProps } from "./type";
3
- export declare function BigCalendar({ events, extraParamsEvent, extraTools }: BigCalendarProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function BigCalendar({ events, extraParamsEvent, extraTools }: BigCalendarProps): import("react").JSX.Element;
@@ -10,9 +10,9 @@ export interface ButtonWithTooltipProps extends React.ButtonHTMLAttributes<HTMLB
10
10
  asChild?: boolean;
11
11
  tooltipContent: string | React.ReactNode;
12
12
  }
13
- export declare function TextButton({ children, variant, asChild, size, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
14
- export declare function TextButtonWithTooltip({ children, variant, asChild, size, tooltipContent, ...props }: ButtonWithTooltipProps): import("react/jsx-runtime").JSX.Element;
15
- export declare function IconTextButton({ children, variant, asChild, size, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
16
- export declare function IconTextButtonWithTooltip({ children, variant, size, asChild, tooltipContent, ...props }: ButtonWithTooltipProps): import("react/jsx-runtime").JSX.Element;
17
- export declare function IconButton({ children, variant, size, asChild, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
18
- export declare function IconButtonWithTooltip({ children, tooltipContent, asChild, variant, size, ...props }: ButtonWithTooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TextButton({ children, variant, asChild, size, ...props }: ButtonProps): React.JSX.Element;
14
+ export declare function TextButtonWithTooltip({ children, variant, asChild, size, tooltipContent, ...props }: ButtonWithTooltipProps): React.JSX.Element;
15
+ export declare function IconTextButton({ children, variant, asChild, size, ...props }: ButtonProps): React.JSX.Element;
16
+ export declare function IconTextButtonWithTooltip({ children, variant, size, asChild, tooltipContent, ...props }: ButtonWithTooltipProps): React.JSX.Element;
17
+ export declare function IconButton({ children, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
18
+ export declare function IconButtonWithTooltip({ children, tooltipContent, asChild, variant, size, ...props }: ButtonWithTooltipProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import { ComboBoxInputProps } from "./type";
2
- export declare function ComboboxInput({ placeholder, items, disabled, onSelect, defaultValue }: ComboBoxInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ComboboxInput({ placeholder, items, disabled, onSelect, defaultValue }: ComboBoxInputProps): React.JSX.Element;
@@ -17,5 +17,5 @@ type CustomComboboxInputProps = {
17
17
  formDescription?: string;
18
18
  disabled?: boolean;
19
19
  };
20
- export declare function CustomComboboxInput({ formControl, name, label, options, placeholder, emptyMessage, onValueChange, className, addNewPlaceholder, formDescription, disabled, }: CustomComboboxInputProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function CustomComboboxInput({ formControl, name, label, options, placeholder, emptyMessage, onValueChange, className, addNewPlaceholder, formDescription, disabled, }: CustomComboboxInputProps): React.JSX.Element;
21
21
  export {};
@@ -1,2 +1,3 @@
1
+ import * as React from "react";
1
2
  import { DataTableViewOptionsProps } from "../type";
2
- export declare function DataTableColumnFilter<TData>({ table, }: DataTableViewOptionsProps<TData>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function DataTableColumnFilter<TData>({ table, }: DataTableViewOptionsProps<TData>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from "react";
1
2
  import { DataTableFacetedFilterProps } from "../type";
2
- export declare function DataTableFacetedFilter<TData, TValue>({ column, }: DataTableFacetedFilterProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function DataTableFacetedFilter<TData, TValue>({ column, }: DataTableFacetedFilterProps<TData, TValue>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from "react";
1
2
  import { DataTableFilterProps } from "../type";
2
- export declare function DataTableFilterMenu<TData>({ table }: DataTableFilterProps<TData>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function DataTableFilterMenu<TData>({ table }: DataTableFilterProps<TData>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from "react";
1
2
  import { DataTablePaginationProps } from "../type";
2
- export declare function DataTablePagination<TData>({ table, extraParams, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function DataTablePagination<TData>({ table, extraParams, }: DataTablePaginationProps<TData>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import * as React from "react";
1
2
  import { DTToolBarProps } from "../type";
2
- export declare function DataTableToolbar<TData>({ table, extraParams, }: DTToolBarProps<TData>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function DataTableToolbar<TData>({ table, extraParams, }: DTToolBarProps<TData>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import { DataTableProps } from "./type";
2
- export declare const DataTable: <TData, TValue>({ columns, data, extraParams, onTableReady }: DataTableProps<TData, TValue>, ref: any) => false | import("react/jsx-runtime").JSX.Element;
3
+ export declare const DataTable: <TData, TValue>({ columns, data, extraParams, onTableReady }: DataTableProps<TData, TValue>, ref: any) => false | React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare function FileInput({ tooltipContent, fileNamePlaceholder, fileName, onFileNameChange, ...props }: any): import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ export declare function FileInput({ tooltipContent, fileNamePlaceholder, fileName, onFileNameChange, ...props }: any): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  export declare const convertFileToObject: (file: File) => Promise<any>;
2
3
  interface FileUploaderProps {
3
4
  label?: string;
@@ -9,6 +10,6 @@ interface FileUploaderProps {
9
10
  showPreview?: boolean;
10
11
  onFileSelect: (files: any[]) => Promise<any> | void;
11
12
  }
12
- export default function FileUploader({ label, isDrag, fileInput, isMultiple, tooltipContent, fileNamePlaceholder, showPreview, onFileSelect, }: FileUploaderProps): import("react/jsx-runtime").JSX.Element;
13
+ export default function FileUploader({ label, isDrag, fileInput, isMultiple, tooltipContent, fileNamePlaceholder, showPreview, onFileSelect, }: FileUploaderProps): React.JSX.Element;
13
14
  export declare function getFileUrlFromObject(obj: any): string;
14
15
  export {};
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import { FormComboboxInputProps } from "../types";
2
- export declare function FormComboboxInput({ formControl, name, label, placeholder, formDescription, items, disabled, onSelect, }: FormComboboxInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormComboboxInput({ formControl, name, label, placeholder, formDescription, items, disabled, onSelect, }: FormComboboxInputProps): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { Control } from "react-hook-form";
2
3
  export interface FormComboboxInputProps {
3
4
  formControl: Control<any>;
@@ -15,4 +16,4 @@ export interface FormComboboxInputProps {
15
16
  value?: string;
16
17
  onChange?: (value: any) => void;
17
18
  }
18
- export declare function FormComboboxInputWithValue(props: FormComboboxInputProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function FormComboboxInputWithValue(props: FormComboboxInputProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from "react";
1
2
  import { FormDateInputProps } from "../types";
2
- export declare function FormDateInput({ formControl, name, label, placeholder, dateFormat, calendarDateDisabled, formDescription, disabled, }: FormDateInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormDateInput({ formControl, name, label, placeholder, dateFormat, calendarDateDisabled, formDescription, disabled, }: FormDateInputProps): React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare function FormFileInput(): import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ export declare function FormFileInput(): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import { FormInputProps } from '../types';
2
- export declare function FormInput({ formControl, label, formDescription, extraFormComponent, name, ...inputProps }: FormInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormInput({ formControl, label, formDescription, extraFormComponent, name, ...inputProps }: FormInputProps): React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import React from "react";
1
2
  import { FormComboboxInputProps as BaseFormComboboxInputProps } from "../../form-fields/types";
2
3
  interface FormComboboxInputProps extends BaseFormComboboxInputProps {
3
4
  defaultOptions?: number;
4
5
  }
5
- export declare function FormMultiComboboxInput({ formControl, name, label, placeholder, formDescription, items, disabled, onSelect, defaultValue, defaultOptions, }: FormComboboxInputProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function FormMultiComboboxInput({ formControl, name, label, placeholder, formDescription, items, disabled, onSelect, defaultValue, defaultOptions, }: FormComboboxInputProps): React.JSX.Element;
6
7
  export {};
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import { FormInputProps } from '../types';
2
- export declare function FormOtpInput({ formControl, label, formDescription, extraFormComponent, name, ...inputProps }: FormInputProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormOtpInput({ formControl, label, formDescription, extraFormComponent, name, ...inputProps }: FormInputProps): React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare function FormPhoneInput(): import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ export declare function FormPhoneInput(): React.JSX.Element;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import { FormTextareaProps } from '../types';
2
- export declare function FormTextarea({ formControl, name, label, formItemClass, formDescription, ...textAreaProps }: FormTextareaProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FormTextarea({ formControl, name, label, formItemClass, formDescription, ...textAreaProps }: FormTextareaProps): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  interface GlowingEffectProps {
2
3
  blur?: number;
3
4
  inactiveZone?: number;
@@ -10,5 +11,5 @@ interface GlowingEffectProps {
10
11
  movementDuration?: number;
11
12
  borderWidth?: number;
12
13
  }
13
- export declare const GlowingEffect: ({ blur, inactiveZone, proximity, spread, variant, glow, className, movementDuration, borderWidth, disabled, }: GlowingEffectProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const GlowingEffect: ({ blur, inactiveZone, proximity, spread, variant, glow, className, movementDuration, borderWidth, disabled, }: GlowingEffectProps) => React.JSX.Element;
14
15
  export {};
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  export interface IconProps {
2
3
  name: string;
3
4
  size?: number | string;
@@ -5,4 +6,4 @@ export interface IconProps {
5
6
  className?: string;
6
7
  strokeWidth?: number;
7
8
  }
8
- export declare function Icon({ name, ...props }: IconProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export declare function Icon({ name, ...props }: IconProps): React.JSX.Element | null;
@@ -1,6 +1,6 @@
1
1
  interface Props {
2
2
  onNewFileUpload?: (...args: any) => void;
3
3
  }
4
- declare function CropperFormComponent({ onNewFileUpload }: Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function CropperFormComponent({ onNewFileUpload }: Props): import("react").JSX.Element;
5
5
  export declare const CropperForm: import("react").MemoExoticComponent<typeof CropperFormComponent>;
6
6
  export {};
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import { AspectRatioWiseImagesProps, OriginalImageProps } from '..';
2
3
  export declare function CropperFormWithModal({ open, onOpenChange, onCropperChange }: Readonly<{
3
4
  open: boolean;
4
5
  onOpenChange: (open: boolean) => void;
5
6
  onCropperChange: (originalImage: OriginalImageProps, aspectRatioWiseImages: AspectRatioWiseImagesProps) => void;
6
- }>): import("react/jsx-runtime").JSX.Element;
7
+ }>): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { CropperUploadImagesInfoProps } from './utils';
3
3
  export interface ImageCropperContextProps {
4
4
  originalImage: OriginalImageProps;
@@ -23,5 +23,5 @@ export interface ImageCropperProps {
23
23
  modalOpen?: boolean;
24
24
  onModalOpenChange?: (open: boolean) => void;
25
25
  }
26
- export declare function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }: ImageCropperProps): import("react/jsx-runtime").JSX.Element;
26
+ export declare function ImageCropperProvider({ children, uploadedImages, onCropperChange, modalOpen, onModalOpenChange }: ImageCropperProps): React.JSX.Element;
27
27
  export declare const useImageCropper: () => ImageCropperContextProps;
@@ -6,4 +6,4 @@ export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
6
6
  export interface LoadingSpinnerProps extends ISVGProps {
7
7
  visible?: boolean;
8
8
  }
9
- export declare const LoadingSpinner: ({ size, className, visible, ...props }: LoadingSpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export declare const LoadingSpinner: ({ size, className, visible, ...props }: LoadingSpinnerProps) => React.JSX.Element | null;
@@ -5,6 +5,6 @@ interface RefreshContextType {
5
5
  }
6
6
  export declare function RefreshProvider({ children }: {
7
7
  children: React.ReactNode;
8
- }): import("react/jsx-runtime").JSX.Element;
8
+ }): React.JSX.Element;
9
9
  export declare function useRefresh(): RefreshContextType;
10
10
  export {};
@@ -29,5 +29,5 @@ export interface SidebarNavContextType {
29
29
  }
30
30
  export declare function SidebarNavProvider({ children }: {
31
31
  children: ReactNode;
32
- }): import("react/jsx-runtime").JSX.Element;
32
+ }): import("react").JSX.Element;
33
33
  export declare function useSidebarNav(): SidebarNavContextType;
@@ -1,3 +1,3 @@
1
1
  import * as React from "react";
2
2
  import { Sidebar } from "../../shadcn/sidebar";
3
- export declare function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>): import("react/jsx-runtime").JSX.Element | null;
3
+ export declare function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>): React.JSX.Element | null;
@@ -14,11 +14,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarRail, } from "../../shadcn/sidebar";
15
15
  import { NavMain } from "./nav-main";
16
16
  import { useSidebarNav } from "./SidebarNavContext";
17
+ import { useSidebarExpanded } from "./sidebar-expanded-context";
18
+ import { cn } from "../../utils/cn";
17
19
  export function AppSidebar(_a) {
18
20
  var props = __rest(_a, []);
19
21
  const { navItems, header, footer } = useSidebarNav();
22
+ const expanded = useSidebarExpanded();
20
23
  if (!navItems || navItems.length === 0) {
21
24
  return null;
22
25
  }
23
- return (_jsxs(Sidebar, Object.assign({ className: "ml-12", collapsible: "offcanvas" }, props, { children: [header && _jsx(SidebarHeader, { children: header }), _jsx(SidebarContent, { children: _jsx(NavMain, {}) }), footer && _jsx(SidebarFooter, { children: footer }), _jsx(SidebarRail, {})] })));
26
+ return (_jsxs(Sidebar, Object.assign({ className: cn("transition-[margin] duration-200 ease-in-out", expanded ? "ml-56" : "ml-12"), collapsible: "offcanvas" }, props, { children: [header && _jsx(SidebarHeader, { children: header }), _jsx(SidebarContent, { children: _jsx(NavMain, {}) }), footer && _jsx(SidebarFooter, { children: footer }), _jsx(SidebarRail, {})] })));
24
27
  }
@@ -1 +1,2 @@
1
- export declare function Footer(): import("react/jsx-runtime").JSX.Element;
1
+ import * as React from "react";
2
+ export declare function Footer(): React.JSX.Element;
@@ -1,6 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Copyright } from "lucide-react";
4
+ import { useSidebarExpanded } from "./sidebar-expanded-context";
5
+ import { cn } from "../../utils/cn";
4
6
  export function Footer() {
5
- return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, { className: "size-4" }), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
7
+ const expanded = useSidebarExpanded();
8
+ return (_jsx("footer", { className: cn("flex border-t px-4 py-2 justify-center lg:justify-start transition-[margin] duration-200 ease-in-out", expanded ? "ml-56" : "ml-12"), children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, { className: "size-4" }), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
6
9
  }
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  export declare function Header({ platformUrl }: {
2
3
  platformUrl: string;
3
- }): import("react/jsx-runtime").JSX.Element;
4
+ }): React.JSX.Element;
@@ -7,10 +7,13 @@ import { SidebarTrigger } from "../../shadcn/sidebar";
7
7
  import { Bell, Play } from "lucide-react";
8
8
  import { IconButtonWithTooltip, IconTextButton } from "../buttons";
9
9
  import { useSidebarNav } from "./SidebarNavContext";
10
+ import { useSidebarExpanded } from "./sidebar-expanded-context";
11
+ import { cn } from "../../utils/cn";
10
12
  import Link from "next/link";
11
13
  export function Header({ platformUrl }) {
12
14
  const { navItems } = useSidebarNav();
13
- return (_jsx("header", { className: "ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: _jsxs("div", { className: "flex items-center justify-between gap-2 px-4 w-full", children: [_jsxs("div", { className: "flex items-center gap-2", children: [(!navItems || navItems.length === 0) ? _jsx("div", {}) : _jsx(SidebarTrigger, { className: "-ml-1" }), (!navItems || navItems.length === 0) ?
15
+ const expanded = useSidebarExpanded();
16
+ return (_jsx("header", { className: cn("flex h-12 border-b shrink-0 items-center gap-2 transition-[margin,width,height] duration-200 ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", expanded ? "ml-56" : "ml-12"), children: _jsxs("div", { className: "flex items-center justify-between gap-2 px-4 w-full", children: [_jsxs("div", { className: "flex items-center gap-2", children: [(!navItems || navItems.length === 0) ? _jsx("div", {}) : _jsx(SidebarTrigger, { className: "-ml-1" }), (!navItems || navItems.length === 0) ?
14
17
  _jsx("div", {}) :
15
18
  _jsx(Separator, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }), _jsx(AppBreadcrumb, {})] }), _jsxs("div", { className: "ml-auto flex gap-4", children: [_jsx(IconButtonWithTooltip, { className: "px-2!", tooltipContent: "Notifications", children: _jsx(Bell, {}) }), _jsx(ThemeToggleBtn, {}), _jsx(Link, { href: `${platformUrl}/app-store`, children: _jsxs(IconTextButton, { variant: "default", children: [_jsx(Play, {}), "App Store"] }) })] })] }) }));
16
19
  }
@@ -3,4 +3,4 @@ export declare function MainLayout({ children, baseUrl, platformUrl }: {
3
3
  children: ReactNode;
4
4
  baseUrl: string;
5
5
  platformUrl: string;
6
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { MainSidebar } from './main-sidebar';
4
4
  import { SidebarInset, SidebarProvider } from '../../shadcn/sidebar';
5
5
  import { DialogProvider } from '../alert-dialog/dialog-context';
@@ -7,6 +7,13 @@ import { AppSidebar } from './app-sidebar';
7
7
  import { Header } from './header';
8
8
  import { Footer } from './footer';
9
9
  import { SidebarNavProvider } from './SidebarNavContext';
10
+ import { SidebarExpandedProvider, useSidebarExpanded } from './sidebar-expanded-context';
11
+ import { cn } from '../../utils/cn';
10
12
  export function MainLayout({ children, baseUrl, platformUrl }) {
11
- return (_jsxs(_Fragment, { children: [_jsx(MainSidebar, { baseUrl: baseUrl, platformUrl: platformUrl }), _jsx(SidebarProvider, { children: _jsx(DialogProvider, { children: _jsxs(SidebarNavProvider, { children: [_jsx(AppSidebar, {}), _jsxs(SidebarInset, { className: "flex flex-col h-screen", children: [_jsx(Header, { platformUrl: platformUrl }), _jsx("div", { className: "flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden", children: children }), _jsx(Footer, {})] })] }) }) })] }));
13
+ return (_jsx(SidebarExpandedProvider, { children: _jsxs(SidebarProvider, { children: [_jsx(MainSidebar, { baseUrl: baseUrl, platformUrl: platformUrl }), _jsx(DialogProvider, { children: _jsxs(SidebarNavProvider, { children: [_jsx(AppSidebar, {}), _jsxs(SidebarInset, { className: "flex flex-col h-screen", children: [_jsx(Header, { platformUrl: platformUrl }), _jsx(MainContent, { children: children }), _jsx(Footer, {})] })] }) })] }) }));
14
+ }
15
+ /** Page content, shifted right to clear the main sidebar rail (wider when expanded). */
16
+ function MainContent({ children }) {
17
+ const expanded = useSidebarExpanded();
18
+ return (_jsx("div", { className: cn("flex flex-col gap-4 p-4 pt-0 grow overflow-auto scrollbar-hidden transition-[margin] duration-200 ease-in-out", expanded ? "ml-56" : "ml-12"), children: children }));
12
19
  }
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  export interface AccountMembership {
2
3
  accountId: string;
3
4
  accountName: string;
@@ -58,4 +59,4 @@ export interface DecodedAccessToken {
58
59
  export declare const MainSidebar: ({ baseUrl, platformUrl, }: {
59
60
  baseUrl: string;
60
61
  platformUrl: string;
61
- }) => import("react/jsx-runtime").JSX.Element;
62
+ }) => React.JSX.Element;
@@ -1,8 +1,11 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import { Check, CircleUserRound, FolderCode, Home, LogOut, Settings, } from "lucide-react";
4
+ import { Check, CircleUserRound, FolderCode, Home, LoaderPinwheel, LogOut, PanelLeftClose, PanelLeftOpen, Settings, } from "lucide-react";
5
5
  import { Button } from "../../shadcn/button";
6
+ import { cn } from "../../utils/cn";
7
+ import { useSidebar } from "../../shadcn/sidebar";
8
+ import { useSidebarExpandedState } from "./sidebar-expanded-context";
6
9
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../../shadcn/tooltip";
7
10
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../../shadcn/dropdown-menu";
8
11
  import { getValidAccessToken } from "../../utils/token-management";
@@ -13,13 +16,21 @@ import Link from "next/link";
13
16
  import { jwtDecode } from "jwt-decode";
14
17
  import { Icon } from "../icon";
15
18
  import { useRefresh } from "./RefreshContext";
16
- import { ProviderWrapper } from "../provider-wrapper";
17
19
  export const MainSidebar = ({ baseUrl, platformUrl, }) => {
18
20
  const [user, setUser] = React.useState();
19
21
  const [accounts, setAccounts] = React.useState([]);
20
22
  const [selectedAccount, setSelectedAccount] = React.useState();
21
23
  const [softwares, setSoftwares] = React.useState([]);
22
24
  const { refreshCounter } = useRefresh();
25
+ const { expanded, setExpanded } = useSidebarExpandedState();
26
+ const { open, setOpen } = useSidebar();
27
+ const [roles, setRoles] = React.useState([]);
28
+ // Sub menu (app sidebar) drives the rail inversely: whenever the sub menu is
29
+ // toggled — including from the header trigger — collapse/expand the rail to
30
+ // the opposite state. Single trigger (`open`), so there is no feedback loop.
31
+ React.useEffect(() => {
32
+ setExpanded(!open);
33
+ }, [open]);
23
34
  const getInitials = (name) => {
24
35
  return name
25
36
  .split(" ")
@@ -43,6 +54,7 @@ export const MainSidebar = ({ baseUrl, platformUrl, }) => {
43
54
  isSetToken: true,
44
55
  });
45
56
  const decoded = jwtDecode(accessToken !== null && accessToken !== void 0 ? accessToken : "");
57
+ setRoles(decoded.platformAccess.roles);
46
58
  // Fetch all data in parallel
47
59
  const [userResponse, accountsResponse, softwaresResponse] = await Promise.all([
48
60
  axios.get(`${baseUrl}/platform/user/${decoded.sub}`, {
@@ -97,24 +109,29 @@ export const MainSidebar = ({ baseUrl, platformUrl, }) => {
97
109
  throw error;
98
110
  }
99
111
  };
100
- return (_jsx(ProviderWrapper, { baseUrl: "", platformUrl: "", children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsxs("aside", { className: "fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "default", className: "mb-4 h-8 w-8 rounded-lg p-0", disabled: !selectedAccount, children: _jsx("span", { className: "text-base font-medium text-accent-foreground", children: selectedAccount
112
+ return (_jsx(TooltipProvider, { delayDuration: 0, children: _jsxs("aside", { className: cn("fixed left-0 top-0 z-20 h-screen border-r border-border bg-sidebar text-sidebar-foreground flex flex-col py-4 transition-[width] duration-200 ease-in-out", expanded ? "w-56 items-stretch px-2" : "w-12 items-center"), children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "default", className: cn("mb-4 h-8 rounded-lg", expanded ? "w-full justify-start gap-3 px-2" : "w-8 p-0"), disabled: !selectedAccount, children: [_jsx("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center text-base font-medium text-accent-foreground", children: selectedAccount
101
113
  ? getInitials(selectedAccount.accountName)
102
- : "..." }) }) }), _jsxs(DropdownMenuContent, { className: "w-55", side: "right", sideOffset: 8, align: "start", children: [_jsx("div", { className: "px-2 py-1.5 text-xs font-semibold text-foreground", children: "Accounts" }), accounts.map((account) => (_jsxs(DropdownMenuItem, { className: "flex items-center justify-between cursor-pointer", onClick: async () => {
103
- try {
104
- setSelectedAccount(account);
105
- console.log(account.accountId);
106
- await switchAccount(account.accountId, baseUrl);
107
- window.location.reload();
108
- }
109
- catch (error) {
110
- console.error("Switch account failed", error);
111
- }
112
- }, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-6 w-6 rounded bg-primary/10 flex items-center justify-center", children: _jsx("span", { className: "text-xs font-medium text-primary", children: getInitials(account.accountName) }) }), _jsx("span", { className: "text-sm", children: account.accountName })] }), (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId) === account.accountId && (_jsx(Check, { className: "h-4 w-4 text-primary" }))] }, account.accountId)))] })] }), _jsx("nav", { className: "flex flex-col gap-1", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: `${platformUrl}/home`, children: [_jsx(Home, { className: "h-8 w-8" }), _jsx("span", { className: "sr-only", children: "Home" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Home" })] }, "home") }), _jsx("nav", { className: "flex flex-col gap-1 flex-1", children: softwares.map((software) => {
113
- var _a, _b;
114
- const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
115
- return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: (_a = software.url) !== null && _a !== void 0 ? _a : "#", children: [hasIcon ? (_jsx(Icon, { name: toPascalCase((_b = software.icon) !== null && _b !== void 0 ? _b : ""), className: "h-8 w-8" })) : (_jsx(FolderCode, { className: "h-8 w-8" })), _jsx("span", { className: "sr-only", children: software.displayName })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.displayName })] }, software.displayName));
116
- }) }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: `${platformUrl}/settings`, children: [_jsx(Settings, { className: "h-8 w-8" }), _jsx("span", { className: "sr-only", children: "Settings" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Settings" })] }, "settings"), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", children: _jsx(CircleUserRound, { className: "h-8 w-8" }) }) }), _jsxs(DropdownMenuContent, { className: "w-55 p-0", side: "right", sideOffset: 8, children: [_jsxs("div", { className: "flex items-start gap-3 p-4 bg-card", children: [_jsx(CircleUserRound, { className: "h-8 w-8" }), _jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [_jsx("p", { className: "text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userName }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userEmail }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
117
- await clearAllCookieSession();
118
- redirect(`${platformUrl}/login.html`);
119
- }, className: "flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive", children: [_jsx(LogOut, { className: "h-4 w-4 text-foreground" }), _jsx("span", { children: "Log out" })] })] })] })] }) }) }));
114
+ : "..." }), expanded && (_jsx("span", { className: "truncate text-sm font-medium", children: (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName) || "Account" }))] }) }), _jsxs(DropdownMenuContent, { className: "w-55", side: "right", sideOffset: 8, align: "start", children: [_jsx("div", { className: "px-2 py-1.5 text-xs font-semibold text-foreground", children: "Accounts" }), accounts.map((account) => (_jsxs(DropdownMenuItem, { className: "flex items-center justify-between cursor-pointer", onClick: async () => {
115
+ try {
116
+ setSelectedAccount(account);
117
+ console.log(account.accountId);
118
+ await switchAccount(account.accountId, baseUrl);
119
+ window.location.reload();
120
+ }
121
+ catch (error) {
122
+ console.error("Switch account failed", error);
123
+ }
124
+ }, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-6 w-6 rounded bg-primary/10 flex items-center justify-center", children: _jsx("span", { className: "text-xs font-medium text-primary", children: getInitials(account.accountName) }) }), _jsx("span", { className: "text-sm", children: account.accountName })] }), (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId) === account.accountId && (_jsx(Check, { className: "h-4 w-4 text-primary" }))] }, account.accountId)))] })] }), _jsx("nav", { className: "flex flex-col gap-1 w-full", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs(Link, { href: `${platformUrl}/home`, children: [_jsx(Home, { className: "h-8 w-8 shrink-0" }), expanded ? (_jsx("span", { className: "truncate text-sm", children: "Home" })) : (_jsx("span", { className: "sr-only", children: "Home" }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Home" }))] }, "home") }), _jsx("nav", { className: "flex flex-col gap-1 flex-1 w-full", children: softwares.map((software) => {
125
+ var _a, _b;
126
+ const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
127
+ return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs(Link, { href: (_a = software.url) !== null && _a !== void 0 ? _a : "#", children: [hasIcon ? (_jsx(Icon, { name: toPascalCase((_b = software.icon) !== null && _b !== void 0 ? _b : ""), className: "h-8 w-8 shrink-0" })) : (_jsx(FolderCode, { className: "h-8 w-8 shrink-0" })), expanded ? (_jsx("span", { className: "truncate text-sm", children: software.displayName })) : (_jsx("span", { className: "sr-only", children: software.displayName }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.displayName }))] }, software.displayName));
128
+ }) }), ((roles === null || roles === void 0 ? void 0 : roles.includes("ADMIN")) || (roles === null || roles === void 0 ? void 0 : roles.includes("DEVELOPER")) || (roles === null || roles === void 0 ? void 0 : roles.includes("SUPERADMIN"))) && (_jsx(_Fragment, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs("a", { href: "https://holocron.keross.com/ikon-portal/login.html", target: "_blank", rel: "noopener noreferrer", children: [_jsx(LoaderPinwheel, { className: "h-8 w-8 shrink-0" }), expanded ? (_jsx("span", { className: "truncate text-sm", children: "Release Ops." })) : (_jsx("span", { className: "sr-only", children: "Release Ops." }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Release Ops." }))] }, "release-ops") })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs(Link, { href: `${platformUrl}/settings`, children: [_jsx(Settings, { className: "h-8 w-8 shrink-0" }), expanded ? (_jsx("span", { className: "truncate text-sm", children: "Settings" })) : (_jsx("span", { className: "sr-only", children: "Settings" }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Settings" }))] }, "settings"), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), children: [_jsx(CircleUserRound, { className: "h-8 w-8 shrink-0" }), expanded && (_jsx("span", { className: "truncate text-sm font-medium", children: (user === null || user === void 0 ? void 0 : user.userName) || "Profile" }))] }) }), _jsxs(DropdownMenuContent, { className: "w-55 p-0", side: "right", sideOffset: 8, children: [_jsxs("div", { className: "flex items-start gap-3 p-4 bg-card", children: [_jsx(CircleUserRound, { className: "h-8 w-8" }), _jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [_jsx("p", { className: "text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userName }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userEmail }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
129
+ await clearAllCookieSession();
130
+ redirect(`${platformUrl}/login.html`);
131
+ }, className: "flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive", children: [_jsx(LogOut, { className: "h-4 w-4 text-foreground" }), _jsx("span", { children: "Log out" })] })] })] }), _jsx("div", { className: cn("mb-2 flex", expanded ? "justify-end" : "justify-center"), children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: expanded ? "default" : "icon", className: cn("h-8", expanded ? "w-full justify-start gap-3 px-3" : "w-8"), onClick: () => {
132
+ const next = !expanded;
133
+ setExpanded(next);
134
+ // Opening the rail closes the sub menu, and vice versa.
135
+ setOpen(!next);
136
+ }, children: [expanded ? (_jsx(PanelLeftClose, { className: "h-5 w-5 shrink-0" })) : (_jsx(PanelLeftOpen, { className: "h-5 w-5 shrink-0" })), expanded ? (_jsx("span", { className: "truncate text-sm", children: "Collapse" })) : (_jsx("span", { className: "sr-only", children: "Expand sidebar" }))] }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Expand sidebar" }))] }, "toggle-sidebar") })] }) }));
120
137
  };
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { SidebarNavItem } from "./SidebarNavContext";
3
- export declare function NavMain(): import("react/jsx-runtime").JSX.Element;
3
+ export declare function NavMain(): import("react").JSX.Element;
4
4
  export declare function RenderSidebarNav({ items, sidebarHeader, sidebarFooter }: {
5
5
  items: SidebarNavItem[];
6
6
  sidebarHeader?: ReactNode;
@@ -0,0 +1,20 @@
1
+ import { type ReactNode } from "react";
2
+ interface SidebarExpandedContextValue {
3
+ /** Whether the main sidebar rail is expanded into its labeled-panel state. */
4
+ expanded: boolean;
5
+ setExpanded: (value: boolean) => void;
6
+ toggle: () => void;
7
+ }
8
+ /**
9
+ * Provides the main sidebar's expanded/collapsed state to the whole layout so
10
+ * that siblings of the rail (app sidebar, header, content, footer) can shift to
11
+ * make room for the expanded panel instead of being covered by it.
12
+ */
13
+ export declare function SidebarExpandedProvider({ children }: {
14
+ children: ReactNode;
15
+ }): import("react").JSX.Element;
16
+ /** Full state + setters for the rail (used by the rail itself). */
17
+ export declare const useSidebarExpandedState: () => SidebarExpandedContextValue;
18
+ /** Convenience hook returning just the boolean (used by rail items / layout). */
19
+ export declare const useSidebarExpanded: () => boolean;
20
+ export {};
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext, useState } from "react";
4
+ const SidebarExpandedContext = createContext({
5
+ expanded: false,
6
+ setExpanded: () => { },
7
+ toggle: () => { },
8
+ });
9
+ /**
10
+ * Provides the main sidebar's expanded/collapsed state to the whole layout so
11
+ * that siblings of the rail (app sidebar, header, content, footer) can shift to
12
+ * make room for the expanded panel instead of being covered by it.
13
+ */
14
+ export function SidebarExpandedProvider({ children }) {
15
+ const [expanded, setExpanded] = useState(false);
16
+ return (_jsx(SidebarExpandedContext.Provider, { value: {
17
+ expanded,
18
+ setExpanded,
19
+ toggle: () => setExpanded((prev) => !prev),
20
+ }, children: children }));
21
+ }
22
+ /** Full state + setters for the rail (used by the rail itself). */
23
+ export const useSidebarExpandedState = () => useContext(SidebarExpandedContext);
24
+ /** Convenience hook returning just the boolean (used by rail items / layout). */
25
+ export const useSidebarExpanded = () => useContext(SidebarExpandedContext).expanded;