@australiangreens/ag-internal-components 0.0.29 → 0.0.30

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 (43) hide show
  1. package/README.md +24 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/esm/index.js +659 -761
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/index.d.ts +6 -1
  7. package/dist/layouts/AppLayout/AppLayout.d.ts +35 -0
  8. package/dist/layouts/AppLayout/AppLayout.d.ts.map +1 -0
  9. package/dist/layouts/AppLayout/AppLayoutContext.d.ts +9 -2
  10. package/dist/layouts/AppLayout/AppLayoutContext.d.ts.map +1 -1
  11. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts +6 -0
  12. package/dist/layouts/AppLayout/NavBar/LinksMenu.d.ts.map +1 -0
  13. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts +44 -0
  14. package/dist/layouts/AppLayout/NavBar/NavBar.d.ts.map +1 -0
  15. package/dist/layouts/AppLayout/NavBar/Styling.d.ts +4 -5
  16. package/dist/layouts/AppLayout/NavBar/Styling.d.ts.map +1 -1
  17. package/dist/layouts/AppLayout/NavBar/index.d.ts +3 -19
  18. package/dist/layouts/AppLayout/NavBar/index.d.ts.map +1 -1
  19. package/dist/layouts/AppLayout/NavBar/types.d.ts +7 -0
  20. package/dist/layouts/AppLayout/NavBar/types.d.ts.map +1 -0
  21. package/dist/layouts/AppLayout/PageContainer.d.ts +5 -12
  22. package/dist/layouts/AppLayout/PageContainer.d.ts.map +1 -1
  23. package/dist/layouts/AppLayout/TopBar.d.ts +5 -9
  24. package/dist/layouts/AppLayout/TopBar.d.ts.map +1 -1
  25. package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts +12 -0
  26. package/dist/layouts/AppLayout/appLayoutContextStateReducer.d.ts.map +1 -1
  27. package/dist/layouts/AppLayout/defaults.d.ts +4 -20
  28. package/dist/layouts/AppLayout/defaults.d.ts.map +1 -1
  29. package/dist/layouts/AppLayout/index.d.ts +1 -2
  30. package/dist/layouts/AppLayout/index.d.ts.map +1 -1
  31. package/dist/providers/index.d.ts +0 -2
  32. package/dist/providers/index.d.ts.map +1 -1
  33. package/dist/themes/types.d.ts +13 -0
  34. package/dist/themes/types.d.ts.map +1 -0
  35. package/package.json +4 -3
  36. package/dist/layouts/AppLayout/NavBar/NavBarDarkStyledList.d.ts +0 -2
  37. package/dist/layouts/AppLayout/NavBar/NavBarDarkStyledList.d.ts.map +0 -1
  38. package/dist/layouts/AppLayout/types.d.ts +0 -23
  39. package/dist/layouts/AppLayout/types.d.ts.map +0 -1
  40. package/dist/providers/AgTheme/index.d.ts +0 -7
  41. package/dist/providers/AgTheme/index.d.ts.map +0 -1
  42. package/dist/providers/AgTheme/themes.d.ts +0 -3
  43. package/dist/providers/AgTheme/themes.d.ts.map +0 -1
