@zauru-sdk/components 6.9.0 → 6.11.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.
@@ -32,6 +32,7 @@ export type NavBarProps = {
32
32
  LinkComponent?: any;
33
33
  version?: string;
34
34
  reloadCatalogsOption?: boolean;
35
+ settingsOption?: boolean;
35
36
  showDarkModeToggle?: boolean;
36
37
  };
37
38
 
@@ -174,6 +174,8 @@ function GroupRows({
174
174
  >
175
175
  <input
176
176
  type="checkbox"
177
+ id={`permission-${role.id}-${action.key}`}
178
+ name={`permission-${role.id}-${action.key}`}
177
179
  className={checkboxClass}
178
180
  checked={granted}
179
181
  disabled={disabled || pending}
@@ -0,0 +1,54 @@
1
+ import type { ReactNode } from "react";
2
+ import { MainContainer } from "../Containers/MainContainer.js";
3
+ import { SubContainer } from "../Containers/SubContainer.js";
4
+ import { RouteTabNav } from "./RouteTabNav.js";
5
+
6
+ type Props = {
7
+ children: ReactNode;
8
+ showEmployees?: boolean;
9
+ showRoles?: boolean;
10
+ showPermissions?: boolean;
11
+ basePath?: string;
12
+ title?: string;
13
+ description?: string;
14
+ };
15
+
16
+ export const WebappSettingsChrome = ({
17
+ children,
18
+ showEmployees = true,
19
+ showRoles = true,
20
+ showPermissions = true,
21
+ basePath = "/configuracion",
22
+ title = "Configuración",
23
+ description = "Roles, empleados y permisos de esta aplicación.",
24
+ }: Props) => {
25
+ const base = basePath.replace(/\/$/, "");
26
+ return (
27
+ <MainContainer>
28
+ <SubContainer title={title} description={description}>
29
+ <RouteTabNav
30
+ ariaLabel="Secciones de configuración de accesos"
31
+ selectedColor="indigo"
32
+ items={[
33
+ {
34
+ to: `${base}/empleados`,
35
+ label: "Empleados",
36
+ hide: !showEmployees,
37
+ },
38
+ {
39
+ to: `${base}/roles`,
40
+ label: "Roles",
41
+ hide: !showRoles,
42
+ },
43
+ {
44
+ to: `${base}/permisos`,
45
+ label: "Permisos",
46
+ hide: !showPermissions,
47
+ },
48
+ ]}
49
+ />
50
+ {children}
51
+ </SubContainer>
52
+ </MainContainer>
53
+ );
54
+ };
package/src/Tab/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./Tab.js";
2
2
  export * from "./RouteTabNav.js";
3
3
  export * from "./PermissionMatrix.js";
4
+ export * from "./WebappSettingsChrome.js";
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./Alerts/index.js";
2
+ export * from "./AccessControl/index.js";
2
3
  export * from "./BlockUI/index.js";
3
4
  export * from "./Buttons/index.js";
4
5
  export * from "./Card/index.js";