@biblioteksentralen/react 3.0.0-beta.10 → 3.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { AlertRootProps, ButtonProps as ButtonProps$1, IconButtonProps as IconButtonProps$1, BoxProps, InputProps, FieldLabelProps, LinkProps, SystemConfig, ToastRootProps } from '@chakra-ui/react';
1
+ import { AlertRootProps, ButtonProps as ButtonProps$1, IconButtonProps as IconButtonProps$1, BoxProps, InputProps, FieldLabelProps, LinkProps, SystemConfig } from '@chakra-ui/react';
2
2
  export * from '@chakra-ui/react';
3
- import { ComponentWithAs, ThemeTypings } from '@chakra-ui/system';
4
- export { ResponsiveObject, StyleProps } from '@chakra-ui/system';
5
3
  import { Modify } from '@biblioteksentralen/types';
6
- import React, { ReactNode, FunctionComponent, HTMLAttributes, ErrorInfo } from 'react';
4
+ import React, { ReactNode, FunctionComponent, RefObject, HTMLAttributes, ErrorInfo } from 'react';
5
+ import { ComponentWithAs, ThemeTypings } from '@chakra-ui/system';
7
6
  export { colors } from '@biblioteksentralen/utils';
8
7
 
9
8
  type Status = "info" | "warning" | "success" | "error";
@@ -67,6 +66,7 @@ interface Props$4 extends InputProps {
67
66
  labelProps?: FieldLabelProps;
68
67
  helperText?: string;
69
68
  errorMessage?: string;
69
+ ref?: RefObject<HTMLInputElement | null>;
70
70
  }
71
71
  /**
72
72
  * Creating custom input-component to make sure label is always set (for accessibility)
@@ -129,7 +129,4 @@ declare function HashLinkTarget(props: Props): React.JSX.Element;
129
129
 
130
130
  declare const withErrorBoundary: <Props>(Component: React.ComponentType<Props>, boundaryName: string) => (props: Props & React.JSX.IntrinsicAttributes) => React.JSX.Element;
131
131
 
132
- declare const toaster: ToastRootProps;
133
- declare const Toaster: () => React.JSX.Element;
134
-
135
- export { Alert, BiblioteksentralenProvider, Button, type ButtonProps, ConditionalWrapper, ErrorBoundary, HashLinkTarget, HideWithCSS, IconButton, type IconButtonProps, Input, Link, Toaster, VisuallyHidden, toaster, withErrorBoundary };
132
+ export { Alert as AlertBS, BiblioteksentralenProvider, Button as ButtonBS, type ButtonProps as ButtonBSProps, ConditionalWrapper as ConditionalWrapperBS, ErrorBoundary as ErrorBoundaryBS, HashLinkTarget as HashLinkTargetBS, HideWithCSS as HideWithCSSBS, IconButton as IconButtonBS, type IconButtonProps as IconButtonBSProps, Input as InputBS, Link as LinkBS, VisuallyHidden as VisuallyHiddenBS, withErrorBoundary as withErrorBoundaryBS };
package/dist/index.js CHANGED
@@ -274,49 +274,43 @@ var __toCommonJS = function(mod) {
274
274
  // src/index.ts
275
275
  var src_exports = {};
276
276
  __export(src_exports, {
277
- Alert: function() {
277
+ AlertBS: function() {
278
278
  return Alert;
279
279
  },
280
280
  BiblioteksentralenProvider: function() {
281
281
  return BiblioteksentralenProvider;
282
282
  },
283
- Button: function() {
283
+ ButtonBS: function() {
284
284
  return Button;
285
285
  },
286
- ConditionalWrapper: function() {
286
+ ConditionalWrapperBS: function() {
287
287
  return ConditionalWrapper;
288
288
  },
289
- ErrorBoundary: function() {
289
+ ErrorBoundaryBS: function() {
290
290
  return ErrorBoundary;
291
291
  },
292
- HashLinkTarget: function() {
292
+ HashLinkTargetBS: function() {
293
293
  return HashLinkTarget;
294
294
  },
295
- HideWithCSS: function() {
295
+ HideWithCSSBS: function() {
296
296
  return HideWithCSS;
297
297
  },
298
- IconButton: function() {
298
+ IconButtonBS: function() {
299
299
  return IconButton;
300
300
  },
301
- Input: function() {
301
+ InputBS: function() {
302
302
  return Input;
303
303
  },
304
- Link: function() {
304
+ LinkBS: function() {
305
305
  return Link;
306
306
  },
307
- Toaster: function() {
308
- return Toaster;
309
- },
310
- VisuallyHidden: function() {
307
+ VisuallyHiddenBS: function() {
311
308
  return VisuallyHidden;
312
309
  },
313
310
  colors: function() {
314
311
  return colors;
315
312
  },
316
- toaster: function() {
317
- return toaster;
318
- },
319
- withErrorBoundary: function() {
313
+ withErrorBoundaryBS: function() {
320
314
  return withErrorBoundary;
321
315
  }
322
316
  });
@@ -865,58 +859,20 @@ var withErrorBoundary = function(Component, boundaryName) {
865
859
  }, /* @__PURE__ */ import_react26.default.createElement(Component, _object_spread({}, props)));
