@biblioteksentralen/react 3.1.0 → 4.0.0-beta.0
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/ButtonStyles-7ASDoOwZ.d.mts +3 -0
- package/dist/ButtonStyles-7ASDoOwZ.d.ts +3 -0
- package/dist/chunk-2KZDHLEJ.mjs +10 -0
- package/dist/chunk-2KZDHLEJ.mjs.map +1 -0
- package/dist/chunk-3IJ454KG.mjs +39 -0
- package/dist/chunk-3IJ454KG.mjs.map +1 -0
- package/dist/chunk-5GJBW3WE.mjs +229 -0
- package/dist/chunk-5GJBW3WE.mjs.map +1 -0
- package/dist/chunk-7MKFY66H.mjs +44 -0
- package/dist/chunk-7MKFY66H.mjs.map +1 -0
- package/dist/chunk-BCT5QU5W.js +142 -0
- package/dist/chunk-BCT5QU5W.js.map +1 -0
- package/dist/chunk-BN5W6FVN.mjs +55 -0
- package/dist/chunk-BN5W6FVN.mjs.map +1 -0
- package/dist/chunk-BRFRPPOW.js +10 -0
- package/dist/chunk-BRFRPPOW.js.map +1 -0
- package/dist/chunk-BZS3AX26.mjs +10 -0
- package/dist/chunk-BZS3AX26.mjs.map +1 -0
- package/dist/chunk-CGCBID7S.mjs +15 -0
- package/dist/chunk-CGCBID7S.mjs.map +1 -0
- package/dist/chunk-J5IF7WUN.js +10 -0
- package/dist/chunk-J5IF7WUN.js.map +1 -0
- package/dist/chunk-NSYSPEHR.js +86 -0
- package/dist/chunk-NSYSPEHR.js.map +1 -0
- package/dist/chunk-NYKSRUWF.js +51 -0
- package/dist/chunk-NYKSRUWF.js.map +1 -0
- package/dist/chunk-O4EXBCND.js +19 -0
- package/dist/chunk-O4EXBCND.js.map +1 -0
- package/dist/chunk-PLWK7HEC.js +75 -0
- package/dist/chunk-PLWK7HEC.js.map +1 -0
- package/dist/chunk-PQLTQYZ3.mjs +15 -0
- package/dist/chunk-PQLTQYZ3.mjs.map +1 -0
- package/dist/chunk-QAW4IRLI.js +55 -0
- package/dist/chunk-QAW4IRLI.js.map +1 -0
- package/dist/chunk-QBXCCJ24.js +344 -0
- package/dist/chunk-QBXCCJ24.js.map +1 -0
- package/dist/chunk-QX75QJ7F.mjs +52 -0
- package/dist/chunk-QX75QJ7F.mjs.map +1 -0
- package/dist/chunk-RZUGRIUF.mjs +17 -0
- package/dist/chunk-RZUGRIUF.mjs.map +1 -0
- package/dist/chunk-UFIMO32F.js +275 -0
- package/dist/chunk-UFIMO32F.js.map +1 -0
- package/dist/chunk-VSICUYFB.js +51 -0
- package/dist/chunk-VSICUYFB.js.map +1 -0
- package/dist/chunk-WYQNSPEX.mjs +10 -0
- package/dist/chunk-WYQNSPEX.mjs.map +1 -0
- package/dist/components/AlertBS.d.mts +18 -0
- package/dist/components/AlertBS.d.ts +18 -0
- package/dist/components/AlertBS.js +9 -0
- package/dist/components/AlertBS.js.map +1 -0
- package/dist/components/AlertBS.mjs +9 -0
- package/dist/components/AlertBS.mjs.map +1 -0
- package/dist/components/BiblioteksentralenProvider.d.mts +10 -0
- package/dist/components/BiblioteksentralenProvider.d.ts +10 -0
- package/dist/components/BiblioteksentralenProvider.js +10 -0
- package/dist/components/BiblioteksentralenProvider.js.map +1 -0
- package/dist/components/BiblioteksentralenProvider.mjs +10 -0
- package/dist/components/BiblioteksentralenProvider.mjs.map +1 -0
- package/dist/components/ButtonBS.d.mts +16 -0
- package/dist/components/ButtonBS.d.ts +16 -0
- package/dist/components/ButtonBS.js +8 -0
- package/dist/components/ButtonBS.js.map +1 -0
- package/dist/components/ButtonBS.mjs +8 -0
- package/dist/components/ButtonBS.mjs.map +1 -0
- package/dist/components/ConditionalWrapperBS.d.mts +15 -0
- package/dist/components/ConditionalWrapperBS.d.ts +15 -0
- package/dist/components/ConditionalWrapperBS.js +8 -0
- package/dist/components/ConditionalWrapperBS.js.map +1 -0
- package/dist/components/ConditionalWrapperBS.mjs +8 -0
- package/dist/components/ConditionalWrapperBS.mjs.map +1 -0
- package/dist/components/ErrorBoundaryBS.d.mts +21 -0
- package/dist/components/ErrorBoundaryBS.d.ts +21 -0
- package/dist/components/ErrorBoundaryBS.js +10 -0
- package/dist/components/ErrorBoundaryBS.js.map +1 -0
- package/dist/components/ErrorBoundaryBS.mjs +10 -0
- package/dist/components/ErrorBoundaryBS.mjs.map +1 -0
- package/dist/components/HashLinkTargetBS.d.mts +16 -0
- package/dist/components/HashLinkTargetBS.d.ts +16 -0
- package/dist/components/HashLinkTargetBS.js +10 -0
- package/dist/components/HashLinkTargetBS.js.map +1 -0
- package/dist/components/HashLinkTargetBS.mjs +10 -0
- package/dist/components/HashLinkTargetBS.mjs.map +1 -0
- package/dist/components/IconButtonBS.d.mts +16 -0
- package/dist/components/IconButtonBS.d.ts +16 -0
- package/dist/components/IconButtonBS.js +8 -0
- package/dist/components/IconButtonBS.js.map +1 -0
- package/dist/components/IconButtonBS.mjs +8 -0
- package/dist/components/IconButtonBS.mjs.map +1 -0
- package/dist/components/InputBS.d.mts +18 -0
- package/dist/components/InputBS.d.ts +18 -0
- package/dist/components/InputBS.js +8 -0
- package/dist/components/InputBS.js.map +1 -0
- package/dist/components/InputBS.mjs +8 -0
- package/dist/components/InputBS.mjs.map +1 -0
- package/dist/components/withErrorBoundaryBS.d.mts +5 -0
- package/dist/components/withErrorBoundaryBS.d.ts +5 -0
- package/dist/components/withErrorBoundaryBS.js +11 -0
- package/dist/components/withErrorBoundaryBS.js.map +1 -0
- package/dist/components/withErrorBoundaryBS.mjs +11 -0
- package/dist/components/withErrorBoundaryBS.mjs.map +1 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +13 -106
- package/dist/index.js +38 -748
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -407
- package/dist/index.mjs.map +1 -1
- package/package.json +27 -11
- /package/{LICENSE → dist/LICENSE} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/withErrorBoundaryBS.tsx"],"sourcesContent":["import React from \"react\";\nimport { ErrorBoundaryBS } from \"./ErrorBoundaryBS\";\n\nexport const withErrorBoundaryBS = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundaryBS boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundaryBS>\n );\n};\n"],"mappings":";;;;;;AAAA,OAAO,WAAW;AAGX,IAAM,sBAAsB,CAAS,WAAuC,iBAAyB;AAC1G,SAAO,CAAC,UACN,oCAAC,mBAAgB,gBACf,oCAAC,aAAW,GAAG,OAAO,CACxB;AAEJ;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
"use client";
|
|
6
|
+
// src/components/IconButtonBS.tsx
|
|
7
|
+
var _react = require("@chakra-ui/react");
|
|
8
|
+
var IconButtonBS = _react.IconButton;
|
|
9
|
+
exports.IconButtonBS = IconButtonBS;
|
|
10
|
+
//# sourceMappingURL=chunk-J5IF7WUN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/IconButtonBS.tsx"],"names":[],"mappings":";;;AACA,SAAS,cAAc,wBAAkE;AAUlF,IAAM,eAAe","sourcesContent":["import { Modify } from \"@biblioteksentralen/types\";\nimport { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras IconButton with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype IconButtonVariants = ChakraIconButtonProps[\"variant\"] | CustomButtonVariants;\nexport type IconButtonBSProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButtonBS = ChakraIconButton as ComponentWithAs<\"button\", IconButtonBSProps>;\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function _object_without_properties(source, excluded) {
|
|
31
|
+
if (source == null) return {};
|
|
32
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
33
|
+
var key, i;
|
|
34
|
+
if (Object.getOwnPropertySymbols) {
|
|
35
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
36
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
37
|
+
key = sourceSymbolKeys[i];
|
|
38
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
39
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
40
|
+
target[key] = source[key];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return target;
|
|
44
|
+
}
|
|
45
|
+
function _object_without_properties_loose(source, excluded) {
|
|
46
|
+
if (source == null) return {};
|
|
47
|
+
var target = {};
|
|
48
|
+
var sourceKeys = Object.keys(source);
|
|
49
|
+
var key, i;
|
|
50
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
51
|
+
key = sourceKeys[i];
|
|
52
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
53
|
+
target[key] = source[key];
|
|
54
|
+
}
|
|
55
|
+
return target;
|
|
56
|
+
}
|
|
57
|
+
Object.defineProperty(exports, "__esModule", {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
60
|
+
function _interopRequireDefault(obj) {
|
|
61
|
+
return obj && obj.__esModule ? obj : {
|
|
62
|
+
default: obj
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
"use client";
|
|
66
|
+
// src/components/InputBS.tsx
|
|
67
|
+
var _react = require("@chakra-ui/react");
|
|
68
|
+
var _react3 = require("react");
|
|
69
|
+
var _react4 = _interopRequireDefault(_react3);
|
|
70
|
+
var FieldHelperText = _react.Field.HelperText;
|
|
71
|
+
var FieldErrorText = _react.Field.ErrorText;
|
|
72
|
+
var InputBS = function(props) {
|
|
73
|
+
var labelProps = props.labelProps, label = props.label, helperText = props.helperText, errorMessage = props.errorMessage, hideLabel = props.hideLabel, inputProps = _object_without_properties(props, [
|
|
74
|
+
"labelProps",
|
|
75
|
+
"label",
|
|
76
|
+
"helperText",
|
|
77
|
+
"errorMessage",
|
|
78
|
+
"hideLabel"
|
|
79
|
+
]);
|
|
80
|
+
var formLabel = /* @__PURE__ */ _react4.default.createElement(_react.Field.Label, _object_spread({}, labelProps), label);
|
|
81
|
+
return /* @__PURE__ */ _react4.default.createElement(_react.Field.Root, {
|
|
82
|
+
invalid: !!errorMessage
|
|
83
|
+
}, hideLabel ? /* @__PURE__ */ _react4.default.createElement(_react.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ _react4.default.createElement(FieldHelperText, null, helperText), /* @__PURE__ */ _react4.default.createElement(_react.Input, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ _react4.default.createElement(FieldErrorText, null, errorMessage));
|
|
84
|
+
};
|
|
85
|
+
exports.InputBS = InputBS;
|
|
86
|
+
//# sourceMappingURL=chunk-NSYSPEHR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/InputBS.tsx"],"names":[],"mappings":";;;AAAA,SAAS,SAAS,aAAa,OAAoC,sBAAsB;AACzF,OAAO,WAA0B;AAGjC,IAAM,kBAAkB,MAAM;AAC9B,IAAM,iBAAiB,MAAM;AAetB,IAAM,UAAU,CAAC,UAAiB;AACvC,QAAM,EAAE,YAAY,OAAO,YAAY,cAAc,WAAW,GAAG,WAAW,IAAI;AAElF,QAAM,YAAY,oCAAC,MAAM,OAAN,EAAa,GAAG,cAAa,KAAM;AAEtD,SACE,oCAAC,MAAM,MAAN,EAAW,SAAS,CAAC,CAAC,gBACpB,YAAY,oCAAC,sBAAgB,SAAU,IAAoB,WAC3D,cAAc,oCAAC,uBAAiB,UAAW,GAC5C,oCAAC,eAAa,GAAG,YAAY,GAC5B,gBAAgB,oCAAC,sBAAgB,YAAa,CACjD;AAEJ","sourcesContent":["import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\n\n// Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types\nconst FieldHelperText = Field.HelperText as React.FC<React.PropsWithChildren>;\nconst FieldErrorText = Field.ErrorText as React.FC<React.PropsWithChildren>;\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n ref?: RefObject<HTMLInputElement | null>;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * 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\n */\nexport const InputBS = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <FieldHelperText>{helperText}</FieldHelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <FieldErrorText>{errorMessage}</FieldErrorText>}\n </Field.Root>\n );\n};\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31
|
+
value: true
|
|
32
|
+
});
|
|
33
|
+
function _interopRequireDefault(obj) {
|
|
34
|
+
return obj && obj.__esModule ? obj : {
|
|
35
|
+
default: obj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
"use client";
|
|
39
|
+
var _chunkQBXCCJ24js = require("./chunk-QBXCCJ24.js");
|
|
40
|
+
// src/components/BiblioteksentralenProvider.tsx
|
|
41
|
+
var _react = require("react");
|
|
42
|
+
var _react2 = _interopRequireDefault(_react);
|
|
43
|
+
var _react3 = require("@chakra-ui/react");
|
|
44
|
+
var _system = require("@chakra-ui/system");
|
|
45
|
+
var BiblioteksentralenProvider = function(props) {
|
|
46
|
+
return /* @__PURE__ */ _react2.default.createElement(_react3.ChakraProvider, {
|
|
47
|
+
value: _react3.createSystem.call(void 0, _react3.defaultConfig, _chunkQBXCCJ24js.biblioteksentralenChakraTheme, props.customTheme || {})
|
|
48
|
+
}, /* @__PURE__ */ _react2.default.createElement(_system.ColorModeProvider, _object_spread({}, props)));
|
|
49
|
+
};
|
|
50
|
+
exports.BiblioteksentralenProvider = BiblioteksentralenProvider;
|
|
51
|
+
//# sourceMappingURL=chunk-NYKSRUWF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/BiblioteksentralenProvider.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,WAA0B;AACjC,SAAS,gBAAgB,cAAc,qBAAmC;AAE1E,SAAS,yBAAyB;AAO3B,IAAM,6BAA6B,CAAC,UACzC,oCAAC,kBAAe,OAAO,aAAa,eAAe,+BAA+B,MAAM,eAAe,CAAC,CAAC,KACvG,oCAAC,qBAAmB,GAAG,OAAO,CAChC","sourcesContent":["import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _interopRequireDefault(obj) {
|
|
6
|
+
return obj && obj.__esModule ? obj : {
|
|
7
|
+
default: obj
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
"use client";
|
|
11
|
+
// src/components/ConditionalWrapperBS.tsx
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _react2 = _interopRequireDefault(_react);
|
|
14
|
+
var ConditionalWrapperBS = function(param) {
|
|
15
|
+
var condition = param.condition, children = param.children, Wrapper = param.wrapper;
|
|
16
|
+
return condition ? /* @__PURE__ */ _react2.default.createElement(Wrapper, null, children) : /* @__PURE__ */ _react2.default.createElement(_react2.default.Fragment, null, children);
|
|
17
|
+
};
|
|
18
|
+
exports.ConditionalWrapperBS = ConditionalWrapperBS;
|
|
19
|
+
//# sourceMappingURL=chunk-O4EXBCND.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ConditionalWrapperBS.tsx"],"names":[],"mappings":";;;AAAA,OAAO,WAA6C;AAW7C,IAAM,uBAAiD,CAAC,EAAE,WAAW,UAAU,SAAS,QAAQ,MACrG,YAAY,oCAAC,eAAS,QAAS,IAAa,0DAAG,QAAS","sourcesContent":["import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapperBS: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(exports, "__esModule", {
|
|
31
|
+
value: true
|
|
32
|
+
});
|
|
33
|
+
function _interopRequireDefault(obj) {
|
|
34
|
+
return obj && obj.__esModule ? obj : {
|
|
35
|
+
default: obj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
"use client";
|
|
39
|
+
var _chunkQBXCCJ24js = require("./chunk-QBXCCJ24.js");
|
|
40
|
+
// src/components/HashLinkTargetBS.tsx
|
|
41
|
+
var _react = require("@chakra-ui/react");
|
|
42
|
+
var _react3 = require("react");
|
|
43
|
+
var _react4 = _interopRequireDefault(_react3);
|
|
44
|
+
var focusOnRelativeParentStyle = {
|
|
45
|
+
_focusWithin: {
|
|
46
|
+
position: "static",
|
|
47
|
+
boxShadow: "none",
|
|
48
|
+
"&::after": _object_spread({
|
|
49
|
+
content: '""',
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
height: "100%",
|
|
54
|
+
width: "100%",
|
|
55
|
+
pointerEvents: "none",
|
|
56
|
+
borderRadius: "0.25rem"
|
|
57
|
+
}, _chunkQBXCCJ24js.focusStyle)
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function HashLinkTargetBS(props) {
|
|
61
|
+
return /* @__PURE__ */ _react4.default.createElement(_react.Box, {
|
|
62
|
+
position: "relative",
|
|
63
|
+
css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
|
|
64
|
+
}, /* @__PURE__ */ _react4.default.createElement(_react.Box, {
|
|
65
|
+
id: props.id,
|
|
66
|
+
tabIndex: props.focusOnParent ? -1 : void 0,
|
|
67
|
+
position: "absolute",
|
|
68
|
+
top: "-".concat(props.spaceAbove || "2.5rem"),
|
|
69
|
+
_focus: {
|
|
70
|
+
boxShadow: "none !important"
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
exports.HashLinkTargetBS = HashLinkTargetBS;
|
|
75
|
+
//# sourceMappingURL=chunk-PLWK7HEC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/HashLinkTargetBS.tsx"],"names":[],"mappings":";;;;;;AAAA,SAAS,WAAW;AACpB,OAAO,WAAW;AAelB,IAAM,6BAA6B;AAAA,EACjC,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,eAAe;AAAA,MACf,cAAc;AAAA,MACd,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAKO,SAAS,iBAAiB,OAAc;AAC7C,SACE,oCAAC,OAAI,UAAS,YAAW,KAAK,MAAM,gBAAgB,6BAA6B,UAC/E;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,MAAM;AAAA,MACV,UAAU,MAAM,gBAAgB,KAAK;AAAA,MACrC,UAAS;AAAA,MACT,KAAK,IAAI,MAAM,cAAc,QAAQ;AAAA,MACrC,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA;AAAA,EACF,CACF;AAEJ","sourcesContent":["import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTargetBS(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
biblioteksentralenChakraTheme
|
|
4
|
+
} from "./chunk-5GJBW3WE.mjs";
|
|
5
|
+
|
|
6
|
+
// src/components/BiblioteksentralenProvider.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { ChakraProvider, createSystem, defaultConfig } from "@chakra-ui/react";
|
|
9
|
+
import { ColorModeProvider } from "@chakra-ui/system";
|
|
10
|
+
var BiblioteksentralenProvider = (props) => /* @__PURE__ */ React.createElement(ChakraProvider, { value: createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ React.createElement(ColorModeProvider, { ...props }));
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
BiblioteksentralenProvider
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=chunk-PQLTQYZ3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/BiblioteksentralenProvider.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n"],"mappings":";;;;;;AAAA,OAAO,WAA0B;AACjC,SAAS,gBAAgB,cAAc,qBAAmC;AAE1E,SAAS,yBAAyB;AAO3B,IAAM,6BAA6B,CAAC,UACzC,oCAAC,kBAAe,OAAO,aAAa,eAAe,+BAA+B,MAAM,eAAe,CAAC,CAAC,KACvG,oCAAC,qBAAmB,GAAG,OAAO,CAChC;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
"use client";
|
|
6
|
+
// ../utils/dist/index.mjs
|
|
7
|
+
var _format = require("date-fns/format");
|
|
8
|
+
var _nb = require("date-fns/locale/nb");
|
|
9
|
+
var colors = {
|
|
10
|
+
black: "#000000",
|
|
11
|
+
grey90: "#181818",
|
|
12
|
+
grey80: "#333333",
|
|
13
|
+
grey60: "#585858",
|
|
14
|
+
grey45: "#8c8c8c",
|
|
15
|
+
grey30: "#b2b2b2",
|
|
16
|
+
grey15: "#d9d9d9",
|
|
17
|
+
grey10: "#e5e5e5",
|
|
18
|
+
grey05: "#f2f2f2",
|
|
19
|
+
white: "#ffffff",
|
|
20
|
+
bsRødDark: "#870010",
|
|
21
|
+
bsRødMedium: "#d53d40",
|
|
22
|
+
accentPurple: "#331433",
|
|
23
|
+
accentPeach: "#ffba99",
|
|
24
|
+
accentGreen: "#003b29",
|
|
25
|
+
accentBlueDark: "#001740",
|
|
26
|
+
accentBlueMedium: "#5996de",
|
|
27
|
+
accentYellow: "#ffc970",
|
|
28
|
+
lightBlue: "#dbe8ef",
|
|
29
|
+
lightGreen: "#dbe0db",
|
|
30
|
+
lightPeach: "#f4e7de",
|
|
31
|
+
lightPurple: "#ece8f3",
|
|
32
|
+
statusRed: "#ad313c",
|
|
33
|
+
statusYellow: "#bc5600",
|
|
34
|
+
statusGreen: "#24845b",
|
|
35
|
+
statusGreenLight: "#edf4f1",
|
|
36
|
+
statusRedLight: "#f8efef",
|
|
37
|
+
statusYellowLight: "#fff6e4",
|
|
38
|
+
neptune: {
|
|
39
|
+
"100": "#CFE6E8",
|
|
40
|
+
"200": "#9FCDD2",
|
|
41
|
+
"300": "#6FB5BB",
|
|
42
|
+
"400": "#3F9CA5",
|
|
43
|
+
"500": "#0F838E",
|
|
44
|
+
"600": "#0C6972",
|
|
45
|
+
"700": "#094F55",
|
|
46
|
+
"800": "#063439",
|
|
47
|
+
"900": "#031A1C"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function isDevelopment() {
|
|
51
|
+
return process.env.NODE_ENV === "development";
|
|
52
|
+
}
|
|
53
|
+
exports.colors = colors;
|
|
54
|
+
exports.isDevelopment = isDevelopment;
|
|
55
|
+
//# sourceMappingURL=chunk-QAW4IRLI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts"],"names":[],"mappings":";;;AAAA,SAAS,cAAc;AACvB,SAAS,UAAU;ACDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;EACT;AACF;ACxCO,SAAS,gBAAyB;AACvC,SAAO,QAAQ,IAAI,aAAa;AAClC","sourcesContent":["import { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\n\nexport function formaterDato(dato?: string, dateFnsformat = \"Pp\") {\n if (typeof dato !== \"string\") return \"Ukjent dato\";\n\n try {\n return format(new Date(dato), dateFnsformat, { locale: nb });\n } catch (e) {\n console.error(\"Kunne ikke formattere dato:\" + dato, e);\n return dato;\n }\n}\n","export const colors = {\n black: \"#000000\",\n grey90: \"#181818\",\n grey80: \"#333333\",\n grey60: \"#585858\",\n grey45: \"#8c8c8c\",\n grey30: \"#b2b2b2\",\n grey15: \"#d9d9d9\",\n grey10: \"#e5e5e5\",\n grey05: \"#f2f2f2\",\n white: \"#ffffff\",\n bsRødDark: \"#870010\",\n bsRødMedium: \"#d53d40\",\n accentPurple: \"#331433\",\n accentPeach: \"#ffba99\",\n accentGreen: \"#003b29\",\n accentBlueDark: \"#001740\",\n accentBlueMedium: \"#5996de\",\n accentYellow: \"#ffc970\",\n lightBlue: \"#dbe8ef\",\n lightGreen: \"#dbe0db\",\n lightPeach: \"#f4e7de\",\n lightPurple: \"#ece8f3\",\n statusRed: \"#ad313c\",\n statusYellow: \"#bc5600\",\n statusGreen: \"#24845b\",\n statusGreenLight: \"#edf4f1\",\n statusRedLight: \"#f8efef\",\n statusYellowLight: \"#fff6e4\",\n neptune: {\n \"100\": \"#CFE6E8\",\n \"200\": \"#9FCDD2\",\n \"300\": \"#6FB5BB\",\n \"400\": \"#3F9CA5\",\n \"500\": \"#0F838E\",\n \"600\": \"#0C6972\",\n \"700\": \"#094F55\",\n \"800\": \"#063439\",\n \"900\": \"#031A1C\",\n },\n};\n","export function isDevelopment(): boolean {\n return process.env.NODE_ENV === \"development\";\n}\n\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\nexport function isServer(): boolean {\n return !isClient();\n}\n"]}
|