@navikt/ds-react 6.6.1 → 6.7.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 (258) hide show
  1. package/cjs/chat/Chat.d.ts +2 -1
  2. package/cjs/chat/Chat.js +2 -1
  3. package/cjs/chat/Chat.js.map +1 -1
  4. package/cjs/date/datepicker/parts/DropdownCaption.js +1 -1
  5. package/cjs/date/datepicker/parts/DropdownCaption.js.map +1 -1
  6. package/cjs/date/monthpicker/MonthCaption.js +1 -1
  7. package/cjs/date/utils/labels.d.ts +2 -2
  8. package/cjs/form/ReadOnlyIcon.d.ts +2 -2
  9. package/cjs/form/combobox/Combobox.js +7 -22
  10. package/cjs/form/combobox/Combobox.js.map +1 -1
  11. package/cjs/form/combobox/ComboboxProvider.js +2 -2
  12. package/cjs/form/combobox/ComboboxProvider.js.map +1 -1
  13. package/cjs/form/combobox/ComboboxWrapper.d.ts +1 -2
  14. package/cjs/form/combobox/ComboboxWrapper.js +4 -2
  15. package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
  16. package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
  17. package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
  18. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +4 -4
  19. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +13 -15
  20. package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  21. package/cjs/form/combobox/Input/{inputContext.d.ts → Input.context.d.ts} +7 -5
  22. package/cjs/form/combobox/Input/{inputContext.js → Input.context.js} +22 -22
  23. package/cjs/form/combobox/Input/Input.context.js.map +1 -0
  24. package/cjs/form/combobox/Input/Input.js +2 -2
  25. package/cjs/form/combobox/Input/Input.js.map +1 -1
  26. package/cjs/form/combobox/Input/InputController.d.ts +3 -0
  27. package/cjs/form/combobox/Input/InputController.js +70 -0
  28. package/cjs/form/combobox/Input/InputController.js.map +1 -0
  29. package/cjs/form/combobox/{ToggleListButton.js → Input/ToggleListButton.js} +1 -1
  30. package/cjs/form/combobox/Input/ToggleListButton.js.map +1 -0
  31. package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +2 -2
  32. package/cjs/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
  33. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +4 -4
  34. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +7 -13
  35. package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
  36. package/cjs/form/combobox/customOptionsContext.d.ts +4 -4
  37. package/cjs/form/combobox/customOptionsContext.js +10 -13
  38. package/cjs/form/combobox/customOptionsContext.js.map +1 -1
  39. package/cjs/form/combobox/types.d.ts +1 -1
  40. package/cjs/help-text/HelpTextIcon.d.ts +1 -1
  41. package/cjs/index.d.ts +1 -0
  42. package/cjs/index.js +4 -2
  43. package/cjs/index.js.map +1 -1
  44. package/cjs/overlay/dismiss/DismissableLayer.d.ts +70 -0
  45. package/cjs/overlay/dismiss/DismissableLayer.js +253 -0
  46. package/cjs/overlay/dismiss/DismissableLayer.js.map +1 -0
  47. package/cjs/overlay/dismiss/util/dispatchCustomEvent.d.ts +50 -0
  48. package/cjs/overlay/dismiss/util/dispatchCustomEvent.js +65 -0
  49. package/cjs/overlay/dismiss/util/dispatchCustomEvent.js.map +1 -0
  50. package/cjs/overlay/dismiss/util/useEscapeKeydown.d.ts +1 -0
  51. package/cjs/overlay/dismiss/util/useEscapeKeydown.js +19 -0
  52. package/cjs/overlay/dismiss/util/useEscapeKeydown.js.map +1 -0
  53. package/cjs/overlay/dismiss/util/useFocusOutside.d.ts +8 -0
  54. package/cjs/overlay/dismiss/util/useFocusOutside.js +42 -0
  55. package/cjs/overlay/dismiss/util/useFocusOutside.js.map +1 -0
  56. package/cjs/overlay/dismiss/util/usePointerDownOutside.d.ts +10 -0
  57. package/cjs/overlay/dismiss/util/usePointerDownOutside.js +84 -0
  58. package/cjs/overlay/dismiss/util/usePointerDownOutside.js.map +1 -0
  59. package/cjs/overlays/floating/Floating.d.ts +53 -0
  60. package/cjs/overlays/floating/Floating.js +215 -0
  61. package/cjs/overlays/floating/Floating.js.map +1 -0
  62. package/cjs/overlays/floating/Floating.utils.d.ts +18 -0
  63. package/cjs/overlays/floating/Floating.utils.js +52 -0
  64. package/cjs/overlays/floating/Floating.utils.js.map +1 -0
  65. package/cjs/popover/Popover.js +13 -28
  66. package/cjs/popover/Popover.js.map +1 -1
  67. package/cjs/progress-bar/ProgressBar.d.ts +72 -0
  68. package/cjs/progress-bar/ProgressBar.js +86 -0
  69. package/cjs/progress-bar/ProgressBar.js.map +1 -0
  70. package/cjs/progress-bar/index.d.ts +1 -0
  71. package/cjs/progress-bar/index.js +10 -0
  72. package/cjs/progress-bar/index.js.map +1 -0
  73. package/cjs/tabs/Tabs.context.d.ts +7 -3
  74. package/cjs/tabs/Tabs.context.js +1 -0
  75. package/cjs/tabs/Tabs.context.js.map +1 -1
  76. package/cjs/timeline/AxisLabels.d.ts +1 -1
  77. package/cjs/toggle-group/ToggleGroup.context.d.ts +7 -3
  78. package/cjs/toggle-group/ToggleGroup.context.js +1 -0
  79. package/cjs/toggle-group/ToggleGroup.context.js.map +1 -1
  80. package/cjs/typography/BodyLong.d.ts +7 -7
  81. package/cjs/typography/BodyLong.js +5 -5
  82. package/cjs/typography/BodyShort.d.ts +5 -5
  83. package/cjs/typography/BodyShort.js +3 -3
  84. package/cjs/typography/Detail.d.ts +5 -5
  85. package/cjs/typography/Detail.js +3 -3
  86. package/cjs/typography/ErrorMessage.d.ts +5 -5
  87. package/cjs/typography/ErrorMessage.js +3 -3
  88. package/cjs/typography/Heading.d.ts +6 -6
  89. package/cjs/typography/Heading.js +3 -3
  90. package/cjs/typography/Label.d.ts +5 -5
  91. package/cjs/typography/Label.js +3 -3
  92. package/cjs/typography/types.d.ts +3 -3
  93. package/cjs/util/hooks/descendants/useDescendant.d.ts +2 -2
  94. package/cjs/util/hooks/descendants/useDescendant.js +49 -52
  95. package/cjs/util/hooks/descendants/useDescendant.js.map +1 -1
  96. package/cjs/util/types/AsChild.d.ts +14 -0
  97. package/cjs/util/types/AsChild.js +3 -0
  98. package/cjs/util/types/AsChild.js.map +1 -0
  99. package/esm/chat/Chat.d.ts +2 -1
  100. package/esm/chat/Chat.js +1 -0
  101. package/esm/chat/Chat.js.map +1 -1
  102. package/esm/date/datepicker/parts/DropdownCaption.js +1 -1
  103. package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
  104. package/esm/date/monthpicker/MonthCaption.js +1 -1
  105. package/esm/date/utils/labels.d.ts +2 -2
  106. package/esm/form/ReadOnlyIcon.d.ts +2 -2
  107. package/esm/form/combobox/Combobox.js +8 -23
  108. package/esm/form/combobox/Combobox.js.map +1 -1
  109. package/esm/form/combobox/ComboboxProvider.js +1 -1
  110. package/esm/form/combobox/ComboboxProvider.js.map +1 -1
  111. package/esm/form/combobox/ComboboxWrapper.d.ts +1 -2
  112. package/esm/form/combobox/ComboboxWrapper.js +4 -2
  113. package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
  114. package/esm/form/combobox/FilteredOptions/FilteredOptions.js +3 -3
  115. package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
  116. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +4 -4
  117. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +15 -16
  118. package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
  119. package/esm/form/combobox/Input/{inputContext.d.ts → Input.context.d.ts} +7 -5
  120. package/esm/form/combobox/Input/{inputContext.js → Input.context.js} +22 -21
  121. package/esm/form/combobox/Input/Input.context.js.map +1 -0
  122. package/esm/form/combobox/Input/Input.js +1 -1
  123. package/esm/form/combobox/Input/Input.js.map +1 -1
  124. package/esm/form/combobox/Input/InputController.d.ts +3 -0
  125. package/esm/form/combobox/Input/InputController.js +41 -0
  126. package/esm/form/combobox/Input/InputController.js.map +1 -0
  127. package/esm/form/combobox/{ToggleListButton.js → Input/ToggleListButton.js} +1 -1
  128. package/esm/form/combobox/Input/ToggleListButton.js.map +1 -0
  129. package/esm/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
  130. package/esm/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
  131. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +4 -4
  132. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +9 -14
  133. package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
  134. package/esm/form/combobox/customOptionsContext.d.ts +4 -4
  135. package/esm/form/combobox/customOptionsContext.js +10 -12
  136. package/esm/form/combobox/customOptionsContext.js.map +1 -1
  137. package/esm/form/combobox/types.d.ts +1 -1
  138. package/esm/help-text/HelpTextIcon.d.ts +1 -1
  139. package/esm/index.d.ts +1 -0
  140. package/esm/index.js +1 -0
  141. package/esm/index.js.map +1 -1
  142. package/esm/overlay/dismiss/DismissableLayer.d.ts +70 -0
  143. package/esm/overlay/dismiss/DismissableLayer.js +226 -0
  144. package/esm/overlay/dismiss/DismissableLayer.js.map +1 -0
  145. package/esm/overlay/dismiss/util/dispatchCustomEvent.d.ts +50 -0
  146. package/esm/overlay/dismiss/util/dispatchCustomEvent.js +58 -0
  147. package/esm/overlay/dismiss/util/dispatchCustomEvent.js.map +1 -0
  148. package/esm/overlay/dismiss/util/useEscapeKeydown.d.ts +1 -0
  149. package/esm/overlay/dismiss/util/useEscapeKeydown.js +15 -0
  150. package/esm/overlay/dismiss/util/useEscapeKeydown.js.map +1 -0
  151. package/esm/overlay/dismiss/util/useFocusOutside.d.ts +8 -0
  152. package/esm/overlay/dismiss/util/useFocusOutside.js +38 -0
  153. package/esm/overlay/dismiss/util/useFocusOutside.js.map +1 -0
  154. package/esm/overlay/dismiss/util/usePointerDownOutside.d.ts +10 -0
  155. package/esm/overlay/dismiss/util/usePointerDownOutside.js +80 -0
  156. package/esm/overlay/dismiss/util/usePointerDownOutside.js.map +1 -0
  157. package/esm/overlays/floating/Floating.d.ts +53 -0
  158. package/esm/overlays/floating/Floating.js +188 -0
  159. package/esm/overlays/floating/Floating.js.map +1 -0
  160. package/esm/overlays/floating/Floating.utils.d.ts +18 -0
  161. package/esm/overlays/floating/Floating.utils.js +48 -0
  162. package/esm/overlays/floating/Floating.utils.js.map +1 -0
  163. package/esm/popover/Popover.js +16 -31
  164. package/esm/popover/Popover.js.map +1 -1
  165. package/esm/progress-bar/ProgressBar.d.ts +72 -0
  166. package/esm/progress-bar/ProgressBar.js +57 -0
  167. package/esm/progress-bar/ProgressBar.js.map +1 -0
  168. package/esm/progress-bar/index.d.ts +1 -0
  169. package/esm/progress-bar/index.js +3 -0
  170. package/esm/progress-bar/index.js.map +1 -0
  171. package/esm/tabs/Tabs.context.d.ts +7 -3
  172. package/esm/tabs/Tabs.context.js +1 -0
  173. package/esm/tabs/Tabs.context.js.map +1 -1
  174. package/esm/timeline/AxisLabels.d.ts +1 -1
  175. package/esm/toggle-group/ToggleGroup.context.d.ts +7 -3
  176. package/esm/toggle-group/ToggleGroup.context.js +1 -0
  177. package/esm/toggle-group/ToggleGroup.context.js.map +1 -1
  178. package/esm/typography/BodyLong.d.ts +7 -7
  179. package/esm/typography/BodyLong.js +5 -5
  180. package/esm/typography/BodyShort.d.ts +5 -5
  181. package/esm/typography/BodyShort.js +3 -3
  182. package/esm/typography/Detail.d.ts +5 -5
  183. package/esm/typography/Detail.js +3 -3
  184. package/esm/typography/ErrorMessage.d.ts +5 -5
  185. package/esm/typography/ErrorMessage.js +3 -3
  186. package/esm/typography/Heading.d.ts +6 -6
  187. package/esm/typography/Heading.js +3 -3
  188. package/esm/typography/Label.d.ts +5 -5
  189. package/esm/typography/Label.js +3 -3
  190. package/esm/typography/types.d.ts +3 -3
  191. package/esm/util/hooks/descendants/useDescendant.d.ts +2 -2
  192. package/esm/util/hooks/descendants/useDescendant.js +49 -52
  193. package/esm/util/hooks/descendants/useDescendant.js.map +1 -1
  194. package/esm/util/types/AsChild.d.ts +14 -0
  195. package/esm/util/types/AsChild.js +2 -0
  196. package/esm/util/types/AsChild.js.map +1 -0
  197. package/package.json +16 -5
  198. package/src/chat/Chat.tsx +2 -1
  199. package/src/date/datepicker/parts/DropdownCaption.tsx +5 -1
  200. package/src/date/monthpicker/MonthCaption.tsx +1 -1
  201. package/src/form/combobox/Combobox.tsx +6 -76
  202. package/src/form/combobox/ComboboxProvider.tsx +1 -1
  203. package/src/form/combobox/ComboboxWrapper.tsx +4 -3
  204. package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +3 -3
  205. package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +19 -29
  206. package/src/form/combobox/Input/{inputContext.tsx → Input.context.tsx} +30 -33
  207. package/src/form/combobox/Input/Input.tsx +1 -1
  208. package/src/form/combobox/Input/InputController.tsx +102 -0
  209. package/src/form/combobox/{ToggleListButton.tsx → Input/ToggleListButton.tsx} +1 -1
  210. package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -1
  211. package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +12 -26
  212. package/src/form/combobox/{combobox-utils.test.ts → __tests__/combobox-utils.test.ts} +1 -1
  213. package/src/form/combobox/{combobox.test.tsx → __tests__/combobox.test.tsx} +2 -3
  214. package/src/form/combobox/customOptionsContext.tsx +14 -18
  215. package/src/form/combobox/types.ts +3 -1
  216. package/src/index.ts +1 -0
  217. package/src/overlay/README.md +5 -0
  218. package/src/overlay/dismiss/DismissableLayer.tsx +368 -0
  219. package/src/overlay/dismiss/util/dispatchCustomEvent.ts +77 -0
  220. package/src/overlay/dismiss/util/useEscapeKeydown.ts +21 -0
  221. package/src/overlay/dismiss/util/useFocusOutside.ts +52 -0
  222. package/src/overlay/dismiss/util/usePointerDownOutside.ts +95 -0
  223. package/src/overlays/floating/Floating.tsx +399 -0
  224. package/src/overlays/floating/Floating.utils.ts +63 -0
  225. package/src/popover/Popover.tsx +38 -70
  226. package/src/progress-bar/ProgressBar.tsx +149 -0
  227. package/src/progress-bar/index.ts +2 -0
  228. package/src/tabs/Tabs.context.ts +2 -0
  229. package/src/toggle-group/ToggleGroup.context.ts +1 -0
  230. package/src/typography/BodyLong.tsx +7 -7
  231. package/src/typography/BodyShort.tsx +5 -5
  232. package/src/typography/Detail.tsx +5 -5
  233. package/src/typography/ErrorMessage.tsx +5 -5
  234. package/src/typography/Heading.tsx +6 -6
  235. package/src/typography/Label.tsx +5 -5
  236. package/src/typography/types.ts +3 -3
  237. package/src/util/hooks/descendants/useDescendant.tsx +55 -68
  238. package/src/util/types/AsChild.ts +15 -0
  239. package/cjs/form/combobox/ClearButton.d.ts +0 -7
  240. package/cjs/form/combobox/ClearButton.js +0 -28
  241. package/cjs/form/combobox/ClearButton.js.map +0 -1
  242. package/cjs/form/combobox/FilteredOptions/CheckIcon.d.ts +0 -3
  243. package/cjs/form/combobox/FilteredOptions/CheckIcon.js +0 -12
  244. package/cjs/form/combobox/FilteredOptions/CheckIcon.js.map +0 -1
  245. package/cjs/form/combobox/Input/inputContext.js.map +0 -1
  246. package/cjs/form/combobox/ToggleListButton.js.map +0 -1
  247. package/esm/form/combobox/ClearButton.d.ts +0 -7
  248. package/esm/form/combobox/ClearButton.js +0 -21
  249. package/esm/form/combobox/ClearButton.js.map +0 -1
  250. package/esm/form/combobox/FilteredOptions/CheckIcon.d.ts +0 -3
  251. package/esm/form/combobox/FilteredOptions/CheckIcon.js +0 -7
  252. package/esm/form/combobox/FilteredOptions/CheckIcon.js.map +0 -1
  253. package/esm/form/combobox/Input/inputContext.js.map +0 -1
  254. package/esm/form/combobox/ToggleListButton.js.map +0 -1
  255. package/src/form/combobox/ClearButton.tsx +0 -29
  256. package/src/form/combobox/FilteredOptions/CheckIcon.tsx +0 -23
  257. /package/cjs/form/combobox/{ToggleListButton.d.ts → Input/ToggleListButton.d.ts} +0 -0
  258. /package/esm/form/combobox/{ToggleListButton.d.ts → Input/ToggleListButton.d.ts} +0 -0
