@navikt/ds-react 3.4.1 → 4.0.0

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 (234) hide show
  1. package/_docs.json +5615 -3780
  2. package/cjs/date/hooks/index.js +4 -4
  3. package/cjs/date/index.js +6 -6
  4. package/cjs/dropdown/Dropdown.js +57 -0
  5. package/cjs/dropdown/Menu/Divider.js +47 -0
  6. package/cjs/dropdown/Menu/GroupedList/Heading.js +47 -0
  7. package/cjs/dropdown/Menu/GroupedList/Item.js +54 -0
  8. package/cjs/dropdown/Menu/GroupedList/index.js +51 -0
  9. package/cjs/dropdown/Menu/GroupedList/package.json +6 -0
  10. package/cjs/dropdown/Menu/List/Item.js +54 -0
  11. package/cjs/dropdown/Menu/List/index.js +49 -0
  12. package/cjs/dropdown/Menu/List/package.json +6 -0
  13. package/cjs/dropdown/Menu/index.js +64 -0
  14. package/cjs/dropdown/Menu/package.json +6 -0
  15. package/cjs/dropdown/Toggle.js +66 -0
  16. package/cjs/dropdown/index.js +23 -0
  17. package/cjs/dropdown/package.json +6 -0
  18. package/cjs/form/radio/RadioGroup.js +10 -0
  19. package/cjs/index.js +3 -0
  20. package/cjs/internal-header/InternalHeader.js +55 -0
  21. package/cjs/internal-header/InternalHeaderButton.js +47 -0
  22. package/cjs/internal-header/InternalHeaderTitle.js +48 -0
  23. package/cjs/internal-header/InternalHeaderUser.js +51 -0
  24. package/cjs/internal-header/InternalHeaderUserButton.js +54 -0
  25. package/cjs/internal-header/index.js +8 -0
  26. package/cjs/internal-header/package.json +6 -0
  27. package/cjs/read-more/ReadMore.js +17 -0
  28. package/cjs/timeline/AxisLabels.js +90 -0
  29. package/cjs/timeline/Pin.js +106 -0
  30. package/cjs/timeline/Timeline.js +162 -0
  31. package/cjs/timeline/TimelineRow.js +86 -0
  32. package/cjs/timeline/hooks/usePeriodContext.js +16 -0
  33. package/cjs/timeline/hooks/useRowContext.js +18 -0
  34. package/cjs/timeline/hooks/useTimelineContext.js +23 -0
  35. package/cjs/timeline/hooks/useTimelineRows.js +79 -0
  36. package/cjs/timeline/index.js +8 -0
  37. package/cjs/timeline/package.json +6 -0
  38. package/cjs/timeline/period/ClickablePeriod.js +120 -0
  39. package/cjs/timeline/period/NonClickablePeriod.js +18 -0
  40. package/cjs/timeline/period/index.js +46 -0
  41. package/cjs/timeline/period/package.json +6 -0
  42. package/cjs/timeline/utils/calc.js +19 -0
  43. package/cjs/timeline/utils/filter.js +18 -0
  44. package/cjs/timeline/utils/index.js +7 -0
  45. package/cjs/timeline/utils/package.json +6 -0
  46. package/cjs/timeline/utils/period.js +40 -0
  47. package/cjs/timeline/utils/sort.js +10 -0
  48. package/cjs/timeline/utils/timeline.js +79 -0
  49. package/cjs/timeline/utils/types.external.js +2 -0
  50. package/cjs/timeline/utils/types.internal.js +2 -0
  51. package/cjs/timeline/zoom/ZoomButton.js +68 -0
  52. package/cjs/timeline/zoom/index.js +50 -0
  53. package/cjs/timeline/zoom/package.json +6 -0
  54. package/esm/date/hooks/index.d.ts +3 -3
  55. package/esm/date/hooks/index.js +3 -3
  56. package/esm/date/hooks/index.js.map +1 -1
  57. package/esm/date/index.d.ts +3 -3
  58. package/esm/date/index.js +3 -3
  59. package/esm/date/index.js.map +1 -1
  60. package/esm/dropdown/Dropdown.d.ts +37 -0
  61. package/esm/dropdown/Dropdown.js +29 -0
  62. package/esm/dropdown/Dropdown.js.map +1 -0
  63. package/esm/dropdown/Menu/Divider.d.ts +4 -0
  64. package/esm/dropdown/Menu/Divider.js +19 -0
  65. package/esm/dropdown/Menu/Divider.js.map +1 -0
  66. package/esm/dropdown/Menu/GroupedList/Heading.d.ts +10 -0
  67. package/esm/dropdown/Menu/GroupedList/Heading.js +19 -0
  68. package/esm/dropdown/Menu/GroupedList/Heading.js.map +1 -0
  69. package/esm/dropdown/Menu/GroupedList/Item.d.ts +11 -0
  70. package/esm/dropdown/Menu/GroupedList/Item.js +26 -0
  71. package/esm/dropdown/Menu/GroupedList/Item.js.map +1 -0
  72. package/esm/dropdown/Menu/GroupedList/index.d.ts +15 -0
  73. package/esm/dropdown/Menu/GroupedList/index.js +23 -0
  74. package/esm/dropdown/Menu/GroupedList/index.js.map +1 -0
  75. package/esm/dropdown/Menu/List/Item.d.ts +11 -0
  76. package/esm/dropdown/Menu/List/Item.js +26 -0
  77. package/esm/dropdown/Menu/List/Item.js.map +1 -0
  78. package/esm/dropdown/Menu/List/index.d.ts +13 -0
  79. package/esm/dropdown/Menu/List/index.js +21 -0
  80. package/esm/dropdown/Menu/List/index.js.map +1 -0
  81. package/esm/dropdown/Menu/index.d.ts +27 -0
  82. package/esm/dropdown/Menu/index.js +36 -0
  83. package/esm/dropdown/Menu/index.js.map +1 -0
  84. package/esm/dropdown/Toggle.d.ts +10 -0
  85. package/esm/dropdown/Toggle.js +38 -0
  86. package/esm/dropdown/Toggle.js.map +1 -0
  87. package/esm/dropdown/index.d.ts +2 -0
  88. package/esm/dropdown/index.js +3 -0
  89. package/esm/dropdown/index.js.map +1 -0
  90. package/esm/form/radio/RadioGroup.d.ts +10 -0
  91. package/esm/form/radio/RadioGroup.js +10 -0
  92. package/esm/form/radio/RadioGroup.js.map +1 -1
  93. package/esm/index.d.ts +3 -0
  94. package/esm/index.js +3 -0
  95. package/esm/index.js.map +1 -1
  96. package/esm/internal-header/InternalHeader.d.ts +16 -0
  97. package/esm/internal-header/InternalHeader.js +27 -0
  98. package/esm/internal-header/InternalHeader.js.map +1 -0
  99. package/esm/internal-header/InternalHeaderButton.d.ts +11 -0
  100. package/esm/internal-header/InternalHeaderButton.js +19 -0
  101. package/esm/internal-header/InternalHeaderButton.js.map +1 -0
  102. package/esm/internal-header/InternalHeaderTitle.d.ts +11 -0
  103. package/esm/internal-header/InternalHeaderTitle.js +20 -0
  104. package/esm/internal-header/InternalHeaderTitle.js.map +1 -0
  105. package/esm/internal-header/InternalHeaderUser.d.ts +14 -0
  106. package/esm/internal-header/InternalHeaderUser.js +23 -0
  107. package/esm/internal-header/InternalHeaderUser.js.map +1 -0
  108. package/esm/internal-header/InternalHeaderUserButton.d.ts +15 -0
  109. package/esm/internal-header/InternalHeaderUserButton.js +26 -0
  110. package/esm/internal-header/InternalHeaderUserButton.js.map +1 -0
  111. package/esm/internal-header/index.d.ts +5 -0
  112. package/esm/internal-header/index.js +2 -0
  113. package/esm/internal-header/index.js.map +1 -0
  114. package/esm/read-more/ReadMore.d.ts +17 -0
  115. package/esm/read-more/ReadMore.js +17 -0
  116. package/esm/read-more/ReadMore.js.map +1 -1
  117. package/esm/timeline/AxisLabels.d.ts +6 -0
  118. package/esm/timeline/AxisLabels.js +81 -0
  119. package/esm/timeline/AxisLabels.js.map +1 -0
  120. package/esm/timeline/Pin.d.ts +17 -0
  121. package/esm/timeline/Pin.js +81 -0
  122. package/esm/timeline/Pin.js.map +1 -0
  123. package/esm/timeline/Timeline.d.ts +45 -0
  124. package/esm/timeline/Timeline.js +134 -0
  125. package/esm/timeline/Timeline.js.map +1 -0
  126. package/esm/timeline/TimelineRow.d.ts +22 -0
  127. package/esm/timeline/TimelineRow.js +58 -0
  128. package/esm/timeline/TimelineRow.js.map +1 -0
  129. package/esm/timeline/hooks/usePeriodContext.d.ts +9 -0
  130. package/esm/timeline/hooks/usePeriodContext.js +13 -0
  131. package/esm/timeline/hooks/usePeriodContext.js.map +1 -0
  132. package/esm/timeline/hooks/useRowContext.d.ts +11 -0
  133. package/esm/timeline/hooks/useRowContext.js +15 -0
  134. package/esm/timeline/hooks/useRowContext.js.map +1 -0
  135. package/esm/timeline/hooks/useTimelineContext.d.ts +15 -0
  136. package/esm/timeline/hooks/useTimelineContext.js +20 -0
  137. package/esm/timeline/hooks/useTimelineContext.js.map +1 -0
  138. package/esm/timeline/hooks/useTimelineRows.d.ts +4 -0
  139. package/esm/timeline/hooks/useTimelineRows.js +74 -0
  140. package/esm/timeline/hooks/useTimelineRows.js.map +1 -0
  141. package/esm/timeline/index.d.ts +6 -0
  142. package/esm/timeline/index.js +2 -0
  143. package/esm/timeline/index.js.map +1 -0
  144. package/esm/timeline/period/ClickablePeriod.d.ts +9 -0
  145. package/esm/timeline/period/ClickablePeriod.js +93 -0
  146. package/esm/timeline/period/ClickablePeriod.js.map +1 -0
  147. package/esm/timeline/period/NonClickablePeriod.d.ts +7 -0
  148. package/esm/timeline/period/NonClickablePeriod.js +14 -0
  149. package/esm/timeline/period/NonClickablePeriod.js.map +1 -0
  150. package/esm/timeline/period/index.d.ts +57 -0
  151. package/esm/timeline/period/index.js +18 -0
  152. package/esm/timeline/period/index.js.map +1 -0
  153. package/esm/timeline/utils/calc.d.ts +5 -0
  154. package/esm/timeline/utils/calc.js +15 -0
  155. package/esm/timeline/utils/calc.js.map +1 -0
  156. package/esm/timeline/utils/filter.d.ts +10 -0
  157. package/esm/timeline/utils/filter.js +11 -0
  158. package/esm/timeline/utils/filter.js.map +1 -0
  159. package/esm/timeline/utils/index.d.ts +1 -0
  160. package/esm/timeline/utils/index.js +2 -0
  161. package/esm/timeline/utils/index.js.map +1 -0
  162. package/esm/timeline/utils/period.d.ts +2 -0
  163. package/esm/timeline/utils/period.js +33 -0
  164. package/esm/timeline/utils/period.js.map +1 -0
  165. package/esm/timeline/utils/sort.d.ts +4 -0
  166. package/esm/timeline/utils/sort.js +5 -0
  167. package/esm/timeline/utils/sort.js.map +1 -0
  168. package/esm/timeline/utils/timeline.d.ts +12 -0
  169. package/esm/timeline/utils/timeline.js +73 -0
  170. package/esm/timeline/utils/timeline.js.map +1 -0
  171. package/esm/timeline/utils/types.external.d.ts +53 -0
  172. package/esm/timeline/utils/types.external.js +2 -0
  173. package/esm/timeline/utils/types.external.js.map +1 -0
  174. package/esm/timeline/utils/types.internal.d.ts +61 -0
  175. package/esm/timeline/utils/types.internal.js +2 -0
  176. package/esm/timeline/utils/types.internal.js.map +1 -0
  177. package/esm/timeline/zoom/ZoomButton.d.ts +19 -0
  178. package/esm/timeline/zoom/ZoomButton.js +43 -0
  179. package/esm/timeline/zoom/ZoomButton.js.map +1 -0
  180. package/esm/timeline/zoom/index.d.ts +11 -0
  181. package/esm/timeline/zoom/index.js +22 -0
  182. package/esm/timeline/zoom/index.js.map +1 -0
  183. package/package.json +2 -2
  184. package/src/date/datepicker/datepicker.stories.tsx +19 -21
  185. package/src/date/datepicker/datepicker.test.tsx +5 -5
  186. package/src/date/hooks/index.ts +3 -3
  187. package/src/date/hooks/useRangeDatepicker.test.tsx +6 -6
  188. package/src/date/index.ts +5 -5
  189. package/src/date/monthpicker/monthpicker.stories.tsx +5 -5
  190. package/src/date/utils/__tests__/get-dates.test.ts +0 -1
  191. package/src/dropdown/Dropdown.tsx +80 -0
  192. package/src/dropdown/Menu/Divider.tsx +18 -0
  193. package/src/dropdown/Menu/GroupedList/Heading.tsx +31 -0
  194. package/src/dropdown/Menu/GroupedList/Item.tsx +45 -0
  195. package/src/dropdown/Menu/GroupedList/index.tsx +33 -0
  196. package/src/dropdown/Menu/List/Item.tsx +44 -0
  197. package/src/dropdown/Menu/List/index.tsx +27 -0
  198. package/src/dropdown/Menu/index.tsx +85 -0
  199. package/src/dropdown/Toggle.tsx +52 -0
  200. package/src/dropdown/dropdown.stories.tsx +91 -0
  201. package/src/dropdown/index.ts +2 -0
  202. package/src/form/radio/RadioGroup.tsx +10 -0
  203. package/src/index.ts +3 -0
  204. package/src/internal-header/InternalHeader.tsx +44 -0
  205. package/src/internal-header/InternalHeaderButton.tsx +28 -0
  206. package/src/internal-header/InternalHeaderTitle.tsx +35 -0
  207. package/src/internal-header/InternalHeaderUser.tsx +39 -0
  208. package/src/internal-header/InternalHeaderUserButton.tsx +43 -0
  209. package/src/internal-header/header.stories.tsx +225 -0
  210. package/src/internal-header/index.ts +8 -0
  211. package/src/read-more/ReadMore.tsx +17 -0
  212. package/src/timeline/AxisLabels.tsx +143 -0
  213. package/src/timeline/Pin.tsx +169 -0
  214. package/src/timeline/Timeline.tsx +219 -0
  215. package/src/timeline/TimelineRow.tsx +122 -0
  216. package/src/timeline/hooks/usePeriodContext.tsx +22 -0
  217. package/src/timeline/hooks/useRowContext.tsx +26 -0
  218. package/src/timeline/hooks/useTimelineContext.tsx +37 -0
  219. package/src/timeline/hooks/useTimelineRows.ts +161 -0
  220. package/src/timeline/index.ts +6 -0
  221. package/src/timeline/period/ClickablePeriod.tsx +193 -0
  222. package/src/timeline/period/NonClickablePeriod.tsx +46 -0
  223. package/src/timeline/period/index.tsx +130 -0
  224. package/src/timeline/timeline.stories.tsx +444 -0
  225. package/src/timeline/utils/calc.ts +26 -0
  226. package/src/timeline/utils/filter.ts +32 -0
  227. package/src/timeline/utils/index.ts +6 -0
  228. package/src/timeline/utils/period.ts +48 -0
  229. package/src/timeline/utils/sort.ts +11 -0
  230. package/src/timeline/utils/timeline.ts +83 -0
  231. package/src/timeline/utils/types.external.ts +67 -0
  232. package/src/timeline/utils/types.internal.ts +76 -0
  233. package/src/timeline/zoom/ZoomButton.tsx +83 -0
  234. package/src/timeline/zoom/index.tsx +30 -0