866
860
  };
867
861
  };
868
- // src/components/ui/toaster.tsx
869
- var import_react27 = require("@chakra-ui/react");
870
- var import_react28 = __toESM(require("react"));
871
- var toaster = (0, import_react27.createToaster)({
872
- pauseOnPageIdle: true,
873
- offsets: {
874
- left: "50%",
875
- top: "50%",
876
- right: "50%",
877
- bottom: "50%"
878
- }
879
- });
880
- var Toaster = function() {
881
- return /* @__PURE__ */ import_react28.default.createElement(import_react27.Portal, null, /* @__PURE__ */ import_react28.default.createElement(import_react27.Toaster, {
882
- toaster: toaster,
883
- insetInline: {
884
- mdDown: "4"
885
- }
886
- }, function(toast) {
887
- if (typeof toast.render === "function") {
888
- return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, toast.render());
889
- }
890
- return /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Root, {
891
- width: {
892
- md: "sm"
893
- }
894
- }, toast.type === "loading" ? /* @__PURE__ */ import_react28.default.createElement(import_react27.Spinner, {
895
- size: "sm",
896
- color: "blue.solid"
897
- }) : /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Indicator, null), /* @__PURE__ */ import_react28.default.createElement(import_react27.Stack, {
898
- gap: "1",
899
- flex: "1",
900
- maxWidth: "100%"
901
- }, toast.title && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Title, null, toast.title), toast.description && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.Description, null, toast.description)), toast.action && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.ActionTrigger, null, toast.action.label), toast.closable && /* @__PURE__ */ import_react28.default.createElement(import_react27.Toast.CloseTrigger, null));
902
- }));
903
- };
904
862
  // Annotate the CommonJS export names for ESM import in node:
905
863
  0 && (module.exports = _object_spread({
906
- Alert: Alert,
864
+ AlertBS: AlertBS,
907
865
  BiblioteksentralenProvider: BiblioteksentralenProvider,
908
- Button: Button,
909
- ConditionalWrapper: ConditionalWrapper,
910
- ErrorBoundary: ErrorBoundary,
911
- HashLinkTarget: HashLinkTarget,
912
- HideWithCSS: HideWithCSS,
913
- IconButton: IconButton,
914
- Input: Input,
915
- Link: Link,
916
- Toaster: Toaster,
917
- VisuallyHidden: VisuallyHidden,
866
+ ButtonBS: ButtonBS,
867
+ ConditionalWrapperBS: ConditionalWrapperBS,
868
+ ErrorBoundaryBS: ErrorBoundaryBS,
869
+ HashLinkTargetBS: HashLinkTargetBS,
870
+ HideWithCSSBS: HideWithCSSBS,
871
+ IconButtonBS: IconButtonBS,
872
+ InputBS: InputBS,
873
+ LinkBS: LinkBS,
874
+ VisuallyHiddenBS: VisuallyHiddenBS,
918
875
  colors: colors,
919
- toaster: toaster,
920
- withErrorBoundary: withErrorBoundary
876
+ withErrorBoundaryBS: withErrorBoundaryBS
921
877
  }, require("@chakra-ui/react")));