@@ -0,0 +1,57 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import cl from "clsx";
13
+ import React, { forwardRef, useRef } from "react";
14
+ /**
15
+ * ProgressBar
16
+ * A component for visualizing progression in a process.
17
+ *
18
+ * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/progress-bar)
19
+ * @see 🏷️ {@link ProgressBarProps}
20
+ *
21
+ * @example
22
+ * // For loading content with an approximate duration in sec.
23
+ * <ProgressBar simulated={{
24
+ * seconds: 30,
25
+ * onTimeout: () => console.log("Oops, this is taking more time than expected!")
26
+ * }}
27
+ * />
28
+ *
29
+ * @example
30
+ * // As a step indicator for forms, questionnaires, etc.
31
+ * <ProgressBar value={2} valueMax={7} />
32
+ */
33
+ export const ProgressBar = forwardRef((_a, ref) => {
34
+ var { size = "medium", value = 0, valueMax = 100, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, className, simulated } = _a, rest = __rest(_a, ["size", "value", "valueMax", "aria-labelledby", "aria-label", "className", "simulated"]);
35
+ const translate = 100 - (Math.round(value) / valueMax) * 100;
36
+ const onTimeoutRef = useRef();
37
+ onTimeoutRef.current = simulated === null || simulated === void 0 ? void 0 : simulated.onTimeout;
38
+ React.useEffect(() => {
39
+ if ((simulated === null || simulated === void 0 ? void 0 : simulated.seconds) && onTimeoutRef.current) {
40
+ const timeout = setTimeout(onTimeoutRef.current, simulated.seconds * 1000);
41
+ return () => clearTimeout(timeout);
42
+ }
43
+ }, [simulated === null || simulated === void 0 ? void 0 : simulated.seconds]);
44
+ return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-progress-bar", `navds-progress-bar--${size}`, className), "aria-valuemax": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds) ? 0 : Math.round(valueMax), "aria-valuenow": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds) ? 0 : Math.round(value), "aria-valuetext": (simulated === null || simulated === void 0 ? void 0 : simulated.seconds)
45
+ ? `Fremdrift kan ikke beregnes, antatt tid er: ${simulated === null || simulated === void 0 ? void 0 : simulated.seconds} sekunder`
46
+ : `${Math.round(value)} av ${Math.round(valueMax)}`, role: "progressbar", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel }, rest),
47
+ React.createElement("div", { className: cl("navds-progress-bar__foreground", {
48
+ "navds-progress-bar__foreground--indeterminate": Number.isInteger(simulated === null || simulated === void 0 ? void 0 : simulated.seconds),
49
+ }), style: {
50
+ "--__ac-progress-bar-simulated": Number.isInteger(simulated === null || simulated === void 0 ? void 0 : simulated.seconds)
51
+ ? `${simulated === null || simulated === void 0 ? void 0 : simulated.seconds}s`
52
+ : undefined,
53
+ "--__ac-progress-bar-translate": `-${translate}%`,
54
+ } })));
55
+ });
56
+ export default ProgressBar;
57
+ //# sourceMappingURL=ProgressBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../src/progress-bar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AA4DlE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,iBAAiB,EAAE,cAAc,EACjC,YAAY,EAAE,S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,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAEvD,IAAI,EAAC,aAAa,qBACD,cAAc,gBACnB,SAAS,IACjB,IAAI;QAER,6BACE,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE;gBAC9C,+CAA+C,EAAE,MAAM,CAAC,SAAS,CAC/D,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,CACnB;aACF,CAAC,EACF,KAAK,EAAE;gBACL,+BAA+B,EAAE,MAAM,CAAC,SAAS,CAC/C,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,CACnB;oBACC,CAAC,CAAC,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,GAAG;oBAC1B,CAAC,CAAC,SAAS;gBACb,+BAA+B,EAAE,IAAI,SAAS,GAAG;aAClD,GACD,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1 @@
1
+ export { default as ProgressBar, type ProgressBarProps } from "./ProgressBar.js";
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ export { default as ProgressBar } from "./ProgressBar.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/progress-bar/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,OAAO,IAAI,WAAW,EAAyB,MAAM,eAAe,CAAC"}
@@ -3,14 +3,18 @@ import { TabsProps } from "./Tabs.types.js";
3
3
  import { useTabs } from "./useTabs.js";
