@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.
Files changed (108) hide show
  1. package/dist/index.d.mts +106 -15
  2. package/dist/index.d.ts +106 -15
  3. package/dist/index.js +739 -37
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +645 -45
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +5 -14
  8. package/dist/ButtonStyles-7ASDoOwZ.d.mts +0 -3
  9. package/dist/ButtonStyles-7ASDoOwZ.d.ts +0 -3
  10. package/dist/chunk-2KZDHLEJ.mjs +0 -10
  11. package/dist/chunk-2KZDHLEJ.mjs.map +0 -1
  12. package/dist/chunk-3IJ454KG.mjs +0 -39
  13. package/dist/chunk-3IJ454KG.mjs.map +0 -1
  14. package/dist/chunk-5GJBW3WE.mjs +0 -229
  15. package/dist/chunk-5GJBW3WE.mjs.map +0 -1
  16. package/dist/chunk-7MKFY66H.mjs +0 -44
  17. package/dist/chunk-7MKFY66H.mjs.map +0 -1
  18. package/dist/chunk-BCT5QU5W.js +0 -142
  19. package/dist/chunk-BCT5QU5W.js.map +0 -1
  20. package/dist/chunk-BN5W6FVN.mjs +0 -55
  21. package/dist/chunk-BN5W6FVN.mjs.map +0 -1
  22. package/dist/chunk-BRFRPPOW.js +0 -10
  23. package/dist/chunk-BRFRPPOW.js.map +0 -1
  24. package/dist/chunk-BZS3AX26.mjs +0 -10
  25. package/dist/chunk-BZS3AX26.mjs.map +0 -1
  26. package/dist/chunk-CGCBID7S.mjs +0 -15
  27. package/dist/chunk-CGCBID7S.mjs.map +0 -1
  28. package/dist/chunk-J5IF7WUN.js +0 -10
  29. package/dist/chunk-J5IF7WUN.js.map +0 -1
  30. package/dist/chunk-NSYSPEHR.js +0 -86
  31. package/dist/chunk-NSYSPEHR.js.map +0 -1
  32. package/dist/chunk-NYKSRUWF.js +0 -51
  33. package/dist/chunk-NYKSRUWF.js.map +0 -1
  34. package/dist/chunk-O4EXBCND.js +0 -19
  35. package/dist/chunk-O4EXBCND.js.map +0 -1
  36. package/dist/chunk-PLWK7HEC.js +0 -75
  37. package/dist/chunk-PLWK7HEC.js.map +0 -1
  38. package/dist/chunk-PQLTQYZ3.mjs +0 -15
  39. package/dist/chunk-PQLTQYZ3.mjs.map +0 -1
  40. package/dist/chunk-QAW4IRLI.js +0 -55
  41. package/dist/chunk-QAW4IRLI.js.map +0 -1
  42. package/dist/chunk-QBXCCJ24.js +0 -344
  43. package/dist/chunk-QBXCCJ24.js.map +0 -1
  44. package/dist/chunk-QX75QJ7F.mjs +0 -52
  45. package/dist/chunk-QX75QJ7F.mjs.map +0 -1
  46. package/dist/chunk-RZUGRIUF.mjs +0 -17
  47. package/dist/chunk-RZUGRIUF.mjs.map +0 -1
  48. package/dist/chunk-UFIMO32F.js +0 -275
  49. package/dist/chunk-UFIMO32F.js.map +0 -1
  50. package/dist/chunk-VSICUYFB.js +0 -51
  51. package/dist/chunk-VSICUYFB.js.map +0 -1
  52. package/dist/chunk-WYQNSPEX.mjs +0 -10
  53. package/dist/chunk-WYQNSPEX.mjs.map +0 -1
  54. package/dist/components/AlertBS.d.mts +0 -18
  55. package/dist/components/AlertBS.d.ts +0 -18
  56. package/dist/components/AlertBS.js +0 -9
  57. package/dist/components/AlertBS.js.map +0 -1
  58. package/dist/components/AlertBS.mjs +0 -9
  59. package/dist/components/AlertBS.mjs.map +0 -1
  60. package/dist/components/BiblioteksentralenProvider.d.mts +0 -10
  61. package/dist/components/BiblioteksentralenProvider.d.ts +0 -10
  62. package/dist/components/BiblioteksentralenProvider.js +0 -10
  63. package/dist/components/BiblioteksentralenProvider.js.map +0 -1
  64. package/dist/components/BiblioteksentralenProvider.mjs +0 -10
  65. package/dist/components/BiblioteksentralenProvider.mjs.map +0 -1
  66. package/dist/components/ButtonBS.d.mts +0 -16
  67. package/dist/components/ButtonBS.d.ts +0 -16
  68. package/dist/components/ButtonBS.js +0 -8
  69. package/dist/components/ButtonBS.js.map +0 -1
  70. package/dist/components/ButtonBS.mjs +0 -8
  71. package/dist/components/ButtonBS.mjs.map +0 -1
  72. package/dist/components/ConditionalWrapperBS.d.mts +0 -15
  73. package/dist/components/ConditionalWrapperBS.d.ts +0 -15
  74. package/dist/components/ConditionalWrapperBS.js +0 -8
  75. package/dist/components/ConditionalWrapperBS.js.map +0 -1
  76. package/dist/components/ConditionalWrapperBS.mjs +0 -8
  77. package/dist/components/ConditionalWrapperBS.mjs.map +0 -1
  78. package/dist/components/ErrorBoundaryBS.d.mts +0 -21
  79. package/dist/components/ErrorBoundaryBS.d.ts +0 -21
  80. package/dist/components/ErrorBoundaryBS.js +0 -10
  81. package/dist/components/ErrorBoundaryBS.js.map +0 -1
  82. package/dist/components/ErrorBoundaryBS.mjs +0 -10
  83. package/dist/components/ErrorBoundaryBS.mjs.map +0 -1
  84. package/dist/components/HashLinkTargetBS.d.mts +0 -16
  85. package/dist/components/HashLinkTargetBS.d.ts +0 -16
  86. package/dist/components/HashLinkTargetBS.js +0 -10
  87. package/dist/components/HashLinkTargetBS.js.map +0 -1
  88. package/dist/components/HashLinkTargetBS.mjs +0 -10
  89. package/dist/components/HashLinkTargetBS.mjs.map +0 -1
  90. package/dist/components/IconButtonBS.d.mts +0 -16
  91. package/dist/components/IconButtonBS.d.ts +0 -16
  92. package/dist/components/IconButtonBS.js +0 -8
  93. package/dist/components/IconButtonBS.js.map +0 -1
  94. package/dist/components/IconButtonBS.mjs +0 -8
  95. package/dist/components/IconButtonBS.mjs.map +0 -1
  96. package/dist/components/InputBS.d.mts +0 -18
  97. package/dist/components/InputBS.d.ts +0 -18
  98. package/dist/components/InputBS.js +0 -8
  99. package/dist/components/InputBS.js.map +0 -1
  100. package/dist/components/InputBS.mjs +0 -8
  101. package/dist/components/InputBS.mjs.map +0 -1
  102. package/dist/components/withErrorBoundaryBS.d.mts +0 -5
  103. package/dist/components/withErrorBoundaryBS.d.ts +0 -5
  104. package/dist/components/withErrorBoundaryBS.js +0 -11
  105. package/dist/components/withErrorBoundaryBS.js.map +0 -1
  106. package/dist/components/withErrorBoundaryBS.mjs +0 -11
  107. package/dist/components/withErrorBoundaryBS.mjs.map +0 -1
  108. /package/{dist/LICENSE → LICENSE} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,15 +1,106 @@
