@manuscripts/style-guide 3.4.2 → 3.4.4

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 (37) hide show
  1. package/dist/cjs/colors.js +49 -0
  2. package/dist/cjs/defaultTheme.js +235 -0
  3. package/dist/cjs/index.js +26 -9
  4. package/dist/es/colors.js +46 -0
  5. package/dist/es/defaultTheme.js +199 -0
  6. package/dist/es/index.js +2 -6
  7. package/dist/types/colors.d.ts +46 -0
  8. package/dist/types/{hooks/use-deep-compare.d.ts → defaultTheme.d.ts} +3 -3
  9. package/dist/types/index.d.ts +2 -6
  10. package/dist/types/theme.d.ts +2 -0
  11. package/package.json +1 -1
  12. package/dist/cjs/components/AutoSaveInput.js +0 -45
  13. package/dist/cjs/components/RichText/RichText.js +0 -24
  14. package/dist/cjs/components/RichText/RichTextField.js +0 -68
  15. package/dist/cjs/components/RichText/index.js +0 -7
  16. package/dist/cjs/components/RichText/schema.js +0 -111
  17. package/dist/cjs/components/TextFieldContainer.js +0 -15
  18. package/dist/cjs/components/TextFieldError.js +0 -34
  19. package/dist/cjs/components/TextFieldGroupContainer.js +0 -11
  20. package/dist/cjs/hooks/use-deep-compare.js +0 -31
  21. package/dist/es/components/AutoSaveInput.js +0 -38
  22. package/dist/es/components/RichText/RichText.js +0 -20
  23. package/dist/es/components/RichText/RichTextField.js +0 -61
  24. package/dist/es/components/RichText/index.js +0 -2
  25. package/dist/es/components/RichText/schema.js +0 -106
  26. package/dist/es/components/TextFieldContainer.js +0 -8
  27. package/dist/es/components/TextFieldError.js +0 -27
  28. package/dist/es/components/TextFieldGroupContainer.js +0 -7
  29. package/dist/es/hooks/use-deep-compare.js +0 -26
  30. package/dist/types/components/AutoSaveInput.d.ts +0 -42
  31. package/dist/types/components/RichText/RichText.d.ts +0 -6
  32. package/dist/types/components/RichText/RichTextField.d.ts +0 -6
  33. package/dist/types/components/RichText/index.d.ts +0 -2
  34. package/dist/types/components/RichText/schema.d.ts +0 -7
  35. package/dist/types/components/TextFieldContainer.d.ts +0 -24
  36. package/dist/types/components/TextFieldError.d.ts +0 -20
  37. package/dist/types/components/TextFieldGroupContainer.d.ts +0 -25
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import styled from 'styled-components';
3
- const Arrow = styled.div `
4
- width: 0;
5
- height: 0;
6
- position: absolute;
7
- border: 5px solid transparent;
8
- top: -5px;
9
- left: calc(16px);
10
- border-bottom-color: ${(props) => props.theme.colors.background.error};
11
- border-top-width: 0;
12
- margin: 0 5px;
13
- `;
14
- const Container = styled.div `
15
- background: ${(props) => props.theme.colors.background.error};
16
- border-radius: 2px;
17
- color: ${(props) => props.theme.colors.text.error};
18
- font-family: ${(props) => props.theme.font.family.sans};
19
- margin-top: 5px;
20
- margin-bottom: 5px;
21
- position: relative;
22
- padding: 4px;
23
- `;
24
- export const TextFieldErrorItem = styled.div `
25
- margin: 8px;
26
- `;
27
- export const TextFieldError = ({ children }) => (_jsxs(Container, { children: [_jsx(Arrow, {}), children] }));
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { TextFieldGroup } from './TextField';
3
- import { TextFieldError, TextFieldErrorItem } from './TextFieldError';
4
- const hasErrors = (errors) => Object.values(errors).some((error) => !!error);
5
- export const TextFieldGroupContainer = ({ children, errors }) => {
6
- return (_jsxs(TextFieldGroup, { children: [children, errors && hasErrors(errors) && (_jsx(TextFieldError, { children: Object.entries(errors).map(([key, error]) => error && (_jsx(TextFieldErrorItem, { id: `${key}-text-field-error`, children: error }, key))) }))] }));
7
- };
@@ -1,26 +0,0 @@
1
- /*!
2
- * © 2022 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { isEqual } from 'lodash';
17
- import { useCallback, useMemo, useRef } from 'react';
18
- const useDeepCompare = (deps) => {
19
- const ref = useRef(deps);
20
- if (!isEqual(deps, ref.current)) {
21
- ref.current = deps;
22
- }
23
- return ref.current;
24
- };
25
- export const useDeepCompareMemo = (callback, deps) => useMemo(callback, [useDeepCompare(deps)]);
26
- export const useDeepCompareCallback = (callback, deps) => useCallback(callback, [useDeepCompare(deps)]);
@@ -1,42 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { FieldProps } from 'formik';
17
- import React, { InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
18
- interface AutoSaveInputProps {
19
- component: React.ComponentType<InputHTMLAttributes<HTMLInputElement> | TextareaHTMLAttributes<HTMLTextAreaElement> | {
20
- 'data-testid'?: string;
21
- }>;
22
- saveOn: 'change' | 'blur';
23
- placeholder?: string;
24
- testId?: string;
25
- isInvalid?: boolean | null;
26
- disabled?: boolean;
27
- }
28
- interface State {
29
- focused: boolean;
30
- }
31
- export declare class AutoSaveInput extends React.Component<FieldProps & AutoSaveInputProps, State> {
32
- state: {
33
- focused: boolean;
34
- };
35
- componentWillUnmount(): void;
36
- render(): import("react/jsx-runtime").JSX.Element;
37
- private handleSubmit;
38
- private handleFocus;
39
- private handleBlur;
40
- private handleChange;
41
- }
42
- export {};
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface RichTextProps {
3
- className?: string;
4
- value: string;
5
- }
6
- export declare const RichText: React.FC<RichTextProps>;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface RichTextFieldProps {
3
- value: string;
4
- onChange?: (value: string) => void;
5
- }
6
- export declare const RichTextField: React.FC<RichTextFieldProps>;
@@ -1,2 +0,0 @@
1
- export { RichText } from './RichText';
2
- export { RichTextField } from './RichTextField';
@@ -1,7 +0,0 @@
1
- import { Node as ProsemirrorNode, Schema } from 'prosemirror-model';
2
- export type Nodes = 'text' | 'rich';
3
- export type Marks = 'bold' | 'italic' | 'smallcaps' | 'subscript' | 'superscript';
4
- export type RichTextSchema = Schema<Nodes, Marks>;
5
- export declare const schema: RichTextSchema;
6
- export declare const parseRichText: (value: string) => ProsemirrorNode;
7
- export declare const serializeRichText: (node: ProsemirrorNode) => string;
@@ -1,24 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import React from 'react';
17
- import { ErrorProps } from './Form';
18
- interface TextFieldContainerProps {
19
- label?: string;
20
- error?: React.ReactNode | undefined;
21
- children: React.ReactElement<ErrorProps>;
22
- }
23
- export declare const TextFieldContainer: React.FunctionComponent<TextFieldContainerProps>;
24
- export {};
@@ -1,20 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import React from 'react';
17
- export declare const TextFieldErrorItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
- export declare const TextFieldError: React.FunctionComponent<{
19
- children: React.ReactNode;
20
- }>;
@@ -1,25 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import React from 'react';
17
- interface Errors {
18
- [key: string]: React.ReactNode | undefined;
19
- }
20
- interface TextFieldGroupContainerProps {
21
- errors?: Errors;
22
- children: React.ReactNode;
23
- }
24
- export declare const TextFieldGroupContainer: React.FunctionComponent<TextFieldGroupContainerProps>;
25
- export {};