4
4
  export declare const TabsDescendantsProvider: import("react").Provider<import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
5
5
  value: string;
6
- }>>, useTabsDescendantsContext: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
6
+ }>>, useTabsDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
7
7
  value: string;
8
- }>, useTabsDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
8
+ }> : import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
9
+ value: string;
10
+ }> | undefined, useTabsDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
9
11
  value: string;
10
12
  }>, useTabsDescendant: (options?: import("../util/hooks/descendants/descendant.js").DescendantOptions<{
11
13
  value: string;
12
14
  }> | undefined) => {
13
- descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLElement, Record<string, any>>;
15
+ descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
16
+ value: string;
17
+ }>;
14
18
  index: number;
15
19
  enabledIndex: number;
16
20
  register: (instance: HTMLButtonElement | null) => void;
@@ -6,5 +6,6 @@ export const [TabsProvider, useTabsContext] = createContext({
6
6
  name: "TabsContext",
7
7
  hookName: "useTabsContext",
8
8
  providerName: "TabsProvider",
9
+ errorMessage: "Tabs.List, Tabs.Tag and Tabs.Panel needs to be wrapped within <Tabs>",
9
10
  });
10
11
  //# sourceMappingURL=Tabs.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.context.js","sourceRoot":"","sources":["../../src/tabs/Tabs.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAIlF,MAAM,CAAC,MAAM,CACX,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EAClB,GAAG,uBAAuB,EAAwC,CAAC;AAQpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,aAAa,CAAoB;IAC7E,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,cAAc;CAC7B,CAAC,CAAC"}