@@ -0,0 +1,44 @@
1
+ import { ReactNode } from 'react';
2
+ import { NavBarLink } from './types';
3
+ export interface NavBarProps {
4
+ open: boolean;
5
+ offsetTop?: number;
6
+ widthOpen: number;
7
+ widthClosed: number;
8
+ /** Set the datatest-id on the root element for using reactdom's getByTestId()
9
+ * function */
10
+ 'data-testid'?: string;
11
+ /** The contents to be displayed at the top, specified to the current page */
12
+ top?: ReactNode;
13
+ /** Display be below the top section, always the same regardless of page. Can
14
+ * be provided either as a node directly, or an array of objects that will be
15
+ * used to generate a standard navbar menu.
16
+ *
17
+ * @example
18
+ *
19
+ * ```
20
+ * // As a ReactNode
21
+ * <NavBar open: {open} middle={<TheContent}/>
22
+ * ```
23
+ *
24
+ * @example
25
+ *
26
+ * ```
27
+ * // As an Array
28
+ * <NavBar open: {open} middle={[
29
+ * {label: 'foo', destPathname: '/foo', icon: {FooIcon}},
30
+ * {label: 'bar', destPathname: '/bar', icon: {BarIcon}},
31
+ * ]}/>
32
+ * ```
33
+ */
34
+ middle: ReactNode | NavBarLink[];
35
+ /** The contents aligned against bottom of view port, user info etc */
36
+ bottom?: ReactNode;
37
+ }
38
+ /**
39
+ * A styled navigation bar. At this point in time its pretty unopinionated, it
40
+ * just renders whatever children it is given. The NavBarLightStyledList
41
+ * component can be used for consistent styling against the background.
42
+ */
43
+ export default function NavBar({ open, offsetTop, widthOpen, widthClosed, 'data-testid': dataTestId, top, middle, bottom, }: NavBarProps): JSX.Element;
44
+ //# sourceMappingURL=NavBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavBar.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/NavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAOrC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IAEd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;IAEpB;kBACc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,6EAA6E;IAC7E,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,EAAE,SAAS,GAAG,UAAU,EAAE,CAAC;IAEjC,sEAAsE;IACtE,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,IAAI,EACJ,SAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EAAE,UAAU,EACzB,GAAG,EACH,MAAM,EACN,MAAM,GACP,EAAE,WAAW,eAgCb"}
@@ -1,19 +1,18 @@
1
1
  /// <reference types="react" />
2
+ import { Theme } from '@mui/material/styles';
2
3
  export declare const classes: {
3
4
  root: string;
4
5
  menuButton: string;
5
6
  hide: string;
6
7
  content: string;
7
- userInfoHolder: string;
8
- settings: string;
9
- pieChartIcon: string;
10
8
  };
11
- export declare const Root: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
9
+ export declare const Root: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").ClassAttributes<HTMLDivElement> | keyof import("react").HTMLAttributes<HTMLDivElement>>, {}>;
12
10
  interface NavDrawerProps {
13
11
  open: boolean;
14
12
  widthOpen: number;
15
13
  widthClosed: number;
14
+ offsetTop: number;
16
15
  }
17
- export declare const NavDrawer: import("@emotion/styled").StyledComponent<import("@mui/material/Drawer").DrawerProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & NavDrawerProps, {}, {}>;
16
+ export declare const NavDrawer: import("@emotion/styled").StyledComponent<import("@mui/material/Drawer").DrawerProps & import("@mui/system").MUIStyledCommonProps<Theme> & NavDrawerProps, {}, {}>;
18
17
  export {};
19
18
  //# sourceMappingURL=Styling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Styling.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/Styling.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC;AAEF,eAAO,MAAM,IAAI,wVAuBd,CAAC;AAwBJ,UAAU,cAAc;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,mMAenB,CAAC"}