922
878
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"names":["import_react","React","colors","ChakraAlert","ChakraButton","ChakraIconButton","ChakraVisuallyHidden","ChakraInput","ChakraLink","variants","ChakraToaster"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,6BAAd;;;ACAA,oBAAuB;AACvB,gBAAmB;ACDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;EACT;AACF;ACxCO,SAAS,gBAAyB;AACvC,SAAO,QAAQ,IAAI,aAAa;AAClC;;;ACAA,mBAAwE;AACxE,IAAAA,gBAAiC;AACjC,2BAAwD;AAMxD,IAAM,cAA6D;AAAA,EACjE,MAAM,EAAE,IAAI,OAAO,WAAW,OAAO,OAAO,iBAAiB;AAAA,EAC7D,SAAS,EAAE,IAAI,OAAO,mBAAmB,OAAO,OAAO,aAAa;AAAA,EACpE,SAAS,EAAE,IAAI,OAAO,kBAAkB,OAAO,OAAO,YAAY;AAAA,EAClE,OAAO,EAAE,IAAI,OAAO,gBAAgB,OAAO,OAAO,UAAU;AAC9D;AAEA,IAAM,aAAiD;AAAA,EACrD,MAAM,8BAA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ACN,+BAAAC,QAAA,cAAC,iBAAc,gBACb,+BAAAA,QAAA,cAAC,aAAW,GAAG,OAAO,CACxB;AAEJ;;;ACPA,IAAAD,iBAQO;AACP,IAAAA,iBAAkB;AAEX,IAAM,cAA0B,8BAAc;AAAA,EACnD,iBAAiB;AAAA,EACjB,SAAS,EAAE,MAAM,OAAO,KAAK,OAAO,OAAO,OAAO,QAAQ,MAAM;AAClE,CAAC;AAEM,IAAM,UAAU,MAAM;AAC3B,SACE,+BAAAC,QAAA,cAAC,6BACC,+BAAAA,QAAA,cAAC,eAAAS,SAAA,EAAc,SAAkB,aAAa,EAAE,QAAQ,IAAI,KACzD,CAAC,UAA0B;AAC1B,QAAI,OAAO,MAAM,WAAW,YAAY;AACtC,aAAO,+BAAAT,QAAA,6BAAAA,QAAA,gBAAG,MAAM,OAAO,CAAE;AAAA,IAC3B;AACA,WACE,+BAAAA,QAAA,cAAC,qBAAM,MAAN,EAAW,OAAO,EAAE,IAAI,KAAK,KAC3B,MAAM,SAAS,YAAY,+BAAAA,QAAA,cAAC,0BAAQ,MAAK,MAAK,OAAM,cAAa,IAAK,+BAAAA,QAAA,cAAC,qBAAM,WAAN,IAAgB,GACxF,+BAAAA,QAAA,cAAC,wBAAM,KAAI,KAAI,MAAK,KAAI,UAAS,UAC9B,MAAM,SAAS,+BAAAA,QAAA,cAAC,qBAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,+BAAAA,QAAA,cAAC,qBAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,+BAAAA,QAAA,cAAC,qBAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,+BAAAA,QAAA,cAAC,qBAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ","sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button, type ButtonProps } from \"./components/Button\"; // Overrides Chakras Button\nexport { IconButton, type IconButtonProps } from \"./components/IconButton\"; // Overrides Chakras IconButton\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\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 Alert({ 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 ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\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 IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\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 ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\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 Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\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 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\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 { 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 },\n tertiary: {},\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 color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\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 { 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/30\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor/30\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\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 { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\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 ErrorBoundary 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 <Alert 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 </Alert>\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 HashLinkTarget(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 { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts","../../utils/src/date.ts","../../utils/src/colors.ts","../../utils/src/environment.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx"],"names":["import_react","React","colors","ChakraAlert","ChakraButton","ChakraIconButton","ChakraVisuallyHidden","ChakraInput","ChakraLink","variants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,6BAAd;;;ACAA,oBAAuB;AACvB,gBAAmB;ACDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,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EAAG,CAC/B,CAEJ,CACF;AAAA,IAEJ;AAEA,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;;;AC3DA,IAAAD,iBAAoB;AACpB,IAAAA,iBAAkB;AAelB,IAAM,6BAA6B;AAAA,EACjC,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,eAAe;AAAA,MACf,cAAc;AAAA,MACd,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAKO,SAAS,eAAe,OAAc;AAC3C,SACE,+BAAAC,QAAA,cAAC,sBAAI,UAAS,YAAW,KAAK,MAAM,gBAAgB,6BAA6B,UAC/E,+BAAAA,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,MAAM;AAAA,MACV,UAAU,MAAM,gBAAgB,KAAK;AAAA,MACrC,UAAS;AAAA,MACT,KAAK,IAAI,MAAM,cAAc,QAAQ;AAAA,MACrC,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA;AAAA,EACF,CACF;AAEJ;;;ACnDA,IAAAD,iBAAkB;AAGX,IAAM,oBAAoB,CAAS,WAAuC,iBAAyB;AACxG,SAAO,CAAC,UACN,+BAAAC,QAAA,cAAC,iBAAc,gBACb,+BAAAA,QAAA,cAAC,aAAW,GAAG,OAAO,CACxB;AAEJ","sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\n\n// Exporting our own components with \"BS\" suffix to allow use of both Chakra and Biblioteksentralen components in the same project\nexport { Alert as AlertBS } from \"./components/Alert\";\nexport { Button as ButtonBS, type ButtonProps as ButtonBSProps } from \"./components/Button\";\nexport { IconButton as IconButtonBS, type IconButtonProps as IconButtonBSProps } from \"./components/IconButton\";\nexport { ConditionalWrapper as ConditionalWrapperBS } from \"./components/ConditionalWrapper\";\nexport { HideWithCSS as HideWithCSSBS } from \"./components/HideWithCSS\";\nexport { Input as InputBS } from \"./components/Input\";\nexport { Link as LinkBS } from \"./components/Link\";\nexport { VisuallyHidden as VisuallyHiddenBS } from \"./components/VisuallyHidden\";\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary as ErrorBoundaryBS } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget as HashLinkTargetBS } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary as withErrorBoundaryBS } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\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 Alert({ 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 ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\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 IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\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 ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\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 Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\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 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\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 { 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 },\n tertiary: {},\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 color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\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 { 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/30\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor/30\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\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 { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\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 ErrorBoundary 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 <Alert 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 </Alert>\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 HashLinkTarget(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 { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n"]}
package/dist/index.mjs CHANGED
@@ -439,44 +439,19 @@ import React9 from "react";
439
439
  var withErrorBoundary = (Component, boundaryName) => {
440
440
  return (props) => /* @__PURE__ */ React9.createElement(ErrorBoundary, { boundaryName }, /* @__PURE__ */ React9.createElement(Component, { ...props }));
441
441
  };
