@smartbooks-ai/layout 0.0.6 → 0.0.7

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 (54) hide show
  1. package/package.json +35 -32
  2. package/src/components/PageHeader/PageHeader.tsx +0 -15
  3. package/src/components/PageHeader/index.ts +0 -1
  4. package/src/components/PageHeader/styles.ts +0 -34
  5. package/src/components/PageWithMenuLayout/AppSelect/index.tsx +0 -66
  6. package/src/components/PageWithMenuLayout/AppSelect/styles.ts +0 -33
  7. package/src/components/PageWithMenuLayout/LogoHeaderImage.tsx +0 -44
  8. package/src/components/PageWithMenuLayout/LogoHeaderText.tsx +0 -48
  9. package/src/components/PageWithMenuLayout/MenuItemWithChildren/MenuItemWithChildren.tsx +0 -149
  10. package/src/components/PageWithMenuLayout/MenuItemWithChildren/styles.ts +0 -179
  11. package/src/components/PageWithMenuLayout/MenuSelect/index.tsx +0 -78
  12. package/src/components/PageWithMenuLayout/MenuSelect/styles.ts +0 -97
  13. package/src/components/PageWithMenuLayout/MultiSubscriptionsMenuItems/ConsolidationIcon.tsx +0 -6
  14. package/src/components/PageWithMenuLayout/MultiSubscriptionsMenuItems/MultiSubscriptionsMenuItems.tsx +0 -120
  15. package/src/components/PageWithMenuLayout/MultiSubscriptionsMenuItems/consolidation.svg +0 -8
  16. package/src/components/PageWithMenuLayout/MultiSubscriptionsMenuItems/index.ts +0 -1
  17. package/src/components/PageWithMenuLayout/MultiSubscriptionsMenuItems/styles.ts +0 -10
  18. package/src/components/PageWithMenuLayout/PageWithMenuLayout.tsx +0 -103
  19. package/src/components/PageWithMenuLayout/UserProfileSelect/index.tsx +0 -64
  20. package/src/components/PageWithMenuLayout/UserProfileSelect/styles.ts +0 -8
  21. package/src/components/PageWithMenuLayout/index.ts +0 -8
  22. package/src/components/PageWithMenuLayout/styles.ts +0 -110
  23. package/src/components/PageWithMenuLayout/types.ts +0 -7
  24. package/src/components/PageWithMenuLayout/useMenuToggle.ts +0 -19
  25. package/src/components/index.ts +0 -3
  26. package/src/emotion.d.ts +0 -76
  27. package/src/hooks/index.ts +0 -2
  28. package/src/hooks/useIsAuthorized.ts +0 -35
  29. package/src/hooks/useToggle.ts +0 -27
  30. package/src/index.ts +0 -7
  31. package/src/package-isolation.test.ts +0 -60
  32. package/src/security/AuthorizedContent/index.tsx +0 -77
  33. package/src/security/AuthorizedContent/state.ts +0 -8
  34. package/src/security/AuthorizedContent/useAuthorizationState.ts +0 -42
  35. package/src/security/ProfileContext/ProfileContext.tsx +0 -37
  36. package/src/security/ProfileContext/index.ts +0 -4
  37. package/src/security/ProfileContext/types.ts +0 -7
  38. package/src/security/ProfileContext/useProfile.tsx +0 -7
  39. package/src/security/UserProfile.ts +0 -48
  40. package/src/security/index.ts +0 -2
  41. package/src/theme/colorPrimitives.ts +0 -107
  42. package/src/theme/colors.ts +0 -78
  43. package/src/theme/font.ts +0 -27
  44. package/src/theme/globalStyles.tsx +0 -55
  45. package/src/theme/index.tsx +0 -228
  46. package/src/theme/radius.ts +0 -12
  47. package/src/theme/spacing.ts +0 -12
  48. package/src/theme/typography.ts +0 -40
  49. package/src/utils/assertNever.ts +0 -14
  50. package/src/utils/index.ts +0 -2
  51. package/src/utils/shouldNotForwardPropsWithKeys.ts +0 -7
  52. package/tsconfig.json +0 -34
  53. package/tsconfig.layout.tsbuildinfo +0 -1
  54. package/vitest.config.ts +0 -10