1
+ {"version":3,"file":"Styling.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/Styling.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAKhE,eAAO,MAAM,OAAO;;;;;CAQnB,CAAC;AAEF,eAAO,MAAM,IAAI,yTAuBd,CAAC;AA+BJ,UAAU,cAAc;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,oKAgBnB,CAAC"}
@@ -1,20 +1,4 @@
1
- import { PropsWithChildren } from 'react';
2
- export type NavbarProps = {
3
- open: boolean;
4
- widthOpen: number;
5
- widthClosed: number;
6
- /** Set the datatest-id on the root element for using reactdom's getByTestId()
7
- * function */
8
- 'data-testid'?: string;
9
- };
10
- /**
11
- * A styled navigation bar. At this point in time its pretty unopinionated, it
12
- * just renders whatever children it is given. The NavBarDarkStyledList
13
- * component can be used for consistent styling against the background. We'll be
14
- * changing the way we use NavBars soon anyway, so not much point solidying the
15
- * patterns yet.
16
- */
17
- export default function NavBar({ open, widthOpen, widthClosed, 'data-testid': dataTestId, children, }: PropsWithChildren<NavbarProps>): JSX.Element;
18
- export * from './NavBarDarkStyledList';
19
- export { classes as navBarClasses } from './Styling';
1
+ export * from './types';
2
+ export * from './NavBar';
3
+ export { default } from './NavBar';
20
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB;kBACc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAKF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,IAAI,EACJ,SAAS,EACT,WAAW,EACX,aAAa,EAAE,UAAU,EACzB,QAAQ,GACT,EAAE,iBAAiB,CAAC,WAAW,CAAC,eAiBhC;AAED,cAAc,wBAAwB,CAAC;AAGvC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export interface NavBarLink {
3
+ label: string;
4
+ destPathname: string;
5
+ icon?: ReactNode;
6
+ }
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAElB"}
@@ -1,14 +1,7 @@
1
- /// <reference types="react" />
2
- /** Just a simple styled container applying our spacings*/
3
- declare const PageContainer: import("@emotion/styled").StyledComponent<Pick<{
4
- children?: import("react").ReactNode;
5
- classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
6
- disableGutters?: boolean | undefined;
7
- fixed?: boolean | undefined;
8
- maxWidth?: false | import("@mui/material").Breakpoint | undefined;
9
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
11
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
12
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "maxWidth" | "children" | "sx" | "fixed" | "disableGutters">, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "maxWidth" | "translate" | "children" | "sx" | "ref" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
1
+ import { PropsWithChildren } from 'react';
2
+ interface PageContainerProps {
3
+ topBarHeight: number;
4
+ }
5
+ declare function PageContainer({ children, topBarHeight }: PropsWithChildren<PageContainerProps>): JSX.Element;
13
6
  export default PageContainer;
14
7
  //# sourceMappingURL=PageContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageContainer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/PageContainer.tsx"],"names":[],"mappings":";AAEA,0DAA0D;AAC1D,QAAA,MAAM,aAAa;;;;;;;;;y1JAMhB,CAAC;AAEJ,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"PageContainer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/PageContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AA4B1C,UAAU,kBAAkB;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,iBAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,eAoBvF;AAED,eAAe,aAAa,CAAC"}
@@ -1,19 +1,15 @@
1
1
  export interface TopBarProps {
2
2
  titleText?: string;
3
+ height: number;
3
4
  'data-testid'?: string;
4
5
  }
5
6
  export declare const classes: {
6
- topStripe: string;
7
- titleBar: string;
8
- titleSlider: string;
9
7
  titleText: string;
10
8
  };
11
9
  /**
12
- * Goes at the top of every page. Wasn't feeling creative in naming it.
13
- *
14
- * This differs from the more complex TopBar used in the PageLayout component
15
- * that it has to interact with a sliding side panel that is not the main
16
- * navbar.
10
+ * Top bar of every page, above the content. Works a bit like MUI's AppBar but
11
+ * the scroll bar will not appear for the whole page, instead just the page
12
+ * content
17
13
  */
18
- export default function TopBar({ titleText, 'data-testid': dataTestId }: TopBarProps): JSX.Element;
14
+ export default function TopBar({ titleText, height, 'data-testid': dataTestId }: TopBarProps): JSX.Element;
19
15
  //# sourceMappingURL=TopBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/TopBar.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO;;;;;CAMnB,CAAC;AAwCF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,SAAc,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,WAAW,eAaxF"}
1
+ {"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/TopBar.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,SAAc,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,EAAE,WAAW,eA6BhG"}
@@ -4,9 +4,21 @@ type Action = {
4
4
  } | {
5
5
  type: 'setNavBarOpen';
6
6
  payload: AppLayoutContextState['navBarOpen'];
7
+ } | {
8
+ type: 'setTopBarHeight';
9
+ payload: AppLayoutContextState['topBarHeight'];
10
+ } | {
11
+ type: 'setNavBarWidthOpen';
12
+ payload: AppLayoutContextState['navBarWidthOpen'];
13
+ } | {
14
+ type: 'setNavBarWidthClosed';
15
+ payload: AppLayoutContextState['navBarWidthClosed'];
7
16
  } | {
8
17
  type: 'setTitleText';
9
18
  payload: AppLayoutContextState['titleText'];
19
+ } | {
20
+ type: 'setNavBarTop';
21
+ payload: AppLayoutContextState['navBarTop'];
10
22
  };
11
23
  export declare const INITIAL_PAGE_LAYOUT_CONTEXT_STATE: AppLayoutContextState;
12
24
  export declare function appLayoutContextStateReducer(state: AppLayoutContextState, action: Action): AppLayoutContextState;
@@ -1 +1 @@
1
- {"version":3,"file":"appLayoutContextStateReducer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/appLayoutContextStateReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,KAAK,MAAM,GACP;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,iCAAiC,EAAE,qBAK/C,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,MAAM,GACb,qBAAqB,CAuBvB"}
1
+ {"version":3,"file":"appLayoutContextStateReducer.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/appLayoutContextStateReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAO3D,KAAK,MAAM,GACP;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,cAAc,CAAC,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAA;CAAE,GACrF;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,iCAAiC,EAAE,qBAO/C,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,MAAM,GACb,qBAAqB,CAyCvB"}
@@ -1,21 +1,5 @@
1
- export declare const SIDE_PANEL_DEFAULTS: {
2
- titleText: string;
3
- flavour: string;
4
- width: number;
5
- arrowButtons: string;
6
- startOpen: boolean;
7
- open: undefined;
8
- onChangeOpen: undefined;
9
- content: JSX.Element;
10
- onOpened: undefined;
11
- onClosed: undefined;
12
- dataTestId: undefined;
13
- };
14
- export declare const INITIAL_LEFT_PANEL_OPEN = false;
15
- export declare const INITIAL_RIGHT_PANEL_OPEN = false;
16
- export declare const NAVBAR_DEFAULTS: {
17
- content: JSX.Element;
18
- widthOpen: number;
19
- widthClosed: number;
20
- };
1
+ export declare const DEFAULT_INITIAL_NAV_BAR_OPEN = true;
2
+ export declare const DEFAULT_TOP_BAR_HEIGHT = 64;
3
+ export declare const DEFAULT_NAV_BAR_WIDTH_CLOSED = 64;
4
+ export declare const DEFAULT_NAV_BAR_WIDTH_OPEN = 256;
21
5
  //# sourceMappingURL=defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/defaults.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;CAY/B,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAC7C,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C,eAAO,MAAM,eAAe;;;;CAI3B,CAAC"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/defaults.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,0BAA0B,MAAM,CAAC"}
@@ -1,4 +1,3 @@
1
- import { AppLayoutProps } from './types';
2
- export default function AppLayoutWithProvider(props: AppLayoutProps): JSX.Element;
1
+ export { default } from './AppLayout';
3
2
  export * from './AppLayoutContext';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA2CzC,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,cAAc,eAMlE;AAED,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -1,5 +1,3 @@
1
- export { default as AgThemeProvider } from './AgTheme';
2
- export * from './AgTheme';
3
1
  export { default as SaladBarProvider } from './SaladBar';
4
2
  export * from './SaladBar';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzD,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** Various components in the library require the theme to provide certain
2
+ * non-standard values like navBar.*/
3
+ export interface AgCustomTheme {
4
+ /** When using PageLayout, there is always a NavBar component on the left of
5
+ * the view port, which can be opened and closed (minimised) by a button in
6
+ * the TopBar */
7
+ navBar: {
8
+ /** In our design the background of the navbar doesn't match anything on
9
+ * the pallete, so we define it separately */
10
+ backgroundColor: string;
11
+ };
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/themes/types.ts"],"names":[],"mappings":"AAAA;qCACqC;AACrC,MAAM,WAAW,aAAa;IAC5B;;oBAEgB;IAChB,MAAM,EAAE;QACN;qDAC6C;QAC7C,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@australiangreens/ag-internal-components",
3
3
  "private": false,
4
- "version": "0.0.29",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",
@@ -50,6 +50,7 @@
50
50
  "@mui/icons-material": "5.11.0",
51
51
  "@mui/material": "5.11.0",
52
52
  "@mui/styles": "5.11.0",
53
+ "jotai": "^2.2.3",
53
54
  "react": "17.0.2",
54
55
  "react-dom": "17.0.2"
55
56
  },
@@ -98,8 +99,8 @@
98
99
  "prop-types": "^15.8.1",
99
100
  "react": "17.0.2",
100
101
  "react-dom": "17.0.2",
101
- "react-router": "^6.14.1",
102
- "react-router-dom": "^6.14.0",
102
+ "react-router": "^6.14.2",
103
+ "react-router-dom": "^6.14.2",
103
104
  "storybook": "^7.0.27",
104
105
  "typescript": "^5.0.2",
105
106
  "vite": "^4.3.9",
@@ -1,2 +0,0 @@
1
- export declare const NavBarDarkStyledList: import("@mui/material/List").ExtendList<import("@mui/material/List").ListTypeMap<{}, "ul">>;
2
- //# sourceMappingURL=NavBarDarkStyledList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NavBarDarkStyledList.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/AppLayout/NavBar/NavBarDarkStyledList.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,6FA8Cf,CAAC"}
@@ -1,23 +0,0 @@
1
- import { ReactNode, ComponentProps, PropsWithChildren } from 'react';
2
- import PageContainer from './PageContainer';
3
- import { AppLayoutContextActions, AppLayoutContextState } from './AppLayoutContext';
4
- export interface NavBarProps {
5
- content?: ReactNode;
6
- widthOpen?: number;
7
- widthClosed?: number;
8
- }
9
- export interface BaseAppLayoutProps {
10
- navBar?: NavBarProps;
11
- /** Props applied to the PageContainer component, which is a styled MUI Container */
12
- pageContainerProps?: ComponentProps<typeof PageContainer>;
13
- topBarDataTestId?: string;
14
- pageContentDataTestId?: string;
15
- /** Allow overriding the context state (navBarOpen etc) for tests,
16
- * particularly with souvlaki */
17
- overrideContextState?: Partial<AppLayoutContextState>;
18
- /** Allow overriding the context actions (setNavBarOpen etc) for tests,
19
- * particularly with souvlaki */
20
- overrideContextActions?: Partial<AppLayoutContextActions>;
21
- }
22
- export type AppLayoutProps = PropsWithChildren<BaseAppLayoutProps>;
23
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/layouts/AppLayout/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEpF,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,oFAAoF;IACpF,kBAAkB,CAAC,EAAE,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;IAE1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;oCACgC;IAChC,oBAAoB,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEtD;oCACgC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC3D;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- export type AgThemeName = 'internal' | 'fed21';
3
- export interface AgThemeProviderProps {
4
- name?: AgThemeName;
5
- }
6
- export default function AgThemeProvider({ name, children, }: PropsWithChildren<AgThemeProviderProps>): JSX.Element;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/AgTheme/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAGD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAiB,EACjB,QAAQ,GACT,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,eAQzC"}
@@ -1,3 +0,0 @@
1
- export declare const internalAGSystemsTheme: import("@mui/material/styles").Theme;
2
- export declare const fed21Theme: import("@mui/material/styles").Theme;
3
- //# sourceMappingURL=themes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../src/providers/AgTheme/themes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,sCAwFjC,CAAC;AAEH,eAAO,MAAM,UAAU,sCAgDrB,CAAC"}