@australiangreens/ag-internal-components 0.1.23 → 0.1.25

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 (31) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/components/AgDialog/AgDialog.d.ts +2 -1
  4. package/dist/components/AgDialog/AgDialog.d.ts.map +1 -1
  5. package/dist/esm/index.js +665 -1011
  6. package/dist/esm/index.js.map +1 -1
  7. package/dist/layouts/index.d.ts +1 -3
  8. package/dist/layouts/index.d.ts.map +1 -1
  9. package/dist/utils/determineUserLevel.d.ts +1 -0
  10. package/dist/utils/determineUserLevel.d.ts.map +1 -1
  11. package/package.json +1 -1
  12. package/dist/layouts/PageLayout/PageContainer.d.ts +0 -6
  13. package/dist/layouts/PageLayout/PageContainer.d.ts.map +0 -1
  14. package/dist/layouts/PageLayout/PageLayout.comp.test.d.ts +0 -2
  15. package/dist/layouts/PageLayout/PageLayout.comp.test.d.ts.map +0 -1
  16. package/dist/layouts/PageLayout/PageLayout.d.ts +0 -60
  17. package/dist/layouts/PageLayout/PageLayout.d.ts.map +0 -1
  18. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts +0 -8
  19. package/dist/layouts/PageLayout/PanelAwareMargins.d.ts.map +0 -1
  20. package/dist/layouts/PageLayout/SidePanel.comp.test.d.ts +0 -2
  21. package/dist/layouts/PageLayout/SidePanel.comp.test.d.ts.map +0 -1
  22. package/dist/layouts/PageLayout/SidePanel.d.ts +0 -26
  23. package/dist/layouts/PageLayout/SidePanel.d.ts.map +0 -1
  24. package/dist/layouts/PageLayout/TopBar.comp.test.d.ts +0 -2
  25. package/dist/layouts/PageLayout/TopBar.comp.test.d.ts.map +0 -1
  26. package/dist/layouts/PageLayout/TopBar.d.ts +0 -32
  27. package/dist/layouts/PageLayout/TopBar.d.ts.map +0 -1
  28. package/dist/layouts/PageLayout/index.d.ts +0 -3
  29. package/dist/layouts/PageLayout/index.d.ts.map +0 -1
  30. package/dist/layouts/PageLayout/index.stories.d.ts +0 -7
  31. package/dist/layouts/PageLayout/index.stories.d.ts.map +0 -1
@@ -1,5 +1,3 @@
1
- export { default as PageLayout } from './PageLayout';
2
- export * from './PageLayout';
3
- export { default as AppLayout } from './AppLayout';
4
1
  export * from './AppLayout';
2
+ export { default as AppLayout } from './AppLayout';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { IdToken } from '@auth0/auth0-spa-js';
2
2
  import { DomainCode } from 'src/domainCode';
3
3
  export declare function determineUserLevelFromClaims<T extends string>(claims: IdToken | undefined, domainCode: DomainCode, roleMapping: Record<T, string[]>, rolePriority: T[]): T | "None";
4
+ export declare const useValidDomains: (appValidBusinessRoles: string[]) => import('@tanstack/react-query').UseQueryResult<("" | "act" | "nsw" | "nt" | "qld" | "sa" | "tas" | "vic" | "wa" | "ag" | "fedmps")[], Error>;
4
5
  //# sourceMappingURL=determineUserLevel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"determineUserLevel.d.ts","sourceRoot":"","sources":["../../src/utils/determineUserLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAC3D,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAChC,YAAY,EAAE,CAAC,EAAE,cAgBlB"}