1
+ {"version":3,"file":"Tabs.context.js","sourceRoot":"","sources":["../../src/tabs/Tabs.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAIlF,MAAM,CAAC,MAAM,CACX,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EAClB,GAAG,uBAAuB,EAAwC,CAAC;AAQpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,GAAG,aAAa,CAAoB;IAC7E,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,gBAAgB;IAC1B,YAAY,EAAE,cAAc;IAC5B,YAAY,EACV,sEAAsE;CACzE,CAAC,CAAC"}
@@ -4,5 +4,5 @@ export declare const dayLabels: (start: Date, end: Date, totalDays: number, dire
4
4
  export declare const monthLabels: (start: Date, end: Date, direction: "left" | "right", template?: string) => AxisLabel[];
5
5
  export declare const yearLabels: (start: Date, end: Date, direction: "left" | "right", template?: string) => AxisLabel[];
6
6
  export declare const AxisLabels: ({ templates, }: {
7
- templates?: AxisLabelTemplates | undefined;
7
+ templates?: AxisLabelTemplates;
8
8
  }) => React.JSX.Element;
@@ -7,14 +7,18 @@ interface ToggleContextProps {
7
7
  export declare const ToggleGroupContext: import("react").Context<ToggleContextProps | null>;
8
8
  export declare const ToggleGroupDescendantsProvider: import("react").Provider<import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
9
9
  value: string;
10
- }>>, useToggleGroupDescendantsContext: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
10
+ }>>, useToggleGroupDescendantsContext: <S extends boolean = true>(strict?: S) => S extends true ? import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
11
11
  value: string;
12
- }>, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
12
+ }> : import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
13
+ value: string;
14
+ }> | undefined, useToggleGroupDescendants: () => import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
13
15
  value: string;
