@biblioteksentralen/react 3.1.0 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/ButtonStyles-CRAk2YIJ.d.mts +3 -0
  2. package/dist/ButtonStyles-CRAk2YIJ.d.ts +3 -0
  3. package/dist/chunk-2KZDHLEJ.mjs +9 -0
  4. package/dist/chunk-2KZDHLEJ.mjs.map +1 -0
  5. package/dist/chunk-3IJ454KG.mjs +185 -0
  6. package/dist/chunk-3IJ454KG.mjs.map +1 -0
  7. package/dist/chunk-5GJBW3WE.mjs +270 -0
  8. package/dist/chunk-5GJBW3WE.mjs.map +1 -0
  9. package/dist/chunk-7MKFY66H.mjs +65 -0
  10. package/dist/chunk-7MKFY66H.mjs.map +1 -0
  11. package/dist/chunk-BCT5QU5W.js +142 -0
  12. package/dist/chunk-BCT5QU5W.js.map +1 -0
  13. package/dist/chunk-BN5W6FVN.mjs +50 -0
  14. package/dist/chunk-BN5W6FVN.mjs.map +1 -0
  15. package/dist/chunk-BRFRPPOW.js +10 -0
  16. package/dist/chunk-BRFRPPOW.js.map +1 -0
  17. package/dist/chunk-BZS3AX26.mjs +6 -0
  18. package/dist/chunk-BZS3AX26.mjs.map +1 -0
  19. package/dist/chunk-CGCBID7S.mjs +41 -0
  20. package/dist/chunk-CGCBID7S.mjs.map +1 -0
  21. package/dist/chunk-J5IF7WUN.js +10 -0
  22. package/dist/chunk-J5IF7WUN.js.map +1 -0
  23. package/dist/chunk-NSYSPEHR.js +86 -0
  24. package/dist/chunk-NSYSPEHR.js.map +1 -0
  25. package/dist/chunk-NYKSRUWF.js +51 -0
  26. package/dist/chunk-NYKSRUWF.js.map +1 -0
  27. package/dist/chunk-O4EXBCND.js +19 -0
  28. package/dist/chunk-O4EXBCND.js.map +1 -0
  29. package/dist/chunk-PLWK7HEC.js +75 -0
  30. package/dist/chunk-PLWK7HEC.js.map +1 -0
  31. package/dist/chunk-PQLTQYZ3.mjs +41 -0
  32. package/dist/chunk-PQLTQYZ3.mjs.map +1 -0
  33. package/dist/chunk-QAW4IRLI.js +55 -0
  34. package/dist/chunk-QAW4IRLI.js.map +1 -0
  35. package/dist/chunk-QBXCCJ24.js +344 -0
  36. package/dist/chunk-QBXCCJ24.js.map +1 -0
  37. package/dist/chunk-QX75QJ7F.mjs +132 -0
  38. package/dist/chunk-QX75QJ7F.mjs.map +1 -0
  39. package/dist/chunk-RZUGRIUF.mjs +76 -0
  40. package/dist/chunk-RZUGRIUF.mjs.map +1 -0
  41. package/dist/chunk-UFIMO32F.js +275 -0
  42. package/dist/chunk-UFIMO32F.js.map +1 -0
  43. package/dist/chunk-VSICUYFB.js +51 -0
  44. package/dist/chunk-VSICUYFB.js.map +1 -0
  45. package/dist/chunk-WYQNSPEX.mjs +6 -0
  46. package/dist/chunk-WYQNSPEX.mjs.map +1 -0
  47. package/dist/components/AlertBS.d.mts +18 -0
  48. package/dist/components/AlertBS.d.ts +18 -0
  49. package/dist/components/AlertBS.js +9 -0
  50. package/dist/components/AlertBS.js.map +1 -0
  51. package/dist/components/AlertBS.mjs +5 -0
  52. package/dist/components/AlertBS.mjs.map +1 -0
  53. package/dist/components/BiblioteksentralenProvider.d.mts +10 -0
  54. package/dist/components/BiblioteksentralenProvider.d.ts +10 -0
  55. package/dist/components/BiblioteksentralenProvider.js +10 -0
  56. package/dist/components/BiblioteksentralenProvider.js.map +1 -0
  57. package/dist/components/BiblioteksentralenProvider.mjs +6 -0
  58. package/dist/components/BiblioteksentralenProvider.mjs.map +1 -0
  59. package/dist/components/ButtonBS.d.mts +16 -0
  60. package/dist/components/ButtonBS.d.ts +16 -0
  61. package/dist/components/ButtonBS.js +8 -0
  62. package/dist/components/ButtonBS.js.map +1 -0
  63. package/dist/components/ButtonBS.mjs +4 -0
  64. package/dist/components/ButtonBS.mjs.map +1 -0
  65. package/dist/components/ConditionalWrapperBS.d.mts +15 -0
  66. package/dist/components/ConditionalWrapperBS.d.ts +15 -0
  67. package/dist/components/ConditionalWrapperBS.js +8 -0
  68. package/dist/components/ConditionalWrapperBS.js.map +1 -0
  69. package/dist/components/ConditionalWrapperBS.mjs +4 -0
  70. package/dist/components/ConditionalWrapperBS.mjs.map +1 -0
  71. package/dist/components/ErrorBoundaryBS.d.mts +21 -0
  72. package/dist/components/ErrorBoundaryBS.d.ts +21 -0
  73. package/dist/components/ErrorBoundaryBS.js +10 -0
  74. package/dist/components/ErrorBoundaryBS.js.map +1 -0
  75. package/dist/components/ErrorBoundaryBS.mjs +6 -0
  76. package/dist/components/ErrorBoundaryBS.mjs.map +1 -0
  77. package/dist/components/HashLinkTargetBS.d.mts +16 -0
  78. package/dist/components/HashLinkTargetBS.d.ts +16 -0
  79. package/dist/components/HashLinkTargetBS.js +10 -0
  80. package/dist/components/HashLinkTargetBS.js.map +1 -0
  81. package/dist/components/HashLinkTargetBS.mjs +6 -0
  82. package/dist/components/HashLinkTargetBS.mjs.map +1 -0
  83. package/dist/components/IconButtonBS.d.mts +16 -0
  84. package/dist/components/IconButtonBS.d.ts +16 -0
  85. package/dist/components/IconButtonBS.js +8 -0
  86. package/dist/components/IconButtonBS.js.map +1 -0
  87. package/dist/components/IconButtonBS.mjs +4 -0
  88. package/dist/components/IconButtonBS.mjs.map +1 -0
  89. package/dist/components/InputBS.d.mts +18 -0
  90. package/dist/components/InputBS.d.ts +18 -0
  91. package/dist/components/InputBS.js +8 -0
  92. package/dist/components/InputBS.js.map +1 -0
  93. package/dist/components/InputBS.mjs +4 -0
  94. package/dist/components/InputBS.mjs.map +1 -0
  95. package/dist/components/withErrorBoundaryBS.d.mts +5 -0
  96. package/dist/components/withErrorBoundaryBS.d.ts +5 -0
  97. package/dist/components/withErrorBoundaryBS.js +11 -0
  98. package/dist/components/withErrorBoundaryBS.js.map +1 -0
  99. package/dist/components/withErrorBoundaryBS.mjs +7 -0
  100. package/dist/components/withErrorBoundaryBS.mjs.map +1 -0
  101. package/dist/index.d.mts +15 -0
  102. package/dist/index.d.ts +13 -106
  103. package/dist/index.js +38 -748
  104. package/dist/index.js.map +1 -1
  105. package/dist/index.mjs +13 -419
  106. package/dist/index.mjs.map +1 -1
  107. package/package.json +27 -11
  108. /package/{LICENSE → dist/LICENSE} +0 -0
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/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/components/HashLinkTargetBS.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/components/withErrorBoundaryBS.tsx","../src/BiblioteksentralenProvider.tsx"],"names":["import_react","React","colors","ChakraAlert","ChakraButton","ChakraIconButton","ChakraInput","variants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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ADtCD,IAAM,6BAA6B;AAAA,EACjC,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,eAAe;AAAA,MACf,cAAc;AAAA,MACd,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAKO,SAAS,iBAAiB,OAAc;AAC7C,SACE,+BAAAN,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;;;ASnDA,IAAAD,iBAAkB;AAGX,IAAM,sBAAsB,CAAS,WAAuC,iBAAyB;AAC1G,SAAO,CAAC,UACN,+BAAAC,QAAA,cAAC,mBAAgB,gBACf,+BAAAA,QAAA,cAAC,aAAW,GAAG,OAAO,CACxB;AAEJ;;;ACTA,IAAAD,iBAAiC;AACjC,IAAAA,iBAA0E;AAE1E,oBAAkC;AAO3B,IAAM,6BAA6B,CAAC,UACzC,+BAAAC,QAAA,cAAC,iCAAe,WAAO,6BAAa,8BAAe,+BAA+B,MAAM,eAAe,CAAC,CAAC,KACvG,+BAAAA,QAAA,cAAC,mCAAmB,GAAG,OAAO,CAChC","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 { AlertBS } from \"./components/AlertBS\";\nexport { ButtonBS, type ButtonBSProps } from \"./components/ButtonBS\";\nexport { IconButtonBS, type IconButtonBSProps } from \"./components/IconButtonBS\";\nexport { InputBS } from \"./components/InputBS\";\nexport { ConditionalWrapperBS } from \"./components/ConditionalWrapperBS\";\nexport { ErrorBoundaryBS } from \"./components/ErrorBoundaryBS\";\nexport { HashLinkTargetBS } from \"./components/HashLinkTargetBS\";\nexport { withErrorBoundaryBS } from \"./components/withErrorBoundaryBS\";\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\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 AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras IconButton with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype IconButtonVariants = ChakraIconButtonProps[\"variant\"] | CustomButtonVariants;\nexport type IconButtonBSProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButtonBS = ChakraIconButton as ComponentWithAs<\"button\", IconButtonBSProps>;\n","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n ref?: RefObject<HTMLInputElement | null>;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * Also handles some common needs (helper text and error message. For more advanced input-components we leave it to the consumers to compose custom input-components based on Chakra\n */\nexport const InputBS = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapperBS: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTargetBS(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import React from \"react\";\nimport { ErrorBoundaryBS } from \"./ErrorBoundaryBS\";\n\nexport const withErrorBoundaryBS = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundaryBS boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundaryBS>\n );\n};\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n"]}
1
+ {"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.js","../src/index.ts"],"names":["Object","defineProperty","exports","value","_createStarExport","obj","keys","filter","key","forEach","hasOwnProperty","enumerable","configurable","get","_chunkNSYSPEHRjs","require","_chunkVSICUYFBjs","_chunkNYKSRUWFjs","_chunkBRFRPPOWjs","_chunkO4EXBCNDjs","_chunkUFIMO32Fjs","_chunkBCT5QU5Wjs","_chunkPLWK7HECjs","_chunkQAW4IRLIjs","_chunkJ5IF7WUNjs","_react","AlertBS","BiblioteksentralenProvider","ButtonBS","ConditionalWrapperBS","ErrorBoundaryBS","HashLinkTargetBS","IconButtonBS","InputBS","colors","withErrorBoundaryBS"],"mappings":"AAAA;AAAAA,OAAAC,cAAA,CAAAC,SAAA,cAAA;IAAAC,OAAA;AAAA;AAAA,SAAAC,kBAAAC,GAAA;IAAAL,OAAAM,IAAA,CAAAD,KAAAE,MAAA,CAAA,SAAAC;eAAAA,QAAA,aAAAA,QAAA;OAAAC,OAAA,CAAA,SAAAD;QAAA,IAAAN,QAAAQ,cAAA,CAAAF,MAAA;YAAA;QAAA;QAAAR,OAAAC,cAAA,CAAAC,SAAAM,KAAA;YAAAG,YAAA;YAAAC,cAAA;YAAAC,KAAA;uBAAAR,GAAA,CAAAG,IAAA;;QAAA;IAAA;AAAA;AAAA;AAGA,IAAAM,mBAAAC,QAAA;AAGA,IAAAC,mBAAAD,QAAA;AAGA,IAAAE,mBAAAF,QAAA;AAGA,IAAAG,mBAAAH,QAAA;AAGA,IAAAI,mBAAAJ,QAAA;AAGA,IAAAK,mBAAAL,QAAA;AAGA,IAAAM,mBAAAN,QAAA;AAGA,IAAAO,mBAAAP,QAAA;AACAA,QAAA;AAGA,IAAAQ,mBAAAR,QAAA;AAGA,IAAAS,mBAAAT,QAAA;AAEA,eAAA;ACjCA,IAAAU,SAAAV,QAAA;AAAAX,kBAAAqB;AD8CAvB,QAAAwB,OAAA,GAAAL,iBAAAK,OAAA;AAAAxB,QAAAyB,0BAAA,GAAAV,iBAAAU,0BAAA;AAAAzB,QAAA0B,QAAA,GAAAV,iBAAAU,QAAA;AAAA1B,QAAA2B,oBAAA,GAAAV,iBAAAU,oBAAA;AAAA3B,QAAA4B,eAAA,GAAAV,iBAAAU,eAAA;AAAA5B,QAAA6B,gBAAA,GAAAT,iBAAAS,gBAAA;AAAA7B,QAAA8B,YAAA,GAAAR,iBAAAQ,YAAA;AAAA9B,QAAA+B,OAAA,GAAAnB,iBAAAmB,OAAA;AAAA/B,QAAAgC,MAAA,GAAAX,iBAAAW,MAAA;AAAAhC,QAAAiC,mBAAA,GAAAnB,iBAAAmB,mBAAA","sourcesContent":["\"use strict\";Object.defineProperty(exports, \"__esModule\", {value: true}); function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== \"default\" && key !== \"__esModule\") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }\"use client\";\n\n\nvar _chunkNSYSPEHRjs = require('./chunk-NSYSPEHR.js');\n\n\nvar _chunkVSICUYFBjs = require('./chunk-VSICUYFB.js');\n\n\nvar _chunkNYKSRUWFjs = require('./chunk-NYKSRUWF.js');\n\n\nvar _chunkBRFRPPOWjs = require('./chunk-BRFRPPOW.js');\n\n\nvar _chunkO4EXBCNDjs = require('./chunk-O4EXBCND.js');\n\n\nvar _chunkUFIMO32Fjs = require('./chunk-UFIMO32F.js');\n\n\nvar _chunkBCT5QU5Wjs = require('./chunk-BCT5QU5W.js');\n\n\nvar _chunkPLWK7HECjs = require('./chunk-PLWK7HEC.js');\nrequire('./chunk-QBXCCJ24.js');\n\n\nvar _chunkQAW4IRLIjs = require('./chunk-QAW4IRLI.js');\n\n\nvar _chunkJ5IF7WUNjs = require('./chunk-J5IF7WUN.js');\n\n// src/index.ts\nvar _react = require('@chakra-ui/react'); _createStarExport(_react);\n\n\n\n\n\n\n\n\n\n\n\nexports.AlertBS = _chunkBCT5QU5Wjs.AlertBS; exports.BiblioteksentralenProvider = _chunkNYKSRUWFjs.BiblioteksentralenProvider; exports.ButtonBS = _chunkBRFRPPOWjs.ButtonBS; exports.ConditionalWrapperBS = _chunkO4EXBCNDjs.ConditionalWrapperBS; exports.ErrorBoundaryBS = _chunkUFIMO32Fjs.ErrorBoundaryBS; exports.HashLinkTargetBS = _chunkPLWK7HECjs.HashLinkTargetBS; exports.IconButtonBS = _chunkJ5IF7WUNjs.IconButtonBS; exports.InputBS = _chunkNSYSPEHRjs.InputBS; exports.colors = _chunkQAW4IRLIjs.colors; exports.withErrorBoundaryBS = _chunkVSICUYFBjs.withErrorBoundaryBS;\n","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 { AlertBS } from \"./components/AlertBS\";\nexport { ButtonBS, type ButtonBSProps } from \"./components/ButtonBS\";\nexport { IconButtonBS, type IconButtonBSProps } from \"./components/IconButtonBS\";\nexport { InputBS } from \"./components/InputBS\";\nexport { ConditionalWrapperBS } from \"./components/ConditionalWrapperBS\";\nexport { ErrorBoundaryBS } from \"./components/ErrorBoundaryBS\";\nexport { HashLinkTargetBS } from \"./components/HashLinkTargetBS\";\nexport { withErrorBoundaryBS } from \"./components/withErrorBoundaryBS\";\nexport { BiblioteksentralenProvider } from \"./components/BiblioteksentralenProvider\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n"]}
package/dist/index.mjs CHANGED
@@ -1,422 +1,16 @@
1
+ "use client";
2
+ import { InputBS } from "./chunk-RZUGRIUF.mjs";
3
+ import { withErrorBoundaryBS } from "./chunk-CGCBID7S.mjs";
4
+ import { BiblioteksentralenProvider } from "./chunk-PQLTQYZ3.mjs";
5
+ import { ButtonBS } from "./chunk-WYQNSPEX.mjs";
6
+ import { ConditionalWrapperBS } from "./chunk-2KZDHLEJ.mjs";
7
+ import { ErrorBoundaryBS } from "./chunk-3IJ454KG.mjs";
8
+ import { AlertBS } from "./chunk-QX75QJ7F.mjs";
9
+ import { HashLinkTargetBS } from "./chunk-7MKFY66H.mjs";
10
+ import "./chunk-5GJBW3WE.mjs";
11
+ import { colors } from "./chunk-BN5W6FVN.mjs";
12
+ import { IconButtonBS } from "./chunk-BZS3AX26.mjs";
1
13
  // src/index.ts