442
-
443
- // src/components/ui/toaster.tsx
444
- import {
445
- Toaster as ChakraToaster,
446
- Portal,
447
- Spinner,
448
- Stack,
449
- Toast,
450
- createToaster
451
- } from "@chakra-ui/react";
452
- import React10 from "react";
453
- var toaster = createToaster({
454
- pauseOnPageIdle: true,
455
- offsets: { left: "50%", top: "50%", right: "50%", bottom: "50%" }
456
- });
457
- var Toaster = () => {
458
- return /* @__PURE__ */ React10.createElement(Portal, null, /* @__PURE__ */ React10.createElement(ChakraToaster, { toaster, insetInline: { mdDown: "4" } }, (toast) => {
459
- if (typeof toast.render === "function") {
460
- return /* @__PURE__ */ React10.createElement(React10.Fragment, null, toast.render());
461
- }
462
- return /* @__PURE__ */ React10.createElement(Toast.Root, { width: { md: "sm" } }, toast.type === "loading" ? /* @__PURE__ */ React10.createElement(Spinner, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ React10.createElement(Toast.Indicator, null), /* @__PURE__ */ React10.createElement(Stack, { gap: "1", flex: "1", maxWidth: "100%" }, toast.title && /* @__PURE__ */ React10.createElement(Toast.Title, null, toast.title), toast.description && /* @__PURE__ */ React10.createElement(Toast.Description, null, toast.description)), toast.action && /* @__PURE__ */ React10.createElement(Toast.ActionTrigger, null, toast.action.label), toast.closable && /* @__PURE__ */ React10.createElement(Toast.CloseTrigger, null));
463
- }));
464
- };
465
442
  export {
466
- Alert,
443
+ Alert as AlertBS,
467
444
  BiblioteksentralenProvider,
468
- Button,
469
- ConditionalWrapper,
470
- ErrorBoundary,
471
- HashLinkTarget,
472
- HideWithCSS,
473
- IconButton,
474
- Input,
475
- Link,
476
- Toaster,
477
- VisuallyHidden,
445
+ Button as ButtonBS,
446
+ ConditionalWrapper as ConditionalWrapperBS,
447
+ ErrorBoundary as ErrorBoundaryBS,
448
+ HashLinkTarget as HashLinkTargetBS,
449
+ HideWithCSS as HideWithCSSBS,
450
+ IconButton as IconButtonBS,
451
+ Input as InputBS,
452
+ Link as LinkBS,
453
+ VisuallyHidden as VisuallyHiddenBS,
478
454
  colors,
479
- toaster,
480
- withErrorBoundary
455
+ withErrorBoundary as withErrorBoundaryBS
481
456
  };
482
457
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../../utils/src/colors.ts","../../utils/src/date.ts","../../utils/src/environment.ts","../../utils/src/random.ts","../../utils/src/slugifyString.ts","../../utils/src/sort/common.ts","../../utils/src/sort/sortAlphabetical.ts","../../utils/src/sort/sortArrayInGroups.ts","../../utils/src/sort/sortByMultiple.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx","../src/components/ui/toaster.tsx"],"sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\nexport type { StyleProps, ResponsiveObject } from \"@chakra-ui/system\"; // Exports Chakra system types\nexport { Alert } from \"./components/Alert\"; // Overrides Chakras Alert\nexport { Button, type ButtonProps } from \"./components/Button\"; // Overrides Chakras Button\nexport { IconButton, type IconButtonProps } from \"./components/IconButton\"; // Overrides Chakras IconButton\nexport { ConditionalWrapper } from \"./components/ConditionalWrapper\"; // Overrides Chakras Input\nexport { HideWithCSS } from \"./components/HideWithCSS\"; // Overrides Chakras HideWithCSS\nexport { Input } from \"./components/Input\"; // Overrides Chakras Input\nexport { Link } from \"./components/Link\"; // Overrides Chakras Link\nexport { VisuallyHidden } from \"./components/VisuallyHidden\"; // Overrides Chakras VisuallyHidden\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n\n// Generated from cli: npmx @chakra-ui/cli snippet add\nexport { Toaster, toaster } from \"./components/ui/toaster\"; // Exports the Toaster component\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","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 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","export function randomFromArray<T>(array: T[]): T {\n return array[Math.floor(Math.random() * array.length)];\n}\n\nexport function seededRandomFromArray<T>(array: T[], seed: string): T {\n return array[Math.floor(seededRandom(seed) * array.length)];\n}\n\n// Returns a pseudo-random floating-point number in the range [0.0 -> 1.0] from a string seed\n// TODO, ser ikke ut til å gi helt jevn fordeling mellom 0 og 1, trenger kanskje litt kjærlighet\nexport function seededRandom(seed: string) {\n // Oversetter ikke-numeriske tegn til tall så de kan brukes som seed\n const numericSeed = Number(seed.replace(/\\D/g, (match) => `${match.charCodeAt(0)}`));\n const x = Math.sin(numericSeed) * 3333;\n return x - Math.floor(x);\n}\n","export const slugifyString = (value = \"\") =>\n value\n .trim()\n .toLowerCase()\n // Bytter ut typisk norske bokstaver æøå\n .replace(/æ/g, \"ae\")\n .replace(/å/g, \"a\")\n .replace(/ø/g, \"o\")\n // Bytter alle tegn som ikke er et regex-word med '-'\n .replace(/\\W/g, \"-\")\n // Bytter ut flere streker med enkelt strek \"----\" => \"-\"\n .replace(/-+/g, \"-\")\n .slice(0, 30);\n","export type GetSortIndex<T> = (element: T) => number | string;\n\nconst compareAlphabetically = (left: string, right: string) => left.localeCompare(right, [\"no-NO\"]);\n\nexport const compare = <T>(left: T, right: T, indexFunction?: GetSortIndex<T>) => {\n const leftIndex = indexFunction ? indexFunction(left) : left;\n const rightIndex = indexFunction ? indexFunction(right) : right;\n\n if (typeof leftIndex == \"number\" && typeof rightIndex == \"number\") return leftIndex - rightIndex;\n\n if (typeof leftIndex == \"string\" && typeof rightIndex == \"string\") {\n return compareAlphabetically(leftIndex, rightIndex);\n }\n\n throw new Error(\"Sort index function gives inconsistent index types\");\n};\n","import { GetSortIndex, compare } from \"./common\";\n\n/**\n * Alphabetical sorting restricted to Norwegian locale, for consistent sorting on server and client\n * (radash's `alphabetical()` is inconsistent between these two)\n */\nexport const sortAlphabetical = <T>(array: T[], indexFunction?: GetSortIndex<T>): T[] =>\n array.slice().sort((left, right) => compare(left, right, indexFunction));\n","export interface Group<T> {\n label: string;\n items: T[];\n}\n\nexport interface GroupedArray<T> extends Array<Group<T>> {}\n\n/* Tar et array og putter ting i grupper basert på gruppekategorier\n *\n * Feks\n *\n * const myArray = ['Apple', 'Aubergine', 'Lemon'];\n *\n * const inGroups = groupArray(myArray, item => item[0]);\n *\n * console.log(inGroups);\n *\n * // [{groupLabel: 'A', groupItems: ['Apple', 'Aubergine']}, {groupLabel: 'L', groupItems: ['Lemon']}]\n *\n * */\nexport function sortArrayInGroups<T>(\n items: T[],\n getGroupLabel: (element: T) => string,\n options?: { sortAlphabetically?: boolean }\n): GroupedArray<T> {\n const groups = items.reduce((acc: GroupedArray<T>, arrayEntry) => {\n const currentCategory = getGroupLabel(arrayEntry);\n const categoryIndex = acc.findIndex((group) => group.label === currentCategory);\n if (categoryIndex >= 0) {\n acc[categoryIndex].items.push(arrayEntry);\n } else {\n acc.push({\n label: currentCategory,\n items: [arrayEntry],\n });\n }\n return acc;\n }, []);\n\n return options?.sortAlphabetically ? groups.sort(sortByLabel) : groups;\n}\n\nfunction sortByLabel<T>(a: Group<T>, b: Group<T>) {\n if (a.label.toLowerCase() > b.label.toLowerCase()) return 1;\n if (a.label.toLowerCase() < b.label.toLowerCase()) return -1;\n return 0;\n}\n","import { AtLeastOne } from \"@biblioteksentralen/types\";\nimport { GetSortIndex, compare } from \"./common\";\n\n/**\n * Corresponds to lodash's sortBy called with several comparison functions (no equivalent in radash)\n */\nexport const sortByMultiple = <T>(array: T[], ...indexFunctions: AtLeastOne<GetSortIndex<T>>): T[] =>\n array.slice().sort((left, right) =>\n indexFunctions.slice(1).reduce(\n // If the previous comparison is 0, it means left and right are equal according to the previous\n // comparison function. That's also the only way it'll be falsy, therefore we can\n // use the or operator || to then apply the next comparison function.\n (previous, indexFunction) => previous || compare(left, right, indexFunction),\n compare(left, right, indexFunctions[0]) // Initial comparison\n )\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 Alert({ 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 ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\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 IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\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 ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\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 Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\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 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\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 { 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 },\n tertiary: {},\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 color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\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 { 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/30\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor/30\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\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 { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\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 ErrorBoundary 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 <Alert 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 </Alert>\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 HashLinkTarget(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 { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n","\"use client\";\n\nimport {\n Toaster as ChakraToaster,\n Portal,\n Spinner,\n Stack,\n Toast,\n ToastRootProps,\n createToaster,\n} from \"@chakra-ui/react\";\nimport React from \"react\";\n\nexport const toaster: ToastRootProps = createToaster({\n pauseOnPageIdle: true,\n offsets: { left: \"50%\", top: \"50%\", right: \"50%\", bottom: \"50%\" },\n});\n\nexport const Toaster = () => {\n return (\n <Portal>\n <ChakraToaster toaster={toaster} insetInline={{ mdDown: \"4\" }}>\n {(toast: ToastRootProps) => {\n if (typeof toast.render === \"function\") {\n return <>{toast.render()}</>;\n }\n return (\n <Toast.Root width={{ md: \"sm\" }}>\n {toast.type === \"loading\" ? <Spinner size=\"sm\" color=\"blue.solid\" /> : <Toast.Indicator />}\n <Stack gap=\"1\" flex=\"1\" maxWidth=\"100%\">\n {toast.title && <Toast.Title>{toast.title}</Toast.Title>}\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Stack>\n {toast.action && <Toast.ActionTrigger>{toast.action.label}</Toast.ActionTrigger>}\n {toast.closable && <Toast.CloseTrigger />}\n </Toast.Root>\n );\n }}\n </ChakraToaster>\n </Portal>\n );\n};\n"],"mappings":";AAAA,cAAc;;;AEAd,SAAS,cAAc;AACvB,SAAS,UAAU;ADDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IAC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AC9B,MAAM,SAAS,gBAAAA,QAAA,cAAC,MAAM,OAAN,MAAa,MAAM,KAAM,GACzC,MAAM,eAAe,gBAAAA,QAAA,cAAC,MAAM,aAAN,MAAmB,MAAM,WAAY,CAC9D,GACC,MAAM,UAAU,gBAAAA,QAAA,cAAC,MAAM,eAAN,MAAqB,MAAM,OAAO,KAAM,GACzD,MAAM,YAAY,gBAAAA,QAAA,cAAC,MAAM,cAAN,IAAmB,CACzC;AAAA,EAEJ,CACF,CACF;AAEJ;","names":["colors","React","React","React","React","React","React","React","defaultConfig","defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","variants","defineRecipe","React","defaultConfig","Box","React","React","Box","Box","React","React","Box","React","React","React"]}
1
+ {"version":3,"sources":["../src/index.ts","../../utils/src/colors.ts","../../utils/src/date.ts","../../utils/src/environment.ts","../../utils/src/random.ts","../../utils/src/slugifyString.ts","../../utils/src/sort/common.ts","../../utils/src/sort/sortAlphabetical.ts","../../utils/src/sort/sortArrayInGroups.ts","../../utils/src/sort/sortByMultiple.ts","../src/components/Alert.tsx","../src/components/Button.tsx","../src/components/IconButton.tsx","../src/components/ConditionalWrapper.tsx","../src/components/HideWithCSS.tsx","../src/components/Input.tsx","../src/components/VisuallyHidden.tsx","../src/components/Link.tsx","../src/BiblioteksentralenProvider.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/components/ErrorBoundary.tsx","../src/components/HashLinkTarget.tsx","../src/components/withErrorBoundary.tsx"],"sourcesContent":["export * from \"@chakra-ui/react\"; // Exports Chakra components first to override some components later\n\n// Exporting our own components with \"BS\" suffix to allow use of both Chakra and Biblioteksentralen components in the same project\nexport { Alert as AlertBS } from \"./components/Alert\";\nexport { Button as ButtonBS, type ButtonProps as ButtonBSProps } from \"./components/Button\";\nexport { IconButton as IconButtonBS, type IconButtonProps as IconButtonBSProps } from \"./components/IconButton\";\nexport { ConditionalWrapper as ConditionalWrapperBS } from \"./components/ConditionalWrapper\";\nexport { HideWithCSS as HideWithCSSBS } from \"./components/HideWithCSS\";\nexport { Input as InputBS } from \"./components/Input\";\nexport { Link as LinkBS } from \"./components/Link\";\nexport { VisuallyHidden as VisuallyHiddenBS } from \"./components/VisuallyHidden\";\n\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\nexport { ErrorBoundary as ErrorBoundaryBS } from \"./components/ErrorBoundary\";\nexport { HashLinkTarget as HashLinkTargetBS } from \"./components/HashLinkTarget\";\nexport { withErrorBoundary as withErrorBoundaryBS } from \"./components/withErrorBoundary\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\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","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 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","export function randomFromArray<T>(array: T[]): T {\n return array[Math.floor(Math.random() * array.length)];\n}\n\nexport function seededRandomFromArray<T>(array: T[], seed: string): T {\n return array[Math.floor(seededRandom(seed) * array.length)];\n}\n\n// Returns a pseudo-random floating-point number in the range [0.0 -> 1.0] from a string seed\n// TODO, ser ikke ut til å gi helt jevn fordeling mellom 0 og 1, trenger kanskje litt kjærlighet\nexport function seededRandom(seed: string) {\n // Oversetter ikke-numeriske tegn til tall så de kan brukes som seed\n const numericSeed = Number(seed.replace(/\\D/g, (match) => `${match.charCodeAt(0)}`));\n const x = Math.sin(numericSeed) * 3333;\n return x - Math.floor(x);\n}\n","export const slugifyString = (value = \"\") =>\n value\n .trim()\n .toLowerCase()\n // Bytter ut typisk norske bokstaver æøå\n .replace(/æ/g, \"ae\")\n .replace(/å/g, \"a\")\n .replace(/ø/g, \"o\")\n // Bytter alle tegn som ikke er et regex-word med '-'\n .replace(/\\W/g, \"-\")\n // Bytter ut flere streker med enkelt strek \"----\" => \"-\"\n .replace(/-+/g, \"-\")\n .slice(0, 30);\n","export type GetSortIndex<T> = (element: T) => number | string;\n\nconst compareAlphabetically = (left: string, right: string) => left.localeCompare(right, [\"no-NO\"]);\n\nexport const compare = <T>(left: T, right: T, indexFunction?: GetSortIndex<T>) => {\n const leftIndex = indexFunction ? indexFunction(left) : left;\n const rightIndex = indexFunction ? indexFunction(right) : right;\n\n if (typeof leftIndex == \"number\" && typeof rightIndex == \"number\") return leftIndex - rightIndex;\n\n if (typeof leftIndex == \"string\" && typeof rightIndex == \"string\") {\n return compareAlphabetically(leftIndex, rightIndex);\n }\n\n throw new Error(\"Sort index function gives inconsistent index types\");\n};\n","import { GetSortIndex, compare } from \"./common\";\n\n/**\n * Alphabetical sorting restricted to Norwegian locale, for consistent sorting on server and client\n * (radash's `alphabetical()` is inconsistent between these two)\n */\nexport const sortAlphabetical = <T>(array: T[], indexFunction?: GetSortIndex<T>): T[] =>\n array.slice().sort((left, right) => compare(left, right, indexFunction));\n","export interface Group<T> {\n label: string;\n items: T[];\n}\n\nexport interface GroupedArray<T> extends Array<Group<T>> {}\n\n/* Tar et array og putter ting i grupper basert på gruppekategorier\n *\n * Feks\n *\n * const myArray = ['Apple', 'Aubergine', 'Lemon'];\n *\n * const inGroups = groupArray(myArray, item => item[0]);\n *\n * console.log(inGroups);\n *\n * // [{groupLabel: 'A', groupItems: ['Apple', 'Aubergine']}, {groupLabel: 'L', groupItems: ['Lemon']}]\n *\n * */\nexport function sortArrayInGroups<T>(\n items: T[],\n getGroupLabel: (element: T) => string,\n options?: { sortAlphabetically?: boolean }\n): GroupedArray<T> {\n const groups = items.reduce((acc: GroupedArray<T>, arrayEntry) => {\n const currentCategory = getGroupLabel(arrayEntry);\n const categoryIndex = acc.findIndex((group) => group.label === currentCategory);\n if (categoryIndex >= 0) {\n acc[categoryIndex].items.push(arrayEntry);\n } else {\n acc.push({\n label: currentCategory,\n items: [arrayEntry],\n });\n }\n return acc;\n }, []);\n\n return options?.sortAlphabetically ? groups.sort(sortByLabel) : groups;\n}\n\nfunction sortByLabel<T>(a: Group<T>, b: Group<T>) {\n if (a.label.toLowerCase() > b.label.toLowerCase()) return 1;\n if (a.label.toLowerCase() < b.label.toLowerCase()) return -1;\n return 0;\n}\n","import { AtLeastOne } from \"@biblioteksentralen/types\";\nimport { GetSortIndex, compare } from \"./common\";\n\n/**\n * Corresponds to lodash's sortBy called with several comparison functions (no equivalent in radash)\n */\nexport const sortByMultiple = <T>(array: T[], ...indexFunctions: AtLeastOne<GetSortIndex<T>>): T[] =>\n array.slice().sort((left, right) =>\n indexFunctions.slice(1).reduce(\n // If the previous comparison is 0, it means left and right are equal according to the previous\n // comparison function. That's also the only way it'll be falsy, therefore we can\n // use the or operator || to then apply the next comparison function.\n (previous, indexFunction) => previous || compare(left, right, indexFunction),\n compare(left, right, indexFunctions[0]) // Initial comparison\n )\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 Alert({ 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 ButtonProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const Button = ChakraButton as ComponentWithAs<\"button\", ButtonProps>;\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 IconButtonProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButton = ChakraIconButton as ComponentWithAs<\"button\", IconButtonProps>;\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 ConditionalWrapper: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { Box, BoxProps } from \"@chakra-ui/react\";\nimport { ThemeTypings } from \"@chakra-ui/system\";\nimport React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n above?: ThemeTypings[\"breakpoints\"];\n below?: ThemeTypings[\"breakpoints\"];\n} & Omit<BoxProps, \"display\">;\n\n/** Chakras <Hide /> component uses client side javascript to hide components. Causes components to flash on mobile while loading */\nexport const HideWithCSS: FunctionComponent<Props> = ({ children, above, below, ...chakraProps }) => {\n const display: BoxProps[\"display\"] = {\n ...(!!below ? { base: \"none\", [below]: \"block\" } : {}),\n ...(!!above ? { [above]: \"none\" } : {}),\n };\n\n return (\n <Box {...chakraProps} display={display}>\n {children}\n </Box>\n );\n};\n","import { Field, Input as ChakraInput, InputProps, FieldLabelProps } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\nimport { VisuallyHidden } from \"./VisuallyHidden\";\nimport { colors } from \"@biblioteksentralen/utils\";\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 Input = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { HTMLAttributes, ReactNode, useEffect } from \"react\";\nimport { VisuallyHidden as ChakraVisuallyHidden } from \"@chakra-ui/react\";\nimport { isDevelopment } from \"@biblioteksentralen/utils\";\n\ninterface Props extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n// https://www.joshwcomeau.com/snippets/react-components/visually-hidden/\nexport function VisuallyHidden({ children, ...rest }: Props) {\n const [forceShow, setForceShow] = React.useState(false);\n\n useEffect(() => {\n if (isDevelopment()) {\n const handleKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(true);\n }\n };\n const handleKeyUp = (ev: KeyboardEvent) => {\n if (ev.key === \"Alt\") {\n setForceShow(false);\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n window.addEventListener(\"keyup\", handleKeyUp);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n window.removeEventListener(\"keyup\", handleKeyUp);\n };\n }\n }, []);\n\n // position=\"fixed\" løser bug der visually hidden ikke hindret tekst fra å ta plass i bredden\n return forceShow ? <span>{children}</span> : <ChakraVisuallyHidden position=\"fixed\">{children}</ChakraVisuallyHidden>;\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Link as ChakraLink, LinkProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomLinkVariants } from \"../styles/chakraTheme/LinkStyles\";\n\n/**\n * Re-exporting chackras Link with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype LinkVariants = LinkProps[\"variant\"] | CustomLinkVariants;\nexport const Link = ChakraLink as ComponentWithAs<\"a\", Modify<LinkProps, { variant?: LinkVariants }>>;\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","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\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 .1rem white, 0 0 0 .2rem black, 0 0 0 .3rem white !important`,\n transition: \"box-shadow 0.1s ease-out\",\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 { 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 },\n tertiary: {},\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 color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\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 { 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/30\",\n _hover: {\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor/30\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\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 { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { Alert } from \"./Alert\";\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 ErrorBoundary 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 <Alert 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 </Alert>\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 HashLinkTarget(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 { ErrorBoundary } from \"./ErrorBoundary\";\n\nexport const withErrorBoundary = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundary boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundary>\n );\n};\n"],"mappings":";AAAA,cAAc;;;AEAd,SAAS,cAAc;AACvB,SAAS,UAAU;ADDZ,IAAM,SAAS;EACpB,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,gBAAW;EACX,kBAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,mBAAmB;EACnB,SAAS;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IAC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AA,cAACC,MAAA,EAAI,UAAS,YAAW,KAAK,MAAM,gBAAgB,6BAA6B,UAC/E,gBAAAD,OAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,IAAI,MAAM;AAAA,MACV,UAAU,MAAM,gBAAgB,KAAK;AAAA,MACrC,UAAS;AAAA,MACT,KAAK,IAAI,MAAM,cAAc,QAAQ;AAAA,MACrC,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA;AAAA,EACF,CACF;AAEJ;;;ACnDA,OAAOC,YAAW;AAGX,IAAM,oBAAoB,CAAS,WAAuC,iBAAyB;AACxG,SAAO,CAAC,UACN,gBAAAC,OAAA,cAAC,iBAAc,gBACb,gBAAAA,OAAA,cAAC,aAAW,GAAG,OAAO,CACxB;AAEJ;","names":["colors","React","React","React","React","React","React","React","defaultConfig","defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","variants","defineRecipe","React","defaultConfig","Box","React","React","Box","Box","React","React","Box","React","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biblioteksentralen/react",
3
- "version": "3.0.0-beta.10",
3
+ "version": "3.0.0-beta.12",
4
4
  "description": "React library for reusable code in Biblioteksentralens js-apps",
5
5
  "keywords": [],
6
6
  "author": "Biblioteksentralen",