14
16
  }>, useToggleGroupDescendant: (options?: import("../util/hooks/descendants/descendant.js").DescendantOptions<{
15
17
  value: string;
16
18
  }> | undefined) => {
17
- descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLElement, Record<string, any>>;
19
+ descendants: import("../util/hooks/descendants/descendant.js").DescendantsManager<HTMLButtonElement, {
20
+ value: string;
21
+ }>;
18
22
  index: number;
19
23
  enabledIndex: number;
20
24
  register: (instance: HTMLButtonElement | null) => void;
@@ -8,5 +8,6 @@ export const [ToggleGroupProvider, useToggleGroupContext] = createContext({
8
8
  name: "ToggleGroupContext",
9
9
  hookName: "useToggleGroupContext",
10
10
  providerName: "ToggleGroupProvider",
11
+ errorMessage: "<ToggleGroup.Item> needs to be wrapped within <ToggleGroup>",
11
12
  });
12
13
  //# sourceMappingURL=ToggleGroup.context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroup.context.js","sourceRoot":"","sources":["../../src/toggle-group/ToggleGroup.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAQlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAClD,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,CACX,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACzB,GAAG,uBAAuB,EAAwC,CAAC;AAKpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GACvD,aAAa,CAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;CACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"ToggleGroup.context.js","sourceRoot":"","sources":["../../src/toggle-group/ToggleGroup.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAQlF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAClD,IAAI,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,CACX,8BAA8B,EAC9B,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,EACzB,GAAG,uBAAuB,EAAwC,CAAC;AAKpE,mBAAmB;AACnB,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GACvD,aAAa,CAA2B;IACtC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,uBAAuB;IACjC,YAAY,EAAE,qBAAqB;IACnC,YAAY,EAAE,6DAA6D;CAC5E,CAAC,CAAC"}
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types/index.js";
3
3
  import { TypoProps } from "./types.js";
4
4
  export interface BodyLongProps extends TypoProps, React.HTMLAttributes<HTMLParagraphElement> {
5
5
  /**
6
- * large: 20px, medium: 18px, small: 16px
6
+ * large: 20px, medium: 18px, small: 16px.
7
7
  * @default "medium"
8
8
  */
9
9
  size?: "large" | "medium" | "small";
10
10
  /**
11
- * Text
11
+ * Text.
12
12
  */
13
13
  children: React.ReactNode;
14
14
  }
@@ -21,11 +21,11 @@ export interface BodyLongProps extends TypoProps, React.HTMLAttributes<HTMLParag
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <BodyLong>
25
- * Hvis du ikke bor sammen med begge foreldrene dine,
26
- * kan du ha rett til barnebidrag fra en eller begge foreldre mens du
27
- * fullfører videregående skole eller tilsvarende.
28
- * </BodyLong>
24
+ * <BodyLong>
25
+ * Hvis du ikke bor sammen med begge foreldrene dine,
26
+ * kan du ha rett til barnebidrag fra en eller begge foreldre mens du
27
+ * fullfører videregående skole eller tilsvarende.
28
+ * </BodyLong>
29
29
  * ```
30
30
  */
31
31
  export declare const BodyLong: OverridableComponent<BodyLongProps, HTMLParagraphElement>;
@@ -21,11 +21,11 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <BodyLong>
25
- * Hvis du ikke bor sammen med begge foreldrene dine,
26
- * kan du ha rett til barnebidrag fra en eller begge foreldre mens du
27
- * fullfører videregående skole eller tilsvarende.
28
- * </BodyLong>
24
+ * <BodyLong>
25
+ * Hvis du ikke bor sammen med begge foreldrene dine,
26
+ * kan du ha rett til barnebidrag fra en eller begge foreldre mens du
27
+ * fullfører videregående skole eller tilsvarende.
28
+ * </BodyLong>
29
29
  * ```
30
30
  */
31
31
  export const BodyLong = forwardRef((_a, ref) => {
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types/index.js";
3
3
  import { TypoProps } from "./types.js";
4
4
  export interface BodyShortProps extends TypoProps, React.HTMLAttributes<HTMLParagraphElement> {
5
5
  /**
6
- * large: 20px, medium: 18px, small: 16px
6
+ * large: 20px, medium: 18px, small: 16px.
7
7
  * @default "medium"
8
8
  */
9
9
  size?: "large" | "medium" | "small";
10
10
  /**
11
- * Paragraph text
11
+ * Paragraph text.
12
12
  */
13
13
  children: React.ReactNode;
14
14
  }
@@ -21,9 +21,9 @@ export interface BodyShortProps extends TypoProps, React.HTMLAttributes<HTMLPara
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <BodyShort>
25
- * Du må gjøre en filtrering for å se brukere i listen.
26
- * </BodyShort>
24
+ * <BodyShort>
25
+ * Du må gjøre en filtrering for å se brukere i listen.
26
+ * </BodyShort>
27
27
  * ```
28
28
  */
29
29
  export declare const BodyShort: OverridableComponent<BodyShortProps, HTMLParagraphElement>;
@@ -21,9 +21,9 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <BodyShort>
25
- * Du må gjøre en filtrering for å se brukere i listen.
26
- * </BodyShort>
24
+ * <BodyShort>
25
+ * Du må gjøre en filtrering for å se brukere i listen.
26
+ * </BodyShort>
27
27
  * ```
28
28
  */
29
29
  export const BodyShort = forwardRef((_a, ref) => {
@@ -7,11 +7,11 @@ export interface DetailProps extends TypoProps, React.HTMLAttributes<HTMLParagra
7
7
  */
8
8
  size?: "medium" | "small";
9
9
  /**
10
- * Paragraph text
10
+ * Text.
11
11
  */
12
12
  children: React.ReactNode;
13
13
  /**
14
- * All caps
14
+ * ALL CAPS.
15
15
  */
16
16
  uppercase?: boolean;
17
17
  }
@@ -24,9 +24,9 @@ export interface DetailProps extends TypoProps, React.HTMLAttributes<HTMLParagra
24
24
  *
25
25
  * @example
26
26
  * ```jsx
27
- * <Detail>
28
- * Du må gjøre en filtrering for å se brukere i listen.
29
- * </Detail>
27
+ * <Detail>
28
+ * Du må gjøre en filtrering for å se brukere i listen.
29
+ * </Detail>
30
30
  * ```
31
31
  */
32
32
  export declare const Detail: OverridableComponent<DetailProps, HTMLParagraphElement>;
@@ -21,9 +21,9 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <Detail>
25
- * Du må gjøre en filtrering for å se brukere i listen.
26
- * </Detail>
24
+ * <Detail>
25
+ * Du må gjøre en filtrering for å se brukere i listen.
26
+ * </Detail>
27
27
  * ```
28
28
  */
29
29
  export const Detail = forwardRef((_a, ref) => {
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types/index.js";
3
3
  import { TypoProps } from "./types.js";
4
4
  export interface ErrorMessageProps extends Pick<TypoProps, "spacing">, React.HTMLAttributes<HTMLParagraphElement> {
5
5
  /**
6
- * medium: 18px, small: 16px
6
+ * medium: 18px, small: 16px.
7
7
  * @default "medium"
8
8
  */
9
9
  size?: "medium" | "small";
10
10
  /**
11
- * Error text
11
+ * Error text.
12
12
  */
13
13
  children: React.ReactNode;
14
14
  }
@@ -21,9 +21,9 @@ export interface ErrorMessageProps extends Pick<TypoProps, "spacing">, React.HTM
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <ErrorMessage>
25
- * Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
- * </ErrorMessage>
24
+ * <ErrorMessage>
25
+ * Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
+ * </ErrorMessage>
27
27
  * ```
28
28
  */
29
29
  export declare const ErrorMessage: OverridableComponent<ErrorMessageProps, HTMLParagraphElement>;
@@ -21,9 +21,9 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <ErrorMessage>
25
- * Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
- * </ErrorMessage>
24
+ * <ErrorMessage>
25
+ * Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
+ * </ErrorMessage>
27
27
  * ```
28
28
  */
29
29
  export const ErrorMessage = forwardRef((_a, ref) => {
@@ -3,16 +3,16 @@ import { OverridableComponent } from "../util/types/index.js";
3
3
  import { TypoProps } from "./types.js";
4
4
  export interface HeadingProps extends Pick<TypoProps, "spacing" | "visuallyHidden" | "align" | "textColor">, React.HTMLAttributes<HTMLHeadingElement> {
5
5
  /**
6
- * Heading level
6
+ * Heading level.
7
7
  * @default "1"
8
8
  */
9
9
  level?: "1" | "2" | "3" | "4" | "5" | "6";
10
10
  /**
11
- * Changes text-sizing
11
+ * xlarge: 40px, large: 32px, medium: 24px, small: 20px, xsmall: 18px.
12
12
  */
13
13
  size: "xlarge" | "large" | "medium" | "small" | "xsmall";
14
14
  /**
15
- * Heading text
15
+ * Heading text.
16
16
  */
17
17
  children: React.ReactNode;
18
18
  }
@@ -25,9 +25,9 @@ export interface HeadingProps extends Pick<TypoProps, "spacing" | "visuallyHidde
25
25
  *
26
26
  * @example
27
27
  * ```jsx
28
- * <Heading level="1" size="xlarge">
29
- * Hva kan vi hjelpe deg med?
30
- * </Heading>
28
+ * <Heading level="1" size="xlarge">
29
+ * Hva kan vi hjelpe deg med?
30
+ * </Heading>
31
31
  * ```
32
32
  */
33
33
  export declare const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement>;
@@ -21,9 +21,9 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <Heading level="1" size="xlarge">
25
- * Hva kan vi hjelpe deg med?
26
- * </Heading>
24
+ * <Heading level="1" size="xlarge">
25
+ * Hva kan vi hjelpe deg med?
26
+ * </Heading>
27
27
  * ```
28
28
  */
29
29
  export const Heading = forwardRef((_a, ref) => {
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types/index.js";
3
3
  import { TypoProps } from "./types.js";
4
4
  export interface LabelProps extends Omit<TypoProps, "weight" | "align" | "truncate">, React.LabelHTMLAttributes<HTMLLabelElement> {
5
5
  /**
6
- * medium: 18px, small: 16px
6
+ * medium: 18px, small: 16px.
7
7
  * @default "medium"
8
8
  */
9
9
  size?: "medium" | "small";
10
10
  /**
11
- * Paragraph text
11
+ * Label text.
12
12
  */
13
13
  children: React.ReactNode;
14
14
  }
@@ -21,9 +21,9 @@ export interface LabelProps extends Omit<TypoProps, "weight" | "align" | "trunca
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <Label>
25
- * Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
- * </Label>
24
+ * <Label>
25
+ * Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
+ * </Label>
27
27
  * ```
28
28
  */
29
29
  export declare const Label: OverridableComponent<LabelProps, HTMLLabelElement>;
@@ -21,9 +21,9 @@ import { typoClassNames } from "./util.js";
21
21
  *
22
22
  * @example
23
23
  * ```jsx
24
- * <Label>
25
- * Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
- * </Label>
24
+ * <Label>
25
+ * Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
26
+ * </Label>
27
27
  * ```
28
28
  */
29
29
  export const Label = forwardRef((_a, ref) => {
@@ -12,15 +12,15 @@ export type TypoProps = {
12
12
  */
13
13
  align?: "start" | "center" | "end";
14
14
  /**
15
- * Visually hide text. Text will still be accessible for screenreaders
15
+ * Visually hide text. Text will still be accessible for screenreaders.
16
16
  */
17
17
  visuallyHidden?: boolean;
18
18
  /**
19
- * Adds spacing below text
19
+ * Adds spacing below text.
20
20
  */
21
21
  spacing?: boolean;
22
22
  /**
23
- * Adjusts color
23
+ * Adjusts color.
24
24
  */
25
25
  textColor?: "default" | "subtle";
26
26
  };
@@ -6,8 +6,8 @@ import { DescendantOptions, DescendantsManager } from "./descendant.js";
6
6
  /**
7
7
  * Provides strongly typed versions of the context provider and hooks above.
8
8
  */
9
- export declare function createDescendantContext<T extends HTMLElement = HTMLElement, K extends Record<string, any> = object>(): readonly [React.Provider<DescendantsManager<T, K>>, () => DescendantsManager<T, K>, () => DescendantsManager<T, K>, (options?: DescendantOptions<K>) => {
10
- descendants: DescendantsManager<HTMLElement, Record<string, any>>;
9
+ export declare function createDescendantContext<T extends HTMLElement = HTMLElement, K extends Record<string, any> = object>(): readonly [React.Provider<DescendantsManager<T, K>>, <S extends boolean = true>(strict?: S) => S extends true ? DescendantsManager<T, K> : DescendantsManager<T, K> | undefined, () => DescendantsManager<T, K>, (options?: DescendantOptions<K>) => {
10
+ descendants: DescendantsManager<T, K>;
11
11
  index: number;
12
12
  enabledIndex: number;
13
13
  register: (instance: T | null) => void;
@@ -7,67 +7,64 @@ import { useClientLayoutEffect } from "../useClientLayoutEffect.js";
7
7
  import { mergeRefs } from "../useMergeRefs.js";
8
8
  import { DescendantsManager } from "./descendant.js";
9
9
  import { cast } from "./utils.js";
10
- /**
11
- * @internal
12
- * Initializing DescendantsManager
13
- */
14
- function useDescendants() {
15
- const descendants = useRef(new DescendantsManager()).current;
16
- return descendants;
17
- }
18
- const [DescendantsContextProvider, useDescendantsContext] = createContext({
19
- name: "DescendantsProvider",
20
- errorMessage: "useDescendantsContext must be used within DescendantsProvider",
21
- });
22
- /**
23
- * @internal
24
- * This hook provides information to descendant component:
25
- * - Index compared to other descendants
26
- * - ref callback to register the descendant
27
- * - Its enabled index compared to other enabled descendants
28
- */
29
- function useDescendant(options) {
30
- const descendants = useDescendantsContext();
31
- const [index, setIndex] = useState(-1);
32
- const ref = useRef(null);
33
- useClientLayoutEffect(() => {
34
- return () => {
35
- if (!ref.current)
36
- return;
37
- descendants.unregister(ref.current);
38
- };
39
- }, []);
40
- useClientLayoutEffect(() => {
41
- if (!ref.current)
42
- return;
43
- const dataIndex = Number(ref.current.dataset["index"]);
44
- if (index != dataIndex && !Number.isNaN(dataIndex)) {
45
- setIndex(dataIndex);
46
- }
47
- });
48
- const refCallback = options
49
- ? cast(descendants.register(options))
50
- : cast(descendants.register);
51
- return {
52
- descendants,
53
- index,
54
- enabledIndex: descendants.enabledIndexOf(ref.current),
55
- register: mergeRefs([refCallback, ref]),
56
- };
57
- }
58
10
  /**
59
11
  * Provides strongly typed versions of the context provider and hooks above.
60
12
  */
61
13
  export function createDescendantContext() {
14
+ const [DescendantsContextProvider, useDescendantsContext] = createContext({
15
+ name: "DescendantsProvider",
16
+ errorMessage: "useDescendantsContext must be used within DescendantsProvider",
17
+ });
62
18
  const ContextProvider = cast((props) => (React.createElement(DescendantsContextProvider, Object.assign({}, props.value), props.children)));
63
- const _useDescendantsContext = () => cast(useDescendantsContext());
64
- const _useDescendant = (options) => useDescendant(options);
65
- const _useDescendants = () => useDescendants();
19
+ /**
20
+ * @internal
21
+ * This hook provides information to descendant component:
22
+ * - Index compared to other descendants
23
+ * - ref callback to register the descendant
24
+ * - Its enabled index compared to other enabled descendants
25
+ */
26
+ function _useDescendant(options) {
27
+ const descendants = useDescendantsContext();
28
+ const [index, setIndex] = useState(-1);
29
+ const ref = useRef(null);
30
+ useClientLayoutEffect(() => {
31
+ return () => {
32
+ if (!ref.current)
33
+ return;
34
+ descendants.unregister(ref.current);
35
+ };
36
+ }, []);
37
+ useClientLayoutEffect(() => {
38
+ if (!ref.current)
39
+ return;
40
+ const dataIndex = Number(ref.current.dataset["index"]);
41
+ if (index != dataIndex && !Number.isNaN(dataIndex)) {
42
+ setIndex(dataIndex);
43
+ }
44
+ });
45
+ const refCallback = options
46
+ ? cast(descendants.register(options))
47
+ : cast(descendants.register);
48
+ return {
49
+ descendants,
50
+ index,
51
+ enabledIndex: descendants.enabledIndexOf(ref.current),
52
+ register: mergeRefs([refCallback, ref]),
53
+ };
54
+ }
55
+ /**
56
+ * @internal
57
+ * Initializing DescendantsManager
58
+ */
59
+ function _useDescendants() {
60
+ const descendants = useRef(new DescendantsManager()).current;
61
+ return descendants;
62
+ }
66
63
  return [
67
64
  // context provider
68
65
  ContextProvider,
69
66
  // call this when you need to read from context
70
- _useDescendantsContext,
67
+ useDescendantsContext,
71
68
  // descendants state information, to be called and passed to `ContextProvider`
72
69
  _useDescendants,
73
70
  // descendant index information
@@ -1 +1 @@
1
- {"version":3,"file":"useDescendant.js","sourceRoot":"","sources":["../../../../src/util/hooks/descendants/useDescendant.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAqB,kBAAkB,EAAE,MAAM,cAAc,CA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AuB,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC3D,CAAC,CAAC,IAAI,CAAuB,WAAW,CAAC,QAAQ,CAAC,CAAC;QAErD,OAAO;YACL,WAAW;YACX,KAAK;YACL,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;YACrD,QAAQ,EAAE,SAAS,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;SACxC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,SAAS,eAAe;QACtB,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,kBAAkB,EAAQ,CAAC,CAAC,OAAO,CAAC;QAEnE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,OAAO;QACL,mBAAmB;QACnB,eAAe;QACf,+CAA+C;QAC/C,qBAAqB;QACrB,8EAA8E;QAC9E,eAAe;QACf,+BAA+B;QAC/B,cAAc;KACN,CAAC;AACb,CAAC"}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export type AsChild = {
3
+ children: React.ReactElement;
4
+ /**
5
+ * Renders the children as a child of the component. Merges the props of the component with the props of the child.
6
+ */
7
+ asChild: true;
8
+ } | {
9
+ children: React.ReactNode;
10
+ /**
11
+ * Renders the children as a child of the component. Merges the props of the component with the props of the child.
12
+ */
13
+ asChild?: false;
14
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AsChild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsChild.js","sourceRoot":"","sources":["../../../src/util/types/AsChild.ts"],"names":[],"mappings":""}