1
- export * from '@chakra-ui/react';
2
- export { AlertBS } from './components/AlertBS.mjs';
3
- export { ButtonBS, ButtonBSProps } from './components/ButtonBS.mjs';
4
- export { IconButtonBS, IconButtonBSProps } from './components/IconButtonBS.mjs';
5
- export { InputBS } from './components/InputBS.mjs';
6
- export { ConditionalWrapperBS } from './components/ConditionalWrapperBS.mjs';
7
- export { ErrorBoundaryBS } from './components/ErrorBoundaryBS.mjs';
8
- export { HashLinkTargetBS } from './components/HashLinkTargetBS.mjs';
9
- export { withErrorBoundaryBS } from './components/withErrorBoundaryBS.mjs';
10
- export { BiblioteksentralenProvider } from './components/BiblioteksentralenProvider.mjs';
11
- export { colors } from '@biblioteksentralen/utils';
12
- import '@biblioteksentralen/types';
13
- import 'react';
14
- import '@chakra-ui/system';
15
- import './ButtonStyles-7ASDoOwZ.mjs';
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
- export * from '@chakra-ui/react';
2
- export { AlertBS } from './components/AlertBS.js';
3
- export { ButtonBS, ButtonBSProps } from './components/ButtonBS.js';
4
- export { IconButtonBS, IconButtonBSProps } from './components/IconButtonBS.js';
5
- export { InputBS } from './components/InputBS.js';
6
- export { ConditionalWrapperBS } from './components/ConditionalWrapperBS.js';
7
- export { ErrorBoundaryBS } from './components/ErrorBoundaryBS.js';
8
- export { HashLinkTargetBS } from './components/HashLinkTargetBS.js';
9
- export { withErrorBoundaryBS } from './components/withErrorBoundaryBS.js';
10
- export { BiblioteksentralenProvider } from './components/BiblioteksentralenProvider.js';
11
- export { colors } from '@biblioteksentralen/utils';
12
- import '@biblioteksentralen/types';
13
- import 'react';
14
- import '@chakra-ui/system';
15
- import './ButtonStyles-7ASDoOwZ.js';
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 };