1
+ {"version":3,"file":"determineUserLevel.d.ts","sourceRoot":"","sources":["../../src/utils/determineUserLevel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAC3D,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAChC,YAAY,EAAE,CAAC,EAAE,cAgBlB;AAED,eAAO,MAAM,eAAe,0BAA2B,MAAM,EAAE,iJAoB9D,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@australiangreens/ag-internal-components",
3
3
  "private": false,
4
- "version": "0.1.23",
4
+ "version": "0.1.25",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",
@@ -1,6 +0,0 @@
1
- import { StyledComponent } from '@emotion/styled';
2
- import { ContainerProps } from '@mui/material';
3
- /** Just a simple styled container applying our spacings*/
4
- declare const PageContainer: StyledComponent<ContainerProps>;
5
- export default PageContainer;
6
- //# sourceMappingURL=PageContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageContainer.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/PageContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAa,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1D,0DAA0D;AAC1D,QAAA,MAAM,aAAa,EAAE,eAAe,CAAC,cAAc,CAOhD,CAAC;AAEJ,eAAe,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PageLayout.comp.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageLayout.comp.test.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/PageLayout.comp.test.tsx"],"names":[],"mappings":""}
@@ -1,60 +0,0 @@
1
- import { ComponentProps, PropsWithChildren, ReactNode } from 'react';
2
- import { default as PageContainer } from './PageContainer';
3
- export interface SidePanelProps {
4
- titleText?: string;
5
- content?: ReactNode;
6
- flavour?: 'push' | 'overlay';
7
- arrowButtons?: 'open' | 'close' | 'both' | 'none';
8
- width?: number;
9
- startOpen?: boolean;
10
- /** Use this and onChangeOpen if you want to use component as a controlled component */
11
- open?: boolean;
12
- onChangeOpen?: (open: boolean) => void;
13
- /** Called when the sliding transition to open has finished */
14
- onOpened?: () => void;
15
- /** Called when the sliding transition to open has finished */
16
- onClosed?: () => void;
17
- dataTestId?: string;
18
- }
19
- interface BasePageLayoutProps {
20
- titleText?: string;
21
- leftPanel?: SidePanelProps;
22
- rightPanel?: SidePanelProps;
23
- /** This will only have an effect for panels whose state is not controlled by
24
- * parent */
25
- sidePanelsAreMutuallyExclusive?: boolean;
26
- /** Temporary, get rid of later */
27
- debugOpacity?: boolean;
28
- /** Props applied to the PageContainer component, which is a styled MUI Container */
29
- pageContainerProps?: ComponentProps<typeof PageContainer>;
30
- topBarDataTestId?: string;
31
- pageContentDataTestId?: string;
32
- }
33
- interface PageLayoutWithNavBarProps extends BasePageLayoutProps {
34
- /** Only used by side panels for alignment purposes */
35
- navBarOpen: boolean;
36
- /** Only used by side panels for alignment purposes */
37
- navBarWidthOpen: number;
38
- /** Only used by side panels for alignment purposes */
39
- navBarWidthClosed: number;
40
- }
41
- interface PagelayoutWithoutNavBarProps extends BasePageLayoutProps {
42
- navBarOpen?: never;
43
- navBarWidthOpen?: never;
44
- navBarWidthClosed?: never;
45
- }
46
- export type PageLayoutProps = PropsWithChildren<PageLayoutWithNavBarProps | PagelayoutWithoutNavBarProps>;
47
- /**
48
- * To be used by all Page components in our apps to use a standard Top Bar, Left
49
- * Panel, Right Panel and Page Contents within the contents for a uniform look.
50
- *
51
- * At present it is somewhat crudely adapted from the code used in the
52
- * ListManager app. It _assumes_ NavBar component on the left.
53
- *
54
- * It is in the process of being tidied up, and as such is very much in flux.
55
- * The end goal is to unify the left most NavBar component with the PageLayout,
56
- * but this has to be done incrementally.
57
- */
58
- export default function PageLayout({ children, titleText, leftPanel, rightPanel, sidePanelsAreMutuallyExclusive, debugOpacity, pageContainerProps, pageContentDataTestId, topBarDataTestId, navBarOpen, navBarWidthOpen, navBarWidthClosed, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
59
- export {};
60
- //# sourceMappingURL=PageLayout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAM1F,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAmB5C,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,uFAAuF;IACvF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IA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-1,8 +0,0 @@
1
- import { StyledComponent } from '@emotion/styled';
2
- import { BoxProps } from '@mui/material';
3
- /** With the optional leftPanel and rightPanel props providing state and width,
4
- * the children of of the PanelAwareMargins will looks like they is pushed aside
5
- * by the panels by transitioning the margins. */
6
- declare const PanelAwareMargins: StyledComponent<BoxProps>;
7
- export default PanelAwareMargins;
8
- //# sourceMappingURL=PanelAwareMargins.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PanelAwareMargins.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/PanelAwareMargins.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoB9C;;iDAEiD;AACjD,QAAA,MAAM,iBAAiB,EAAE,eAAe,CAAC,QAAQ,CAuB9C,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=SidePanel.comp.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SidePanel.comp.test.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/SidePanel.comp.test.tsx"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { BoxProps } from '@mui/material';
3
- export declare const DEFAULT_PANEL_WIDTH = 400;
4
- type SidePanelProps = PropsWithChildren<{
5
- open: boolean;
6
- anchor?: 'left' | 'right';
7
- onClose?: React.MouseEventHandler<HTMLElement>;
8
- titleText?: string;
9
- width?: number;
10
- showCloseArrow?: boolean;
11
- debugOpacity?: boolean;
12
- headerBoxProps?: BoxProps;
13
- onOpened?: () => void;
14
- onClosed?: () => void;
15
- 'data-testid'?: string;
16
- navBarOpen?: boolean;
17
- navBarWidthOpen?: number;
18
- navBarWidthClosed?: number;
19
- }>;
20
- /**
21
- * The SidePanel is designed to be used along with the TopBar component for a
22
- * consistent look and feel.
23
- */
24
- export default function SidePanel({ children, anchor, open, onClose, titleText, width, showCloseArrow, debugOpacity, headerBoxProps, onOpened, onClosed, 'data-testid': dataTestId, navBarOpen, navBarWidthOpen, navBarWidthClosed, }: SidePanelProps): import("react/jsx-runtime").JSX.Element;
25
- export {};
26
- //# sourceMappingURL=SidePanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAM,QAAQ,EAAsD,MAAM,eAAe,CAAC;AAGjG,eAAO,MAAM,mBAAmB,MAAM,CAAC;AA+EvC,KAAK,cAAc,GAAG,iBAAiB,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,MAAe,EACf,IAAI,EACJ,OAAkB,EAClB,SAAc,EACd,KAA2B,EAC3B,cAAqB,EACrB,YAAoB,EACpB,cAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,aAAa,EAAE,UAAU,EACzB,UAAkB,EAClB,eAAmB,EACnB,iBAAqB,GACtB,EAAE,cAAc,2CAgDhB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TopBar.comp.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopBar.comp.test.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/TopBar.comp.test.tsx"],"names":[],"mappings":""}
@@ -1,32 +0,0 @@
1
- interface PanelProps {
2
- open: boolean;
3
- width: number;
4
- showOpenArrow: boolean;
5
- /** Called when the arrow button is pressed (if showOpenButton is true) */
6
- onOpen?: () => void;
7
- showOpenButton?: boolean;
8
- }
9
- export interface TopBarProps {
10
- titleText?: string;
11
- leftPanel?: PanelProps;
12
- rightPanel?: PanelProps;
13
- 'data-testid'?: string;
14
- }
15
- export declare const classes: {
16
- topStripe: string;
17
- titleBar: string;
18
- titleSlider: string;
19
- titleText: string;
20
- leftPanelButton: string;
21
- rightPanelButton: string;
22
- };
23
- /**
24
- * Goes at the top of every page. Wasn't feeling creative in naming it.
25
- *
26
- * This differs from the typical appbar with a toolbar used in most MUI apps in
27
- * that it has to interact with a sliding side panel that is not the main
28
- * navbar.
29
- */
30
- export default function TopBar({ titleText, leftPanel, rightPanel, 'data-testid': dataTestId, }: TopBarProps): import("react/jsx-runtime").JSX.Element;
31
- export {};
32
- //# sourceMappingURL=TopBar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/TopBar.tsx"],"names":[],"mappings":"AAQA,UAAU,UAAU;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IAEvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO;;;;;;;CAQnB,CAAC;AAoEF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,SAAc,EACd,SAAS,EACT,UAAU,EACV,aAAa,EAAE,UAAU,GAC1B,EAAE,WAAW,2CAyCb"}
@@ -1,3 +0,0 @@
1
- export { default } from './PageLayout';
2
- export * from './PageLayout';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,cAAc,cAAc,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { default as PageLayout } from '.';
3
- declare const meta: Meta<typeof PageLayout>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Playground: Story;
7
- //# sourceMappingURL=index.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/PageLayout/index.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,UAAU,MAAM,GAAG,CAAC;AAwB3B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAmDC,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAoDnC,eAAO,MAAM,UAAU,EAAE,KA4BxB,CAAC"}