@biblioteksentralen/react 4.0.0-beta.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 (72) hide show
  1. package/dist/chunk-2KZDHLEJ.mjs +4 -5
  2. package/dist/chunk-2KZDHLEJ.mjs.map +1 -1
  3. package/dist/chunk-3IJ454KG.mjs +179 -33
  4. package/dist/chunk-3IJ454KG.mjs.map +1 -1
  5. package/dist/chunk-5GJBW3WE.mjs +217 -176
  6. package/dist/chunk-5GJBW3WE.mjs.map +1 -1
  7. package/dist/chunk-7MKFY66H.mjs +55 -34
  8. package/dist/chunk-7MKFY66H.mjs.map +1 -1
  9. package/dist/chunk-BCT5QU5W.js.map +1 -1
  10. package/dist/chunk-BN5W6FVN.mjs +41 -46
  11. package/dist/chunk-BN5W6FVN.mjs.map +1 -1
  12. package/dist/chunk-BRFRPPOW.js.map +1 -1
  13. package/dist/chunk-BZS3AX26.mjs +1 -5
  14. package/dist/chunk-BZS3AX26.mjs.map +1 -1
  15. package/dist/chunk-CGCBID7S.mjs +36 -10
  16. package/dist/chunk-CGCBID7S.mjs.map +1 -1
  17. package/dist/chunk-J5IF7WUN.js.map +1 -1
  18. package/dist/chunk-NSYSPEHR.js.map +1 -1
  19. package/dist/chunk-NYKSRUWF.js.map +1 -1
  20. package/dist/chunk-O4EXBCND.js.map +1 -1
  21. package/dist/chunk-PLWK7HEC.js.map +1 -1
  22. package/dist/chunk-PQLTQYZ3.mjs +34 -8
  23. package/dist/chunk-PQLTQYZ3.mjs.map +1 -1
  24. package/dist/chunk-QAW4IRLI.js.map +1 -1
  25. package/dist/chunk-QBXCCJ24.js.map +1 -1
  26. package/dist/chunk-QX75QJ7F.mjs +119 -39
  27. package/dist/chunk-QX75QJ7F.mjs.map +1 -1
  28. package/dist/chunk-RZUGRIUF.mjs +68 -9
  29. package/dist/chunk-RZUGRIUF.mjs.map +1 -1
  30. package/dist/chunk-UFIMO32F.js.map +1 -1
  31. package/dist/chunk-VSICUYFB.js.map +1 -1
  32. package/dist/chunk-WYQNSPEX.mjs +1 -5
  33. package/dist/chunk-WYQNSPEX.mjs.map +1 -1
  34. package/dist/components/AlertBS.js.map +1 -1
  35. package/dist/components/AlertBS.mjs +2 -6
  36. package/dist/components/AlertBS.mjs.map +1 -1
  37. package/dist/components/BiblioteksentralenProvider.js.map +1 -1
  38. package/dist/components/BiblioteksentralenProvider.mjs +2 -6
  39. package/dist/components/BiblioteksentralenProvider.mjs.map +1 -1
  40. package/dist/components/ButtonBS.d.mts +1 -1
  41. package/dist/components/ButtonBS.d.ts +1 -1
  42. package/dist/components/ButtonBS.js.map +1 -1
  43. package/dist/components/ButtonBS.mjs +2 -6
  44. package/dist/components/ButtonBS.mjs.map +1 -1
  45. package/dist/components/ConditionalWrapperBS.js.map +1 -1
  46. package/dist/components/ConditionalWrapperBS.mjs +2 -6
  47. package/dist/components/ConditionalWrapperBS.mjs.map +1 -1
  48. package/dist/components/ErrorBoundaryBS.js.map +1 -1
  49. package/dist/components/ErrorBoundaryBS.mjs +2 -6
  50. package/dist/components/ErrorBoundaryBS.mjs.map +1 -1
  51. package/dist/components/HashLinkTargetBS.js.map +1 -1
  52. package/dist/components/HashLinkTargetBS.mjs +2 -6
  53. package/dist/components/HashLinkTargetBS.mjs.map +1 -1
  54. package/dist/components/IconButtonBS.d.mts +1 -1
  55. package/dist/components/IconButtonBS.d.ts +1 -1
  56. package/dist/components/IconButtonBS.js.map +1 -1
  57. package/dist/components/IconButtonBS.mjs +2 -6
  58. package/dist/components/IconButtonBS.mjs.map +1 -1
  59. package/dist/components/InputBS.js.map +1 -1
  60. package/dist/components/InputBS.mjs +2 -6
  61. package/dist/components/InputBS.mjs.map +1 -1
  62. package/dist/components/withErrorBoundaryBS.js.map +1 -1
  63. package/dist/components/withErrorBoundaryBS.mjs +2 -6
  64. package/dist/components/withErrorBoundaryBS.mjs.map +1 -1
  65. package/dist/index.d.mts +1 -1
  66. package/dist/index.d.ts +1 -1
  67. package/dist/index.js.map +1 -1
  68. package/dist/index.mjs +11 -43
  69. package/dist/index.mjs.map +1 -1
  70. package/package.json +3 -3
  71. /package/dist/{ButtonStyles-7ASDoOwZ.d.mts → ButtonStyles-CRAk2YIJ.d.mts} +0 -0
  72. /package/dist/{ButtonStyles-7ASDoOwZ.d.ts → ButtonStyles-CRAk2YIJ.d.ts} +0 -0