@@ -0,0 +1,3 @@
1
+ export { default as Dropdown } from "./Dropdown";
2
+ export * from "./Dropdown";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,YAAY,CAAC"}
@@ -34,5 +34,15 @@ export interface RadioGroupProps extends Omit<FieldsetProps, "onChange" | "error
34
34
  */
35
35
  required?: boolean;
36
36
  }
37
+ /**
38
+ * Form radio group
39
+ * @see https://aksel.nav.no/komponenter/core/radio
40
+ * @see {@link RadioGroupProps}
41
+ * @example
42
+ * <RadioGroup legend="Får du AAP nå?">
43
+ * <Radio value="ja">Ja</Radio>
44
+ * <Radio value="Nei">Nei</Radio>
45
+ * </RadioGroup>
46
+ */
37
47
  export declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLFieldSetElement>>;
38
48
  export default RadioGroup;
@@ -14,6 +14,16 @@ import cl from "clsx";
14
14
  import { Fieldset, FieldsetContext } from "..";
15
15
  import { useId } from "../..";
16
16
  export const RadioGroupContext = React.createContext(null);
17
+ /**
18
+ * Form radio group
19
+ * @see https://aksel.nav.no/komponenter/core/radio
20
+ * @see {@link RadioGroupProps}
21
+ * @example
22
+ * <RadioGroup legend="Får du AAP nå?">
23
+ * <Radio value="ja">Ja</Radio>
24
+ * <Radio value="Nei">Nei</Radio>
25
+ * </RadioGroup>
26
+ */
17
27
  export const RadioGroup = forwardRef((_a, ref) => {
18
28
  var _b, _c;
19
29
  var { children, className, name, defaultValue, value, onChange = () => { }, required } = _a, rest = __rest(_a, ["children", "className", "name", "defaultValue", "value", "onChange", "required"]);
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/form/radio/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAiB,MAAM,IAAI,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAU9B,MAAM,CAAC,MAAM,iBAAiB,GAC5B,KAAK,CAAC,aAAa,CAAgC,IAAI,CAAC,CAAC;AAiC3D,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,CACE,EASC,EACD,GAAG,EACH,EAAE;;QAXF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EACnB,QAAQ,OAET,EADI,IAAI,cART,kFASC,CADQ;IAIT,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IAEvB,OAA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AAe,CAAC,CAAC;IAE7C,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IAEvB,OAAO,CACL,oBAAC,QAAQ,oBACH,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,SAAS,EACT,mBAAmB,EACnB,sBAAsB,MAAA,MAAA,IAAI,CAAC,IAAI,mCAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,mCAAI,QAAQ,EAAE,CAChE;QAED,oBAAC,iBAAiB,CAAC,QAAQ,IACzB,KAAK,EAAE;gBACL,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,kBAAkB,MAAM,EAAE;gBACxC,YAAY;gBACZ,KAAK;gBACL,QAAQ;gBACR,QAAQ;aACT;YAED,6BAAK,SAAS,EAAC,qBAAqB,IAAE,QAAQ,CAAO,CAC1B,CACpB,CACZ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
package/esm/index.d.ts CHANGED
@@ -5,11 +5,13 @@ export * from "./chat";
5
5
  export * from "./chips";
6
6
  export * from "./copybutton";
7
7
  export * from "./date";
8
+ export * from "./dropdown";
8
9
  export * from "./expansion-card";
9
10
  export * from "./form";
10
11
  export * from "./grid";
11
12
  export * from "./guide-panel";
12
13
  export * from "./help-text";
14
+ export * from "./internal-header";
13
15
  export * from "./link";
14
16
  export * from "./link-panel";
15
17
  export * from "./list";
@@ -24,6 +26,7 @@ export * from "./stepper";
24
26
  export * from "./table";
25
27
  export * from "./tabs";
26
28
  export * from "./tag";
29
+ export * from "./timeline";
27
30
  export * from "./toggle-group";
28
31
  export * from "./tooltip";
29
32
  export * from "./typography";
package/esm/index.js CHANGED
@@ -5,11 +5,13 @@ export * from "./chat";
5
5
  export * from "./chips";
6
6
  export * from "./copybutton";
7
7
  export * from "./date";
8
+ export * from "./dropdown";
8
9
  export * from "./expansion-card";
9
10
  export * from "./form";
10
11
  export * from "./grid";
11
12
  export * from "./guide-panel";
12
13
  export * from "./help-text";
14
+ export * from "./internal-header";
13
15
  export * from "./link";
14
16
  export * from "./link-panel";
15
17
  export * from "./list";
@@ -24,6 +26,7 @@ export * from "./stepper";
24
26
  export * from "./table";
25
27
  export * from "./tabs";
26
28
  export * from "./tag";
29
+ export * from "./timeline";
27
30
  export * from "./toggle-group";
28
31
  export * from "./tooltip";
29
32
  export * from "./typography";
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ import { InternalHeaderTitleType } from "./InternalHeaderTitle";
3
+ import { InternalHeaderUserType } from "./InternalHeaderUser";
4
+ import { InternalHeaderButtonType } from "./InternalHeaderButton";
5
+ import { InternalHeaderUserButtonType } from "./InternalHeaderUserButton";
6
+ export interface InternalHeaderProps extends HTMLAttributes<HTMLElement> {
7
+ children: React.ReactNode;
8
+ }
9
+ interface InternalHeaderComponent extends React.ForwardRefExoticComponent<InternalHeaderProps & React.RefAttributes<HTMLElement>> {
10
+ Title: InternalHeaderTitleType;
11
+ User: InternalHeaderUserType;
12
+ Button: InternalHeaderButtonType;
13
+ UserButton: InternalHeaderUserButtonType;
14
+ }
15
+ export declare const InternalHeader: InternalHeaderComponent;
16
+ export default InternalHeader;
@@ -0,0 +1,27 @@
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 React, { forwardRef } from "react";
13
+ import InternalHeaderTitle from "./InternalHeaderTitle";
14
+ import InternalHeaderUser from "./InternalHeaderUser";
15
+ import InternalHeaderButton from "./InternalHeaderButton";
16
+ import InternalHeaderUserButton from "./InternalHeaderUserButton";
17
+ import cl from "clsx";
18
+ export const InternalHeader = forwardRef((_a, ref) => {
19
+ var { className } = _a, rest = __rest(_a, ["className"]);
20
+ return (React.createElement("header", Object.assign({ "data-theme": "dark" }, rest, { ref: ref, className: cl("navds-internalheader", className) })));
21
+ });
22
+ InternalHeader.Title = InternalHeaderTitle;
23
+ InternalHeader.User = InternalHeaderUser;
24
+ InternalHeader.Button = InternalHeaderButton;
25
+ InternalHeader.UserButton = InternalHeaderUserButton;
26
+ export default InternalHeader;
27
+ //# sourceMappingURL=InternalHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalHeader.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,mBAEN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,kBAEN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,oBAEN,MAAM,wBAAwB,CAAC;AAChC,OAAO,wBAEN,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,MAAM,CAAC;AAgBtB,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,EAAsB,EAAE,GAAG,EAAE,EAAE;QAA/B,EAAE,SAAS,OAAW,EAAN,IAAI,cAApB,aAAsB,CAAF;IAAY,OAAA,CACxE,4DACa,MAAM,IACb,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,IAChD,CACH,CAAA;CAAA,CAA4B,CAAC;AAE9B,cAAc,CAAC,KAAK,GAAG,mBAAmB,CAAC;AAC3C,cAAc,CAAC,IAAI,GAAG,kBAAkB,CAAC;AACzC,cAAc,CAAC,MAAM,GAAG,oBAAoB,CAAC;AAC7C,cAAc,CAAC,UAAU,GAAG,wBAAwB,CAAC;AAErD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { OverridableComponent } from "../util/OverridableComponent";
3
+ export interface InternalHeaderButtonProps extends React.AnchorHTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * Application Button
6
+ */
7
+ children: React.ReactNode;
8
+ }
9
+ export type InternalHeaderButtonType = OverridableComponent<InternalHeaderButtonProps, HTMLButtonElement>;
10
+ export declare const InternalHeaderButton: InternalHeaderButtonType;
11
+ export default InternalHeaderButton;
@@ -0,0 +1,19 @@
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 React, { forwardRef } from "react";
13
+ import cl from "clsx";
14
+ export const InternalHeaderButton = forwardRef((_a, ref) => {
15
+ var { as: Component = "button", className } = _a, rest = __rest(_a, ["as", "className"]);
16
+ return (React.createElement(Component, Object.assign({}, rest, { ref: ref, className: cl("navds-internalheader__button", className) })));
17
+ });
18
+ export default InternalHeaderButton;
19
+ //# sourceMappingURL=InternalHeaderButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalHeaderButton.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeaderButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;AAgBtB,MAAM,CAAC,MAAM,oBAAoB,GAA6B,UAAU,CACtE,CAAC,EAAgD,EAAE,GAAG,EAAE,EAAE;QAAzD,EAAE,EAAE,EAAE,SAAS,GAAG,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9C,mBAAgD,CAAF;IAAY,OAAA,CACzD,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,8BAA8B,EAAE,SAAS,CAAC,IACxD,CACH,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { OverridableComponent } from "../util/OverridableComponent";
3
+ export interface InternalHeaderTitleProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
+ /**
5
+ * Application title
6
+ */
7
+ children: React.ReactNode;
8
+ }
9
+ export type InternalHeaderTitleType = OverridableComponent<InternalHeaderTitleProps, HTMLAnchorElement>;
10
+ export declare const InternalHeaderTitle: InternalHeaderTitleType;
11
+ export default InternalHeaderTitle;
@@ -0,0 +1,20 @@
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 React, { forwardRef } from "react";
13
+ import cl from "clsx";
14
+ export const InternalHeaderTitle = forwardRef((_a, ref) => {
15
+ var { as: Component = "a", children, className } = _a, rest = __rest(_a, ["as", "children", "className"]);
16
+ return (React.createElement(Component, Object.assign({}, rest, { ref: ref, size: "xsmall", className: cl("navds-internalheader__title", "navds-body-short", className) }),
17
+ React.createElement("span", null, children)));
18
+ });
19
+ export default InternalHeaderTitle;
20
+ //# sourceMappingURL=InternalHeaderTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalHeaderTitle.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeaderTitle.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,MAAM,CAAC;AAgBtB,MAAM,CAAC,MAAM,mBAAmB,GAA4B,UAAU,CACpE,CAAC,EAAqD,EAAE,GAAG,EAAE,EAAE;QAA9D,EAAE,EAAE,EAAE,SAAS,GAAG,GAAG,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAAnD,+BAAqD,CAAF;IAAY,OAAA,CAC9D,oBAAC,SAAS,oBACJ,IAAI,IACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,6BAA6B,EAC7B,kBAAkB,EAClB,SAAS,CACV;QAED,kCAAO,QAAQ,CAAQ,CACb,CACb,CAAA;CAAA,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React, { HTMLAttributes } from "react";
2
+ export interface InternalHeaderUserProps extends HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * User name
5
+ */
6
+ name: string;
7
+ /**
8
+ * User description
9
+ */
10
+ description?: string;
11
+ }
12
+ export type InternalHeaderUserType = React.ForwardRefExoticComponent<InternalHeaderUserProps & React.RefAttributes<HTMLDivElement>>;
13
+ export declare const InternalHeaderUser: React.ForwardRefExoticComponent<InternalHeaderUserProps & React.RefAttributes<HTMLDivElement>>;
14
+ export default InternalHeaderUser;
@@ -0,0 +1,23 @@
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 React, { forwardRef } from "react";
13
+ import cl from "clsx";
14
+ import { BodyShort, Detail } from "../typography";
15
+ export const InternalHeaderUser = forwardRef((_a, ref) => {
16
+ var { className, name, description } = _a, rest = __rest(_a, ["className", "name", "description"]);
17
+ return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cl("navds-internalheader__user", className) }),
18
+ React.createElement("span", null,
19
+ React.createElement(BodyShort, { size: "small", as: "div" }, name),
20
+ description && React.createElement(Detail, { as: "div" }, description))));
21
+ });
22
+ export default InternalHeaderUser;
23
+ //# sourceMappingURL=InternalHeaderUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalHeaderUser.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeaderUser.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAkBlD,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAG1C,CAAC,EAAyC,EAAE,GAAG,EAAE,EAAE;QAAlD,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,OAAW,EAAN,IAAI,cAAvC,oCAAyC,CAAF;IAAY,OAAA,CACpD,6CACM,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC;QAEtD;YACE,oBAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,EAAE,EAAC,KAAK,IAC7B,IAAI,CACK;YACX,WAAW,IAAI,oBAAC,MAAM,IAAC,EAAE,EAAC,KAAK,IAAE,WAAW,CAAU,CAClD,CACH,CACP,CAAA;CAAA,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { OverridableComponent } from "../util/OverridableComponent";
3
+ export interface InternalHeaderUserButtonProps extends React.AnchorHTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * User name
6
+ */
7
+ name: string;
8
+ /**
9
+ * User description
10
+ */
11
+ description?: string;
12
+ }
13
+ export type InternalHeaderUserButtonType = OverridableComponent<InternalHeaderUserButtonProps, HTMLButtonElement>;
14
+ export declare const InternalHeaderUserButton: InternalHeaderUserButtonType;
15
+ export default InternalHeaderUserButton;
@@ -0,0 +1,26 @@
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 { ChevronDownIcon } from "@navikt/aksel-icons";
13
+ import cl from "clsx";
14
+ import React, { forwardRef } from "react";
15
+ import { BodyShort, Detail } from "../typography";
16
+ import InternalHeaderButton from "./InternalHeaderButton";
17
+ export const InternalHeaderUserButton = forwardRef((_a, ref) => {
18
+ var { as, name, description, className } = _a, rest = __rest(_a, ["as", "name", "description", "className"]);
19
+ return (React.createElement(InternalHeaderButton, Object.assign({}, rest, { as: as, ref: ref, className: cl("navds-internalheader__user-button", className) }),
20
+ React.createElement("div", null,
21
+ React.createElement(BodyShort, { size: "small", as: "div" }, name),
22
+ description && React.createElement(Detail, { as: "div" }, description)),
23
+ React.createElement(ChevronDownIcon, { title: "vis meny" })));
24
+ });
25
+ export default InternalHeaderUserButton;
26
+ //# sourceMappingURL=InternalHeaderUserButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalHeaderUserButton.js","sourceRoot":"","sources":["../../src/internal-header/InternalHeaderUserButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAmB1D,MAAM,CAAC,MAAM,wBAAwB,GACnC,UAAU,CAAC,CAAC,EAA6C,EAAE,GAAG,EAAE,EAAE;QAAtD,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,OAAW,EAAN,IAAI,cAA3C,0CAA6C,CAAF;IAAY,OAAA,CACjE,oBAAC,oBAAoB,oBACf,IAAI,IACR,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,mCAAmC,EAAE,SAAS,CAAC;QAE7D;YACE,oBAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,EAAE,EAAC,KAAK,IAC7B,IAAI,CACK;YACX,WAAW,IAAI,oBAAC,MAAM,IAAC,EAAE,EAAC,KAAK,IAAE,WAAW,CAAU,CACnD;QACN,oBAAC,eAAe,IAAC,KAAK,EAAC,UAAU,GAAG,CACf,CACxB,CAAA;CAAA,CAAC,CAAC;AAEL,eAAe,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default as InternalHeader, type InternalHeaderProps, } from "./InternalHeader";
2
+ export { type InternalHeaderButtonProps } from "./InternalHeaderButton";
3
+ export { type InternalHeaderTitleProps } from "./InternalHeaderTitle";
4
+ export { type InternalHeaderUserProps } from "./InternalHeaderUser";
5
+ export { type InternalHeaderUserButtonProps } from "./InternalHeaderUserButton";
@@ -0,0 +1,2 @@
1
+ export { default as InternalHeader, } from "./InternalHeader";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/internal-header/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,cAAc,GAE1B,MAAM,kBAAkB,CAAC"}
@@ -24,5 +24,22 @@ export interface ReadMoreProps extends React.ButtonHTMLAttributes<HTMLButtonElem
24
24
  */
