@biblioteksentralen/react 4.0.0-beta.0 → 4.0.0-beta.2
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/index.d.mts +106 -15
- package/dist/index.d.ts +106 -15
- package/dist/index.js +739 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +645 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -14
- package/dist/ButtonStyles-7ASDoOwZ.d.mts +0 -3
- package/dist/ButtonStyles-7ASDoOwZ.d.ts +0 -3
- package/dist/chunk-2KZDHLEJ.mjs +0 -10
- package/dist/chunk-2KZDHLEJ.mjs.map +0 -1
- package/dist/chunk-3IJ454KG.mjs +0 -39
- package/dist/chunk-3IJ454KG.mjs.map +0 -1
- package/dist/chunk-5GJBW3WE.mjs +0 -229
- package/dist/chunk-5GJBW3WE.mjs.map +0 -1
- package/dist/chunk-7MKFY66H.mjs +0 -44
- package/dist/chunk-7MKFY66H.mjs.map +0 -1
- package/dist/chunk-BCT5QU5W.js +0 -142
- package/dist/chunk-BCT5QU5W.js.map +0 -1
- package/dist/chunk-BN5W6FVN.mjs +0 -55
- package/dist/chunk-BN5W6FVN.mjs.map +0 -1
- package/dist/chunk-BRFRPPOW.js +0 -10
- package/dist/chunk-BRFRPPOW.js.map +0 -1
- package/dist/chunk-BZS3AX26.mjs +0 -10
- package/dist/chunk-BZS3AX26.mjs.map +0 -1
- package/dist/chunk-CGCBID7S.mjs +0 -15
- package/dist/chunk-CGCBID7S.mjs.map +0 -1
- package/dist/chunk-J5IF7WUN.js +0 -10
- package/dist/chunk-J5IF7WUN.js.map +0 -1
- package/dist/chunk-NSYSPEHR.js +0 -86
- package/dist/chunk-NSYSPEHR.js.map +0 -1
- package/dist/chunk-NYKSRUWF.js +0 -51
- package/dist/chunk-NYKSRUWF.js.map +0 -1
- package/dist/chunk-O4EXBCND.js +0 -19
- package/dist/chunk-O4EXBCND.js.map +0 -1
- package/dist/chunk-PLWK7HEC.js +0 -75
- package/dist/chunk-PLWK7HEC.js.map +0 -1
- package/dist/chunk-PQLTQYZ3.mjs +0 -15
- package/dist/chunk-PQLTQYZ3.mjs.map +0 -1
- package/dist/chunk-QAW4IRLI.js +0 -55
- package/dist/chunk-QAW4IRLI.js.map +0 -1
- package/dist/chunk-QBXCCJ24.js +0 -344
- package/dist/chunk-QBXCCJ24.js.map +0 -1
- package/dist/chunk-QX75QJ7F.mjs +0 -52
- package/dist/chunk-QX75QJ7F.mjs.map +0 -1
- package/dist/chunk-RZUGRIUF.mjs +0 -17
- package/dist/chunk-RZUGRIUF.mjs.map +0 -1
- package/dist/chunk-UFIMO32F.js +0 -275
- package/dist/chunk-UFIMO32F.js.map +0 -1
- package/dist/chunk-VSICUYFB.js +0 -51
- package/dist/chunk-VSICUYFB.js.map +0 -1
- package/dist/chunk-WYQNSPEX.mjs +0 -10
- package/dist/chunk-WYQNSPEX.mjs.map +0 -1
- package/dist/components/AlertBS.d.mts +0 -18
- package/dist/components/AlertBS.d.ts +0 -18
- package/dist/components/AlertBS.js +0 -9
- package/dist/components/AlertBS.js.map +0 -1
- package/dist/components/AlertBS.mjs +0 -9
- package/dist/components/AlertBS.mjs.map +0 -1
- package/dist/components/BiblioteksentralenProvider.d.mts +0 -10
- package/dist/components/BiblioteksentralenProvider.d.ts +0 -10
- package/dist/components/BiblioteksentralenProvider.js +0 -10
- package/dist/components/BiblioteksentralenProvider.js.map +0 -1
- package/dist/components/BiblioteksentralenProvider.mjs +0 -10
- package/dist/components/BiblioteksentralenProvider.mjs.map +0 -1
- package/dist/components/ButtonBS.d.mts +0 -16
- package/dist/components/ButtonBS.d.ts +0 -16
- package/dist/components/ButtonBS.js +0 -8
- package/dist/components/ButtonBS.js.map +0 -1
- package/dist/components/ButtonBS.mjs +0 -8
- package/dist/components/ButtonBS.mjs.map +0 -1
- package/dist/components/ConditionalWrapperBS.d.mts +0 -15
- package/dist/components/ConditionalWrapperBS.d.ts +0 -15
- package/dist/components/ConditionalWrapperBS.js +0 -8
- package/dist/components/ConditionalWrapperBS.js.map +0 -1
- package/dist/components/ConditionalWrapperBS.mjs +0 -8
- package/dist/components/ConditionalWrapperBS.mjs.map +0 -1
- package/dist/components/ErrorBoundaryBS.d.mts +0 -21
- package/dist/components/ErrorBoundaryBS.d.ts +0 -21
- package/dist/components/ErrorBoundaryBS.js +0 -10
- package/dist/components/ErrorBoundaryBS.js.map +0 -1
- package/dist/components/ErrorBoundaryBS.mjs +0 -10
- package/dist/components/ErrorBoundaryBS.mjs.map +0 -1
- package/dist/components/HashLinkTargetBS.d.mts +0 -16
- package/dist/components/HashLinkTargetBS.d.ts +0 -16
- package/dist/components/HashLinkTargetBS.js +0 -10
- package/dist/components/HashLinkTargetBS.js.map +0 -1
- package/dist/components/HashLinkTargetBS.mjs +0 -10
- package/dist/components/HashLinkTargetBS.mjs.map +0 -1
- package/dist/components/IconButtonBS.d.mts +0 -16
- package/dist/components/IconButtonBS.d.ts +0 -16
- package/dist/components/IconButtonBS.js +0 -8
- package/dist/components/IconButtonBS.js.map +0 -1
- package/dist/components/IconButtonBS.mjs +0 -8
- package/dist/components/IconButtonBS.mjs.map +0 -1
- package/dist/components/InputBS.d.mts +0 -18
- package/dist/components/InputBS.d.ts +0 -18
- package/dist/components/InputBS.js +0 -8
- package/dist/components/InputBS.js.map +0 -1
- package/dist/components/InputBS.mjs +0 -8
- package/dist/components/InputBS.mjs.map +0 -1
- package/dist/components/withErrorBoundaryBS.d.mts +0 -5
- package/dist/components/withErrorBoundaryBS.d.ts +0 -5
- package/dist/components/withErrorBoundaryBS.js +0 -11
- package/dist/components/withErrorBoundaryBS.js.map +0 -1
- package/dist/components/withErrorBoundaryBS.mjs +0 -11
- package/dist/components/withErrorBoundaryBS.mjs.map +0 -1
- /package/{dist/LICENSE → LICENSE} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Modify } from '@biblioteksentralen/types';
|
|
2
|
+
import { AlertRootProps, ButtonProps, IconButtonProps, InputProps, FieldLabelProps, SystemConfig } from '@chakra-ui/react';
|
|
3
|
+
import React, { ReactNode, RefObject, FunctionComponent, ErrorInfo } from 'react';
|
|
4
|
+
import { ComponentWithAs } from '@chakra-ui/system';
|
|
5
|
+
|
|
6
|
+
type Status = "info" | "warning" | "success" | "error";
|
|
7
|
+
type CustomVariants = "inline";
|
|
8
|
+
type Variants = AlertRootProps["variant"] | CustomVariants;
|
|
9
|
+
interface Props$5 extends Modify<AlertRootProps, {
|
|
10
|
+
variant?: Variants;
|
|
11
|
+
}> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
header?: ReactNode;
|
|
14
|
+
status: Status;
|
|
15
|
+
variant?: Variants;
|
|
16
|
+
}
|
|
17
|
+
declare function AlertBS({ status, children, variant, header, ...rest }: Props$5): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type CustomButtonVariants = "primary" | "secondary" | "tertiary";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Re-exporting chackras Button with a customised types
|
|
23
|
+
* This causes both chakras native variants and our home-made variants to show up in auto-complete
|
|
24
|
+
*/
|
|
25
|
+
type ButtonVariants = ButtonProps["variant"] | CustomButtonVariants;
|
|
26
|
+
type ButtonBSProps = Modify<ButtonProps, {
|
|
27
|
+
variant?: ButtonVariants;
|
|
28
|
+
}>;
|
|
29
|
+
declare const ButtonBS: ComponentWithAs<"button", ButtonBSProps>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Re-exporting chackras IconButton with a customised types
|
|
33
|
+
* This causes both chakras native variants and our home-made variants to show up in auto-complete
|
|
34
|
+
*/
|
|
35
|
+
type IconButtonVariants = IconButtonProps["variant"] | CustomButtonVariants;
|
|
36
|
+
type IconButtonBSProps = Modify<IconButtonProps, {
|
|
37
|
+
variant?: IconButtonVariants;
|
|
38
|
+
}>;
|
|
39
|
+
declare const IconButtonBS: ComponentWithAs<"button", IconButtonBSProps>;
|
|
40
|
+
|
|
41
|
+
interface Props$4 extends InputProps {
|
|
42
|
+
label: string;
|
|
43
|
+
hideLabel?: boolean;
|
|
44
|
+
labelProps?: FieldLabelProps;
|
|
45
|
+
helperText?: string;
|
|
46
|
+
errorMessage?: string;
|
|
47
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Creating custom input-component to make sure label is always set (for accessibility)
|
|
51
|
+
* Also handles some common needs (helper text and error message. For more advanced input-components we leave it to the consumers to compose custom input-components based on Chakra
|
|
52
|
+
*/
|
|
53
|
+
declare const InputBS: (props: Props$4) => React.JSX.Element;
|
|
54
|
+
|
|
55
|
+
type Props$3 = {
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
wrapper: FunctionComponent<{
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
condition: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.
|
|
64
|
+
*/
|
|
65
|
+
declare const ConditionalWrapperBS: FunctionComponent<Props$3>;
|
|
66
|
+
|
|
67
|
+
interface Props$2 {
|
|
68
|
+
boundaryName?: string;
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}
|
|
71
|
+
interface State {
|
|
72
|
+
hasError: boolean;
|
|
73
|
+
error?: Error;
|
|
74
|
+
errorInfo?: ErrorInfo;
|
|
75
|
+
}
|
|
76
|
+
declare class ErrorBoundaryBS extends React.Component<Props$2, State> {
|
|
77
|
+
constructor(props: any);
|
|
78
|
+
static getDerivedStateFromError(error: any): {
|
|
79
|
+
hasError: boolean;
|
|
80
|
+
};
|
|
81
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
82
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface Props$1 {
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'
|
|
89
|
+
*/
|
|
90
|
+
spaceAbove?: string;
|
|
91
|
+
/**
|
|
92
|
+
* angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el
|
|
93
|
+
*/
|
|
94
|
+
focusOnParent?: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare function HashLinkTargetBS(props: Props$1): React.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare const withErrorBoundaryBS: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => (props: Props & React.JSX.IntrinsicAttributes) => React.JSX.Element;
|
|
99
|
+
|
|
100
|
+
interface Props {
|
|
101
|
+
children: ReactNode;
|
|
102
|
+
customTheme?: SystemConfig;
|
|
103
|
+
}
|
|
104
|
+
declare const BiblioteksentralenProvider: (props: Props) => React.JSX.Element;
|
|
105
|
+
|
|
106
|
+
export { AlertBS, BiblioteksentralenProvider, ButtonBS, type ButtonBSProps, ConditionalWrapperBS, ErrorBoundaryBS, HashLinkTargetBS, IconButtonBS, type IconButtonBSProps, InputBS, withErrorBoundaryBS };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Modify } from '@biblioteksentralen/types';
|
|
2
|
+
import { AlertRootProps, ButtonProps, IconButtonProps, InputProps, FieldLabelProps, SystemConfig } from '@chakra-ui/react';
|
|
3
|
+
import React, { ReactNode, RefObject, FunctionComponent, ErrorInfo } from 'react';
|
|
4
|
+
import { ComponentWithAs } from '@chakra-ui/system';
|
|
5
|
+
|
|
6
|
+
type Status = "info" | "warning" | "success" | "error";
|
|
7
|
+
type CustomVariants = "inline";
|
|
8
|
+
type Variants = AlertRootProps["variant"] | CustomVariants;
|
|
9
|
+
interface Props$5 extends Modify<AlertRootProps, {
|
|
10
|
+
variant?: Variants;
|
|
11
|
+
}> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
header?: ReactNode;
|
|
14
|
+
status: Status;
|
|
15
|
+
variant?: Variants;
|
|
16
|
+
}
|
|
17
|
+
declare function AlertBS({ status, children, variant, header, ...rest }: Props$5): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
type CustomButtonVariants = "primary" | "secondary" | "tertiary";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Re-exporting chackras Button with a customised types
|
|
23
|
+
* This causes both chakras native variants and our home-made variants to show up in auto-complete
|
|
24
|
+
*/
|
|
25
|
+
type ButtonVariants = ButtonProps["variant"] | CustomButtonVariants;
|
|
26
|
+
type ButtonBSProps = Modify<ButtonProps, {
|
|
27
|
+
variant?: ButtonVariants;
|
|
28
|
+
}>;
|
|
29
|
+
declare const ButtonBS: ComponentWithAs<"button", ButtonBSProps>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Re-exporting chackras IconButton with a customised types
|
|
33
|
+
* This causes both chakras native variants and our home-made variants to show up in auto-complete
|
|
34
|
+
*/
|
|
35
|
+
type IconButtonVariants = IconButtonProps["variant"] | CustomButtonVariants;
|
|
36
|
+
type IconButtonBSProps = Modify<IconButtonProps, {
|
|
37
|
+
variant?: IconButtonVariants;
|
|
38
|
+
}>;
|
|
39
|
+
declare const IconButtonBS: ComponentWithAs<"button", IconButtonBSProps>;
|
|
40
|
+
|
|
41
|
+
interface Props$4 extends InputProps {
|
|
42
|
+
label: string;
|
|
43
|
+
hideLabel?: boolean;
|
|
44
|
+
labelProps?: FieldLabelProps;
|
|
45
|
+
helperText?: string;
|
|
46
|
+
errorMessage?: string;
|
|
47
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Creating custom input-component to make sure label is always set (for accessibility)
|
|
51
|
+
* Also handles some common needs (helper text and error message. For more advanced input-components we leave it to the consumers to compose custom input-components based on Chakra
|
|
52
|
+
*/
|
|
53
|
+
declare const InputBS: (props: Props$4) => React.JSX.Element;
|
|
54
|
+
|
|
55
|
+
type Props$3 = {
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
wrapper: FunctionComponent<{
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}>;
|
|
60
|
+
condition: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.
|
|
64
|
+
*/
|
|
65
|
+
declare const ConditionalWrapperBS: FunctionComponent<Props$3>;
|
|
66
|
+
|
|
67
|
+
interface Props$2 {
|
|
68
|
+
boundaryName?: string;
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}
|
|
71
|
+
interface State {
|
|
72
|
+
hasError: boolean;
|
|
73
|
+
error?: Error;
|
|
74
|
+
errorInfo?: ErrorInfo;
|
|
75
|
+
}
|
|
76
|
+
declare class ErrorBoundaryBS extends React.Component<Props$2, State> {
|
|
77
|
+
constructor(props: any);
|
|
78
|
+
static getDerivedStateFromError(error: any): {
|
|
79
|
+
hasError: boolean;
|
|
80
|
+
};
|
|
81
|
+
componentDidCatch(error: any, errorInfo: any): void;
|
|
82
|
+
render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface Props$1 {
|
|
86
|
+
id: string;
|
|
87
|
+
/**
|
|
88
|
+
* angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'
|
|
89
|
+
*/
|
|
90
|
+
spaceAbove?: string;
|
|
91
|
+
/**
|
|
92
|
+
* angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el
|
|
93
|
+
*/
|
|
94
|
+
focusOnParent?: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare function HashLinkTargetBS(props: Props$1): React.JSX.Element;
|
|
97
|
+
|
|
98
|
+
declare const withErrorBoundaryBS: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => (props: Props & React.JSX.IntrinsicAttributes) => React.JSX.Element;
|
|
99
|
+
|
|
100
|
+
interface Props {
|
|
101
|
+
children: ReactNode;
|
|
102
|
+
customTheme?: SystemConfig;
|
|
103
|
+
}
|
|
104
|
+
declare const BiblioteksentralenProvider: (props: Props) => React.JSX.Element;
|
|
105
|
+
|
|
106
|
+
export { AlertBS, BiblioteksentralenProvider, ButtonBS, type ButtonBSProps, ConditionalWrapperBS, ErrorBoundaryBS, HashLinkTargetBS, IconButtonBS, type IconButtonBSProps, InputBS, withErrorBoundaryBS };
|