@@ -1,229 +1,270 @@
1
1
  "use client";
2
- import {
3
- colors
4
- } from "./chunk-BN5W6FVN.mjs";
5
-
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ var _defaultConfig_theme_recipes_button_variants, _defaultConfig_theme_recipes_button, _defaultConfig_theme_recipes, _defaultConfig_theme;
31
+ import { colors } from "./chunk-BN5W6FVN.mjs";
6
32
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
7
33
  import { defineConfig, defineTokens } from "@chakra-ui/react";
8
-
9
34
  // src/styles/chakraTheme/ButtonStyles.ts
10
35
  import { defaultConfig, defineRecipe } from "@chakra-ui/react";
11
- var variants = {
12
- primary: {
13
- backgroundColor: colors.black,
14
- color: "white",
15
- _hover: {
16
- backgroundColor: "hsla(0deg, 0%, 70%, 1)",
17
- color: "black"
18
- }
19
- },
20
- secondary: {
21
- borderColor: "currentColor",
22
- color: "currentColor",
23
- backgroundColor: "transparent",
24
- _hover: {
25
- backgroundColor: "currentColor/7"
26
- }
27
- },
28
- tertiary: {
29
- color: "currentColor",
30
- backgroundColor: "transparent",
31
- _hover: {
32
- backgroundColor: "currentColor/7"
36
+ var variants = _object_spread({
37
+ primary: {
38
+ backgroundColor: colors.black,
39
+ color: "white",
40
+ _hover: {
41
+ backgroundColor: "hsla(0deg, 0%, 70%, 1)",
42
+ color: "black"
43
+ }
44
+ },
45
+ secondary: {
46
+ borderColor: "currentColor",
47
+ color: "currentColor",
48
+ backgroundColor: "transparent",
49
+ _hover: {
50
+ backgroundColor: "currentColor/7"
51
+ }
52
+ },
53
+ tertiary: {
54
+ color: "currentColor",
55
+ backgroundColor: "transparent",
56
+ _hover: {
57
+ backgroundColor: "currentColor/7"
58
+ }
33
59
  }
34
- },
35
- // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.
36
- ...defaultConfig.theme?.recipes?.button?.variants?.variant
37
- };
60
+ }, (_defaultConfig_theme = defaultConfig.theme) === null || _defaultConfig_theme === void 0 ? void 0 : (_defaultConfig_theme_recipes = _defaultConfig_theme.recipes) === null || _defaultConfig_theme_recipes === void 0 ? void 0 : (_defaultConfig_theme_recipes_button = _defaultConfig_theme_recipes.button) === null || _defaultConfig_theme_recipes_button === void 0 ? void 0 : (_defaultConfig_theme_recipes_button_variants = _defaultConfig_theme_recipes_button.variants) === null || _defaultConfig_theme_recipes_button_variants === void 0 ? void 0 : _defaultConfig_theme_recipes_button_variants.variant);
38
61
  var ButtonStyles = defineRecipe({
39
- base: {
40
- borderColor: "transparent",
41
- borderWidth: "0.1em",
42
- fontWeight: 600,
43
- _disabled: {
44
- backgroundColor: `${colors.grey45}`,
45
- color: "white",
46
- opacity: 1
47
- }
48
- },
49
- variants: {
50
- variant: variants,
51
- size: {
52
- sm: {
53
- h: "8",
54
- px: "2",
55
- textStyle: "md"
56
- },
57
- md: {
58
- textStyle: "md"
59
- },
60
- lg: {
61
- h: "12",
62
- textStyle: "lg"
63
- }
62
+ base: {
63
+ borderColor: "transparent",
64
+ borderWidth: "0.1em",
65
+ fontWeight: 600,
66
+ _disabled: {
67
+ backgroundColor: "".concat(colors.grey45),
68
+ color: "white",
69
+ opacity: 1
70
+ }
71
+ },
72
+ variants: {
73
+ variant: variants,
74
+ size: {
75
+ sm: {
76
+ h: "8",
77
+ px: "2",
78
+ textStyle: "md"
79
+ },
80
+ md: {
81
+ textStyle: "md"
82
+ },
83
+ lg: {
84
+ h: "12",
85
+ textStyle: "lg"
86
+ }
87
+ }
88
+ },
89
+ defaultVariants: {
90
+ variant: "primary",
91
+ size: "md"
64
92
  }
65
- },
66
- defaultVariants: {
67
- variant: "primary",
68
- size: "md"
69
- }
70
93
  });
71
-
72
94
  // src/styles/chakraTheme/ContainerStyles.ts
73
95
  import { defineRecipe as defineRecipe2 } from "@chakra-ui/react";
74
96
  var ContainerStyles = defineRecipe2({
75
- base: {
76
- px: ".75rem"
77
- // Padding left/right
78
- }
97
+ base: {
98
+ px: ".75rem"
99
+ }
79
100
  });
80
-
81
101
  // src/styles/chakraTheme/HeadingStyles.ts
82
102
  import { defineRecipe as defineRecipe3 } from "@chakra-ui/react";
83
103
  var HeadingStyles = defineRecipe3({
84
- base: {
85
- fontWeight: "600"
86
- }
104
+ base: {
105
+ fontWeight: "600"
106
+ }
87
107
  });
88
-
89
108
  // src/styles/chakraTheme/InputStyles.ts
90
109
  import { defineRecipe as defineRecipe4 } from "@chakra-ui/react";
91
110
  var variants2 = {
92
- subtle: {
93
- backgroundColor: { _light: "gray.200", _dark: "whiteAlpha.100" },
94
- _hover: {
95
- bg: { _light: "gray.300", _dark: "whiteAlpha.200" }
96
- }
97
- },
98
- outline: {
99
- borderColor: { _light: "gray.300", _dark: "whiteAlpha.300" },
100
- _hover: {
101
- borderColor: { _light: "gray.400", _dark: "whiteAlpha.400" }
102
- }
103
- },
104
- flushed: {
105
- borderColor: { _light: "gray.300", _dark: "whiteAlpha.300" },
106
- _hover: {
107
- borderColor: { _light: "gray.400", _dark: "whiteAlpha.400" }
111
+ subtle: {
112
+ backgroundColor: {
113
+ _light: "gray.200",
114
+ _dark: "whiteAlpha.100"
115
+ },
116
+ _hover: {
117
+ bg: {
118
+ _light: "gray.300",
119
+ _dark: "whiteAlpha.200"
120
+ }
121
+ }
122
+ },
123
+ outline: {
124
+ borderColor: {
125
+ _light: "gray.300",
126
+ _dark: "whiteAlpha.300"
127
+ },
128
+ _hover: {
129
+ borderColor: {
130
+ _light: "gray.400",
131
+ _dark: "whiteAlpha.400"
132
+ }
133
+ }
134
+ },
135
+ flushed: {
136
+ borderColor: {
137
+ _light: "gray.300",
138
+ _dark: "whiteAlpha.300"
139
+ },
140
+ _hover: {
141
+ borderColor: {
142
+ _light: "gray.400",
143
+ _dark: "whiteAlpha.400"
144
+ }
145
+ }
108
146
  }
109
- }
110
147
  };
111
148
  var InputStyles = defineRecipe4({
112
- base: {
113
- _placeholder: {
114
- color: { _light: "gray.500", _dark: "whiteAlpha.500" }
149
+ base: {
150
+ _placeholder: {
151
+ color: {
152
+ _light: "gray.500",
153
+ _dark: "whiteAlpha.500"
154
+ }
155
+ }
156
+ },
157
+ variants: {
158
+ variant: variants2
159
+ },
160
+ defaultVariants: {
161
+ variant: "subtle"
115
162
  }
116
- },
117
- variants: {
118
- variant: variants2
119
- },
120
- defaultVariants: {
121
- variant: "subtle"
122
- }
123
163
  });
124
-
125
164
  // src/styles/chakraTheme/SpinnerStyles.ts
126
165
  import { defineRecipe as defineRecipe5 } from "@chakra-ui/react";
127
166
  var SpinnerStyles = defineRecipe5({
128
- base: {
129
- animationDuration: ".8s",
130
- color: colors.accentBlueMedium,
131
- // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color
132
- borderWidth: ".175em"
133
- }
167
+ base: {
168
+ animationDuration: ".8s",
169
+ color: colors.accentBlueMedium,
170
+ // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color
171
+ borderWidth: ".175em"
172
+ }
134
173
  });
135
-
136
174
  // src/styles/chakraTheme/sizes.ts
137
175
  var container = {
138
- sm: { value: "40rem" },
139
- md: { value: "48rem" },
140
- lg: { value: "56rem" },
141
- // Forsøker 56rem som standardbredde etter testing med Katrine
142
- xl: { value: "80rem" }
176
+ sm: {
177
+ value: "40rem"
178
+ },
179
+ md: {
180
+ value: "48rem"
181
+ },
182
+ lg: {
183
+ value: "56rem"
184
+ },
185
+ // Forsøker 56rem som standardbredde etter testing med Katrine
186
+ xl: {
187
+ value: "80rem"
188
+ }
143
189
  };
144
190
  var sizes = {
145
- container
191
+ container: container
146
192
  };
147
-
148
193
  // src/styles/chakraTheme/LinkStyles.ts
149
194
  import { defineRecipe as defineRecipe6 } from "@chakra-ui/react";
150
195
  var variants3 = {
151
- plain: {
152
- color: "currentColor",
153
- textDecoration: "none",
154
- textDecorationColor: "currentColor",
155
- _hover: {
156
- textDecorationColor: "currentColor",
157
- textDecoration: "underline"
158
- }
159
- },
160
- underline: {
161
- color: "currentColor",
162
- textDecoration: "underline",
163
- textDecorationColor: "currentColor",
164
- _hover: {
165
- textDecoration: "none"
196
+ plain: {
197
+ color: "currentColor",
198
+ textDecoration: "none",
199
+ textDecorationColor: "currentColor",
200
+ _hover: {
201
+ textDecorationColor: "currentColor",
202
+ textDecoration: "underline"
203
+ }
204
+ },
205
+ underline: {
206
+ color: "currentColor",
207
+ textDecoration: "underline",
208
+ textDecorationColor: "currentColor",
209
+ _hover: {
210
+ textDecoration: "none"
211
+ }
166
212
  }
167
- }
168
213
  };
169
214
  var LinkStyles = defineRecipe6({
170
- base: {
171
- _focus: {
172
- outline: "none"
215
+ base: {
216
+ _focus: {
217
+ outline: "none"
218
+ }
219
+ },
220
+ variants: {
221
+ variant: variants3
222
+ },
223
+ defaultVariants: {
224
+ variant: "underline"
173
225
  }
174
- },
175
- variants: {
176
- variant: variants3
177
- },
178
- defaultVariants: {
179
- variant: "underline"
180
- }
181
226
  });
182
-
183
227
  // src/styles/chakraTheme/biblioteksentralenChakraTheme.ts
184
228
  var tokens = defineTokens({
185
- sizes
229
+ sizes: sizes
186
230
  });
187
231
  var globalHyphens = {
188
- hyphens: "auto",
189
- hyphenateLimitChars: "8 5 3"
190
- // minimum word-length / min letters first line / min letters second line
232
+ hyphens: "auto",
233
+ hyphenateLimitChars: "8 5 3"
191
234
  };
192
235
  var focusStyle = {
193
- outline: "none !important",
194
- boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,
195
- transition: "box-shadow 0.1s ease-out"
196
- // Transition makes the newly focused element "pop in" and easier to spot
236
+ outline: "none !important",
237
+ boxShadow: "0 0 0 .05rem ".concat(colors.white, ", 0 0 0 .25rem ").concat(colors.accentBlueMedium, ", 0 0 0 .3rem ").concat(colors.white, " !important"),
238
+ transition: "box-shadow 0.1s ease-out"
197
239
  };
198
240
  var biblioteksentralenChakraTheme = defineConfig({
199
- theme: {
200
- tokens,
201
- recipes: {
202
- heading: HeadingStyles,
203
- button: ButtonStyles,
204
- input: InputStyles,
205
- link: LinkStyles,
206
- container: ContainerStyles,
207
- spinner: SpinnerStyles
208
- }
209
- },
210
- globalCss: {
211
- html: {
212
- fontSize: { base: "112.5%", md: "120%" },
213
- // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,
214
- // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)
215
- "&:focus-within": { scrollBehavior: "smooth !important" }
241
+ theme: {
242
+ tokens: tokens,
243
+ recipes: {
244
+ heading: HeadingStyles,
245
+ button: ButtonStyles,
246
+ input: InputStyles,
247
+ link: LinkStyles,
248
+ container: ContainerStyles,
249
+ spinner: SpinnerStyles
250
+ }
216
251
  },
217
- body: {
218
- ...globalHyphens
219
- },
220
- // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus
221
- "*:focus-visible": focusStyle
222
- }
252
+ globalCss: {
253
+ html: {
254
+ fontSize: {
255
+ base: "112.5%",
256
+ md: "120%"
257
+ },
258
+ // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,
259
+ // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)
260
+ "&:focus-within": {
261
+ scrollBehavior: "smooth !important"
262
+ }
263
+ },
264
+ body: _object_spread({}, globalHyphens),
265
+ // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus
266
+ "*:focus-visible": focusStyle
267
+ }
223
268
  });
224
-
225
- export {
226
- focusStyle,
227
- biblioteksentralenChakraTheme
228
- };
269
+ export { focusStyle, biblioteksentralenChakraTheme };
229
270
  //# sourceMappingURL=chunk-5GJBW3WE.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../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"],"sourcesContent":["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"],"mappings":";;;;;;AAAA,SAAS,cAAc,oBAAoB;;;ACC3C,SAAS,eAAe,oBAAuC;AAI/D,IAAM,WAA4D;AAAA,EAChE,SAAS;AAAA,IACP,iBAAiB,OAAO;AAAA,IACxB,OAAO;AAAA,IACP,QAAQ;AAAA,MACN,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,aAAa;AAAA,IACb,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,QAAQ;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,QAAQ;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAAA;AAAA,EAEA,GAAG,cAAc,OAAO,SAAS,QAAQ,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A,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,EACX;AACF,CAAC;;;AP1BD,IAAM,SAAS,aAAa;AAAA,EAC1B;AACF,CAAC;AAMD,IAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,EACT,qBAAqB;AAAA;AACvB;AAEO,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,WAAW,gBAAgB,OAAO,KAAK,kBAAkB,OAAO,gBAAgB,iBAAiB,OAAO,KAAK;AAAA,EAC7G,YAAY;AAAA;AACd;AAEO,IAAM,gCAAgC,aAAa;AAAA,EACxD,OAAO;AAAA,IACL;AAAA,IACA,SAAS;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,MAAM;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,MACJ,UAAU,EAAE,MAAM,UAAU,IAAI,OAAO;AAAA;AAAA;AAAA,MAGvC,kBAAkB,EAAE,gBAAgB,oBAAoB;AAAA,IAC1D;AAAA,IACA,MAAM;AAAA,MACJ,GAAG;AAAA,IACL;AAAA;AAAA,IAEA,mBAAmB;AAAA,EACrB;AACF,CAAC;","names":["defineRecipe","defineRecipe","defineRecipe","variants","defineRecipe","defineRecipe","variants"]}
1
+ {"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/chunk-5GJBW3WE.mjs","../src/styles/chakraTheme/ButtonStyles.ts","../src/styles/chakraTheme/biblioteksentralenChakraTheme.ts","../src/styles/chakraTheme/ContainerStyles.ts","../src/styles/chakraTheme/HeadingStyles.ts","../src/styles/chakraTheme/InputStyles.ts","../src/styles/chakraTheme/SpinnerStyles.ts","../src/styles/chakraTheme/sizes.ts","../src/styles/chakraTheme/LinkStyles.ts"],"names":["defaultConfig","colors","defineConfig","defineTokens","defineRecipe","variants","primary","backgroundColor","black","color","_hover","secondary","borderColor","tertiary","theme","recipes","button","variant","ButtonStyles","base","borderWidth","fontWeight","_disabled","grey45","opacity","size","sm","h","px","textStyle","md","lg","defaultVariants","ContainerStyles","HeadingStyles","subtle","_light","_dark","bg","outline","flushed","InputStyles","_placeholder","SpinnerStyles","animationDuration","accentBlueMedium","container","value","xl","sizes","plain","textDecoration","textDecorationColor","underline","LinkStyles","_focus","tokens","globalHyphens","hyphens","hyphenateLimitChars","focusStyle","boxShadow","white","transition","biblioteksentralenChakraTheme","heading","input","link","spinner","globalCss","html","fontSize","scrollBehavior","body"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IC8BKA,8CAAAA,qCAAAA,8BAAAA;AD7BL,SACEC,MAAM,QACD,uBAAuB;AAE9B,0DAA0D;AEL1D,SAASC,YAAA,EAAcC,YAAA,QAAoB,mBAAA;AFQ3C,yCAAyC;ACPzC,SAASH,aAAA,EAAeI,YAAA,QAAuC,mBAAA;AAI/D,IAAMC,WAA4D;IAChEC,SAAS;QACPC,iBAAiBN,OAAOO,KAAA;QACxBC,OAAO;QACPC,QAAQ;YACNH,iBAAiB;YACjBE,OAAO;QACT;IACF;IACAE,WAAW;QACTC,aAAa;QACbH,OAAO;QACPF,iBAAiB;QACjBG,QAAQ;YACNH,iBAAiB;QACnB;IACF;IACAM,UAAU;QACRJ,OAAO;QACPF,iBAAiB;QACjBG,QAAQ;YACNH,iBAAiB;QACnB;IACF;IAEGP,uBAAAA,cAAcc,KAAA,cAAdd,4CAAAA,+BAAAA,qBAAqBe,OAAA,cAArBf,oDAAAA,sCAAAA,6BAA8BgB,MAAA,cAA9BhB,2DAAAA,+CAAAA,oCAAsCK,QAAA,cAAtCL,mEAAAA,6CAAgDiB,OAAA;AAG9C,IAAMC,eAAed,aAAa;IACvCe,MAAM;QACJP,aAAa;QACbQ,aAAa;QACbC,YAAY;QACZC,WAAW;YACTf,iBAAiB,GAAgB,OAAbN,OAAOsB,MAAM;YACjCd,OAAO;YACPe,SAAS;QACX;IACF;IACAnB,UAAU;QACRY,SAASZ;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ACP0B,MAAMb;YACNR,WAAWb;YACXmC,SAASzB;QACX;IACF;IACA0B,WAAW;QACTC,MAAM;YACJC,UAAU;gBAAEpD,MAAM;gBAAUW,IAAI;YAAO;YAAA,uFAAA;YAAA,yEAAA;YAGvC,kBAAkB;gBAAE0C,gBAAgB;YAAoB;QAC1D;QACAC,MAAM,mBACDhB;QACL,2HAAA;QAEA,mBAAmBG;IACrB;AACF;AF0KA,SACEA,UAAU,EACVI,6BAA6B,GAC7B","sourcesContent":["\"use client\";\nimport {\n colors\n} from \"./chunk-BN5W6FVN.mjs\";\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nimport { defineConfig, defineTokens } from \"@chakra-ui/react\";\n\n// src/styles/chakraTheme/ButtonStyles.ts\nimport { defaultConfig, defineRecipe } from \"@chakra-ui/react\";\nvar variants = {\n primary: {\n backgroundColor: colors.black,\n color: \"white\",\n _hover: {\n backgroundColor: \"hsla(0deg, 0%, 70%, 1)\",\n color: \"black\"\n }\n },\n secondary: {\n borderColor: \"currentColor\",\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n tertiary: {\n color: \"currentColor\",\n backgroundColor: \"transparent\",\n _hover: {\n backgroundColor: \"currentColor/7\"\n }\n },\n // Inherit variants from Chakra's default config. Seems like they are overridden by our custom variants by default.\n ...defaultConfig.theme?.recipes?.button?.variants?.variant\n};\nvar ButtonStyles = defineRecipe({\n base: {\n borderColor: \"transparent\",\n borderWidth: \"0.1em\",\n fontWeight: 600,\n _disabled: {\n backgroundColor: `${colors.grey45}`,\n color: \"white\",\n opacity: 1\n }\n },\n variants: {\n variant: variants,\n size: {\n sm: {\n h: \"8\",\n px: \"2\",\n textStyle: \"md\"\n },\n md: {\n textStyle: \"md\"\n },\n lg: {\n h: \"12\",\n textStyle: \"lg\"\n }\n }\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\"\n }\n});\n\n// src/styles/chakraTheme/ContainerStyles.ts\nimport { defineRecipe as defineRecipe2 } from \"@chakra-ui/react\";\nvar ContainerStyles = defineRecipe2({\n base: {\n px: \".75rem\"\n // Padding left/right\n }\n});\n\n// src/styles/chakraTheme/HeadingStyles.ts\nimport { defineRecipe as defineRecipe3 } from \"@chakra-ui/react\";\nvar HeadingStyles = defineRecipe3({\n base: {\n fontWeight: \"600\"\n }\n});\n\n// src/styles/chakraTheme/InputStyles.ts\nimport { defineRecipe as defineRecipe4 } from \"@chakra-ui/react\";\nvar variants2 = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" }\n }\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" }\n }\n }\n};\nvar InputStyles = defineRecipe4({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" }\n }\n },\n variants: {\n variant: variants2\n },\n defaultVariants: {\n variant: \"subtle\"\n }\n});\n\n// src/styles/chakraTheme/SpinnerStyles.ts\nimport { defineRecipe as defineRecipe5 } from \"@chakra-ui/react\";\nvar SpinnerStyles = defineRecipe5({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\"\n }\n});\n\n// src/styles/chakraTheme/sizes.ts\nvar container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" },\n // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" }\n};\nvar sizes = {\n container\n};\n\n// src/styles/chakraTheme/LinkStyles.ts\nimport { defineRecipe as defineRecipe6 } from \"@chakra-ui/react\";\nvar variants3 = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\"\n }\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\"\n }\n }\n};\nvar LinkStyles = defineRecipe6({\n base: {\n _focus: {\n outline: \"none\"\n }\n },\n variants: {\n variant: variants3\n },\n defaultVariants: {\n variant: \"underline\"\n }\n});\n\n// src/styles/chakraTheme/biblioteksentralenChakraTheme.ts\nvar tokens = defineTokens({\n sizes\n});\nvar globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\"\n // minimum word-length / min letters first line / min letters second line\n};\nvar focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\"\n // Transition makes the newly focused element \"pop in\" and easier to spot\n};\nvar biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles\n }\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" }\n },\n body: {\n ...globalHyphens\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle\n }\n});\n\nexport {\n focusStyle,\n biblioteksentralenChakraTheme\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 { defineConfig, defineTokens } from \"@chakra-ui/react\";\nimport { ButtonStyles } from \"./ButtonStyles\";\nimport { ContainerStyles } from \"./ContainerStyles\";\nimport { HeadingStyles } from \"./HeadingStyles\";\nimport { InputStyles } from \"./InputStyles\";\nimport { SpinnerStyles } from \"./SpinnerStyles\";\nimport { sizes } from \"./sizes\";\nimport { LinkStyles } from \"./LinkStyles\";\nimport { colors } from \"@biblioteksentralen/utils\";\n\nconst tokens = defineTokens({\n sizes,\n});\n\n// https://blog.logrocket.com/guide-css-word-wrap-overflow-wrap-word-break/\n// https://medium.com/clear-left-thinking/all-you-need-to-know-about-hyphenation-in-css-2baee2d89179\n// Skrur på hyphens auto som default fordi vi har masse mikrotekster og små elementer der layout knekker uten dette, og vi lager stadig nye og glemmer å ta hensyn til dette.\n// Så kan man optionaly sette hyphens: none de stedene man ikke ønsker det, men har ikke sett noe som knekker/blir rart pga dette enda\nconst globalHyphens = {\n hyphens: \"auto\",\n hyphenateLimitChars: \"8 5 3\", // minimum word-length / min letters first line / min letters second line\n};\n\nexport const focusStyle = {\n outline: \"none !important\",\n boxShadow: `0 0 0 .05rem ${colors.white}, 0 0 0 .25rem ${colors.accentBlueMedium}, 0 0 0 .3rem ${colors.white} !important`,\n transition: \"box-shadow 0.1s ease-out\", // Transition makes the newly focused element \"pop in\" and easier to spot\n};\n\nexport const biblioteksentralenChakraTheme = defineConfig({\n theme: {\n tokens,\n recipes: {\n heading: HeadingStyles,\n button: ButtonStyles,\n input: InputStyles,\n link: LinkStyles,\n container: ContainerStyles,\n spinner: SpinnerStyles,\n },\n },\n globalCss: {\n html: {\n fontSize: { base: \"112.5%\", md: \"120%\" },\n // Sørger for smooth scrolling for interne lenker som scroller til annet sted på siden,\n // men ikke hvis fokus er utenfor viduet, feks ved søk i tekst (ctrl + f)\n \"&:focus-within\": { scrollBehavior: \"smooth !important\" },\n },\n body: {\n ...globalHyphens,\n },\n // Felles fokus-styling for alle elementer for å sikre at de har en tydelig og uniform visuell indikasjon når de er i fokus\n \"*:focus-visible\": focusStyle,\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const ContainerStyles = defineRecipe({\n base: {\n px: \".75rem\", // Padding left/right\n },\n});\n","import { defineRecipe } from \"@chakra-ui/react\";\n\nexport const HeadingStyles = defineRecipe({\n base: {\n fontWeight: \"600\",\n },\n});\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nconst variants: Record<string, SystemStyleObject> = {\n subtle: {\n backgroundColor: { _light: \"gray.200\", _dark: \"whiteAlpha.100\" },\n _hover: {\n bg: { _light: \"gray.300\", _dark: \"whiteAlpha.200\" },\n },\n },\n outline: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n flushed: {\n borderColor: { _light: \"gray.300\", _dark: \"whiteAlpha.300\" },\n _hover: {\n borderColor: { _light: \"gray.400\", _dark: \"whiteAlpha.400\" },\n },\n },\n};\n\nexport const InputStyles = defineRecipe({\n base: {\n _placeholder: {\n color: { _light: \"gray.500\", _dark: \"whiteAlpha.500\" },\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"subtle\",\n },\n});\n","import { colors } from \"@biblioteksentralen/utils\";\nimport { defineRecipe } from \"@chakra-ui/react\";\n\nexport const SpinnerStyles = defineRecipe({\n base: {\n animationDuration: \".8s\",\n color: colors.accentBlueMedium,\n // Todo: Legg til trackColor: https://chakra-ui.com/docs/components/spinner#track-color\n borderWidth: \".175em\",\n },\n});\n","const container = {\n sm: { value: \"40rem\" },\n md: { value: \"48rem\" },\n lg: { value: \"56rem\" }, // Forsøker 56rem som standardbredde etter testing med Katrine\n xl: { value: \"80rem\" },\n};\n\nexport const sizes = {\n container,\n};\n","import { defineRecipe, SystemStyleObject } from \"@chakra-ui/react\";\n\nexport type CustomLinkVariants = \"plain\" | \"underline\";\n\nconst variants: Record<CustomLinkVariants, SystemStyleObject> = {\n plain: {\n color: \"currentColor\",\n textDecoration: \"none\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecorationColor: \"currentColor\",\n textDecoration: \"underline\",\n },\n },\n underline: {\n color: \"currentColor\",\n textDecoration: \"underline\",\n textDecorationColor: \"currentColor\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n};\n\nexport const LinkStyles = defineRecipe({\n base: {\n _focus: {\n outline: \"none\",\n },\n },\n variants: {\n variant: variants,\n },\n defaultVariants: {\n variant: \"underline\",\n },\n});\n"]}
@@ -1,44 +1,65 @@
1
1
  "use client";
2
- import {
3
- focusStyle
4
- } from "./chunk-5GJBW3WE.mjs";
5
-
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ import { focusStyle } from "./chunk-5GJBW3WE.mjs";
6
31
  // src/components/HashLinkTargetBS.tsx
7
32
  import { Box } from "@chakra-ui/react";
8
33
  import React from "react";
9
34
  var focusOnRelativeParentStyle = {
10
- _focusWithin: {
11
- position: "static",
12
- boxShadow: "none",
13
- "&::after": {
14
- content: '""',
15
- position: "absolute",
16
- top: 0,
17
- left: 0,
18
- height: "100%",
19
- width: "100%",
20
- pointerEvents: "none",
21
- borderRadius: "0.25rem",
22
- ...focusStyle
35
+ _focusWithin: {
36
+ position: "static",
37
+ boxShadow: "none",
38
+ "&::after": _object_spread({
39
+ content: '""',
40
+ position: "absolute",
41
+ top: 0,
42
+ left: 0,
43
+ height: "100%",
44
+ width: "100%",
45
+ pointerEvents: "none",
46
+ borderRadius: "0.25rem"
47
+ }, focusStyle)
23
48
  }
24
- }
25
49
  };
26
50
  function HashLinkTargetBS(props) {
27
- return /* @__PURE__ */ React.createElement(Box, { position: "relative", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ React.createElement(
28
- Box,
29
- {
30
- id: props.id,
31
- tabIndex: props.focusOnParent ? -1 : void 0,
32
- position: "absolute",
33
- top: `-${props.spaceAbove || "2.5rem"}`,
34
- _focus: {
35
- boxShadow: "none !important"
36
- }
37
- }
38
- ));
51
+ return /* @__PURE__ */ React.createElement(Box, {
52
+ position: "relative",
53
+ css: props.focusOnParent ? focusOnRelativeParentStyle : void 0
54
+ }, /* @__PURE__ */ React.createElement(Box, {
55
+ id: props.id,
56
+ tabIndex: props.focusOnParent ? -1 : void 0,
57
+ position: "absolute",
58
+ top: "-".concat(props.spaceAbove || "2.5rem"),
59
+ _focus: {
60
+ boxShadow: "none !important"
61
+ }
62
+ }));
39
63
  }
40
-
41
- export {
42
- HashLinkTargetBS
43
- };
64
+ export { HashLinkTargetBS };
44
65
  //# sourceMappingURL=chunk-7MKFY66H.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/HashLinkTargetBS.tsx"],"sourcesContent":["import { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nimport { focusStyle } from \"../styles/chakraTheme/biblioteksentralenChakraTheme\";\n\ninterface Props {\n id: string;\n /**\n * angir hvor mye luft til vil ha over HashLinkTarget ved bruk av hash-lenke, eks '4rem'\n */\n spaceAbove?: string;\n /**\n * angir om du vil ha fokusramme rundt komponenten som mounter HashLinkTarget. Da må komponenten du wrapper med ha position: relative | absolute el\n */\n focusOnParent?: boolean;\n}\n\nconst focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle,\n },\n },\n};\n\n/*\n * Komponent som sørger for luft over anchors (elementer man kan lenke til med hash-lenker feks <a href=\"#min-overskrift\">Ta meg til overskrift</a>)\n */\nexport function HashLinkTargetBS(props: Props) {\n return (\n <Box position=\"relative\" css={props.focusOnParent ? focusOnRelativeParentStyle : undefined}>\n <Box\n id={props.id}\n tabIndex={props.focusOnParent ? -1 : undefined}\n position=\"absolute\"\n top={`-${props.spaceAbove || \"2.5rem\"}`}\n _focus={{\n boxShadow: \"none !important\",\n }}\n />\n </Box>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAS,WAAW;AACpB,OAAO,WAAW;AAelB,IAAM,6BAA6B;AAAA,EACjC,cAAc;AAAA,IACZ,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,eAAe;AAAA,MACf,cAAc;AAAA,MACd,GAAG;AAAA,IACL;AAAA,EACF;AACF;AAKO,SAAS,iBAAiB,OAAc;AAC7C,SACE,oCAAC,OAAI,UAAS,YAAW,KAAK,MAAM,gBAAgB,6BAA6B,UAC/E;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,MAAM;AAAA,MACV,UAAU,MAAM,gBAAgB,KAAK;AAAA,MACrC,UAAS;AAAA,MACT,KAAK,IAAI,MAAM,cAAc,QAAQ;AAAA,MACrC,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA;AAAA,EACF,CACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["/Users/danielwinsvold/Code/js-utils/packages/react/dist/chunk-7MKFY66H.mjs","../src/components/HashLinkTargetBS.tsx"],"names":["focusStyle","Box","React","focusOnRelativeParentStyle","_focusWithin","position","boxShadow","content","top","left","height","width","pointerEvents","borderRadius","HashLinkTargetBS","props","createElement","css","focusOnParent","id","tabIndex","spaceAbove","_focus"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SACEA,UAAU,QACL,uBAAuB;AAE9B,sCAAsC;ACLtC,SAASC,GAAA,QAAW,mBAAA;AACpB,OAAOC,WAAW,QAAA;AAelB,IAAMC,6BAA6B;IACjCC,cAAc;QACZC,UAAU;QACVC,WAAW;QACX,YAAY;YACVC,SAAS;YACTF,UAAU;YACVG,KAAK;YACLC,MAAM;YACNC,QAAQ;YACRC,OAAO;YACPC,eAAe;YACfC,cAAc;WACXb;IAEP;AACF;AAKO,SAASc,iBAAiBC,KAAA;IAC/B,OACE,aAAA,GAAAb,MAAAc,aAAA,CAACf,KAAA;QAAII,UAAS;QAAWY,KAAKF,MAAMG,aAAA,GAAgBf,6BAA6B,KAAA;IAAA,GAC/E,aAAA,GAAAD,MAAAc,aAAA,CAACf,KAAA;QACCkB,IAAIJ,MAAMI,EAAA;QACVC,UAAUL,MAAMG,aAAA,GAAgB,CAAA,IAAK,KAAA;QACrCb,UAAS;QACTG,KAAK,IAAgC,OAA5BO,MAAMM,UAAA,IAAc;QAC7BC,QAAQ;YACNhB,WAAW;QACb;IAAA;AAIR;ADXA,SACEQ,gBAAgB,GAChB","sourcesContent":["\"use client\";\nimport {\n focusStyle\n} from \"./chunk-5GJBW3WE.mjs\";\n\n// src/components/HashLinkTargetBS.tsx\nimport { Box } from \"@chakra-ui/react\";\nimport React from \"react\";\nvar focusOnRelativeParentStyle = {\n _focusWithin: {\n position: \"static\",\n boxShadow: \"none\",\n \"&::after\": {\n content: '\"\"',\n position: \"absolute\",\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n pointerEvents: \"none\",\n borderRadius: \"0.25rem\",\n ...focusStyle\n }\n }\n};\nfunction HashLinkTargetBS(props) {\n return /* @__PURE__ */ React.createElement(Box, { position: \"relative\", css: props.focusOnParent ? focusOnRelativeParentStyle : void 0 }, /* @__PURE__ */ React.createElement(\n Box,\n {\n id: props.id,\n tabIndex: props.focusOnParent ? -1 : void 0,\n position: \"absolute\",\n top: `-${props.spaceAbove || \"2.5rem\"}`,\n _focus: {\n boxShadow: \"none !important\"\n }\n }\n ));\n}\n\nexport {\n HashLinkTargetBS\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"]}