25
25
  size?: "medium" | "small";
26
26
  }
27
+ /**
28
+ * ReadMore
29
+ * @see https://aksel.nav.no/komponenter/core/read-more
30
+ * @see {@link ReadMoreProps}
31
+ *
32
+ * @example
33
+ * // Default
34
+ * <ReadMore header="Dette regnes som helsemessige begrensninger">
35
+ * Med helsemessige begrensninger mener vi funksjonshemming, sykdom...
36
+ * </ReadMore>
37
+ *
38
+ * @example
39
+ * // Litt mindre versjon
40
+ * <ReadMore size="small" header="Dette regnes som helsemessige begrensninger">
41
+ * Med helsemessige begrensninger mener vi funksjonshemming, sykdom...
42
+ * </ReadMore>
43
+ */
27
44
  export declare const ReadMore: React.ForwardRefExoticComponent<ReadMoreProps & React.RefAttributes<HTMLButtonElement>>;
28
45
  export default ReadMore;
@@ -13,6 +13,23 @@ import React, { forwardRef, useState } from "react";
13
13
  import cl from "clsx";
14
14
  import { BodyLong } from "../typography";
15
15
  import { ChevronDownIcon } from "@navikt/aksel-icons";
16
+ /**
17
+ * ReadMore
18
+ * @see https://aksel.nav.no/komponenter/core/read-more
19
+ * @see {@link ReadMoreProps}
20
+ *
21
+ * @example
22
+ * // Default
23
+ * <ReadMore header="Dette regnes som helsemessige begrensninger">
24
+ * Med helsemessige begrensninger mener vi funksjonshemming, sykdom...
25
+ * </ReadMore>
26
+ *
27
+ * @example
28
+ * // Litt mindre versjon
29
+ * <ReadMore size="small" header="Dette regnes som helsemessige begrensninger">
30
+ * Med helsemessige begrensninger mener vi funksjonshemming, sykdom...
31
+ * </ReadMore>
32
+ */
16
33
  export const ReadMore = forwardRef((_a, ref) => {
17
34
  var { className, header, children, open, defaultOpen = false, onClick, size = "medium" } = _a, rest = __rest(_a, ["className", "header", "children", "open", "defaultOpen", "onClick", "size"]);
18
35
  const [internalOpen, setInternalOpen] = useState(defaultOpen);
@@ -1 +1 @@
1
- {"version":3,"file":"ReadMore.js","sourceRoot":"","sources":["../../src/read-more/ReadMore.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA6BtD,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EASC,EACD,GAAG,EACH,EAAE;QAXF,EACE,SAAS,EACT,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,GAAG,KAAK,EACnB,OAAO,EACP,IAAI,GAAG,QAAQ,OAEhB,EADI,IAAI,cART,6EASC,CADQ;IAIT,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ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;gBACxC,kCAAkC,EAAE,CAAC,QAAQ;aAC9C,CAAC,EACF,IAAI,EAAE,IAAI,IAET,QAAQ,CACA,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { AxisLabel } from "./utils/types.external";
3
+ export declare const dayLabels: (start: Date, end: Date, totalDays: number, direction: "left" | "right") => AxisLabel[];
4
+ export declare const monthLabels: (start: Date, end: Date, direction: "left" | "right") => AxisLabel[];
5
+ export declare const yearLabels: (start: Date, end: Date, direction: "left" | "right") => AxisLabel[];
6
+ export declare const AxisLabels: () => React.JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { Detail } from "../typography/Detail";
2
+ import { addDays, addMonths, addYears, differenceInDays, differenceInMonths, differenceInYears, endOfMonth, endOfYear, format, startOfDay, startOfMonth, startOfYear, subDays, } from "date-fns";
3
+ import nbLocale from "date-fns/locale/nb";
4
+ import React from "react";
5
+ import { useTimelineContext } from "./hooks/useTimelineContext";
6
+ import { isVisible } from "./utils";
7
+ import { horizontalPositionAndWidth } from "./utils/calc";
8
+ export const dayLabels = (start, end, totalDays, direction) => {
9
+ const increment = Math.ceil(totalDays / 10);
10
+ const lastDay = startOfDay(end);
11
+ return new Array(totalDays)
12
+ .fill(lastDay)
13
+ .map((thisDay, i) => {
14
+ if (i % increment !== 0)
15
+ return null;
16
+ const day = subDays(thisDay, i);
17
+ const { horizontalPosition, width } = horizontalPositionAndWidth(day, addDays(day, 1), start, end);
18
+ return {
19
+ direction: direction,
20
+ horizontalPosition: horizontalPosition,
21
+ label: format(day, "dd.MM", { locale: nbLocale }),
22
+ date: day,
23
+ width: width,
24
+ };
25
+ })
26
+ .filter((label) => label !== null);
27
+ };
28
+ export const monthLabels = (start, end, direction) => {
29
+ const startMonth = startOfMonth(start);
30
+ const endMonth = endOfMonth(end);
31
+ const numberOfMonths = differenceInMonths(endMonth, startMonth) + 1;
32
+ return new Array(numberOfMonths).fill(startMonth).map((thisMonth, i) => {
33
+ const month = addMonths(thisMonth, i);
34
+ const { horizontalPosition, width } = horizontalPositionAndWidth(month, addMonths(month, 1), start, end);
35
+ return {
36
+ direction: direction,
37
+ horizontalPosition: horizontalPosition,
38
+ label: format(month, "MMM yy", { locale: nbLocale }),
39
+ date: month,
40
+ width: width,
41
+ };
42
+ });
43
+ };
44
+ export const yearLabels = (start, end, direction) => {
45
+ const firstYear = startOfYear(start);
46
+ const lastYear = endOfYear(end);
47
+ const yearCount = differenceInYears(lastYear, start) + 1;
48
+ return new Array(yearCount).fill(firstYear).map((thisYear, i) => {
49
+ const year = addYears(thisYear, i);
50
+ const { horizontalPosition, width } = horizontalPositionAndWidth(year, addYears(year, 1), start, end);
51
+ return {
52
+ direction: direction,
53
+ horizontalPosition: horizontalPosition,
54
+ label: year.getFullYear().toString(),
55
+ date: year,
56
+ width: width,
57
+ };
58
+ });
59
+ };
60
+ const axisLabels = (start, end, direction) => {
61
+ const totalDays = differenceInDays(end, start);
62
+ if (totalDays < 40) {
63
+ return dayLabels(start, end, totalDays, direction);
64
+ }
65
+ else if (totalDays < 370) {
66
+ return monthLabels(start, end, direction);
67
+ }
68
+ else {
69
+ return yearLabels(start, end, direction);
70
+ }
71
+ };
72
+ export const AxisLabels = () => {
73
+ const { endDate, startDate, direction } = useTimelineContext();
74
+ const labels = axisLabels(startDate, endDate, direction).filter(isVisible);
75
+ return (React.createElement("div", { className: "navds-timeline__axislabels", "aria-hidden": "true" }, labels.map((etikett) => (React.createElement(Detail, { className: "navds-timeline__axislabels-label", as: "div", key: etikett.label, style: {
76
+ justifyContent: direction === "left" ? "flex-start" : "flex-end",
77
+ [direction]: `${etikett.horizontalPosition}%`,
78
+ width: `${etikett.width}%`,
79
+ } }, etikett.label)))));
80
+ };
81
+ //# sourceMappingURL=AxisLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisLabels.js","sourceRoot":"","sources":["../../src/timeline/AxisLabels.tsx"],"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AAS,EAAE,SAAS,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAE3E,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B,iBAAa,MAAM,IAC3D,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACvB,oBAAC,MAAM,IACL,SAAS,EAAC,kCAAkC,EAC5C,EAAE,EAAC,KAAK,EACR,GAAG,EAAE,OAAO,CAAC,KAAK,EAClB,KAAK,EAAE;YACL,cAAc,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU;YAChE,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,CAAC,kBAAkB,GAAG;YAC7C,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG;SAC3B,IAEA,OAAO,CAAC,KAAK,CACP,CACV,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { TimelineComponentTypes } from "./utils/types.internal";
3
+ export interface TimelinePinProps extends React.HTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * Date position for the pin.
6
+ */
7
+ date: Date;
8
+ /**
9
+ * Content in Pin Popover.
10
+ */
11
+ children?: React.ReactNode;
12
+ }
13
+ export interface PinType extends React.ForwardRefExoticComponent<TimelinePinProps & React.RefAttributes<HTMLButtonElement>> {
14
+ componentType: TimelineComponentTypes;
15
+ }
16
+ export declare const Pin: PinType;
17
+ export default Pin;
@@ -0,0 +1,81 @@
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 { autoUpdate, arrow as flArrow, flip, offset, safePolygon, shift, useDismiss, useFloating, useFocus, useHover, useInteractions, } from "@floating-ui/react";
13
+ import { useEventListener, mergeRefs } from "../util";
14
+ import { format } from "date-fns";
15
+ import React, { forwardRef, useCallback, useMemo, useRef, useState, } from "react";
16
+ import { useTimelineContext } from "./hooks/useTimelineContext";
17
+ import { position } from "./utils/calc";
18
+ export const Pin = forwardRef((_a, ref) => {
19
+ var { date, children } = _a, rest = __rest(_a, ["date", "children"]);
20
+ const { startDate, endDate, direction } = useTimelineContext();
21
+ const [open, setOpen] = useState(false);
22
+ const arrowRef = useRef(null);
23
+ const { context, placement, middlewareData: { arrow: { x: arrowX, y: arrowY } = {} }, refs, floatingStyles, } = useFloating({
24
+ placement: "top",
25
+ open: open,
26
+ onOpenChange: setOpen,
27
+ middleware: [
28
+ offset(16),
29
+ shift(),
30
+ flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
31
+ flArrow({ element: arrowRef, padding: 5 }),
32
+ ],
33
+ whileElementsMounted: autoUpdate,
34
+ });
35
+ const { getFloatingProps, getReferenceProps } = useInteractions([
36
+ useHover(context, {
37
+ handleClose: safePolygon(),
38
+ restMs: 25,
39
+ delay: { open: 1000 },
40
+ }),
41
+ useFocus(context),
42
+ useDismiss(context),
43
+ ]);
44
+ const mergedRef = useMemo(() => mergeRefs([refs.setReference, ref]), [ref, refs.setReference]);
45
+ useEventListener("focusin", useCallback((e) => {
46
+ var _a;
47
+ if (![refs.domReference.current, (_a = refs === null || refs === void 0 ? void 0 : refs.floating) === null || _a === void 0 ? void 0 : _a.current].some((element) => element === null || element === void 0 ? void 0 : element.contains(e.target))) {
48
+ open && setOpen(false);
49
+ }
50
+ }, [open, refs.domReference, refs === null || refs === void 0 ? void 0 : refs.floating]));
51
+ const staticSide = {
52
+ top: "bottom",
53
+ right: "left",
54
+ bottom: "top",
55
+ left: "right",
56
+ }[placement.split("-")[0]];
57
+ return (React.createElement(React.Fragment, null,
58
+ React.createElement("div", { className: "navds-timeline__pin-wrapper", style: { [direction]: `${position(date, startDate, endDate)}%` } },
59
+ React.createElement("button", Object.assign({}, rest, { ref: mergedRef, className: "navds-timeline__pin-button", "aria-label": `pin:${format(date, "dd.MM.yyyy")}`, type: "button", "aria-expanded": children ? open : undefined }, getReferenceProps({
60
+ onKeyDown: (e) => {
61
+ var _a;
62
+ (_a = rest === null || rest === void 0 ? void 0 : rest.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(rest, e);
63
+ if (e.key === "Enter") {
64
+ setOpen((prev) => !prev);
65
+ }
66
+ else if (e.key === " ") {
67
+ setOpen(false);
68
+ }
69
+ },
70
+ })))),
71
+ children && (React.createElement("div", Object.assign({ className: "navds-timeline__popover", "data-placement": placement, "aria-hidden": !open, ref: refs.setFloating }, getFloatingProps({
72
+ tabIndex: -1,
73
+ }), { style: Object.assign(Object.assign({}, floatingStyles), { display: open ? undefined : "none" }) }),
74
+ React.createElement("div", { className: "navds-timeline__popover-content" }, children),
75
+ React.createElement("div", { ref: (node) => {
76
+ arrowRef.current = node;
77
+ }, style: Object.assign(Object.assign(Object.assign({}, (arrowX != null ? { left: arrowX } : {})), (arrowY != null ? { top: arrowY } : {})), (staticSide ? { [staticSide]: "-0.5rem" } : {})), className: "navds-timeline__popover-arrow" })))));
78
+ });
79
+ Pin.componentType = "pin";
80
+ export default Pin;
81
+ //# sourceMappingURL=Pin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pin.js","sourceRoot":"","sources":["../../src/timeline/Pin.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,KAAK,IAAI,OAAO,EAChB,IAAI,EACJ,MAAM,EACN,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW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