@australiangreens/ag-internal-components 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("/home/anthony/agdev/ag-internal-components/node_modules/react/jsx-runtime.js"),o=require("/home/anthony/agdev/ag-internal-components/node_modules/react/index.js"),l=require("/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Button/index.js"),a=require("/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Paper/index.js"),n=require("/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Typography/index.js");function c({text:r}){const[i,s]=o.useState(0);return e.jsxs(e.Fragment,{children:[e.jsx(n,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),e.jsx(n,{variant:"caption",display:"block",children:e.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency"})}),e.jsx(l,{variant:"outlined",onClick:()=>s(t=>t+1),"aria-label":"Increment",children:"Hello I am a button"}),e.jsxs("p",{children:["This is some text: ",e.jsx("span",{children:r})]}),e.jsxs(a,{children:["This number will incremember when button pressed: ",i]})]})}exports.HelloWorld=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),c=require("@mui/material/Button"),l=require("@mui/material/Paper"),a=require("@mui/material/Typography"),r=require("@mui/material/styles");function d({text:e}){const[n,o]=s.useState(0);return t.jsxs(t.Fragment,{children:[t.jsx(a,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),t.jsx(a,{variant:"caption",display:"block",children:t.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),t.jsx(c,{variant:"outlined",onClick:()=>o(i=>i+1),"aria-label":"Increment",children:"Hello I am a button"}),t.jsxs("p",{children:["This is some text: ",t.jsx("span",{children:e})]}),t.jsxs(l,{children:["This number will incremember when button pressed: ",n]})]})}const p=r.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:r.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:r.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:r.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"},h3:{fontSize:"1rem",fontWeight:700}}}),u=r.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}}});function F({name:e="internal",children:n}){const o=e==="internal"?p:e==="fed21"?u:void 0;return t.jsx(r.ThemeProvider,{theme:o,children:n})}exports.AgThemeProvider=F;exports.ExampleComponent=d;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/HelloWorld/index.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Button from '@mui/material/Button';\nimport Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\nexport interface HelloWorldProps {\n text: string;\n}\n\nexport default function HelloWorld({ text }: HelloWorldProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n"],"names":["HelloWorld","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper"],"mappings":"gjBAQwB,SAAAA,EAAW,CAAE,KAAAC,GAAyB,CAC5D,KAAM,CAACC,EAAKC,CAAM,EAAIC,WAAS,CAAC,EAEhC,OAEIC,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACC,EAAW,CAAA,QAAQ,KAAK,MAAM,UAAU,UAAU,MAAM,GAAI,CAAE,SAAU,MAAO,EAAG,SAEnF,cAAA,EAEAD,EAAAA,IAACC,GAAW,QAAQ,UAAU,QAAQ,QACpC,SAAAD,EAAAA,IAAC,OAAK,CAAA,SAAA,8DAAA,CAA4D,CACpE,CAAA,EACAA,EAAA,IAACE,EAAA,CACC,QAAQ,WACR,QAAS,IAAMN,EAAQO,GAAWA,EAAS,CAAC,EAC5C,aAAW,YACZ,SAAA,qBAAA,CAED,SACC,IAAE,CAAA,SAAA,CAAA,sBACkBH,EAAAA,IAAC,QAAM,SAAKN,CAAA,CAAA,CAAA,EACjC,SACCU,EAAM,CAAA,SAAA,CAAA,qDAAmDT,CAAA,EAAI,CAChE,CAAA,CAAA,CAEJ"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/AgThemeProvider/themes.ts","../../src/components/AgThemeProvider/index.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Button from '@mui/material/Button';\nimport Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\n\nexport interface ExampleComponentProps {\n text: string;\n}\n\nexport default function ExampleComponent({ text }: ExampleComponentProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency. v0.0.11</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n","import { alpha, createTheme } from '@mui/material/styles';\n\nexport const internalAGSystemsTheme = createTheme({\n palette: {\n primary: {\n main: '#007236',\n dark: '#005221',\n light: '#00A04E',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#662D91',\n dark: '#440E62',\n light: '#93268F',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#D32F2F',\n dark: '#C62828',\n light: '#EF5350',\n },\n info: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n success: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n },\n components: {\n MuiTextField: {\n defaultProps: { color: 'secondary' },\n },\n MuiToggleButtonGroup: {\n defaultProps: { color: 'secondary' },\n },\n MuiCheckbox: {\n defaultProps: { color: 'secondary' },\n },\n MuiSelect: {\n defaultProps: { color: 'secondary' },\n },\n MuiSwitch: {\n defaultProps: { color: 'secondary' },\n },\n MuiFormControl: {\n defaultProps: { color: 'secondary' },\n },\n MuiMenuItem: {\n // Setting defaultProps for color on MenuItem does not work, so update manually\n styleOverrides: {\n root: ({ theme }) => ({\n '&.Mui-selected': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n '&:hover': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n },\n '&.Mui-focusVisible': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.focusOpacity\n ),\n },\n },\n }),\n },\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n h3: {\n fontSize: '1rem',\n fontWeight: 700,\n },\n },\n});\n\nexport const fed21Theme = createTheme({\n palette: {\n primary: {\n dark: '#00A651',\n light: '#A3D39C',\n main: '#007236',\n contrastText: '#FFF',\n },\n warning: {\n main: '#F5871F',\n light: '#FCC589',\n dark: '#A2590A',\n contrastText: '#FFF',\n },\n secondary: {\n main: '#662D91',\n light: '#BD8CBF',\n dark: '#440E62',\n contrastText: '#FFF',\n },\n error: {\n main: '#D43C95',\n light: '#8F2064',\n dark: '#F9CDE0',\n contrastText: '#FFF',\n },\n info: {\n main: '#00A88D',\n light: '#ADDCCF',\n dark: '#005243',\n contrastText: '#FFF',\n },\n success: {\n main: '#00A651',\n light: '#A3D39C',\n dark: '#007236',\n contrastText: '#FFF',\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n },\n});\n\n// See https://mui.com/material-ui/customization/typography/#adding-amp-disabling-variants\ndeclare module '@mui/material/styles' {\n interface TypographyVariants {\n explainer: React.CSSProperties;\n }\n\n // allow configuration using `createTheme`\n interface TypographyVariantsOptions {\n explainer?: React.CSSProperties;\n }\n}\n\n// Update the Typography's variant prop options\ndeclare module '@mui/material/Typography' {\n interface TypographyPropsVariantOverrides {\n explainer: true;\n }\n}\n","import { PropsWithChildren } from 'react';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { internalAGSystemsTheme, fed21Theme } from './themes';\n\nexport interface AgThemeProviderProps {\n name?: 'internal' | 'fed21';\n}\n\nexport default function AgThemeProvider({\n name = 'internal',\n children,\n}: PropsWithChildren<AgThemeProviderProps>) {\n const theme =\n name === 'internal' ? internalAGSystemsTheme : name === 'fed21' ? fed21Theme : undefined;\n\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n}\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","internalAGSystemsTheme","createTheme","theme","alpha","fed21Theme","AgThemeProvider","name","children","ThemeProvider"],"mappings":"mRASwB,SAAAA,EAAiB,CAAE,KAAAC,GAA+B,CACxE,KAAM,CAACC,EAAKC,CAAM,EAAIC,WAAS,CAAC,EAEhC,OAEIC,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACC,EAAW,CAAA,QAAQ,KAAK,MAAM,UAAU,UAAU,MAAM,GAAI,CAAE,SAAU,MAAO,EAAG,SAEnF,cAAA,EAEAD,EAAAA,IAACC,GAAW,QAAQ,UAAU,QAAQ,QACpC,SAAAD,EAAAA,IAAC,OAAK,CAAA,SAAA,uEAAA,CAAqE,CAC7E,CAAA,EACAA,EAAA,IAACE,EAAA,CACC,QAAQ,WACR,QAAS,IAAMN,EAAQO,GAAWA,EAAS,CAAC,EAC5C,aAAW,Y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,CACF,SAAU,OACV,WAAY,GACd,CACF,CACF,CAAC,EAEYE,EAAaH,EAAAA,YAAY,CACpC,QAAS,CACP,QAAS,CACP,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,EACA,QAAS,CACP,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,EACA,UAAW,CACT,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,EACA,MAAO,CACL,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,EACA,KAAM,CACJ,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,EACA,QAAS,CACP,KAAM,UACN,MAAO,UACP,KAAM,UACN,aAAc,MAChB,CACF,EACA,WAAY,CAIV,UAAW,CACT,SAAU,OACV,iBAAkB,KACpB,CACF,CACF,CAAC,ECnID,SAAwBI,EAAgB,CACtC,KAAAC,EAAO,WACP,SAAAC,CACF,EAA4C,CAC1C,MAAML,EACJI,IAAS,WAAaN,EAAyBM,IAAS,QAAUF,EAAa,OAK1E,OAAAT,EAAA,IAACa,EAAc,cAAA,CAAA,MAAAN,EAAe,SAAAK,CAAS,CAAA,CAChD"}
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface AgThemeProviderProps {
3
+ name?: 'internal' | 'fed21';
4
+ }
5
+ export default function AgThemeProvider({ name, children, }: PropsWithChildren<AgThemeProviderProps>): JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/AgThemeProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAiB,EACjB,QAAQ,GACT,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,eAQzC"}
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export declare const internalAGSystemsTheme: import("@mui/material/styles").Theme;
3
+ export declare const fed21Theme: import("@mui/material/styles").Theme;
4
+ declare module '@mui/material/styles' {
5
+ interface TypographyVariants {
6
+ explainer: React.CSSProperties;
7
+ }
8
+ interface TypographyVariantsOptions {
9
+ explainer?: React.CSSProperties;
10
+ }
11
+ }
12
+ declare module '@mui/material/Typography' {
13
+ interface TypographyPropsVariantOverrides {
14
+ explainer: true;
15
+ }
16
+ }
17
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../src/components/AgThemeProvider/themes.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,sBAAsB,sCAwFjC,CAAC;AAEH,eAAO,MAAM,UAAU,sCAgDrB,CAAC;AAGH,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,kBAAkB;QAC1B,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC;KAChC;IAGD,UAAU,yBAAyB;QACjC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KACjC;CACF;AAGD,OAAO,QAAQ,0BAA0B,CAAC;IACxC,UAAU,+BAA+B;QACvC,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
@@ -0,0 +1,5 @@
1
+ export interface ExampleComponentProps {
2
+ text: string;
3
+ }
4
+ export default function ExampleComponent({ text }: ExampleComponentProps): JSX.Element;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ExampleComponent/index.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,qBAAqB,eAyBvE"}
package/dist/esm/index.js CHANGED
@@ -1,33 +1,178 @@
1
- import { jsxs as n, Fragment as a, jsx as e } from "/home/anthony/agdev/ag-internal-components/node_modules/react/jsx-runtime.js";
2
- import { useState as s } from "/home/anthony/agdev/ag-internal-components/node_modules/react/index.js";
3
- import m from "/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Button/index.js";
4
- import p from "/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Paper/index.js";
5
- import r from "/home/anthony/agdev/ag-internal-components/node_modules/@mui/material/Typography/index.js";
6
- function b({ text: i }) {
7
- const [o, t] = s(0);
8
- return /* @__PURE__ */ n(a, { children: [
9
- /* @__PURE__ */ e(r, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
10
- /* @__PURE__ */ e(r, { variant: "caption", display: "block", children: /* @__PURE__ */ e("span", { children: "Just ensuring MUI is working as planned as a peer dependency" }) }),
11
- /* @__PURE__ */ e(
12
- m,
1
+ import { jsxs as o, Fragment as s, jsx as t } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import p from "@mui/material/Button";
4
+ import m from "@mui/material/Paper";
5
+ import i from "@mui/material/Typography";
6
+ import { createTheme as l, alpha as n, ThemeProvider as F } from "@mui/material/styles";
7
+ function C({ text: e }) {
8
+ const [r, a] = d(0);
9
+ return /* @__PURE__ */ o(s, { children: [
10
+ /* @__PURE__ */ t(i, { variant: "h6", color: "inherit", component: "div", sx: { fontSize: "22px" }, children: "Hello world" }),
11
+ /* @__PURE__ */ t(i, { variant: "caption", display: "block", children: /* @__PURE__ */ t("span", { children: "Just ensuring MUI is working as planned as a peer dependency. v0.0.11" }) }),
12
+ /* @__PURE__ */ t(
13
+ p,
13
14
  {
14
15
  variant: "outlined",
15
- onClick: () => t((l) => l + 1),
16
+ onClick: () => a((c) => c + 1),
16
17
  "aria-label": "Increment",
17
18
  children: "Hello I am a button"
18
19
  }
19
20
  ),
20
- /* @__PURE__ */ n("p", { children: [
21
+ /* @__PURE__ */ o("p", { children: [
21
22
  "This is some text: ",
22
- /* @__PURE__ */ e("span", { children: i })
23
+ /* @__PURE__ */ t("span", { children: e })
23
24
  ] }),
24
- /* @__PURE__ */ n(p, { children: [
25
+ /* @__PURE__ */ o(m, { children: [
25
26
  "This number will incremember when button pressed: ",
26
- o
27
+ r
27
28
  ] })
28
29
  ] });
29
30
  }
31
+ const u = l({
32
+ palette: {
33
+ primary: {
34
+ main: "#007236",
35
+ dark: "#005221",
36
+ light: "#00A04E",
37
+ contrastText: "#FFFFFF"
38
+ },
39
+ secondary: {
40
+ main: "#662D91",
41
+ dark: "#440E62",
42
+ light: "#93268F",
43
+ contrastText: "#FFFFFF"
44
+ },
45
+ error: {
46
+ main: "#D32F2F",
47
+ dark: "#C62828",
48
+ light: "#EF5350"
49
+ },
50
+ info: {
51
+ main: "#0288D1",
52
+ dark: "#01579B",
53
+ light: "#03A9F4"
54
+ },
55
+ success: {
56
+ main: "#0288D1",
57
+ dark: "#01579B",
58
+ light: "#03A9F4"
59
+ }
60
+ },
61
+ components: {
62
+ MuiTextField: {
63
+ defaultProps: { color: "secondary" }
64
+ },
65
+ MuiToggleButtonGroup: {
66
+ defaultProps: { color: "secondary" }
67
+ },
68
+ MuiCheckbox: {
69
+ defaultProps: { color: "secondary" }
70
+ },
71
+ MuiSelect: {
72
+ defaultProps: { color: "secondary" }
73
+ },
74
+ MuiSwitch: {
75
+ defaultProps: { color: "secondary" }
76
+ },
77
+ MuiFormControl: {
78
+ defaultProps: { color: "secondary" }
79
+ },
80
+ MuiMenuItem: {
81
+ // Setting defaultProps for color on MenuItem does not work, so update manually
82
+ styleOverrides: {
83
+ root: ({ theme: e }) => ({
84
+ "&.Mui-selected": {
85
+ backgroundColor: n(
86
+ e.palette.secondary.main,
87
+ e.palette.action.selectedOpacity
88
+ ),
89
+ "&:hover": {
90
+ backgroundColor: n(
91
+ e.palette.secondary.main,
92
+ e.palette.action.selectedOpacity
93
+ )
94
+ },
95
+ "&.Mui-focusVisible": {
96
+ backgroundColor: n(
97
+ e.palette.secondary.main,
98
+ e.palette.action.focusOpacity
99
+ )
100
+ }
101
+ }
102
+ })
103
+ }
104
+ }
105
+ },
106
+ typography: {
107
+ // I couldn't think of what to call this. It is an attempt to match
108
+ // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730
109
+ // but not sure if line height should be changed
110
+ explainer: {
111
+ fontSize: "14px",
112
+ marginBlockStart: "1em"
113
+ },
114
+ h3: {
115
+ fontSize: "1rem",
116
+ fontWeight: 700
117
+ }
118
+ }
119
+ }), h = l({
120
+ palette: {
121
+ primary: {
122
+ dark: "#00A651",
123
+ light: "#A3D39C",
124
+ main: "#007236",
125
+ contrastText: "#FFF"
126
+ },
127
+ warning: {
128
+ main: "#F5871F",
129
+ light: "#FCC589",
130
+ dark: "#A2590A",
131
+ contrastText: "#FFF"
132
+ },
133
+ secondary: {
134
+ main: "#662D91",
135
+ light: "#BD8CBF",
136
+ dark: "#440E62",
137
+ contrastText: "#FFF"
138
+ },
139
+ error: {
140
+ main: "#D43C95",
141
+ light: "#8F2064",
142
+ dark: "#F9CDE0",
143
+ contrastText: "#FFF"
144
+ },
145
+ info: {
146
+ main: "#00A88D",
147
+ light: "#ADDCCF",
148
+ dark: "#005243",
149
+ contrastText: "#FFF"
150
+ },
151
+ success: {
152
+ main: "#00A651",
153
+ light: "#A3D39C",
154
+ dark: "#007236",
155
+ contrastText: "#FFF"
156
+ }
157
+ },
158
+ typography: {
159
+ // I couldn't think of what to call this. It is an attempt to match
160
+ // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730
161
+ // but not sure if line height should be changed
162
+ explainer: {
163
+ fontSize: "14px",
164
+ marginBlockStart: "1em"
165
+ }
166
+ }
167
+ });
168
+ function A({
169
+ name: e = "internal",
170
+ children: r
171
+ }) {
172
+ return /* @__PURE__ */ t(F, { theme: e === "internal" ? u : e === "fed21" ? h : void 0, children: r });
173
+ }
30
174
  export {
31
- b as HelloWorld
175
+ A as AgThemeProvider,
176
+ C as ExampleComponent
32
177
  };
33
178
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/HelloWorld/index.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Button from '@mui/material/Button';\nimport Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\nexport interface HelloWorldProps {\n text: string;\n}\n\nexport default function HelloWorld({ text }: HelloWorldProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n"],"names":["HelloWorld","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper"],"mappings":";;;;;AAQwB,SAAAA,EAAW,EAAE,MAAAC,KAAyB;AAC5D,QAAM,CAACC,GAAKC,CAAM,IAAIC,EAAS,CAAC;AAEhC,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAW,EAAA,SAAQ,MAAK,OAAM,WAAU,WAAU,OAAM,IAAI,EAAE,UAAU,OAAO,GAAG,UAEnF,eAAA;AAAA,IAEA,gBAAAD,EAACC,KAAW,SAAQ,WAAU,SAAQ,SACpC,UAAA,gBAAAD,EAAC,QAAK,EAAA,UAAA,+DAAA,CAA4D,EACpE,CAAA;AAAA,IACA,gBAAAA;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAMN,EAAO,CAACO,MAAWA,IAAS,CAAC;AAAA,QAC5C,cAAW;AAAA,QACZ,UAAA;AAAA,MAAA;AAAA,IAED;AAAA,sBACC,KAAE,EAAA,UAAA;AAAA,MAAA;AAAA,MACkB,gBAAAH,EAAC,UAAM,UAAKN,EAAA,CAAA;AAAA,IAAA,GACjC;AAAA,sBACCU,GAAM,EAAA,UAAA;AAAA,MAAA;AAAA,MAAmDT;AAAA,IAAA,GAAI;AAAA,EAChE,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/ExampleComponent/index.tsx","../../src/components/AgThemeProvider/themes.ts","../../src/components/AgThemeProvider/index.tsx"],"sourcesContent":["import { useState } from 'react';\nimport Button from '@mui/material/Button';\nimport Paper from '@mui/material/Paper';\nimport Typography from '@mui/material/Typography';\n\nexport interface ExampleComponentProps {\n text: string;\n}\n\nexport default function ExampleComponent({ text }: ExampleComponentProps) {\n const [num, setNum] = useState(0);\n\n return (\n <>\n <Typography variant=\"h6\" color=\"inherit\" component=\"div\" sx={{ fontSize: '22px' }}>\n Hello world\n </Typography>\n\n <Typography variant=\"caption\" display=\"block\">\n <span>Just ensuring MUI is working as planned as a peer dependency. v0.0.11</span>\n </Typography>\n <Button\n variant=\"outlined\"\n onClick={() => setNum((oldNum) => oldNum + 1)}\n aria-label=\"Increment\"\n >\n Hello I am a button\n </Button>\n <p>\n This is some text: <span>{text}</span>\n </p>\n <Paper>This number will incremember when button pressed: {num}</Paper>\n </>\n );\n}\n","import { alpha, createTheme } from '@mui/material/styles';\n\nexport const internalAGSystemsTheme = createTheme({\n palette: {\n primary: {\n main: '#007236',\n dark: '#005221',\n light: '#00A04E',\n contrastText: '#FFFFFF',\n },\n secondary: {\n main: '#662D91',\n dark: '#440E62',\n light: '#93268F',\n contrastText: '#FFFFFF',\n },\n error: {\n main: '#D32F2F',\n dark: '#C62828',\n light: '#EF5350',\n },\n info: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n success: {\n main: '#0288D1',\n dark: '#01579B',\n light: '#03A9F4',\n },\n },\n components: {\n MuiTextField: {\n defaultProps: { color: 'secondary' },\n },\n MuiToggleButtonGroup: {\n defaultProps: { color: 'secondary' },\n },\n MuiCheckbox: {\n defaultProps: { color: 'secondary' },\n },\n MuiSelect: {\n defaultProps: { color: 'secondary' },\n },\n MuiSwitch: {\n defaultProps: { color: 'secondary' },\n },\n MuiFormControl: {\n defaultProps: { color: 'secondary' },\n },\n MuiMenuItem: {\n // Setting defaultProps for color on MenuItem does not work, so update manually\n styleOverrides: {\n root: ({ theme }) => ({\n '&.Mui-selected': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n '&:hover': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.selectedOpacity\n ),\n },\n '&.Mui-focusVisible': {\n backgroundColor: alpha(\n theme.palette.secondary.main,\n theme.palette.action.focusOpacity\n ),\n },\n },\n }),\n },\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n h3: {\n fontSize: '1rem',\n fontWeight: 700,\n },\n },\n});\n\nexport const fed21Theme = createTheme({\n palette: {\n primary: {\n dark: '#00A651',\n light: '#A3D39C',\n main: '#007236',\n contrastText: '#FFF',\n },\n warning: {\n main: '#F5871F',\n light: '#FCC589',\n dark: '#A2590A',\n contrastText: '#FFF',\n },\n secondary: {\n main: '#662D91',\n light: '#BD8CBF',\n dark: '#440E62',\n contrastText: '#FFF',\n },\n error: {\n main: '#D43C95',\n light: '#8F2064',\n dark: '#F9CDE0',\n contrastText: '#FFF',\n },\n info: {\n main: '#00A88D',\n light: '#ADDCCF',\n dark: '#005243',\n contrastText: '#FFF',\n },\n success: {\n main: '#00A651',\n light: '#A3D39C',\n dark: '#007236',\n contrastText: '#FFF',\n },\n },\n typography: {\n // I couldn't think of what to call this. It is an attempt to match\n // https://www.figma.com/file/atonRPl2YD9A1NCntbDtKR/List-Filter-and-Product-Concept?node-id=1187%3A43730\n // but not sure if line height should be changed\n explainer: {\n fontSize: '14px',\n marginBlockStart: '1em',\n },\n },\n});\n\n// See https://mui.com/material-ui/customization/typography/#adding-amp-disabling-variants\ndeclare module '@mui/material/styles' {\n interface TypographyVariants {\n explainer: React.CSSProperties;\n }\n\n // allow configuration using `createTheme`\n interface TypographyVariantsOptions {\n explainer?: React.CSSProperties;\n }\n}\n\n// Update the Typography's variant prop options\ndeclare module '@mui/material/Typography' {\n interface TypographyPropsVariantOverrides {\n explainer: true;\n }\n}\n","import { PropsWithChildren } from 'react';\nimport { ThemeProvider } from '@mui/material/styles';\n\nimport { internalAGSystemsTheme, fed21Theme } from './themes';\n\nexport interface AgThemeProviderProps {\n name?: 'internal' | 'fed21';\n}\n\nexport default function AgThemeProvider({\n name = 'internal',\n children,\n}: PropsWithChildren<AgThemeProviderProps>) {\n const theme =\n name === 'internal' ? internalAGSystemsTheme : name === 'fed21' ? fed21Theme : undefined;\n\n // Should be resolved when we move to React >= 18\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return <ThemeProvider theme={theme}>{children}</ThemeProvider>;\n}\n"],"names":["ExampleComponent","text","num","setNum","useState","jsxs","Fragment","jsx","Typography","Button","oldNum","Paper","internalAGSystemsTheme","createTheme","theme","alpha","fed21Theme","AgThemeProvider","name","children","ThemeProvider"],"mappings":";;;;;;AASwB,SAAAA,EAAiB,EAAE,MAAAC,KAA+B;AACxE,QAAM,CAACC,GAAKC,CAAM,IAAIC,EAAS,CAAC;AAEhC,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAW,EAAA,SAAQ,MAAK,OAAM,WAAU,WAAU,OAAM,IAAI,EAAE,UAAU,OAAO,GAAG,UAEnF,eAAA;AAAA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MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM;AAAA,MACN,cAAc;AAAA,IAChB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM;AAAA,MACN,cAAc;AAAA,IAChB;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM;AAAA,MACN,cAAc;AAAA,IAChB;AAAA,EACF;AAAA,EACA,YAAY;AAAA;AAAA;AAAA;AAAA,IAIV,WAAW;AAAA,MACT,UAAU;AAAA,MACV,kBAAkB;AAAA,IACpB;AAAA,EACF;AACF,CAAC;ACnID,SAAwBI,EAAgB;AAAA,EACtC,MAAAC,IAAO;AAAA,EACP,UAAAC;AACF,GAA4C;AAOnC,SAAA,gBAAAZ,EAACa,GAAc,EAAA,OALpBF,MAAS,aAAaN,IAAyBM,MAAS,UAAUF,IAAa,QAK5C,UAAAG,EAAS,CAAA;AAChD;"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- export { default as HelloWorld } from './HelloWorld';
2
- export * from './HelloWorld';
1
+ export { default as ExampleComponent } from './components/ExampleComponent';
2
+ export * from './components/ExampleComponent';
3
+ export { default as AgThemeProvider } from './components/AgThemeProvider';
4
+ export * from './components/AgThemeProvider';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAAc,8BAA8B,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.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/australiangreens/ag-internal-components#readme",
7
7
  "license": "MIT",
@@ -41,11 +41,8 @@
41
41
  "@emotion/react": "^11.10.5",
42
42
  "@emotion/styled": "^11.10.5",
43
43
  "@mui/icons-material": "^5.11.0",
44
- "@mui/lab": "^5.0.0-alpha.112",
45
44
  "@mui/material": "^5.11.0",
46
45
  "@mui/styles": "^5.11.0",
47
- "@mui/x-data-grid": "^5.17.14",
48
- "@mui/x-date-pickers": "^5.0.10",
49
46
  "react": "17.0.2",
50
47
  "react-dom": "17.0.2"
51
48
  },
@@ -53,11 +50,8 @@
53
50
  "@emotion/react": "^11.10.5",
54
51
  "@emotion/styled": "^11.10.5",
55
52
  "@mui/icons-material": "^5.11.0",
56
- "@mui/lab": "^5.0.0-alpha.112",
57
53
  "@mui/material": "^5.11.0",
58
54
  "@mui/styles": "^5.11.0",
59
- "@mui/x-data-grid": "^5.17.14",
60
- "@mui/x-date-pickers": "^5.0.10",
61
55
  "@testing-library/dom": "^9.3.0",
62
56
  "@testing-library/jest-dom": "^5.16.5",
63
57
  "@testing-library/react": "12.1.2",
@@ -1,5 +0,0 @@
1
- export interface HelloWorldProps {
2
- text: string;
3
- }
4
- export default function HelloWorld({ text }: HelloWorldProps): JSX.Element;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/HelloWorld/index.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,eAAe,eAyB3D"}