2
14
  export * from "@chakra-ui/react";
3
-
4
- // ../utils/dist/index.mjs
5
- import { format } from "date-fns/format";
6
- import { nb } from "date-fns/locale/nb";
7
- var colors = {
8
- black: "#000000",
9
- grey90: "#181818",
10
- grey80: "#333333",
11
- grey60: "#585858",
12
- grey45: "#8c8c8c",
13
- grey30: "#b2b2b2",
14
- grey15: "#d9d9d9",
15
- grey10: "#e5e5e5",
16
- grey05: "#f2f2f2",
17
- white: "#ffffff",
18
- bsR\u00F8dDark: "#870010",
19
- bsR\u00F8dMedium: "#d53d40",
20
- accentPurple: "#331433",
21
- accentPeach: "#ffba99",
22
- accentGreen: "#003b29",
23
- accentBlueDark: "#001740",
24
- accentBlueMedium: "#5996de",
25
- accentYellow: "#ffc970",
26
- lightBlue: "#dbe8ef",
27
- lightGreen: "#dbe0db",
28
- lightPeach: "#f4e7de",
29
- lightPurple: "#ece8f3",
30
- statusRed: "#ad313c",
31
- statusYellow: "#bc5600",
32
- statusGreen: "#24845b",
33
- statusGreenLight: "#edf4f1",
34
- statusRedLight: "#f8efef",
35
- statusYellowLight: "#fff6e4",
36
- neptune: {
37
- "100": "#CFE6E8",
38
- "200": "#9FCDD2",
39
- "300": "#6FB5BB",
40
- "400": "#3F9CA5",
41
- "500": "#0F838E",
42
- "600": "#0C6972",
43
- "700": "#094F55",
44
- "800": "#063439",
45
- "900": "#031A1C"
46
- }
47
- };
48
- function isDevelopment() {
49
- return process.env.NODE_ENV === "development";
50
- }
51
-
52
- // src/components/AlertBS.tsx
53
- import { Alert as ChakraAlert } from "@chakra-ui/react";
54
- import React from "react";
55
- import { AlertCircle, CheckCircle, Info, XCircle } from "react-feather";
56
- var colorLookup = {
57
- info: { bg: colors.lightBlue, color: colors.accentBlueMedium },
58
- warning: { bg: colors.statusYellowLight, color: colors.statusYellow },
59
- success: { bg: colors.statusGreenLight, color: colors.statusGreen },
60
- error: { bg: colors.statusRedLight, color: colors.statusRed }
61
- };
62
- var iconLookup = {
63
- info: /* @__PURE__ */ React.createElement(Info, { strokeWidth: 1.75, role: "img", "aria-label": "Informasjon" }),
64
- warning: /* @__PURE__ */ React.createElement(AlertCircle, { strokeWidth: 1.75, role: "img", "aria-label": "Advarsel" }),
65
- success: /* @__PURE__ */ React.createElement(CheckCircle, { strokeWidth: 1.75, role: "img", "aria-label": "Suksess" }),
66
- error: /* @__PURE__ */ React.createElement(XCircle, { strokeWidth: 1.75, role: "img", "aria-label": "Feil" })
67
- };
68
- var variantStyles = {
69
- inline: {
70
- borderColor: "transparent",
71
- backgroundColor: "transparent",
72
- padding: "0"
73
- }
74
- };
75
- function AlertBS({ status, children, variant, header, ...rest }) {
76
- const colors2 = colorLookup[status];
77
- return /* @__PURE__ */ React.createElement(
78
- ChakraAlert.Root,
79
- {
80
- status,
81
- fontSize: "md",
82
- border: `0.1rem solid`,
83
- borderColor: colors2.color,
84
- backgroundColor: colors2.bg,
85
- display: "flex",
86
- flexWrap: "wrap",
87
- ...variant === "inline" ? variantStyles[variant] : {},
88
- ...rest
89
- },
90
- /* @__PURE__ */ React.createElement(ChakraAlert.Indicator, { marginX: "auto" }, iconLookup[status]),
91
- /* @__PURE__ */ React.createElement(ChakraAlert.Content, { color: "black" }, header && /* @__PURE__ */ React.createElement(ChakraAlert.Title, null, header), /* @__PURE__ */ React.createElement(ChakraAlert.Description, null, children))
92
- );
93
- }
94
-
95
- // src/components/ButtonBS.tsx
96
- import { Button as ChakraButton } from "@chakra-ui/react";
97
- var ButtonBS = ChakraButton;
98
-
99
- // src/components/IconButtonBS.tsx
100
- import { IconButton as ChakraIconButton } from "@chakra-ui/react";
101
- var IconButtonBS = ChakraIconButton;
102
-
103
- // src/components/InputBS.tsx
104
- import { Input as ChakraInput, Field, VisuallyHidden } from "@chakra-ui/react";
105
- import React2 from "react";
106
- var InputBS = (props) => {
107
- const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;
108
- const formLabel = /* @__PURE__ */ React2.createElement(Field.Label, { ...labelProps }, label);
109
- return /* @__PURE__ */ React2.createElement(Field.Root, { invalid: !!errorMessage }, hideLabel ? /* @__PURE__ */ React2.createElement(VisuallyHidden, null, formLabel) : formLabel, helperText && /* @__PURE__ */ React2.createElement(Field.HelperText, null, helperText), /* @__PURE__ */ React2.createElement(ChakraInput, { ...inputProps }), errorMessage && /* @__PURE__ */ React2.createElement(Field.ErrorText, null, errorMessage));
110
- };
111
-
112
- // src/components/ConditionalWrapperBS.tsx
113
- import React3 from "react";
114
- var ConditionalWrapperBS = ({ condition, children, wrapper: Wrapper }) => condition ? /* @__PURE__ */ React3.createElement(Wrapper, null, children) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, children);
115
-
116
- // src/components/ErrorBoundaryBS.tsx
117
- import { Box } from "@chakra-ui/react";
118
- import React4 from "react";
119
- var StyledPre = (props) => /* @__PURE__ */ React4.createElement(Box, { as: "pre", paddingTop: "0.5rem", wordBreak: "break-all", whiteSpace: "pre-wrap", fontSize: "0.8rem", ...props });
120
- var ErrorBoundaryBS = class extends React4.Component {
121
- constructor(props) {
122
- super(props);
123
- this.state = { hasError: false };
124
- }
125
- static getDerivedStateFromError(error) {
126
- return { hasError: true };
127
- }
128
- componentDidCatch(error, errorInfo) {
129
- this.setState({ hasError: true, error, errorInfo });
130
- console.error(error, { errorInfo, boundaryName: this.props.boundaryName });
131
- }
132
- render() {
133
- if (this.state.hasError) {
134
- const stackTrace = this.state.errorInfo?.componentStack;
135
- const errormsg = this.state.error?.message;
136
- const info = this.props.boundaryName;
137
- return /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(AlertBS, { status: "error" }, /* @__PURE__ */ React4.createElement("p", null, "Beklager, det skjedde en teknisk feil."), isDevelopment() && (stackTrace || errormsg) && /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(StyledPre, null, errormsg || ""), /* @__PURE__ */ React4.createElement(StyledPre, null, info || ""), /* @__PURE__ */ React4.createElement(StyledPre, null, stackTrace || ""))));
138
- }
139
- return this.props.children;
140
- }
141
- };
142
-
143
- // src/components/HashLinkTargetBS.tsx
144
- import { Box as Box2 } from "@chakra-ui/react";
145
- import React5 from "react";
146
-
147
- // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
148
- import { defineConfig, defineTokens } from "@chakra-ui/react";
149
-
150
- // src/styles/chakraTheme/ButtonStyles.ts
151
- import { defaultConfig, defineRecipe } from "@chakra-ui/react";
152
- var variants = {
153
- primary: {
154
- backgroundColor: colors.black,
155
- color: "white",
156
- _hover: {
157
- backgroundColor: "hsla(0deg, 0%, 70%, 1)",
158
- color: "black"
159
- }
160
- },
161
- secondary: {
162
- borderColor: "currentColor",
163
- color: "currentColor",
164
- backgroundColor: "transparent",
165
- _hover: {
166
- backgroundColor: "currentColor/7"
167
- }
168
- },
169
- tertiary: {
170
- color: "currentColor",
171
- backgroundColor: "transparent",
172
- _hover: {
173
- backgroundColor: "currentColor/7"
174
- }
175
- },
176
- // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.
177
- ...defaultConfig.theme?.recipes?.button?.variants?.variant
178
- };
179
- var ButtonStyles = defineRecipe({
180
- base: {
181
- borderColor: "transparent",
182
- borderWidth: "0.1em",
183
- fontWeight: 600,
184
- _disabled: {
185
- backgroundColor: `${colors.grey45}`,
186
- color: "white",
187
- opacity: 1
188
- }
189
- },
190
- variants: {
191
- variant: variants,
192
- size: {
193
- sm: {
194
- h: "8",
195
- px: "2",
196
- textStyle: "md"
197
- },
198
- md: {
199
- textStyle: "md"
200
- },
201
- lg: {
202
- h: "12",
203
- textStyle: "lg"
204
- }
205
- }
206
- },
207
- defaultVariants: {
208
- variant: "primary",
209
- size: "md"
210
- }
211
- });
212
-
213
- // src/styles/chakraTheme/ContainerStyles.ts
214
- import { defineRecipe as defineRecipe2 } from "@chakra-ui/react";
215
- var ContainerStyles = defineRecipe2({
216
- base: {
217
- px: ".75rem"
218
- // Padding left/right
219
- }
220
- });
221
-
222
- // src/styles/chakraTheme/HeadingStyles.ts
223
- import { defineRecipe as defineRecipe3 } from "@chakra-ui/react";
224
- var HeadingStyles = defineRecipe3({
225
- base: {
226
- fontWeight: "600"
227
- }
228
- });
229
-
230
- // src/styles/chakraTheme/InputStyles.ts
231
- import { defineRecipe as defineRecipe4 } from "@chakra-ui/react";
232
- var variants2 = {
233
- subtle: {
234
- backgroundColor: { _light: "gray.200", _dark: "whiteAlpha.100" },
235
- _hover: {
236
- bg: { _light: "gray.300", _dark: "whiteAlpha.200" }
237
- }
238
- },
239
- outline: {
240
- borderColor: { _light: "gray.300", _dark: "whiteAlpha.300" },
241
- _hover: {
242
- borderColor: { _light: "gray.400", _dark: "whiteAlpha.400" }
243
- }
244
- },
245
- flushed: {
246
- borderColor: { _light: "gray.300", _dark: "whiteAlpha.300" },
247
- _hover: {
248
- borderColor: { _light: "gray.400", _dark: "whiteAlpha.400" }
249
- }
250
- }
251
- };
252
- var InputStyles = defineRecipe4({
253
- base: {
254
- _placeholder: {
255
- color: { _light: "gray.500", _dark: "whiteAlpha.500" }
256
- }
257
- },
258
- variants: {
259
- variant: variants2
260
- },
261
- defaultVariants: {
262
- variant: "subtle"
263
- }
264
- });
265
-
266
- // src/styles/chakraTheme/SpinnerStyles.ts
267
- import { defineRecipe as defineRecipe5 } from "@chakra-ui/react";
268
- var SpinnerStyles = defineRecipe5({
269
- base: {
270
- animationDuration: ".8s",
271
- color: colors.accentBlueMedium,
272
- // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color
273
- borderWidth: ".175em"
274
- }
275
- });
276
-
277
- // src/styles/chakraTheme/sizes.ts
278
- var container = {
279
- sm: { value: "40rem" },
280
- md: { value: "48rem" },
281
- lg: { value: "56rem" },
282
- // Forsøker 56rem som standardbredde etter testing med Katrine
283
- xl: { value: "80rem" }
284
- };
285
- var sizes = {
286
- container
287
- };
288
-
289
- // src/styles/chakraTheme/LinkStyles.ts
290
- import { defineRecipe as defineRecipe6 } from "@chakra-ui/react";
291
- var variants3 = {
292
- plain: {
293
- color: "currentColor",
294
- textDecoration: "none",
295
- textDecorationColor: "currentColor",
296
- _hover: {
297
- textDecorationColor: "currentColor",
298
- textDecoration: "underline"
299
- }
300
- },
301
- underline: {
302
- color: "currentColor",
303
- textDecoration: "underline",
304
- textDecorationColor: "currentColor",
305
- _hover: {
306
- textDecoration: "none"
307
- }
308
- }
309
- };
310
- var LinkStyles = defineRecipe6({
311
- base: {
312
- _focus: {
313
- outline: "none"
314
- }
315
- },
316
- variants: {
317
- variant: variants3
318
- },
319
- defaultVariants: {
320
- variant: "underline"
321
- }
322
- });
323
-
324
- // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
325
- var tokens = defineTokens({
326
- sizes
327
- });
328
- var globalHyphens = {
329
- hyphens: "auto",
330
- hyphenateLimitChars: "8 5 3"
331
- // minimum word-length / min letters first line / min letters second line
332
- };
333
- var focusStyle = {
334
- outline: "none !important",
335
- boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,
336
- transition: "box-shadow 0.1s ease-out"
337
- // Transition makes the newly focused element "pop in" and easier to spot
338
- };
339
- var biblioteksentralenChakraTheme = defineConfig({
340
- theme: {
341
- tokens,
342
- recipes: {
343
- heading: HeadingStyles,
344
- button: ButtonStyles,
345
- input: InputStyles,
346
- link: LinkStyles,
347
- container: ContainerStyles,
348
- spinner: SpinnerStyles
349
- }
350
- },
351
- globalCss: {
352
- html: {
353
- fontSize: { base: "112.5%", md: "120%" },
354
- // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,
355
- // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)
356
- "&:focus-within": { scrollBehavior: "smooth !important" }
357
- },
358
- body: {
359
- ...globalHyphens
360
- },
361
- // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus
362
- "*:focus-visible": focusStyle
363
- }
364
- });
365
-
366
- // src/components/HashLinkTargetBS.tsx
367
- var focusOnRelativeParentStyle = {
368
- _focusWithin: {
369
- position: "static",
370
- boxShadow: "none",
371
- "&::after": {
372
- content: '""',
373
- position: "absolute",
374
- top: 0,
375
- left: 0,
376
- height: "100%",
377
- width: "100%",
378
- pointerEvents: "none",
379
- borderRadius: "0.25rem",
380
- ...focusStyle
381
- }
382
- }
383
- };
384
- function HashLinkTargetBS(props) {
385
- return /* @__PURE__ */ React5.createElement(Box2, { position: "relative", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ React5.createElement(
386
- Box2,
387
- {
388
- id: props.id,
389
- tabIndex: props.focusOnParent ? -1 : void 0,
390
- position: "absolute",
391
- top: `-${props.spaceAbove || "2.5rem"}`,
392
- _focus: {
393
- boxShadow: "none !important"
394
- }
395
- }
396
- ));
397
- }
398
-
399
- // src/components/withErrorBoundaryBS.tsx
400
- import React6 from "react";
401
- var withErrorBoundaryBS = (Component, boundaryName) => {
402
- return (props) => /* @__PURE__ */ React6.createElement(ErrorBoundaryBS, { boundaryName }, /* @__PURE__ */ React6.createElement(Component, { ...props }));
403
- };
404
-
405
- // src/BiblioteksentralenProvider.tsx
406
- import React7 from "react";
407
- import { ChakraProvider, createSystem, defaultConfig as defaultConfig2 } from "@chakra-ui/react";
408
- import { ColorModeProvider } from "@chakra-ui/system";
409
- var BiblioteksentralenProvider = (props) => /* @__PURE__ */ React7.createElement(ChakraProvider, { value: createSystem(defaultConfig2, biblioteksentralenChakraTheme, props.customTheme || {}) }, /* @__PURE__ */ React7.createElement(ColorModeProvider, { ...props }));
410
- export {
411
- AlertBS,
412
- BiblioteksentralenProvider,
413
- ButtonBS,
414
- ConditionalWrapperBS,
415
- ErrorBoundaryBS,
416
- HashLinkTargetBS,
417
- IconButtonBS,
418
- InputBS,
419
- colors,
420
- withErrorBoundaryBS
421
- };
15
+ export { AlertBS, BiblioteksentralenProvider, ButtonBS, ConditionalWrapperBS, ErrorBoundaryBS, HashLinkTargetBS, IconButtonBS, InputBS, colors, withErrorBoundaryBS };
422
16
  //# 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/AlertBS.tsx","../src/components/ButtonBS.tsx","../src/components/IconButtonBS.tsx","../src/components/InputBS.tsx","../src/components/ConditionalWrapperBS.tsx","../src/components/ErrorBoundaryBS.tsx","../src/components/HashLinkTargetBS.tsx","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts","../src/components/withErrorBoundaryBS.tsx","../src/BiblioteksentralenProvider.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 { AlertBS } from \"./components/AlertBS\";\nexport { ButtonBS, type ButtonBSProps } from \"./components/ButtonBS\";\nexport { IconButtonBS, type IconButtonBSProps } from \"./components/IconButtonBS\";\nexport { InputBS } from \"./components/InputBS\";\nexport { ConditionalWrapperBS } from \"./components/ConditionalWrapperBS\";\nexport { ErrorBoundaryBS } from \"./components/ErrorBoundaryBS\";\nexport { HashLinkTargetBS } from \"./components/HashLinkTargetBS\";\nexport { withErrorBoundaryBS } from \"./components/withErrorBoundaryBS\";\nexport { BiblioteksentralenProvider } from \"./BiblioteksentralenProvider\";\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 AlertBS({ status, children, variant, header, ...rest }: Props) {\n const colors = colorLookup[status];\n return (\n <ChakraAlert.Root\n status={status}\n fontSize=\"md\"\n border={`0.1rem solid`}\n borderColor={colors.color}\n backgroundColor={colors.bg}\n display=\"flex\"\n flexWrap=\"wrap\"\n {...(variant === \"inline\" ? variantStyles[variant] : {})}\n {...rest}\n >\n <ChakraAlert.Indicator marginX=\"auto\">{iconLookup[status]}</ChakraAlert.Indicator>\n <ChakraAlert.Content color=\"black\">\n {header && <ChakraAlert.Title>{header}</ChakraAlert.Title>}\n <ChakraAlert.Description>{children}</ChakraAlert.Description>\n </ChakraAlert.Content>\n </ChakraAlert.Root>\n );\n}\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { Button as ChakraButton, ButtonProps as NativeButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras Button with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype ButtonVariants = NativeButtonProps[\"variant\"] | CustomButtonVariants;\nexport type ButtonBSProps = Modify<NativeButtonProps, { variant?: ButtonVariants }>;\nexport const ButtonBS = ChakraButton as ComponentWithAs<\"button\", ButtonBSProps>;\n","import { Modify } from \"@biblioteksentralen/types\";\nimport { IconButton as ChakraIconButton, IconButtonProps as ChakraIconButtonProps } from \"@chakra-ui/react\";\nimport { ComponentWithAs } from \"@chakra-ui/system\";\nimport { CustomButtonVariants } from \"../styles/chakraTheme/ButtonStyles\";\n\n/**\n * Re-exporting chackras IconButton with a customised types\n * This causes both chakras native variants and our home-made variants to show up in auto-complete\n */\ntype IconButtonVariants = ChakraIconButtonProps[\"variant\"] | CustomButtonVariants;\nexport type IconButtonBSProps = Modify<ChakraIconButtonProps, { variant?: IconButtonVariants }>;\nexport const IconButtonBS = ChakraIconButton as ComponentWithAs<\"button\", IconButtonBSProps>;\n","import { Input as ChakraInput, Field, FieldLabelProps, InputProps, VisuallyHidden } from \"@chakra-ui/react\";\nimport React, { RefObject } from \"react\";\n\ninterface Props extends InputProps {\n label: string;\n hideLabel?: boolean;\n labelProps?: FieldLabelProps;\n helperText?: string;\n errorMessage?: string;\n ref?: RefObject<HTMLInputElement | null>;\n}\n\n/**\n * Creating custom input-component to make sure label is always set (for accessibility)\n * Also handles some common needs (helper text and error message. For more advanced input-components we leave it to the consumers to compose custom input-components based on Chakra\n */\nexport const InputBS = (props: Props) => {\n const { labelProps, label, helperText, errorMessage, hideLabel, ...inputProps } = props;\n\n const formLabel = <Field.Label {...labelProps}>{label}</Field.Label>;\n\n return (\n <Field.Root invalid={!!errorMessage}>\n {hideLabel ? <VisuallyHidden>{formLabel}</VisuallyHidden> : formLabel}\n {helperText && <Field.HelperText>{helperText}</Field.HelperText>}\n <ChakraInput {...inputProps} />\n {errorMessage && <Field.ErrorText>{errorMessage}</Field.ErrorText>}\n </Field.Root>\n );\n};\n","import React, { FunctionComponent, ReactNode } from \"react\";\n\ntype Props = {\n children: ReactNode;\n wrapper: FunctionComponent<{ children: ReactNode }>;\n condition: boolean;\n};\n\n/**\n * Conditionally wrapps children with a component. If conditions are not met children mounted without the wrapper.\n */\nexport const ConditionalWrapperBS: FunctionComponent<Props> = ({ condition, children, wrapper: Wrapper }) =>\n condition ? <Wrapper>{children}</Wrapper> : <>{children}</>;\n","import { isDevelopment } from \"@biblioteksentralen/utils\";\nimport { Box, BoxProps } from \"@chakra-ui/react\";\nimport React, { ErrorInfo, ReactNode } from \"react\";\nimport { AlertBS } from \"./AlertBS\";\n\ninterface Props {\n boundaryName?: string;\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n error?: Error;\n errorInfo?: ErrorInfo;\n}\n\nconst StyledPre = (props: BoxProps) => (\n <Box as=\"pre\" paddingTop=\"0.5rem\" wordBreak=\"break-all\" whiteSpace=\"pre-wrap\" fontSize=\"0.8rem\" {...props} />\n);\n\nexport class ErrorBoundaryBS extends React.Component<Props, State> {\n constructor(props: any) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError(error: any) {\n return { hasError: true };\n }\n\n componentDidCatch(error: any, errorInfo: any) {\n this.setState({ hasError: true, error, errorInfo });\n console.error(error, { errorInfo, boundaryName: this.props.boundaryName });\n }\n\n render() {\n if (this.state.hasError) {\n const stackTrace = this.state.errorInfo?.componentStack;\n const errormsg = this.state.error?.message;\n const info = this.props.boundaryName;\n\n return (\n <div>\n <AlertBS status=\"error\">\n <p>Beklager, det skjedde en teknisk feil.</p>\n {isDevelopment() && (stackTrace || errormsg) && (\n <div>\n <StyledPre>{errormsg || \"\"}</StyledPre>\n <StyledPre>{info || \"\"}</StyledPre>\n <StyledPre>{stackTrace || \"\"}</StyledPre>\n </div>\n )}\n </AlertBS>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n","import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTargetBS(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n","import { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defaultConfig, defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomButtonVariants = \"primary\" | \"secondary\" | \"tertiary\";\n\nconst variants: Record<CustomButtonVariants, SystemStyleObject> = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\",\n },\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\",\n },\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant,\n};\n\nexport const ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1,\n },\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\",\n },\n md: {\n textStyle: \"md\",\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\",\n },\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n","import React from \"react\";\nimport { ErrorBoundaryBS } from \"./ErrorBoundaryBS\";\n\nexport const withErrorBoundaryBS = <Props,>(Component: React.ComponentType<Props>, boundaryName: string) => {\n return (props: Props & React.JSX.IntrinsicAttributes) => (\n <ErrorBoundaryBS boundaryName={boundaryName}>\n <Component {...props} />\n </ErrorBoundaryBS>\n );\n};\n","import React, { ReactNode } from \"react\";\nimport { ChakraProvider, createSystem, defaultConfig, SystemConfig } from \"@chakra-ui/react\";\nimport { biblioteksentralenChakraTheme } from \"./styles/chakraTheme/biblioteksentralenChakraTheme\";\nimport { ColorModeProvider } from \"@chakra-ui/system\";\n\ninterface Props {\n children: ReactNode;\n customTheme?: SystemConfig;\n}\n\nexport const BiblioteksentralenProvider = (props: Props) => (\n <ChakraProvider value={createSystem(defaultConfig, biblioteksentralenChakraTheme, props.customTheme || {})}>\n <ColorModeProvider {...props} />\n </ChakraProvider>\n);\n"],"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;IAC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d,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAKO,SAAS,iBAAiB,OAAc;AAC7C,SACE,gBAAAC,OAAA,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;;;ASnDA,OAAOC,YAAW;AAGX,IAAM,sBAAsB,CAAS,WAAuC,iBAAyB;AAC1G,SAAO,CAAC,UACN,gBAAAC,OAAA,cAAC,mBAAgB,gBACf,gBAAAA,OAAA,cAAC,aAAW,GAAG,OAAO,CACxB;AAEJ;;;ACTA,OAAOC,YAA0B;AACjC,SAAS,gBAAgB,cAAc,iBAAAC,sBAAmC;AAE1E,SAAS,yBAAyB;AAO3B,IAAM,6BAA6B,CAAC,UACzC,gBAAAC,OAAA,cAAC,kBAAe,OAAO,aAAaC,gBAAe,+BAA+B,MAAM,eAAe,CAAC,CAAC,KACvG,gBAAAD,OAAA,cAAC,qBAAmB,GAAG,OAAO,CAChC;","names":["colors","React","React","React","React","Box","React","defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","defineRecipe","variants","React","Box","React","React","React","defaultConfig","React","defaultConfig"]}
1
+ {"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/index.mjs","../src/index.ts"],"names":["InputBS","withErrorBoundaryBS","BiblioteksentralenProvider","ButtonBS","ConditionalWrapperBS","ErrorBoundaryBS","AlertBS","HashLinkTargetBS","colors","IconButtonBS"],"mappings":"AAAA;AACA,SACEA,OAAO,QACF,uBAAuB;AAC9B,SACEC,mBAAmB,QACd,uBAAuB;AAC9B,SACEC,0BAA0B,QACrB,uBAAuB;AAC9B,SACEC,QAAQ,QACH,uBAAuB;AAC9B,SACEC,oBAAoB,QACf,uBAAuB;AAC9B,SACEC,eAAe,QACV,uBAAuB;AAC9B,SACEC,OAAO,QACF,uBAAuB;AAC9B,SACEC,gBAAgB,QACX,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,SACEC,MAAM,QACD,uBAAuB;AAC9B,SACEC,YAAY,QACP,uBAAuB;AAE9B,eAAe;ACjCf,cAAc,mBAAA;ADmCd,SACEH,OAAO,EACPJ,0BAA0B,EAC1BC,QAAQ,EACRC,oBAAoB,EACpBC,eAAe,EACfE,gBAAgB,EAChBE,YAAY,EACZT,OAAO,EACPQ,MAAM,EACNP,mBAAmB,GACnB","sourcesContent":["\"use client\";\nimport {\n InputBS\n} from \"./chunk-RZUGRIUF.mjs\";\nimport {\n withErrorBoundaryBS\n} from \"./chunk-CGCBID7S.mjs\";\nimport {\n BiblioteksentralenProvider\n} from \"./chunk-PQLTQYZ3.mjs\";\nimport {\n ButtonBS\n} from \"./chunk-WYQNSPEX.mjs\";\nimport {\n ConditionalWrapperBS\n} from \"./chunk-2KZDHLEJ.mjs\";\nimport {\n ErrorBoundaryBS\n} from \"./chunk-3IJ454KG.mjs\";\nimport {\n AlertBS\n} from \"./chunk-QX75QJ7F.mjs\";\nimport {\n HashLinkTargetBS\n} from \"./chunk-7MKFY66H.mjs\";\nimport \"./chunk-5GJBW3WE.mjs\";\nimport {\n colors\n} from \"./chunk-BN5W6FVN.mjs\";\nimport {\n IconButtonBS\n} from \"./chunk-BZS3AX26.mjs\";\n\n// src/index.ts\nexport * from \"@chakra-ui/react\";\nexport {\n AlertBS,\n BiblioteksentralenProvider,\n ButtonBS,\n ConditionalWrapperBS,\n ErrorBoundaryBS,\n HashLinkTargetBS,\n IconButtonBS,\n InputBS,\n colors,\n withErrorBoundaryBS\n};\n","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 { AlertBS } from \"./components/AlertBS\";\nexport { ButtonBS, type ButtonBSProps } from \"./components/ButtonBS\";\nexport { IconButtonBS, type IconButtonBSProps } from \"./components/IconButtonBS\";\nexport { InputBS } from \"./components/InputBS\";\nexport { ConditionalWrapperBS } from \"./components/ConditionalWrapperBS\";\nexport { ErrorBoundaryBS } from \"./components/ErrorBoundaryBS\";\nexport { HashLinkTargetBS } from \"./components/HashLinkTargetBS\";\nexport { withErrorBoundaryBS } from \"./components/withErrorBoundaryBS\";\nexport { BiblioteksentralenProvider } from \"./components/BiblioteksentralenProvider\";\n\nexport { colors } from \"@biblioteksentralen/utils\"; // Re-export colors for convenience\n"]}