@@ -1,55 +0,0 @@
1
- import { GlobalStyles as MUIGlobalStyles } from '@mui/material';
2
-
3
- export default function GlobalStyles() {
4
- const inputGlobalStyles = (
5
- <MUIGlobalStyles
6
- styles={{
7
- '@keyframes mui-auto-fill': { from: { display: 'block' } },
8
- '@keyframes mui-auto-fill-cancel': { from: { display: 'block' } },
9
- '*': {
10
- boxSizing: 'border-box',
11
- },
12
- html: {
13
- margin: 0,
14
- padding: 0,
15
- width: '100%',
16
- height: '100%',
17
- WebkitOverflowScrolling: 'touch',
18
- },
19
- body: {
20
- margin: 0,
21
- padding: 0,
22
- width: '100%',
23
- height: '100%',
24
- },
25
- '#root': {
26
- width: '100%',
27
- height: '100%',
28
- },
29
- input: {
30
- '&[type=number]': {
31
- MozAppearance: 'textfield',
32
- '&::-webkit-outer-spin-button': {
33
- margin: 0,
34
- WebkitAppearance: 'none',
35
- },
36
- '&::-webkit-inner-spin-button': {
37
- margin: 0,
38
- WebkitAppearance: 'none',
39
- },
40
- },
41
- },
42
- img: {
43
- display: 'block',
44
- maxWidth: '100%',
45
- },
46
- ul: {
47
- margin: 0,
48
- padding: 0,
49
- },
50
- }}
51
- />
52
- );
53
-
54
- return inputGlobalStyles;
55
- }
@@ -1,228 +0,0 @@
1
- import { forwardRef } from 'react';
2
-
3
- import { ThemeProvider as EmotionThemeProvider, css } from '@emotion/react';
4
- import ExpandedMoreRoundedIcon from '@mui/icons-material/ExpandMoreRounded';
5
- import { listItemTextClasses } from '@mui/material';
6
- import { buttonClasses } from '@mui/material/Button';
7
- import CssBaseline from '@mui/material/CssBaseline';
8
- import { LinkProps } from '@mui/material/Link';
9
- import {
10
- ThemeProvider as MUIThemeProvider,
11
- ThemeOptions as MuiThemeOptions,
12
- StyledEngineProvider,
13
- createTheme,
14
- } from '@mui/material/styles';
15
- import type {} from '@mui/x-date-pickers/themeAugmentation';
16
- import { rem } from 'polished';
17
- import { Link as RouterLink, LinkProps as RouterLinkProps } from 'react-router';
18
-
19
- import { colorPrimitives } from './colorPrimitives';
20
- import { colors } from './colors';
21
- import { font } from './font';
22
- import GlobalStyles from './globalStyles';
23
- import { radius } from './radius';
24
- import { spacing } from './spacing';
25
- import typography from './typography';
26
-
27
- import { ThemeOptions } from '../emotion';
28
-
29
- const LinkBehavior = forwardRef<HTMLAnchorElement, Omit<RouterLinkProps, 'to'> & { href: RouterLinkProps['to'] }>(
30
- ({ href, ...other }, ref) => <RouterLink ref={ref} to={href} {...other} />,
31
- );
32
-
33
- const muiTextField = {
34
- defaultProps: {
35
- variant: 'outlined',
36
- margin: 'normal',
37
- size: 'small',
38
- InputLabelProps: { shrink: true },
39
- SelectProps: { displayEmpty: true },
40
- },
41
- } as const;
42
-
43
- const muiOutlinedInput = {
44
- styleOverrides: {
45
- notchedOutline: css`
46
- border-color: ${colorPrimitives.darkNavy[100]};
47
- `,
48
- },
49
- } as const;
50
-
51
- const muiTheme: MuiThemeOptions = {
52
- shape: { borderRadius: 6 },
53
- typography,
54
- components: {
55
- MuiCssBaseline: {
56
- styleOverrides: {
57
- a: css`
58
- color: '#000000';
59
-
60
- text-decoration: none;
61
- `,
62
- },
63
- },
64
- MuiAccordionDetails: {
65
- styleOverrides: {
66
- root: css`
67
- display: flex;
68
-
69
- flex-direction: column;
70
-
71
- row-gap: ${spacing.xxs};
72
- `,
73
- },
74
- },
75
- MuiDialogContent: {
76
- styleOverrides: {
77
- root: css`
78
- display: flex;
79
-
80
- flex-direction: column;
81
-
82
- row-gap: ${spacing.sm};
83
-
84
- min-width: 30rem;
85
- `,
86
- },
87
- },
88
- MuiCheckbox: {
89
- defaultProps: {
90
- size: 'small',
91
- },
92
- },
93
- MuiFormControlLabel: {
94
- styleOverrides: {
95
- label: css`
96
- overflow: hidden;
97
- text-overflow: ellipsis;
98
-
99
- font: ${font.body2};
100
-
101
- white-space: nowrap;
102
- `,
103
- },
104
- },
105
- MuiInputBase: {
106
- defaultProps: {
107
- disableInjectingGlobalStyles: true,
108
- },
109
- },
110
- MuiTextField: muiTextField,
111
- MuiPickersTextField: muiTextField,
112
- MuiAccordion: {
113
- defaultProps: {
114
- elevation: 3,
115
- slotProps: { transition: { unmountOnExit: true } },
116
- },
117
- },
118
- MuiAccordionSummary: {
119
- defaultProps: {
120
- expandIcon: <ExpandedMoreRoundedIcon />,
121
- },
122
- },
123
- MuiLink: {
124
- defaultProps: {
125
- component: LinkBehavior,
126
- } as LinkProps,
127
- styleOverrides: {
128
- root: ({ theme }) => css`
129
- color: ${theme.palette.primary.main};
130
-
131
- text-decoration-color: inherit;
132
- text-underline-offset: 0.25rem;
133
-
134
- &:hover {
135
- color: ${theme.palette.primary.dark};
136
- }
137
- `,
138
- },
139
- },
140
- MuiOutlinedInput: muiOutlinedInput,
141
- MuiPickersOutlinedInput: muiOutlinedInput,
142
- MuiButtonGroup: {
143
- defaultProps: {
144
- disableRipple: true,
145
- },
146
- },
147
- MuiMenuItem: {
148
- styleOverrides: {
149
- root: css`
150
- font: ${font.body3};
151
- `,
152
- },
153
- },
154
- MuiButtonBase: {
155
- styleOverrides: {
156
- root: css`
157
- &.${buttonClasses.outlined} {
158
- border: 0.0625rem solid ${colorPrimitives.darkNavy[100]};
159
-
160
- &:hover {
161
- /* For button groups - we should bring the border of hovered button in front of the other ones */
162
- z-index: 1;
163
-
164
- background: none;
165
- border: 0.0625rem solid ${colorPrimitives.darkNavy[800]};
166
- }
167
- }
168
- `,
169
- },
170
- defaultProps: {
171
- disableRipple: true,
172
- LinkComponent: LinkBehavior,
173
- type: 'button',
174
- },
175
- },
176
- MuiTooltip: {
177
- styleOverrides: {
178
- tooltip: css`
179
- font: ${font.body3};
180
-
181
- line-height: 1.5;
182
-
183
- letter-spacing: 0.05rem;
184
-
185
- background-color: ${colorPrimitives.darkNavy[900]};
186
- `,
187
- },
188
- },
189
- MuiSelect: {
190
- styleOverrides: {
191
- select: css`
192
- .${listItemTextClasses.root} {
193
- margin-top: ${rem(2)};
194
- margin-bottom: ${rem(2)};
195
- }
196
- `,
197
- },
198
- },
199
- },
200
- };
201
-
202
- const themeValue: ThemeOptions = {
203
- ...muiTheme,
204
- my: {
205
- font,
206
- radius,
207
- spacing,
208
- colors,
209
- },
210
- };
211
-
212
- const theme = createTheme(themeValue);
213
-
214
- export function ThemeProvider(props: React.PropsWithChildren) {
215
- return (
216
- <StyledEngineProvider injectFirst={true}>
217
- <MUIThemeProvider theme={theme}>
218
- <EmotionThemeProvider theme={theme}>
219
- <CssBaseline />
220
-
221
- <GlobalStyles />
222
-
223
- {props.children}
224
- </EmotionThemeProvider>
225
- </MUIThemeProvider>
226
- </StyledEngineProvider>
227
- );
228
- }
@@ -1,12 +0,0 @@
1
- import { Theme } from '@emotion/react';
2
-
3
- export const radius: Theme['my']['radius'] = {
4
- sq: '0',
5
- xs: '0.125rem',
6
- sm: '0.25rem',
7
- md: '0.5rem',
8
- lg: '0.75rem',
9
- xl: '1rem',
10
- xxl: '1.5rem',
11
- xxxl: '2rem',
12
- };
@@ -1,12 +0,0 @@
1
- import { Theme } from '@emotion/react';
2
-
3
- export const spacing: Theme['my']['spacing'] = {
4
- xxxs: '0.25rem',
5
- xxs: '0.5rem',
6
- xs: '0.75rem',
7
- sm: '1rem',
8
- md: '1.5rem',
9
- lg: '2rem',
10
- xl: '2.5rem',
11
- xxl: '3rem',
12
- };
@@ -1,40 +0,0 @@
1
- import { TypographyStyle, TypographyVariantsOptions } from '@mui/material';
2
-
3
- import { FONT_FAMILY, font } from './font';
4
-
5
- import { FontStyleName } from '../emotion';
6
-
7
- const stylesForFont = (fontName: FontStyleName): TypographyStyle => ({
8
- font: font[fontName],
9
-
10
- // This is needed to prevent overrides
11
- fontFamily: undefined,
12
- fontWeight: undefined,
13
- fontSize: undefined,
14
- lineHeight: undefined,
15
- });
16
-
17
- const typography: TypographyVariantsOptions = {
18
- fontFamily: FONT_FAMILY,
19
- fontWeightRegular: 400,
20
- fontWeightMedium: 600,
21
- fontWeightBold: 700,
22
- h1: stylesForFont('h1'),
23
- h2: stylesForFont('h2'),
24
- h3: stylesForFont('h3'),
25
- h4: stylesForFont('h4'),
26
- h5: stylesForFont('h5'),
27
- h6: stylesForFont('h6'),
28
- subtitle1: stylesForFont('subtitle1'),
29
- subtitle2: stylesForFont('subtitle2'),
30
- body1: stylesForFont('body1'),
31
- body2: stylesForFont('body2'),
32
- caption: stylesForFont('caption'),
33
- overline: stylesForFont('overline'),
34
- button: {
35
- ...stylesForFont('button1'),
36
- textTransform: 'inherit',
37
- },
38
- };
39
-
40
- export default typography;
@@ -1,14 +0,0 @@
1
- /**
2
- * @example
3
- * const a: 'one' | 'two' = 'one';
4
- *
5
- * switch(a) {
6
- * case 'one':
7
- * return 1;
8
- * case 'two':
9
- * return 2;
10
- * default:
11
- * return assertNever(a); // Works fine, but if we change the type of `a` to `'one' | 'two' | 'three'` then we get an error here
12
- * }
13
- */
14
- export const assertNever = (input: never): never => input;
@@ -1,2 +0,0 @@
1
- export { assertNever } from './assertNever';
2
- export { shouldNotForwardPropsWithKeys } from './shouldNotForwardPropsWithKeys';
@@ -1,7 +0,0 @@
1
- import { StyledOptions } from '@emotion/styled';
2
-
3
- export const shouldNotForwardPropsWithKeys = <TCustomProps extends object>(
4
- keys: (keyof TCustomProps)[],
5
- ): StyledOptions<TCustomProps> => ({
6
- shouldForwardProp: (propName: PropertyKey) => !keys.map((key) => key.toString()).includes(propName.toString()),
7
- });
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "extends": "@tsconfig/vite-react/tsconfig.json",
3
- "compilerOptions": {
4
- "target": "ES2023",
5
- "lib": ["ES2023", "DOM", "DOM.Iterable"],
6
- "module": "ES2022",
7
- "moduleResolution": "bundler",
8
- "skipLibCheck": true,
9
- "allowImportingTsExtensions": false,
10
- "verbatimModuleSyntax": false,
11
- "moduleDetection": "force",
12
- "noEmit": false,
13
- "emitDeclarationOnly": false,
14
- "declaration": true,
15
- "declarationMap": true,
16
- "jsx": "react-jsx",
17
- "jsxImportSource": "@emotion/react",
18
- "strict": true,
19
- "noUnusedLocals": false,
20
- "noUnusedParameters": false,
21
- "erasableSyntaxOnly": false,
22
- "noFallthroughCasesInSwitch": true,
23
- "noUncheckedSideEffectImports": true,
24
- "outDir": "./dist",
25
- "rootDir": "./src",
26
- "incremental": true,
27
- "composite": true,
28
- "tsBuildInfoFile": "./tsconfig.layout.tsbuildinfo",
29
- "baseUrl": ".",
30
- "paths": {}
31
- },
32
- "include": ["src/**/*", "src/emotion.d.ts"],
33
- "exclude": ["dist", "node_modules"]
34
- }