@biblioteksentralen/react 4.0.0-beta.2 → 4.0.0-beta.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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -339,7 +339,7 @@ var InputBS = function(props) {
|
|
|
339
339
|
var formLabel = /* @__PURE__ */ _react4.default.createElement(_react.Field.Label, _object_spread({}, labelProps), label);
|
|
340
340
|
return /* @__PURE__ */ _react4.default.createElement(_react.Field.Root, {
|
|
341
341
|
invalid: !!errorMessage
|
|
342
|
-
}, hideLabel ? /* @__PURE__ */ _react4.default.createElement(_react.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ _react4.default.createElement(
|
|
342
|
+
}, hideLabel ? /* @__PURE__ */ _react4.default.createElement(_react.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ _react4.default.createElement(_react.Field.HelperText, null, helperText), /* @__PURE__ */ _react4.default.createElement(_react.Input, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ _react4.default.createElement(_react.Field.ErrorText, null, errorMessage));
|
|
343
343
|
};
|
|
344
344
|
// src/components/ConditionalWrapperBS.tsx
|
|
345
345
|
var ConditionalWrapperBS = function(param) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.js","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/components/HashLinkTargetBS.tsx","../src/components/withErrorBoundaryBS.tsx","../src/components/BiblioteksentralenProvider.tsx"],"names":["Object","defineProperty","exports","value","_interopRequireDefault","obj","__esModule","default","_optionalChain","ops","lastAccessLHS","undefined","i","length","op","fn","args","call","_format","require","_nb","colors","black","grey90","grey80","grey60","grey45","grey30","grey15","grey10","grey05","white","bsRødDark","bsRødMedium","accentPurple","accentPeach","accentGreen","accentBlueDark","accentBlueMedium","accentYellow","lightBlue","lightGreen","lightPeach","lightPurple","statusRed","statusYellow","statusGreen","statusGreenLight","statusRedLight","statusYellowLight","neptune","isDevelopment","process","env","NODE_ENV","_react","_react3","_react4","_reactfeather","colorLookup","info","bg","color","warning","success","error","iconLookup","createElement","Info","strokeWidth","role","AlertCircle","CheckCircle","XCircle","variantStyles","inline","borderColor","backgroundColor","padding","AlertBS","status","children","variant","header","rest","Alert","Root","fontSize","border","display","flexWrap","Indicator","marginX","Content","Title","Description","ButtonBS","Button","IconButtonBS","IconButton","InputBS","props","labelProps","label","helperText","errorMessage","hideLabel","inputProps","formLabel","React","Field","Label","invalid","VisuallyHidden","FieldHelperText","Input","FieldErrorText","ConditionalWrapperBS","condition","wrapper","Wrapper","Fragment","StyledPre","Box","as","paddingTop","wordBreak","whiteSpace","ErrorBoundaryBS","state","hasError","componentDidCatch","errorInfo","setState","console","boundaryName","render","stackTrace","_","_2","_3","componentStack","errormsg","_4","_5","_6","message","getDerivedStateFromError","Component","variants","primary","_hover","secondary","tertiary","defaultConfig","_7","theme","_8","recipes","_9","button","_10","_11","ButtonStyles","defineRecipe","base","borderWidth","fontWeight","_disabled","opacity","size","sm","h","px","textStyle","md","lg","defaultVariants","variants2","subtle","_light","_dark","outline","flushed","_placeholder","animationDuration","container","xl","sizes","variants3","plain","textDecoration","textDecorationColor","underline","_focus","tokens","defineTokens","globalHyphens","hyphens","hyphenateLimitChars","focusStyle","boxShadow","transition","biblioteksentralenChakraTheme","defineConfig","heading","HeadingStyles","input","InputStyles","link","LinkStyles","ContainerStyles","spinner","SpinnerStyles","globalCss","html","scrollBehavior","body","focusOnRelativeParentStyle","_focusWithin","position","content","top","left","height","width","pointerEvents","borderRadius","HashLinkTargetBS","css","focusOnParent","id","tabIndex","spaceAbove","withErrorBoundaryBS","_system","BiblioteksentralenProvider","ChakraProvider","createSystem","customTheme","ColorModeProvider"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAAC,cAAA,CAAAC,SAAA,cAAA;IAAAC,OAAA;AAAA;AAAA,SAAAC,uBAAAC,GAAA;IAAA,OAAAA,OAAAA,IAAAC,UAAA,GAAAD,MAAA;QAAAE,SAAAF;IAAA;AAAA;AAAA,SAAAG,eAAAC,GAAA;IAAA,IAAAC,gBAAAC;IAAA,IAAAR,QAAAM,GAAA,CAAA,EAAA;IAAA,IAAAG,IAAA;IAAA,MAAAA,IAAAH,IAAAI,MAAA,CAAA;QAAA,IAAAC,KAAAL,GAAA,CAAAG,EAAA;QAAA,IAAAG,KAAAN,GAAA,CAAAG,IAAA,EAAA;QAAAA,KAAA;QAAA,IAAA,AAAAE,CAAAA,OAAA,oBAAAA,OAAA,cAAA,KAAAX,SAAA,MAAA;YAAA,OAAAQ;QAAA;QAAA,IAAAG,OAAA,YAAAA,OAAA,kBAAA;YAAAJ,gBAAAP;YAAAA,QAAAY,GAAAZ;QAAA,OAAA,IAAAW,OAAA,UAAAA,OAAA,gBAAA;gBAAAX;YAAAA,QAAAY,GAAA;iDAAAC;oB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obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\"use client\";\n\n// ../utils/dist/index.mjs\nvar _format = require('date-fns/format');\nvar _nb = require('date-fns/locale/nb');\nvar 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\\u00F8dDark: \"#870010\",\n bsR\\u00F8dMedium: \"#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};\nfunction isDevelopment() {\n return process.env.NODE_ENV === \"development\";\n}\n\n// src/components/AlertBS.tsx\nvar _react = require('@chakra-ui/react');\nvar _react3 = require('react'); var _react4 = _interopRequireDefault(_react3);\nvar _reactfeather = require('react-feather');\nvar colorLookup = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed }\n};\nvar iconLookup = {\n info: /* @__PURE__ */ _react4.default.createElement(_reactfeather.Info, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Informasjon\" }),\n warning: /* @__PURE__ */ _react4.default.createElement(_reactfeather.AlertCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Advarsel\" }),\n success: /* @__PURE__ */ _react4.default.createElement(_reactfeather.CheckCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Suksess\" }),\n error: /* @__PURE__ */ _react4.default.createElement(_reactfeather.XCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Feil\" })\n};\nvar variantStyles = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\"\n }\n};\nfunction AlertBS({ status, children, variant, header, ...rest }) {\n const colors2 = colorLookup[status];\n return /* @__PURE__ */ _react4.default.createElement(\n _react.Alert.Root,\n {\n status,\n fontSize: \"md\",\n border: `0.1rem solid`,\n borderColor: colors2.color,\n backgroundColor: colors2.bg,\n display: \"flex\",\n flexWrap: \"wrap\",\n ...variant === \"inline\" ? variantStyles[variant] : {},\n ...rest\n },\n /* @__PURE__ */ _react4.default.createElement(_react.Alert.Indicator, { marginX: \"auto\" }, iconLookup[status]),\n /* @__PURE__ */ _react4.default.createElement(_react.Alert.Content, { color: \"black\" }, header && /* @__PURE__ */ _react4.default.createElement(_react.Alert.Title, null, header), /* @__PURE__ */ _react4.default.createElement(_react.Alert.Description, null, children))\n );\n}\n\n// src/components/ButtonBS.tsx\n\nvar ButtonBS = _react.Button;\n\n// src/components/IconButtonBS.tsx\n\nvar IconButtonBS = _react.IconButton;\n\n// src/components/InputBS.tsx\n\n\nvar InputBS = (props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n const formLabel = /* @__PURE__ */ _react4.default.createElement(_react.Field.Label, { ...labelProps }, label);\n return /* @__PURE__ */ _react4.default.createElement(_react.Field.Root, { invalid: !!errorMessage }, hideLabel ? /* @__PURE__ */ _react4.default.createElement(_react.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ _react4.default.createElement(FieldHelperText, null, helperText), /* @__PURE__ */ _react4.default.createElement(_react.Input, { ...inputProps }), errorMessage && /* @__PURE__ */ _react4.default.createElement(FieldErrorText, null, errorMessage));\n};\n\n// src/components/ConditionalWrapperBS.tsx\n\nvar ConditionalWrapperBS = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ _react4.default.createElement(Wrapper, null, children) : /* @__PURE__ */ _react4.default.createElement(_react4.default.Fragment, null, children);\n\n// src/components/ErrorBoundaryBS.tsx\n\n\nvar StyledPre = (props) => /* @__PURE__ */ _react4.default.createElement(_react.Box, { as: \"pre\", paddingTop: \"0.5rem\", wordBreak: \"break-all\", whiteSpace: \"pre-wrap\", fontSize: \"0.8rem\", ...props });\nvar ErrorBoundaryBS = class extends _react4.default.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n static getDerivedStateFromError(error) {\n return { hasError: true };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n render() {\n if (this.state.hasError) {\n const stackTrace = _optionalChain([this, 'access', _ => _.state, 'access', _2 => _2.errorInfo, 'optionalAccess', _3 => _3.componentStack]);\n const errormsg = _optionalChain([this, 'access', _4 => _4.state, 'access', _5 => _5.error, 'optionalAccess', _6 => _6.message]);\n const info = this.props.boundaryName;\n return /* @__PURE__ */ _react4.default.createElement(\"div\", null, /* @__PURE__ */ _react4.default.createElement(AlertBS, { status: \"error\" }, /* @__PURE__ */ _react4.default.createElement(\"p\", null, \"Beklager, det skjedde en teknisk feil.\"), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ _react4.default.createElement(\"div\", null, /* @__PURE__ */ _react4.default.createElement(StyledPre, null, errormsg || \"\"), /* @__PURE__ */ _react4.default.createElement(StyledPre, null, info || \"\"), /* @__PURE__ */ _react4.default.createElement(StyledPre, null, stackTrace || \"\"))));\n }\n return this.props.children;\n }\n};\n\n// src/components/HashLinkTargetBS.tsx\n\n\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\n\n\n// src/styles/chakraTheme/ButtonStyles.ts\n\nvar variants = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\"\n }\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ..._optionalChain([_react.defaultConfig, 'access', _7 => _7.theme, 'optionalAccess', _8 => _8.recipes, 'optionalAccess', _9 => _9.button, 'optionalAccess', _10 => _10.variants, 'optionalAccess', _11 => _11.variant])\n};\nvar ButtonStyles = _react.defineRecipe.call(void 0, {\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1\n }\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\"\n },\n md: {\n textStyle: \"md\"\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\"\n }\n }\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\"\n }\n});\n\n// src/styles/chakraTheme/ContainerStyles.ts\n\nvar ContainerStyles = _react.defineRecipe.call(void 0, {\n base: {\n px: \".75rem\"\n // Padding left/right\n }\n});\n\n// src/styles/chakraTheme/HeadingStyles.ts\n\nvar HeadingStyles = _react.defineRecipe.call(void 0, {\n base: {\n fontWeight: \"600\"\n }\n});\n\n// src/styles/chakraTheme/InputStyles.ts\n\nvar variants2 = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" }\n }\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n }\n};\nvar InputStyles = _react.defineRecipe.call(void 0, {\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" }\n }\n },\n variants: {\n variant: variants2\n },\n defaultVariants: {\n variant: \"subtle\"\n }\n});\n\n// src/styles/chakraTheme/SpinnerStyles.ts\n\nvar SpinnerStyles = _react.defineRecipe.call(void 0, {\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\"\n }\n});\n\n// src/styles/chakraTheme/sizes.ts\nvar container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" },\n // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" }\n};\nvar sizes = {\n container\n};\n\n// src/styles/chakraTheme/LinkStyles.ts\n\nvar variants3 = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\"\n }\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\"\n }\n }\n};\nvar LinkStyles = _react.defineRecipe.call(void 0, {\n base: {\n _focus: {\n outline: \"none\"\n }\n },\n variants: {\n variant: variants3\n },\n defaultVariants: {\n variant: \"underline\"\n }\n});\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nvar tokens = _react.defineTokens.call(void 0, {\n sizes\n});\nvar globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\"\n // minimum word-length / min letters first line / min letters second line\n};\nvar focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\"\n // Transition makes the newly focused element \"pop in\" and easier to spot\n};\nvar biblioteksentralenChakraTheme = _react.defineConfig.call(void 0, {\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles\n }\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" }\n },\n body: {\n ...globalHyphens\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle\n }\n});\n\n// src/components/HashLinkTargetBS.tsx\nvar 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};\nfunction HashLinkTargetBS(props) {\n return /* @__PURE__ */ _react4.default.createElement(_react.Box, { position: \"relative\", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ _react4.default.createElement(\n _react.Box,\n {\n id: props.id,\n tabIndex: props.focusOnParent ? -1 : void 0,\n position: \"absolute\",\n top: `-${props.spaceAbove || \"2.5rem\"}`,\n _focus: {\n boxShadow: \"none !important\"\n }\n }\n ));\n}\n\n// src/components/withErrorBoundaryBS.tsx\n\nvar withErrorBoundaryBS = (Component, boundaryName) => {\n return (props) => /* @__PURE__ */ _react4.default.createElement(ErrorBoundaryBS, { boundaryName }, /* @__PURE__ */ _react4.default.createElement(Component, { ...props }));\n};\n\n// src/components/BiblioteksentralenProvider.tsx\n\n\nvar _system = require('@chakra-ui/system');\nvar BiblioteksentralenProvider = (props) => /* @__PURE__ */ _react4.default.createElement(_react.ChakraProvider, { value: _react.createSystem.call(void 0, _react.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ _react4.default.createElement(_system.ColorModeProvider, { ...props }));\n\n\n\n\n\n\n\n\n\n\nexports.AlertBS = AlertBS; exports.BiblioteksentralenProvider = BiblioteksentralenProvider; exports.ButtonBS = ButtonBS; exports.ConditionalWrapperBS = ConditionalWrapperBS; exports.ErrorBoundaryBS = ErrorBoundaryBS; exports.HashLinkTargetBS = HashLinkTargetBS; exports.IconButtonBS = IconButtonBS; exports.InputBS = InputBS; exports.withErrorBoundaryBS = withErrorBoundaryBS;\n","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","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","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","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\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 {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {helperText && <FieldHelperText>{helperText}</FieldHelperText>}\n <ChakraInput {...inputProps} />\n {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {errorMessage && <FieldErrorText>{errorMessage}</FieldErrorText>}\n </Field.Root>\n );\n};\n","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","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","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","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","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"]}
|
|
1
|
+
{"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.js","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/components/HashLinkTargetBS.tsx","../src/components/withErrorBoundaryBS.tsx","../src/components/BiblioteksentralenProvider.tsx"],"names":["Object","defineProperty","exports","value","_interopRequireDefault","obj","__esModule","default","_optionalChain","ops","lastAccessLHS","undefined","i","length","op","fn","args","call","_format","require","_nb","colors","black","grey90","grey80","grey60","grey45","grey30","grey15","grey10","grey05","white","bsRødDark","bsRødMedium","accentPurple","accentPeach","accentGreen","accentBlueDark","accentBlueMedium","accentYellow","lightBlue","lightGreen","lightPeach","lightPurple","statusRed","statusYellow","statusGreen","statusGreenLight","statusRedLight","statusYellowLight","neptune","isDevelopment","process","env","NODE_ENV","_react","_react3","_react4","_reactfeather","colorLookup","info","bg","color","warning","success","error","iconLookup","createElement","Info","strokeWidth","role","AlertCircle","CheckCircle","XCircle","variantStyles","inline","borderColor","backgroundColor","padding","AlertBS","status","children","variant","header","rest","Alert","Root","fontSize","border","display","flexWrap","Indicator","marginX","Content","Title","Description","ButtonBS","Button","IconButtonBS","IconButton","InputBS","props","labelProps","label","helperText","errorMessage","hideLabel","inputProps","formLabel","React","Field","Label","invalid","VisuallyHidden","HelperText","Input","ErrorText","ConditionalWrapperBS","condition","wrapper","Wrapper","Fragment","StyledPre","Box","as","paddingTop","wordBreak","whiteSpace","ErrorBoundaryBS","state","hasError","componentDidCatch","errorInfo","setState","console","boundaryName","render","stackTrace","_","_2","_3","componentStack","errormsg","_4","_5","_6","message","getDerivedStateFromError","Component","variants","primary","_hover","secondary","tertiary","defaultConfig","_7","theme","_8","recipes","_9","button","_10","_11","ButtonStyles","defineRecipe","base","borderWidth","fontWeight","_disabled","opacity","size","sm","h","px","textStyle","md","lg","defaultVariants","variants2","subtle","_light","_dark","outline","flushed","_placeholder","animationDuration","container","xl","sizes","variants3","plain","textDecoration","textDecorationColor","underline","_focus","tokens","defineTokens","globalHyphens","hyphens","hyphenateLimitChars","focusStyle","boxShadow","transition","biblioteksentralenChakraTheme","defineConfig","heading","HeadingStyles","input","InputStyles","link","LinkStyles","ContainerStyles","spinner","SpinnerStyles","globalCss","html","scrollBehavior","body","focusOnRelativeParentStyle","_focusWithin","position","content","top","left","height","width","pointerEvents","borderRadius","HashLinkTargetBS","css","focusOnParent","id","tabIndex","spaceAbove","withErrorBoundaryBS","_system","BiblioteksentralenProvider","ChakraProvider","createSystem","customTheme","ColorModeProvider"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAAC,cAAA,CAAAC,SAAA,cAAA;IAAAC,OAAA;AAAA;AAAA,SAAAC,uBAAAC,GAAA;IAAA,OAAAA,OAAAA,IAAAC,UAAA,GAAAD,MAAA;QAAAE,SAAAF;IAAA;AAAA;AAAA,SAAAG,eAAAC,GAAA;IAAA,IAAAC,gBAAAC;IAAA,IAAAR,QAAAM,GAAA,CAAA,EAAA;IAAA,IAAAG,IAAA;IAAA,MAAAA,IAAAH,IAAAI,MAAA,CAAA;QAAA,IAAAC,KAAAL,GAAA,CAAAG,EAAA;QAAA,IAAAG,KAAAN,G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wZWnG,QAAA6E,OAAA,GAAAA;AAAA7E,QAAA0O,0BAAA,GAAAA;AAAA1O,QAAA8F,QAAA,GAAAA;AAAA9F,QAAAmH,oBAAA,GAAAA;AAAAnH,QAAA8H,eAAA,GAAAA;AAAA9H,QAAAkO,gBAAA,GAAAA;AAAAlO,QAAAgG,YAAA,GAAAA;AAAAhG,QAAAkG,OAAA,GAAAA;AAAAlG,QAAAwO,mBAAA,GAAAA","sourcesContent":["\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\"use client\";\n\n// ../utils/dist/index.mjs\nvar _format = require('date-fns/format');\nvar _nb = require('date-fns/locale/nb');\nvar 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\\u00F8dDark: \"#870010\",\n bsR\\u00F8dMedium: \"#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};\nfunction isDevelopment() {\n return process.env.NODE_ENV === \"development\";\n}\n\n// src/components/AlertBS.tsx\nvar _react = require('@chakra-ui/react');\nvar _react3 = require('react'); var _react4 = _interopRequireDefault(_react3);\nvar _reactfeather = require('react-feather');\nvar colorLookup = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed }\n};\nvar iconLookup = {\n info: /* @__PURE__ */ _react4.default.createElement(_reactfeather.Info, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Informasjon\" }),\n warning: /* @__PURE__ */ _react4.default.createElement(_reactfeather.AlertCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Advarsel\" }),\n success: /* @__PURE__ */ _react4.default.createElement(_reactfeather.CheckCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Suksess\" }),\n error: /* @__PURE__ */ _react4.default.createElement(_reactfeather.XCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Feil\" })\n};\nvar variantStyles = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\"\n }\n};\nfunction AlertBS({ status, children, variant, header, ...rest }) {\n const colors2 = colorLookup[status];\n return /* @__PURE__ */ _react4.default.createElement(\n _react.Alert.Root,\n {\n status,\n fontSize: \"md\",\n border: `0.1rem solid`,\n borderColor: colors2.color,\n backgroundColor: colors2.bg,\n display: \"flex\",\n flexWrap: \"wrap\",\n ...variant === \"inline\" ? variantStyles[variant] : {},\n ...rest\n },\n /* @__PURE__ */ _react4.default.createElement(_react.Alert.Indicator, { marginX: \"auto\" }, iconLookup[status]),\n /* @__PURE__ */ _react4.default.createElement(_react.Alert.Content, { color: \"black\" }, header && /* @__PURE__ */ _react4.default.createElement(_react.Alert.Title, null, header), /* @__PURE__ */ _react4.default.createElement(_react.Alert.Description, null, children))\n );\n}\n\n// src/components/ButtonBS.tsx\n\nvar ButtonBS = _react.Button;\n\n// src/components/IconButtonBS.tsx\n\nvar IconButtonBS = _react.IconButton;\n\n// src/components/InputBS.tsx\n\n\nvar InputBS = (props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n const formLabel = /* @__PURE__ */ _react4.default.createElement(_react.Field.Label, { ...labelProps }, label);\n return /* @__PURE__ */ _react4.default.createElement(_react.Field.Root, { invalid: !!errorMessage }, hideLabel ? /* @__PURE__ */ _react4.default.createElement(_react.VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ _react4.default.createElement(_react.Field.HelperText, null, helperText), /* @__PURE__ */ _react4.default.createElement(_react.Input, { ...inputProps }), errorMessage && /* @__PURE__ */ _react4.default.createElement(_react.Field.ErrorText, null, errorMessage));\n};\n\n// src/components/ConditionalWrapperBS.tsx\n\nvar ConditionalWrapperBS = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ _react4.default.createElement(Wrapper, null, children) : /* @__PURE__ */ _react4.default.createElement(_react4.default.Fragment, null, children);\n\n// src/components/ErrorBoundaryBS.tsx\n\n\nvar StyledPre = (props) => /* @__PURE__ */ _react4.default.createElement(_react.Box, { as: \"pre\", paddingTop: \"0.5rem\", wordBreak: \"break-all\", whiteSpace: \"pre-wrap\", fontSize: \"0.8rem\", ...props });\nvar ErrorBoundaryBS = class extends _react4.default.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n static getDerivedStateFromError(error) {\n return { hasError: true };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n render() {\n if (this.state.hasError) {\n const stackTrace = _optionalChain([this, 'access', _ => _.state, 'access', _2 => _2.errorInfo, 'optionalAccess', _3 => _3.componentStack]);\n const errormsg = _optionalChain([this, 'access', _4 => _4.state, 'access', _5 => _5.error, 'optionalAccess', _6 => _6.message]);\n const info = this.props.boundaryName;\n return /* @__PURE__ */ _react4.default.createElement(\"div\", null, /* @__PURE__ */ _react4.default.createElement(AlertBS, { status: \"error\" }, /* @__PURE__ */ _react4.default.createElement(\"p\", null, \"Beklager, det skjedde en teknisk feil.\"), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ _react4.default.createElement(\"div\", null, /* @__PURE__ */ _react4.default.createElement(StyledPre, null, errormsg || \"\"), /* @__PURE__ */ _react4.default.createElement(StyledPre, null, info || \"\"), /* @__PURE__ */ _react4.default.createElement(StyledPre, null, stackTrace || \"\"))));\n }\n return this.props.children;\n }\n};\n\n// src/components/HashLinkTargetBS.tsx\n\n\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\n\n\n// src/styles/chakraTheme/ButtonStyles.ts\n\nvar variants = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\"\n }\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ..._optionalChain([_react.defaultConfig, 'access', _7 => _7.theme, 'optionalAccess', _8 => _8.recipes, 'optionalAccess', _9 => _9.button, 'optionalAccess', _10 => _10.variants, 'optionalAccess', _11 => _11.variant])\n};\nvar ButtonStyles = _react.defineRecipe.call(void 0, {\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1\n }\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\"\n },\n md: {\n textStyle: \"md\"\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\"\n }\n }\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\"\n }\n});\n\n// src/styles/chakraTheme/ContainerStyles.ts\n\nvar ContainerStyles = _react.defineRecipe.call(void 0, {\n base: {\n px: \".75rem\"\n // Padding left/right\n }\n});\n\n// src/styles/chakraTheme/HeadingStyles.ts\n\nvar HeadingStyles = _react.defineRecipe.call(void 0, {\n base: {\n fontWeight: \"600\"\n }\n});\n\n// src/styles/chakraTheme/InputStyles.ts\n\nvar variants2 = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" }\n }\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n }\n};\nvar InputStyles = _react.defineRecipe.call(void 0, {\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" }\n }\n },\n variants: {\n variant: variants2\n },\n defaultVariants: {\n variant: \"subtle\"\n }\n});\n\n// src/styles/chakraTheme/SpinnerStyles.ts\n\nvar SpinnerStyles = _react.defineRecipe.call(void 0, {\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\"\n }\n});\n\n// src/styles/chakraTheme/sizes.ts\nvar container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" },\n // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" }\n};\nvar sizes = {\n container\n};\n\n// src/styles/chakraTheme/LinkStyles.ts\n\nvar variants3 = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\"\n }\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\"\n }\n }\n};\nvar LinkStyles = _react.defineRecipe.call(void 0, {\n base: {\n _focus: {\n outline: \"none\"\n }\n },\n variants: {\n variant: variants3\n },\n defaultVariants: {\n variant: \"underline\"\n }\n});\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nvar tokens = _react.defineTokens.call(void 0, {\n sizes\n});\nvar globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\"\n // minimum word-length / min letters first line / min letters second line\n};\nvar focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\"\n // Transition makes the newly focused element \"pop in\" and easier to spot\n};\nvar biblioteksentralenChakraTheme = _react.defineConfig.call(void 0, {\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles\n }\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" }\n },\n body: {\n ...globalHyphens\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle\n }\n});\n\n// src/components/HashLinkTargetBS.tsx\nvar 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};\nfunction HashLinkTargetBS(props) {\n return /* @__PURE__ */ _react4.default.createElement(_react.Box, { position: \"relative\", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ _react4.default.createElement(\n _react.Box,\n {\n id: props.id,\n tabIndex: props.focusOnParent ? -1 : void 0,\n position: \"absolute\",\n top: `-${props.spaceAbove || \"2.5rem\"}`,\n _focus: {\n boxShadow: \"none !important\"\n }\n }\n ));\n}\n\n// src/components/withErrorBoundaryBS.tsx\n\nvar withErrorBoundaryBS = (Component, boundaryName) => {\n return (props) => /* @__PURE__ */ _react4.default.createElement(ErrorBoundaryBS, { boundaryName }, /* @__PURE__ */ _react4.default.createElement(Component, { ...props }));\n};\n\n// src/components/BiblioteksentralenProvider.tsx\n\n\nvar _system = require('@chakra-ui/system');\nvar BiblioteksentralenProvider = (props) => /* @__PURE__ */ _react4.default.createElement(_react.ChakraProvider, { value: _react.createSystem.call(void 0, _react.defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ _react4.default.createElement(_system.ColorModeProvider, { ...props }));\n\n\n\n\n\n\n\n\n\n\nexports.AlertBS = AlertBS; exports.BiblioteksentralenProvider = BiblioteksentralenProvider; exports.ButtonBS = ButtonBS; exports.ConditionalWrapperBS = ConditionalWrapperBS; exports.ErrorBoundaryBS = ErrorBoundaryBS; exports.HashLinkTargetBS = HashLinkTargetBS; exports.IconButtonBS = IconButtonBS; exports.InputBS = InputBS; exports.withErrorBoundaryBS = withErrorBoundaryBS;\n","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","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","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","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\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 {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","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","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","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","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","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"]}
|
package/dist/index.mjs
CHANGED
|
@@ -280,7 +280,7 @@ var InputBS = function(props) {
|
|
|
280
280
|
var formLabel = /* @__PURE__ */ React2.createElement(Field.Label, _object_spread({}, labelProps), label);
|
|
281
281
|
return /* @__PURE__ */ React2.createElement(Field.Root, {
|
|
282
282
|
invalid: !!errorMessage
|
|
283
|
-
}, hideLabel ? /* @__PURE__ */ React2.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ React2.createElement(
|
|
283
|
+
}, hideLabel ? /* @__PURE__ */ React2.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ React2.createElement(Field.HelperText, null, helperText), /* @__PURE__ */ React2.createElement(ChakraInput, _object_spread({}, inputProps)), errorMessage && /* @__PURE__ */ React2.createElement(Field.ErrorText, null, errorMessage));
|
|
284
284
|
};
|
|
285
285
|
// src/components/ConditionalWrapperBS.tsx
|
|
286
286
|
import React3 from "react";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.mjs","../src/styles/chakraTheme/ButtonStyles.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/components/HashLinkTargetBS.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/components/withErrorBoundaryBS.tsx","../src/components/BiblioteksentralenProvider.tsx"],"names":["defaultConfig","format","nb","colors","black","grey90","grey80","grey60","grey45","grey30","grey15","grey10","grey05","white","bsRødDark","bsRødMedium","accentPurple","accentPeach","accentGreen","accentBlueDark","accentBlueMedium","accentYellow","lightBlue","lightGreen","lightPeach","lightPurple","statusRed","statusYellow","statusGreen","statusGreenLight","statusRedLight","statusYellowLight","neptune","isDevelopment","process","env","NODE_ENV","Alert","ChakraAlert","React","AlertCircle","CheckCircle","Info","XCircle","colorLookup","info","bg","color","warning","success","error","iconLookup","createElement","strokeWidth","role","variantStyles","inline","borderColor","backgroundColor","padding","AlertBS","status","children","variant","header","rest","Root","fontSize","border","display","flexWrap","Indicator","marginX","Content","Title","Description","Button","ChakraButton","ButtonBS","IconButton","ChakraIconButton","IconButtonBS","Input","ChakraInput","Field","VisuallyHidden","InputBS","props","labelProps","label","helperText","errorMessage","hideLabel","inputProps","formLabel","Label","invalid","FieldHelperText","FieldErrorText","ConditionalWrapperBS","condition","wrapper","Wrapper","Fragment","Box","StyledPre","as","paddingTop","wordBreak","whiteSpace","ErrorBoundaryBS","state","hasError","componentDidCatch","errorInfo","setState","console","boundaryName","render","stackTrace","componentStack","errormsg","message","getDerivedStateFromError","Component","defineConfig","defineTokens","defineRecipe","variants","primary","_hover","secondary","tertiary","theme","recipes","button","ButtonStyles","base","borderWidth","fontWeight","_disabled","opacity","size","sm","h","px","textStyle","md","lg","defaultVariants","ContainerStyles","HeadingStyles","subtle","_light","_dark","outline","flushed","InputStyles","_placeholder","SpinnerStyles","animationDuration","container","value","xl","sizes","plain","textDecoration","textDecorationColor","underline","LinkStyles","_focus","tokens","globalHyphens","hyphens","hyphenateLimitChars","focusStyle","boxShadow","transition","biblioteksentralenChakraTheme","heading","input","link","spinner","globalCss","html","scrollBehavior","body","focusOnRelativeParentStyle","_focusWithin","position","content","top","left","height","width","pointerEvents","borderRadius","HashLinkTargetBS","css","focusOnParent","id","tabIndex","spaceAbove","withErrorBoundaryBS","ChakraProvider","createSystem","ColorModeProvider","BiblioteksentralenProvider","customTheme"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IC8BKA,8CAAAA,qCAAAA,8BAAAA;AD5BL,0BAA0B;AEF1B,SAASC,MAAA,QAAc,kBAAA;AACvB,SAASC,EAAA,QAAU,qBAAA;ACDZ,IAAMC,SAAS;IACpBC,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,aAAa;IACbC,cAAc;IACdC,aAAa;IACbC,aAAa;IACbC,gBAAgB;IAChBC,kBAAkB;IAClBC,cAAc;IACdC,WAAW;IACXC,YAAY;IACZC,YAAY;IACZC,aAAa;IACbC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbC,kBAAkB;IAClBC,gBAAgB;IAChBC,mBAAmB;IACnBC,SAAS;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;IACT;AACF;ACxCO,SAASC;IACd,OAAOC,QAAQC,GAAA,CAAIC,QAAA,KAAa;AAClC;AJgDA,6BAA6B;AKhD7B,SAAyBC,SAASC,WAAA,QAAsC,mBAAA;AACxE,OAAOC,WA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UlH,MAAMgH,aAAA,GAAgB,CAAA,IAAK,KAAA;QACrCV,UAAS;QACTE,KAAK,IAAgC,OAA5BxG,MAAMmH,UAAA,IAAc;QAC7BhC,QAAQ;YACNM,WAAW;QACb;IAAA;AAIR;AX0VA,yCAAyC;AmB7YzC,OAAOzI,YAAW,QAAA;AAGX,IAAMoK,sBAAsB,SAAS/E,WAAuCP;IACjF,OAAO,SAAC9B;eACN,aAAA,GAAAhD,OAAAa,aAAA,CAAC0D,iBAAA;YAAgBO,cAAAA;QAAA,GACf,aAAA,GAAA9E,OAAAa,aAAA,CAACwE,WAAA,mBAAcrC;;AAGrB;AnB0YA,gDAAgD;AoBnZhD,OAAOhD,YAA0B,QAAA;AACjC,SAASqK,cAAA,EAAgBC,YAAA,EAAc7M,iBAAAA,cAAAA,QAAmC,mBAAA;AAE1E,SAAS8M,iBAAA,QAAyB,oBAAA;AAO3B,IAAMC,6BAA6B,SAACxH;WACzC,aAAA,GAAAhD,OAAAa,aAAA,CAACwJ,gBAAA;QAAe1C,OAAO2C,aAAa7M,gBAAekL,+BAA+B3F,MAAMyH,WAAA,IAAe,CAAC;IAAC,GACvG,aAAA,GAAAzK,OAAAa,aAAA,CAAC0J,mBAAA,mBAAsBvH;;ApB4Y3B,SACE3B,OAAO,EACPmJ,0BAA0B,EAC1BjI,QAAQ,EACRqB,oBAAoB,EACpBW,eAAe,EACfuF,gBAAgB,EAChBpH,YAAY,EACZK,OAAO,EACPqH,mBAAmB,GACnB","sourcesContent":["\"use client\";\n\n// ../utils/dist/index.mjs\nimport { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\nvar 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\\u00F8dDark: \"#870010\",\n bsR\\u00F8dMedium: \"#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};\nfunction isDevelopment() {\n return process.env.NODE_ENV === \"development\";\n}\n\n// src/components/AlertBS.tsx\nimport { Alert as ChakraAlert } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\nvar colorLookup = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed }\n};\nvar iconLookup = {\n info: /* @__PURE__ */ React.createElement(Info, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Informasjon\" }),\n warning: /* @__PURE__ */ React.createElement(AlertCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Advarsel\" }),\n success: /* @__PURE__ */ React.createElement(CheckCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Suksess\" }),\n error: /* @__PURE__ */ React.createElement(XCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Feil\" })\n};\nvar variantStyles = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\"\n }\n};\nfunction AlertBS({ status, children, variant, header, ...rest }) {\n const colors2 = colorLookup[status];\n return /* @__PURE__ */ React.createElement(\n ChakraAlert.Root,\n {\n status,\n fontSize: \"md\",\n border: `0.1rem solid`,\n borderColor: colors2.color,\n backgroundColor: colors2.bg,\n display: \"flex\",\n flexWrap: \"wrap\",\n ...variant === \"inline\" ? variantStyles[variant] : {},\n ...rest\n },\n /* @__PURE__ */ React.createElement(ChakraAlert.Indicator, { marginX: \"auto\" }, iconLookup[status]),\n /* @__PURE__ */ React.createElement(ChakraAlert.Content, { color: \"black\" }, header && /* @__PURE__ */ React.createElement(ChakraAlert.Title, null, header), /* @__PURE__ */ React.createElement(ChakraAlert.Description, null, children))\n );\n}\n\n// src/components/ButtonBS.tsx\nimport { Button as ChakraButton } from \"@chakra-ui/react\";\nvar ButtonBS = ChakraButton;\n\n// src/components/IconButtonBS.tsx\nimport { IconButton as ChakraIconButton } from \"@chakra-ui/react\";\nvar IconButtonBS = ChakraIconButton;\n\n// src/components/InputBS.tsx\nimport { Input as ChakraInput, Field, VisuallyHidden } from \"@chakra-ui/react\";\nimport React2 from \"react\";\nvar InputBS = (props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n const formLabel = /* @__PURE__ */ React2.createElement(Field.Label, { ...labelProps }, label);\n return /* @__PURE__ */ React2.createElement(Field.Root, { invalid: !!errorMessage }, hideLabel ? /* @__PURE__ */ React2.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ React2.createElement(FieldHelperText, null, helperText), /* @__PURE__ */ React2.createElement(ChakraInput, { ...inputProps }), errorMessage && /* @__PURE__ */ React2.createElement(FieldErrorText, null, errorMessage));\n};\n\n// src/components/ConditionalWrapperBS.tsx\nimport React3 from \"react\";\nvar ConditionalWrapperBS = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ React3.createElement(Wrapper, null, children) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);\n\n// src/components/ErrorBoundaryBS.tsx\nimport { Box } from \"@chakra-ui/react\";\nimport React4 from \"react\";\nvar StyledPre = (props) => /* @__PURE__ */ React4.createElement(Box, { as: \"pre\", paddingTop: \"0.5rem\", wordBreak: \"break-all\", whiteSpace: \"pre-wrap\", fontSize: \"0.8rem\", ...props });\nvar ErrorBoundaryBS = class extends React4.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n static getDerivedStateFromError(error) {\n return { hasError: true };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n return /* @__PURE__ */ React4.createElement(\"div\", null, /* @__PURE__ */ React4.createElement(AlertBS, { status: \"error\" }, /* @__PURE__ */ React4.createElement(\"p\", null, \"Beklager, det skjedde en teknisk feil.\"), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ React4.createElement(\"div\", null, /* @__PURE__ */ React4.createElement(StyledPre, null, errormsg || \"\"), /* @__PURE__ */ React4.createElement(StyledPre, null, info || \"\"), /* @__PURE__ */ React4.createElement(StyledPre, null, stackTrace || \"\"))));\n }\n return this.props.children;\n }\n};\n\n// src/components/HashLinkTargetBS.tsx\nimport { Box as Box2 } from \"@chakra-ui/react\";\nimport React5 from \"react\";\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nimport { defineConfig, defineTokens } from \"@chakra-ui/react\";\n\n// src/styles/chakraTheme/ButtonStyles.ts\nimport { defaultConfig, defineRecipe } from \"@chakra-ui/react\";\nvar variants = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\"\n }\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant\n};\nvar ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1\n }\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\"\n },\n md: {\n textStyle: \"md\"\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\"\n }\n }\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\"\n }\n});\n\n// src/styles/chakraTheme/ContainerStyles.ts\nimport { defineRecipe as defineRecipe2 } from \"@chakra-ui/react\";\nvar ContainerStyles = defineRecipe2({\n base: {\n px: \".75rem\"\n // Padding left/right\n }\n});\n\n// src/styles/chakraTheme/HeadingStyles.ts\nimport { defineRecipe as defineRecipe3 } from \"@chakra-ui/react\";\nvar HeadingStyles = defineRecipe3({\n base: {\n fontWeight: \"600\"\n }\n});\n\n// src/styles/chakraTheme/InputStyles.ts\nimport { defineRecipe as defineRecipe4 } from \"@chakra-ui/react\";\nvar variants2 = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" }\n }\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n }\n};\nvar InputStyles = defineRecipe4({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" }\n }\n },\n variants: {\n variant: variants2\n },\n defaultVariants: {\n variant: \"subtle\"\n }\n});\n\n// src/styles/chakraTheme/SpinnerStyles.ts\nimport { defineRecipe as defineRecipe5 } from \"@chakra-ui/react\";\nvar SpinnerStyles = defineRecipe5({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\"\n }\n});\n\n// src/styles/chakraTheme/sizes.ts\nvar container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" },\n // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" }\n};\nvar sizes = {\n container\n};\n\n// src/styles/chakraTheme/LinkStyles.ts\nimport { defineRecipe as defineRecipe6 } from \"@chakra-ui/react\";\nvar variants3 = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\"\n }\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\"\n }\n }\n};\nvar LinkStyles = defineRecipe6({\n base: {\n _focus: {\n outline: \"none\"\n }\n },\n variants: {\n variant: variants3\n },\n defaultVariants: {\n variant: \"underline\"\n }\n});\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nvar tokens = defineTokens({\n sizes\n});\nvar globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\"\n // minimum word-length / min letters first line / min letters second line\n};\nvar focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\"\n // Transition makes the newly focused element \"pop in\" and easier to spot\n};\nvar biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles\n }\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" }\n },\n body: {\n ...globalHyphens\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle\n }\n});\n\n// src/components/HashLinkTargetBS.tsx\nvar 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};\nfunction HashLinkTargetBS(props) {\n return /* @__PURE__ */ React5.createElement(Box2, { position: \"relative\", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ React5.createElement(\n Box2,\n {\n id: props.id,\n tabIndex: props.focusOnParent ? -1 : void 0,\n position: \"absolute\",\n top: `-${props.spaceAbove || \"2.5rem\"}`,\n _focus: {\n boxShadow: \"none !important\"\n }\n }\n ));\n}\n\n// src/components/withErrorBoundaryBS.tsx\nimport React6 from \"react\";\nvar withErrorBoundaryBS = (Component, boundaryName) => {\n return (props) => /* @__PURE__ */ React6.createElement(ErrorBoundaryBS, { boundaryName }, /* @__PURE__ */ React6.createElement(Component, { ...props }));\n};\n\n// src/components/BiblioteksentralenProvider.tsx\nimport React7 from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig as defaultConfig2 } from \"@chakra-ui/react\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\nvar BiblioteksentralenProvider = (props) => /* @__PURE__ */ React7.createElement(ChakraProvider, { value: createSystem(defaultConfig2, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ React7.createElement(ColorModeProvider, { ...props }));\nexport {\n AlertBS,\n BiblioteksentralenProvider,\n ButtonBS,\n ConditionalWrapperBS,\n ErrorBoundaryBS,\n HashLinkTargetBS,\n IconButtonBS,\n InputBS,\n withErrorBoundaryBS\n};\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","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","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","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","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\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 {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {helperText && <FieldHelperText>{helperText}</FieldHelperText>}\n <ChakraInput {...inputProps} />\n {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {errorMessage && <FieldErrorText>{errorMessage}</FieldErrorText>}\n </Field.Root>\n );\n};\n","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","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","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","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"]}
|
|
1
|
+
{"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.mjs","../src/styles/chakraTheme/ButtonStyles.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/components/HashLinkTargetBS.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/components/withErrorBoundaryBS.tsx","../src/components/BiblioteksentralenProvider.tsx"],"names":["defaultConfig","format","nb","colors","black","grey90","grey80","grey60","grey45","grey30","grey15","grey10","grey05","white","bsRødDark","bsRødMedium","accentPurple","accentPeach","accentGreen","accentBlueDark","accentBlueMedium","accentYellow","lightBlue","lightGreen","lightPeach","lightPurple","statusRed","statusYellow","statusGreen","statusGreenLight","statusRedLight","statusYellowLight","neptune","isDevelopment","process","env","NODE_ENV","Alert","ChakraAlert","React","AlertCircle","CheckCircle","Info","XCircle","colorLookup","info","bg","color","warning","success","error","iconLookup","createElement","strokeWidth","role","variantStyles","inline","borderColor","backgroundColor","padding","AlertBS","status","children","variant","header","rest","Root","fontSize","border","display","flexWrap","Indicator","marginX","Content","Title","Description","Button","ChakraButton","ButtonBS","IconButton","ChakraIconButton","IconButtonBS","Input","ChakraInput","Field","VisuallyHidden","InputBS","props","labelProps","label","helperText","errorMessage","hideLabel","inputProps","formLabel","Label","invalid","HelperText","ErrorText","ConditionalWrapperBS","condition","wrapper","Wrapper","Fragment","Box","StyledPre","as","paddingTop","wordBreak","whiteSpace","ErrorBoundaryBS","state","hasError","componentDidCatch","errorInfo","setState","console","boundaryName","render","stackTrace","componentStack","errormsg","message","getDerivedStateFromError","Component","defineConfig","defineTokens","defineRecipe","variants","primary","_hover","secondary","tertiary","theme","recipes","button","ButtonStyles","base","borderWidth","fontWeight","_disabled","opacity","size","sm","h","px","textStyle","md","lg","defaultVariants","ContainerStyles","HeadingStyles","subtle","_light","_dark","outline","flushed","InputStyles","_placeholder","SpinnerStyles","animationDuration","container","value","xl","sizes","plain","textDecoration","textDecorationColor","underline","LinkStyles","_focus","tokens","globalHyphens","hyphens","hyphenateLimitChars","focusStyle","boxShadow","transition","biblioteksentralenChakraTheme","heading","input","link","spinner","globalCss","html","scrollBehavior","body","focusOnRelativeParentStyle","_focusWithin","position","content","top","left","height","width","pointerEvents","borderRadius","HashLinkTargetBS","css","focusOnParent","id","tabIndex","spaceAbove","withErrorBoundaryBS","ChakraProvider","createSystem","ColorModeProvider","BiblioteksentralenProvider","customTheme"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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aAAA,CAACwE,WAAA,mBAAcrC;;AAGrB;AnB0YA,gDAAgD;AoBnZhD,OAAOhD,YAA0B,QAAA;AACjC,SAASqK,cAAA,EAAgBC,YAAA,EAAc7M,iBAAAA,cAAAA,QAAmC,mBAAA;AAE1E,SAAS8M,iBAAA,QAAyB,oBAAA;AAO3B,IAAMC,6BAA6B,SAACxH;WACzC,aAAA,GAAAhD,OAAAa,aAAA,CAACwJ,gBAAA;QAAe1C,OAAO2C,aAAa7M,gBAAekL,+BAA+B3F,MAAMyH,WAAA,IAAe,CAAC;IAAC,GACvG,aAAA,GAAAzK,OAAAa,aAAA,CAAC0J,mBAAA,mBAAsBvH;;ApB4Y3B,SACE3B,OAAO,EACPmJ,0BAA0B,EAC1BjI,QAAQ,EACRqB,oBAAoB,EACpBW,eAAe,EACfuF,gBAAgB,EAChBpH,YAAY,EACZK,OAAO,EACPqH,mBAAmB,GACnB","sourcesContent":["\"use client\";\n\n// ../utils/dist/index.mjs\nimport { format } from \"date-fns/format\";\nimport { nb } from \"date-fns/locale/nb\";\nvar 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\\u00F8dDark: \"#870010\",\n bsR\\u00F8dMedium: \"#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};\nfunction isDevelopment() {\n return process.env.NODE_ENV === \"development\";\n}\n\n// src/components/AlertBS.tsx\nimport { Alert as ChakraAlert } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\nvar colorLookup = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed }\n};\nvar iconLookup = {\n info: /* @__PURE__ */ React.createElement(Info, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Informasjon\" }),\n warning: /* @__PURE__ */ React.createElement(AlertCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Advarsel\" }),\n success: /* @__PURE__ */ React.createElement(CheckCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Suksess\" }),\n error: /* @__PURE__ */ React.createElement(XCircle, { strokeWidth: 1.75, role: \"img\", \"aria-label\": \"Feil\" })\n};\nvar variantStyles = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\"\n }\n};\nfunction AlertBS({ status, children, variant, header, ...rest }) {\n const colors2 = colorLookup[status];\n return /* @__PURE__ */ React.createElement(\n ChakraAlert.Root,\n {\n status,\n fontSize: \"md\",\n border: `0.1rem solid`,\n borderColor: colors2.color,\n backgroundColor: colors2.bg,\n display: \"flex\",\n flexWrap: \"wrap\",\n ...variant === \"inline\" ? variantStyles[variant] : {},\n ...rest\n },\n /* @__PURE__ */ React.createElement(ChakraAlert.Indicator, { marginX: \"auto\" }, iconLookup[status]),\n /* @__PURE__ */ React.createElement(ChakraAlert.Content, { color: \"black\" }, header && /* @__PURE__ */ React.createElement(ChakraAlert.Title, null, header), /* @__PURE__ */ React.createElement(ChakraAlert.Description, null, children))\n );\n}\n\n// src/components/ButtonBS.tsx\nimport { Button as ChakraButton } from \"@chakra-ui/react\";\nvar ButtonBS = ChakraButton;\n\n// src/components/IconButtonBS.tsx\nimport { IconButton as ChakraIconButton } from \"@chakra-ui/react\";\nvar IconButtonBS = ChakraIconButton;\n\n// src/components/InputBS.tsx\nimport { Input as ChakraInput, Field, VisuallyHidden } from \"@chakra-ui/react\";\nimport React2 from \"react\";\nvar InputBS = (props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n const formLabel = /* @__PURE__ */ React2.createElement(Field.Label, { ...labelProps }, label);\n return /* @__PURE__ */ React2.createElement(Field.Root, { invalid: !!errorMessage }, hideLabel ? /* @__PURE__ */ React2.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ React2.createElement(Field.HelperText, null, helperText), /* @__PURE__ */ React2.createElement(ChakraInput, { ...inputProps }), errorMessage && /* @__PURE__ */ React2.createElement(Field.ErrorText, null, errorMessage));\n};\n\n// src/components/ConditionalWrapperBS.tsx\nimport React3 from \"react\";\nvar ConditionalWrapperBS = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ React3.createElement(Wrapper, null, children) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);\n\n// src/components/ErrorBoundaryBS.tsx\nimport { Box } from \"@chakra-ui/react\";\nimport React4 from \"react\";\nvar StyledPre = (props) => /* @__PURE__ */ React4.createElement(Box, { as: \"pre\", paddingTop: \"0.5rem\", wordBreak: \"break-all\", whiteSpace: \"pre-wrap\", fontSize: \"0.8rem\", ...props });\nvar ErrorBoundaryBS = class extends React4.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n static getDerivedStateFromError(error) {\n return { hasError: true };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n return /* @__PURE__ */ React4.createElement(\"div\", null, /* @__PURE__ */ React4.createElement(AlertBS, { status: \"error\" }, /* @__PURE__ */ React4.createElement(\"p\", null, \"Beklager, det skjedde en teknisk feil.\"), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ React4.createElement(\"div\", null, /* @__PURE__ */ React4.createElement(StyledPre, null, errormsg || \"\"), /* @__PURE__ */ React4.createElement(StyledPre, null, info || \"\"), /* @__PURE__ */ React4.createElement(StyledPre, null, stackTrace || \"\"))));\n }\n return this.props.children;\n }\n};\n\n// src/components/HashLinkTargetBS.tsx\nimport { Box as Box2 } from \"@chakra-ui/react\";\nimport React5 from \"react\";\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nimport { defineConfig, defineTokens } from \"@chakra-ui/react\";\n\n// src/styles/chakraTheme/ButtonStyles.ts\nimport { defaultConfig, defineRecipe } from \"@chakra-ui/react\";\nvar variants = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\"\n }\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant\n};\nvar ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1\n }\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\"\n },\n md: {\n textStyle: \"md\"\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\"\n }\n }\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\"\n }\n});\n\n// src/styles/chakraTheme/ContainerStyles.ts\nimport { defineRecipe as defineRecipe2 } from \"@chakra-ui/react\";\nvar ContainerStyles = defineRecipe2({\n base: {\n px: \".75rem\"\n // Padding left/right\n }\n});\n\n// src/styles/chakraTheme/HeadingStyles.ts\nimport { defineRecipe as defineRecipe3 } from \"@chakra-ui/react\";\nvar HeadingStyles = defineRecipe3({\n base: {\n fontWeight: \"600\"\n }\n});\n\n// src/styles/chakraTheme/InputStyles.ts\nimport { defineRecipe as defineRecipe4 } from \"@chakra-ui/react\";\nvar variants2 = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" }\n }\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n }\n};\nvar InputStyles = defineRecipe4({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" }\n }\n },\n variants: {\n variant: variants2\n },\n defaultVariants: {\n variant: \"subtle\"\n }\n});\n\n// src/styles/chakraTheme/SpinnerStyles.ts\nimport { defineRecipe as defineRecipe5 } from \"@chakra-ui/react\";\nvar SpinnerStyles = defineRecipe5({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\"\n }\n});\n\n// src/styles/chakraTheme/sizes.ts\nvar container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" },\n // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" }\n};\nvar sizes = {\n container\n};\n\n// src/styles/chakraTheme/LinkStyles.ts\nimport { defineRecipe as defineRecipe6 } from \"@chakra-ui/react\";\nvar variants3 = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\"\n }\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\"\n }\n }\n};\nvar LinkStyles = defineRecipe6({\n base: {\n _focus: {\n outline: \"none\"\n }\n },\n variants: {\n variant: variants3\n },\n defaultVariants: {\n variant: \"underline\"\n }\n});\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nvar tokens = defineTokens({\n sizes\n});\nvar globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\"\n // minimum word-length / min letters first line / min letters second line\n};\nvar focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\"\n // Transition makes the newly focused element \"pop in\" and easier to spot\n};\nvar biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles\n }\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" }\n },\n body: {\n ...globalHyphens\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle\n }\n});\n\n// src/components/HashLinkTargetBS.tsx\nvar 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};\nfunction HashLinkTargetBS(props) {\n return /* @__PURE__ */ React5.createElement(Box2, { position: \"relative\", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ React5.createElement(\n Box2,\n {\n id: props.id,\n tabIndex: props.focusOnParent ? -1 : void 0,\n position: \"absolute\",\n top: `-${props.spaceAbove || \"2.5rem\"}`,\n _focus: {\n boxShadow: \"none !important\"\n }\n }\n ));\n}\n\n// src/components/withErrorBoundaryBS.tsx\nimport React6 from \"react\";\nvar withErrorBoundaryBS = (Component, boundaryName) => {\n return (props) => /* @__PURE__ */ React6.createElement(ErrorBoundaryBS, { boundaryName }, /* @__PURE__ */ React6.createElement(Component, { ...props }));\n};\n\n// src/components/BiblioteksentralenProvider.tsx\nimport React7 from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig as defaultConfig2 } from \"@chakra-ui/react\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\nvar BiblioteksentralenProvider = (props) => /* @__PURE__ */ React7.createElement(ChakraProvider, { value: createSystem(defaultConfig2, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ React7.createElement(ColorModeProvider, { ...props }));\nexport {\n AlertBS,\n BiblioteksentralenProvider,\n ButtonBS,\n ConditionalWrapperBS,\n ErrorBoundaryBS,\n HashLinkTargetBS,\n IconButtonBS,\n InputBS,\n withErrorBoundaryBS\n};\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","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","import { Modify } from \"@biblioteksentralen/types\";\nimport { colors } from \"@biblioteksentralen/utils\";\nimport { AlertRootProps, Alert as ChakraAlert, SystemStyleObject } from \"@chakra-ui/react\";\nimport React, { ReactNode } from \"react\";\nimport { AlertCircle, CheckCircle, Info, XCircle } from \"react-feather\";\n\ntype Status = \"info\" | \"warning\" | \"success\" | \"error\";\ntype CustomVariants = \"inline\";\ntype Variants = AlertRootProps[\"variant\"] | CustomVariants;\n\nconst colorLookup: Record<Status, { bg: string; color: string }> = {\n info: { bg: colors.lightBlue, color: colors.accentBlueMedium },\n warning: { bg: colors.statusYellowLight, color: colors.statusYellow },\n success: { bg: colors.statusGreenLight, color: colors.statusGreen },\n error: { bg: colors.statusRedLight, color: colors.statusRed },\n};\n\nconst iconLookup: Record<Status, React.ReactElement> = {\n info: <Info strokeWidth={1.75} role=\"img\" aria-label=\"Informasjon\" />,\n warning: <AlertCircle strokeWidth={1.75} role=\"img\" aria-label=\"Advarsel\" />,\n success: <CheckCircle strokeWidth={1.75} role=\"img\" aria-label=\"Suksess\" />,\n error: <XCircle strokeWidth={1.75} role=\"img\" aria-label=\"Feil\" />,\n};\n\ninterface Props extends Modify<AlertRootProps, { variant?: Variants }> {\n children: ReactNode;\n header?: ReactNode;\n status: Status;\n variant?: Variants;\n}\n\nconst variantStyles: Record<CustomVariants, SystemStyleObject> = {\n inline: {\n borderColor: \"transparent\",\n backgroundColor: \"transparent\",\n padding: \"0\",\n },\n};\n\nexport function AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","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","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\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 {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {/* @ts-expect-error Chakra v3 Field.HelperText and Field.ErrorText don't include children in their types */}\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","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","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","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","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@biblioteksentralen/react",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.4",
|
|
4
4
|
"description": "React library for reusable code in Biblioteksentralens js-apps",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Biblioteksentralen",
|
|
@@ -41,12 +41,11 @@
|
|
|
41
41
|
"@types/react": "^19.1.8",
|
|
42
42
|
"@chakra-ui/react": "^3.34.0",
|
|
43
43
|
"@chakra-ui/system": "^2.6.2",
|
|
44
|
-
"@chakra-ui/theme": "^3.4.6",
|
|
45
44
|
"react": "^19.1.0",
|
|
46
45
|
"react-dom": "^19.1.0",
|
|
47
46
|
"tsup": "^8.5.1",
|
|
48
|
-
"@biblioteksentralen/types": "1.0.0",
|
|
49
47
|
"@biblioteksentralen/utils": "2.0.0",
|
|
48
|
+
"@biblioteksentralen/types": "1.0.0",
|
|
50
49
|
"@biblioteksentralen/icons": "2.1.1"
|
|
51
50
|
},
|
|
52
51
|
"peerDependencies": {
|