@oslokommune/punkt-react 20.0.4 → 20.1.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 (211) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
  3. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
  4. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
  5. package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
  6. package/dist/_virtual/_rolldown/runtime.js +1 -2
  7. package/dist/components/accordion/Accordion.js +1 -2
  8. package/dist/components/accordion/AccordionItem.js +9 -10
  9. package/dist/components/alert/Alert.js +7 -8
  10. package/dist/components/backlink/BackLink.js +1 -2
  11. package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
  12. package/dist/components/button/Button.js +35 -35
  13. package/dist/components/calendar/Calendar.js +1 -2
  14. package/dist/components/calendar/CalendarGrid.js +1 -2
  15. package/dist/components/calendar/CalendarNav.js +5 -6
  16. package/dist/components/calendar/calendar-utils.js +1 -2
  17. package/dist/components/calendar/useCalendarState.js +90 -91
  18. package/dist/components/card/Card.js +14 -15
  19. package/dist/components/checkbox/Checkbox.js +3 -8
  20. package/dist/components/checkboxgroup/CheckboxGroup.js +10 -11
  21. package/dist/components/checkboxgroup/CheckboxGroupContext.js +1 -2
  22. package/dist/components/combobox/Combobox.js +5 -6
  23. package/dist/components/combobox/ComboboxInput.js +6 -7
  24. package/dist/components/combobox/ComboboxTags.js +11 -12
  25. package/dist/components/combobox/Listbox.js +25 -26
  26. package/dist/components/combobox/useComboboxState.js +38 -39
  27. package/dist/components/consent/Consent.js +6 -7
  28. package/dist/components/datepicker/DateTags.js +14 -15
  29. package/dist/components/datepicker/Datepicker.js +1 -2
  30. package/dist/components/datepicker/DatepickerInputs.js +1 -2
  31. package/dist/components/datepicker/DatepickerPopup.js +5 -6
  32. package/dist/components/datepicker/useDatepickerState.js +20 -21
  33. package/dist/components/fileupload/DropZone.js +6 -7
  34. package/dist/components/fileupload/FileUpload.js +36 -37
  35. package/dist/components/fileupload/FileUploadContext.js +1 -2
  36. package/dist/components/fileupload/QueueDisplay.js +12 -13
  37. package/dist/components/fileupload/QueueItemContent.js +14 -15
  38. package/dist/components/fileupload/Subcomponents.js +70 -71
  39. package/dist/components/fileupload/Truncate.js +1 -2
  40. package/dist/components/fileupload/extensions/Comments.js +21 -22
  41. package/dist/components/fileupload/extensions/Remove.js +1 -2
  42. package/dist/components/fileupload/extensions/Rename.js +8 -9
  43. package/dist/components/fileupload/hooks/useFileAttributes.js +1 -2
  44. package/dist/components/fileupload/hooks/useImageObjectUrl.js +1 -2
  45. package/dist/components/fileupload/hooks/useImagePreview.js +1 -2
  46. package/dist/components/fileupload/hooks/useOperationState.js +1 -2
  47. package/dist/components/fileupload/hooks/useRequiredFormValidation.js +1 -2
  48. package/dist/components/fileupload/types.js +4 -5
  49. package/dist/components/footer/Footer.js +23 -24
  50. package/dist/components/footer/FooterGlobal.js +24 -25
  51. package/dist/components/footerSimple/FooterSimple.js +5 -6
  52. package/dist/components/header/Header.js +1 -2
  53. package/dist/components/header/HeaderGlobal.js +127 -128
  54. package/dist/components/header/HeaderService.js +84 -85
  55. package/dist/components/header-menu/HeaderMenu.js +34 -35
  56. package/dist/components/headerUserMenu/UserMenu.js +14 -15
  57. package/dist/components/heading/Heading.js +1 -2
  58. package/dist/components/helptext/Helptext.js +5 -6
  59. package/dist/components/icon/Icon.js +2 -3
  60. package/dist/components/input/Input.js +1 -2
  61. package/dist/components/inputwrapper/InputWrapper.js +12 -17
  62. package/dist/components/link/Link.js +1 -2
  63. package/dist/components/linkcard/LinkCard.js +2 -3
  64. package/dist/components/loader/Loader.js +2 -3
  65. package/dist/components/messagebox/Messagebox.js +6 -7
  66. package/dist/components/modal/Modal.js +13 -14
  67. package/dist/components/progressbar/Progressbar.js +5 -6
  68. package/dist/components/radio/RadioButton.js +3 -8
  69. package/dist/components/radiogroup/RadioGroup.js +1 -2
  70. package/dist/components/radiogroup/RadioGroupContext.js +1 -2
  71. package/dist/components/searchinput/SearchInput.js +11 -12
  72. package/dist/components/select/Select.js +6 -7
  73. package/dist/components/stepper/Step.js +1 -2
  74. package/dist/components/stepper/Stepper.js +1 -2
  75. package/dist/components/strings/PktStringsProvider.js +1 -2
  76. package/dist/components/table/Table.js +2 -3
  77. package/dist/components/table/TableBody.js +1 -2
  78. package/dist/components/table/TableDataCell.js +1 -2
  79. package/dist/components/table/TableHeader.js +1 -2
  80. package/dist/components/table/TableHeaderCell.js +1 -2
  81. package/dist/components/table/TableRow.js +1 -2
  82. package/dist/components/tabs/TabItem.js +1 -2
  83. package/dist/components/tabs/Tabs.js +5 -6
  84. package/dist/components/tag/Tag.js +6 -7
  85. package/dist/components/textarea/Textarea.js +5 -6
  86. package/dist/components/textinput/Textinput.js +6 -7
  87. package/dist/components/timepicker/Timepicker.js +6 -7
  88. package/dist/components/timepicker/useTimepickerState.js +27 -28
  89. package/dist/hooks/useElementWidth.js +1 -2
  90. package/dist/hooks/useFocusModality.js +1 -2
  91. package/dist/hooks/useGeneratedId.js +1 -2
  92. package/dist/hooks/useHeaderChrome.js +1 -2
  93. package/dist/hooks/useOptionGroupField.js +1 -2
  94. package/dist/hooks/useOwnerForm.js +1 -2
  95. package/dist/hooks/usePktStrings.js +1 -2
  96. package/dist/hooks/useScrollLock.js +1 -2
  97. package/dist/node_modules/@date-fns/tz/date/index.js +1 -2
  98. package/dist/node_modules/@date-fns/tz/date/mini.js +1 -2
  99. package/dist/node_modules/@date-fns/tz/index.js +3 -3
  100. package/dist/node_modules/@date-fns/tz/tzName/index.js +1 -2
  101. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +1 -2
  102. package/dist/node_modules/classnames/index.js +1 -2
  103. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -2
  104. package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -2
  105. package/dist/node_modules/date-fns/_lib/format/formatters.js +18 -19
  106. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -2
  107. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -2
  108. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -2
  109. package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -2
  110. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +1 -2
  111. package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -2
  112. package/dist/node_modules/date-fns/addDays.js +1 -2
  113. package/dist/node_modules/date-fns/constants.js +1 -2
  114. package/dist/node_modules/date-fns/constructFrom.js +1 -2
  115. package/dist/node_modules/date-fns/differenceInCalendarDays.js +6 -7
  116. package/dist/node_modules/date-fns/eachDayOfInterval.js +5 -6
  117. package/dist/node_modules/date-fns/endOfDay.js +1 -2
  118. package/dist/node_modules/date-fns/format.js +15 -16
  119. package/dist/node_modules/date-fns/getDayOfYear.js +6 -7
  120. package/dist/node_modules/date-fns/getISODay.js +1 -2
  121. package/dist/node_modules/date-fns/getISOWeek.js +5 -6
  122. package/dist/node_modules/date-fns/getISOWeekYear.js +6 -7
  123. package/dist/node_modules/date-fns/getWeek.js +5 -6
  124. package/dist/node_modules/date-fns/getWeekYear.js +8 -9
  125. package/dist/node_modules/date-fns/isDate.js +1 -2
  126. package/dist/node_modules/date-fns/isValid.js +4 -5
  127. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -2
  128. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -2
  129. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -2
  130. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -2
  131. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -2
  132. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -1
  133. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -2
  134. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -1
  135. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -1
  136. package/dist/node_modules/date-fns/locale/en-US.js +1 -2
  137. package/dist/node_modules/date-fns/startOfDay.js +1 -2
  138. package/dist/node_modules/date-fns/startOfISOWeek.js +1 -2
  139. package/dist/node_modules/date-fns/startOfISOWeekYear.js +5 -6
  140. package/dist/node_modules/date-fns/startOfWeek.js +4 -5
  141. package/dist/node_modules/date-fns/startOfWeekYear.js +7 -8
  142. package/dist/node_modules/date-fns/startOfYear.js +1 -2
  143. package/dist/node_modules/date-fns/toDate.js +1 -2
  144. package/dist/punkt-react.cjs +1 -1
  145. package/dist/shared-strings/consent.js +1 -2
  146. package/dist/shared-strings/format.js +1 -2
  147. package/dist/shared-strings/nb.js +1 -2
  148. package/dist/shared-strings/resolve.js +1 -2
  149. package/dist/shared-strings/store.js +1 -2
  150. package/dist/shared-types/accordion.js +1 -2
  151. package/dist/shared-types/button.d.ts +13 -0
  152. package/dist/shared-types/button.js +14 -0
  153. package/dist/shared-types/calendar.js +1 -2
  154. package/dist/shared-types/card.js +1 -2
  155. package/dist/shared-types/checkbox.js +1 -2
  156. package/dist/shared-types/combobox.js +1 -2
  157. package/dist/shared-types/consent.js +1 -2
  158. package/dist/shared-types/footer.js +1 -2
  159. package/dist/shared-types/header-footer.js +1 -2
  160. package/dist/shared-types/icon.js +1 -2
  161. package/dist/shared-types/index.d.ts +1 -1
  162. package/dist/shared-types/index.js +11 -10
  163. package/dist/shared-types/input-wrapper.js +1 -2
  164. package/dist/shared-types/linkcard.js +1 -2
  165. package/dist/shared-types/loader.js +1 -2
  166. package/dist/shared-types/messagebox.js +1 -2
  167. package/dist/shared-types/option-group.js +1 -2
  168. package/dist/shared-types/progressbar.js +1 -2
  169. package/dist/shared-types/radiobutton.js +1 -2
  170. package/dist/shared-types/select.js +1 -2
  171. package/dist/shared-types/size.js +1 -2
  172. package/dist/shared-types/table.js +1 -2
  173. package/dist/shared-types/tag.js +1 -2
  174. package/dist/shared-types/textarea.js +1 -2
  175. package/dist/shared-types/textinput.js +1 -2
  176. package/dist/shared-utils/calendar/calendar-grid.js +4 -5
  177. package/dist/shared-utils/calendar/date-validation.js +1 -2
  178. package/dist/shared-utils/calendar/keyboard-navigation.js +1 -2
  179. package/dist/shared-utils/calendar/selection-manager.js +31 -32
  180. package/dist/shared-utils/combobox/input-utils.js +1 -2
  181. package/dist/shared-utils/combobox/keyboard-navigation.js +1 -2
  182. package/dist/shared-utils/combobox/option-utils.js +1 -2
  183. package/dist/shared-utils/date-utils.js +10 -11
  184. package/dist/shared-utils/datepicker-utils.js +4 -5
  185. package/dist/shared-utils/device-utils.js +1 -2
  186. package/dist/shared-utils/fileupload/announcements.js +1 -2
  187. package/dist/shared-utils/fileupload/filename.js +1 -2
  188. package/dist/shared-utils/fileupload/formats.js +1 -2
  189. package/dist/shared-utils/fileupload/navigation.js +1 -2
  190. package/dist/shared-utils/fileupload/size.js +1 -2
  191. package/dist/shared-utils/fileupload/transfers.js +1 -2
  192. package/dist/shared-utils/fileupload/truncate.js +1 -2
  193. package/dist/shared-utils/fileupload/validation.js +8 -9
  194. package/dist/shared-utils/focus-trap/index.js +13 -31
  195. package/dist/shared-utils/forms/described-by.js +1 -2
  196. package/dist/shared-utils/header-footer/external-domain.js +1 -2
  197. package/dist/shared-utils/header-footer/fetch-header-footer-data.js +1 -2
  198. package/dist/shared-utils/header-footer/icon-map.js +1 -2
  199. package/dist/shared-utils/header-footer/select-megamenu.js +1 -2
  200. package/dist/shared-utils/scroll-lock/index.js +1 -2
  201. package/dist/shared-utils/timepicker/options.js +1 -2
  202. package/dist/shared-utils/timepicker/stepper.js +1 -2
  203. package/dist/shared-utils/timepicker/time-utils.js +1 -2
  204. package/dist/shared-utils/value-utils.js +1 -2
  205. package/dist/utils/nativeInputValue.js +1 -2
  206. package/dist/utils/stableKeys.js +1 -2
  207. package/dist/utils/stringutils.js +1 -2
  208. package/package.json +20 -21
  209. package/src/components/accordion/Accordion.test.tsx +2 -4
  210. package/src/components/button/Button.tsx +11 -11
  211. package/src/components/tag/Tag.tsx +0 -1
@@ -1,20 +1,20 @@
1
- import { PktIcon as e } from "../icon/Icon.js";
2
- import { formatString as t } from "../../shared-strings/format.js";
3
- import { PktButton as n } from "../button/Button.js";
4
- import { formatFileSize as r } from "../../shared-utils/fileupload/size.js";
5
- import { trapTabInside as i } from "../../shared-utils/focus-trap/index.js";
6
- import { getDisplayFilename as a } from "../../shared-utils/fileupload/filename.js";
1
+ import { formatString as e } from "../../shared-strings/format.js";
7
2
  import "../../shared-utils/fileupload/index.js";
8
- import { PktFileUploadContext as o } from "./FileUploadContext.js";
9
- import { useImageObjectUrl as s } from "./hooks/useImageObjectUrl.js";
10
- import { PktProgressbar as c } from "../progressbar/Progressbar.js";
11
- import { PktModal as l } from "../modal/Modal.js";
12
- import { Truncate as u } from "./Truncate.js";
3
+ import { PktButton as t } from "../button/Button.js";
4
+ import { PktIcon as n } from "../icon/Icon.js";
5
+ import { trapTabInside as r } from "../../shared-utils/focus-trap/index.js";
6
+ import { getDisplayFilename as i } from "../../shared-utils/fileupload/filename.js";
7
+ import { PktProgressbar as a } from "../progressbar/Progressbar.js";
8
+ import { PktModal as o } from "../modal/Modal.js";
9
+ import { Truncate as s } from "./Truncate.js";
10
+ import { PktFileUploadContext as c } from "./FileUploadContext.js";
11
+ import { useImageObjectUrl as l } from "./hooks/useImageObjectUrl.js";
12
+ import { formatFileSize as u } from "../../shared-utils/fileupload/size.js";
13
13
  import { useContext as d, useEffect as f, useState as p } from "react";
14
14
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
15
- //#region src/components/fileupload/Subcomponents.tsx
15
+ // src/components/fileupload/Subcomponents.tsx
16
16
  var _ = (e) => {
17
- let { strings: t } = d(o);
17
+ let { strings: t } = d(c);
18
18
  return /* @__PURE__ */ h("button", {
19
19
  type: "button",
20
20
  onClick: e.onClick,
@@ -24,39 +24,39 @@ var _ = (e) => {
24
24
  children: e.label || t.cancel
25
25
  });
26
26
  }, v = () => {
27
- let { strings: e } = d(o);
27
+ let { strings: e } = d(c);
28
28
  return /* @__PURE__ */ h("span", {
29
29
  className: "pkt-fileupload__queue-display__item__loading-text",
30
30
  "aria-label": e.uploadingFile,
31
31
  children: e.uploading
32
32
  });
33
- }, y = ({ cancelTransfer: t, transferItem: n, disabled: i = !1 }) => {
34
- let { strings: s } = d(o), l = n.showProgress ?? n.progress !== 0;
33
+ }, y = ({ cancelTransfer: e, transferItem: t, disabled: r = !1 }) => {
34
+ let { strings: o } = d(c), l = t.showProgress ?? t.progress !== 0;
35
35
  return /* @__PURE__ */ g(m, { children: [
36
- /* @__PURE__ */ h(e, {
36
+ /* @__PURE__ */ h(n, {
37
37
  name: "document-text",
38
38
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
39
39
  "aria-hidden": "true"
40
40
  }),
41
41
  /* @__PURE__ */ g("p", {
42
42
  className: "pkt-fileupload__queue-display__item__title",
43
- "aria-label": s.filename,
44
- children: [/* @__PURE__ */ h(u, { children: a(n) }), /* @__PURE__ */ g("span", {
43
+ "aria-label": o.filename,
44
+ children: [/* @__PURE__ */ h(s, { children: i(t) }), /* @__PURE__ */ g("span", {
45
45
  className: "pkt-fileupload__queue-display__item__filesize",
46
46
  children: [
47
47
  " ",
48
48
  "(",
49
- r(n.file.size),
49
+ u(t.file.size),
50
50
  ")"
51
51
  ]
52
52
  })]
53
53
  }),
54
54
  /* @__PURE__ */ h(_, {
55
- onClick: t,
56
- disabled: i
55
+ onClick: e,
56
+ disabled: r
57
57
  }),
58
- l ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(c, {
59
- valueCurrent: n.progress * 100,
58
+ l ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(a, {
59
+ valueCurrent: t.progress * 100,
60
60
  statusType: "none",
61
61
  valueMax: 100,
62
62
  statusPlacement: "following",
@@ -64,64 +64,64 @@ var _ = (e) => {
64
64
  }), /* @__PURE__ */ h("span", {
65
65
  className: "pkt-fileupload__queue-display__item__percentage",
66
66
  "aria-hidden": "true",
67
- children: `${Math.round(n.progress * 100)}%`
67
+ children: `${Math.round(t.progress * 100)}%`
68
68
  })] }) : /* @__PURE__ */ h(v, {})
69
69
  ] });
70
70
  }, b = ({ transferItem: e }) => /* @__PURE__ */ g("p", {
71
71
  className: "pkt-fileupload__queue-display__item__title",
72
- children: [/* @__PURE__ */ h(u, { children: a(e) }), e.file && /* @__PURE__ */ g("span", {
72
+ children: [/* @__PURE__ */ h(s, { children: i(e) }), e.file && /* @__PURE__ */ g("span", {
73
73
  className: "pkt-fileupload__queue-display__item__filesize",
74
74
  children: [
75
75
  " (",
76
- r(e.file.size),
76
+ u(e.file.size),
77
77
  ")"
78
78
  ]
79
79
  })]
80
- }), x = ({ transferItem: t, onRemove: n, disabled: r }) => {
81
- let { strings: i } = d(o), a = (t.lastProgress ?? 1) * 100;
80
+ }), x = ({ transferItem: e, onRemove: t, disabled: r }) => {
81
+ let { strings: i } = d(c), o = (e.lastProgress ?? 1) * 100;
82
82
  return /* @__PURE__ */ g(m, { children: [
83
- /* @__PURE__ */ h(e, {
83
+ /* @__PURE__ */ h(n, {
84
84
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
85
85
  name: "alert-error",
86
86
  "aria-hidden": "true"
87
87
  }),
88
- /* @__PURE__ */ h(b, { transferItem: t }),
88
+ /* @__PURE__ */ h(b, { transferItem: e }),
89
89
  /* @__PURE__ */ h(_, {
90
- onClick: n,
90
+ onClick: t,
91
91
  label: i.removeFailed,
92
92
  ariaLabel: i.removeFailedFile,
93
93
  disabled: r
94
94
  }),
95
- /* @__PURE__ */ h(c, {
96
- valueCurrent: a,
95
+ /* @__PURE__ */ h(a, {
96
+ valueCurrent: o,
97
97
  statusType: "none",
98
98
  valueMax: 100,
99
99
  statusPlacement: "following",
100
100
  className: "pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"
101
101
  }),
102
- t.errorMessage && /* @__PURE__ */ h("span", {
102
+ e.errorMessage && /* @__PURE__ */ h("span", {
103
103
  className: "pkt-fileupload__queue-display__item__error-message",
104
- children: t.errorMessage
104
+ children: e.errorMessage
105
105
  })
106
106
  ] });
107
- }, S = ({ transferItem: t, onRemove: n, disabled: r }) => {
108
- let { strings: i } = d(o);
107
+ }, S = ({ transferItem: e, onRemove: t, disabled: r }) => {
108
+ let { strings: i } = d(c);
109
109
  return /* @__PURE__ */ g(m, { children: [
110
- /* @__PURE__ */ h(e, {
110
+ /* @__PURE__ */ h(n, {
111
111
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
112
112
  name: "alert-error",
113
113
  "aria-hidden": "true"
114
114
  }),
115
- /* @__PURE__ */ h(b, { transferItem: t }),
115
+ /* @__PURE__ */ h(b, { transferItem: e }),
116
116
  /* @__PURE__ */ h(_, {
117
- onClick: n,
117
+ onClick: t,
118
118
  label: i.removeFailed,
119
119
  ariaLabel: i.removeFailedFile,
120
120
  disabled: r
121
121
  }),
122
- t.errorMessage && /* @__PURE__ */ h("span", {
122
+ e.errorMessage && /* @__PURE__ */ h("span", {
123
123
  className: "pkt-fileupload__queue-display__item__error-message",
124
- children: t.errorMessage
124
+ children: e.errorMessage
125
125
  })
126
126
  ] });
127
127
  }, C = ({ transferItem: e, onRemove: t, disabled: n }) => e.showProgress ? /* @__PURE__ */ h(x, {
@@ -144,43 +144,43 @@ var _ = (e) => {
144
144
  "aria-label": typeof e.ariaLabel == "function" ? e.ariaLabel(t.file) : e.ariaLabel,
145
145
  children: n
146
146
  }) : null;
147
- }, T = ({ transferItem: t }) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(e, {
147
+ }, T = ({ transferItem: e }) => /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(n, {
148
148
  name: "document-text",
149
149
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium",
150
150
  "aria-hidden": "true"
151
- }), /* @__PURE__ */ h(b, { transferItem: t })] }), E = ({ transferItem: r, onPreviewClick: i }) => {
152
- let { strings: a } = d(o), c = s(r.file), [l, f] = p(null), m = !!c && l === c, _ = c && !m && /* @__PURE__ */ h("img", {
153
- src: c,
151
+ }), /* @__PURE__ */ h(b, { transferItem: e })] }), E = ({ transferItem: r, onPreviewClick: i }) => {
152
+ let { strings: a } = d(c), o = l(r.file), [u, f] = p(null), m = !!o && u === o, _ = o && !m && /* @__PURE__ */ h("img", {
153
+ src: o,
154
154
  alt: r.attributes.targetFilename,
155
- onError: () => f(c)
156
- }) || /* @__PURE__ */ h(e, {
155
+ onError: () => f(o)
156
+ }) || /* @__PURE__ */ h(n, {
157
157
  name: "document-text",
158
158
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
159
159
  }), v = !!i;
160
160
  return /* @__PURE__ */ g("div", {
161
- className: `pkt-fileupload__queue-display__item__thumbnail${c && !m ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
162
- children: [/* @__PURE__ */ g(n, {
161
+ className: `pkt-fileupload__queue-display__item__thumbnail${o && !m ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
162
+ children: [/* @__PURE__ */ g(t, {
163
163
  className: "pkt-fileupload__queue-display__item__thumbnail__image-wrapper",
164
- "aria-label": t(a.previewImage, { filename: r.attributes.targetFilename }),
164
+ "aria-label": e(a.previewImage, { filename: r.attributes.targetFilename }),
165
165
  type: "button",
166
166
  skin: "secondary",
167
167
  onClick: i,
168
- children: [v && /* @__PURE__ */ h(e, {
168
+ children: [v && /* @__PURE__ */ h(n, {
169
169
  name: "expand",
170
170
  className: "pkt-fileupload__queue-display__item__thumbnail__expand-icon",
171
171
  "aria-hidden": "true"
172
172
  }), _]
173
173
  }), /* @__PURE__ */ h("span", {
174
174
  className: "pkt-fileupload__queue-display__item__thumbnail__title",
175
- children: /* @__PURE__ */ h(u, { children: r.attributes.targetFilename })
175
+ children: /* @__PURE__ */ h(s, { children: r.attributes.targetFilename })
176
176
  })]
177
177
  });
178
- }, D = ({ isOpen: r, images: a, currentIndex: c, onClose: u, onNavigate: m, modalRef: _ }) => {
179
- let { strings: v } = d(o), y = a[c], b = a.length > 1, x = s(y?.file), [S, C] = p(null), w = !!x && S === x;
178
+ }, D = ({ isOpen: i, images: a, currentIndex: s, onClose: u, onNavigate: m, modalRef: _ }) => {
179
+ let { strings: v } = d(c), y = a[s], b = a.length > 1, x = l(y?.file), [S, C] = p(null), w = !!x && S === x;
180
180
  return f(() => {
181
- if (!r) return;
181
+ if (!i) return;
182
182
  let e = (e) => {
183
- if (e.key === "Tab") i(e, _.current);
183
+ if (e.key === "Tab") r(e, _.current);
184
184
  else switch (e.key) {
185
185
  case "ArrowLeft":
186
186
  e.preventDefault(), m("prev");
@@ -193,11 +193,11 @@ var _ = (e) => {
193
193
  };
194
194
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
195
195
  }, [
196
- r,
196
+ i,
197
197
  m,
198
198
  u,
199
199
  _
200
- ]), y ? /* @__PURE__ */ h(l, {
200
+ ]), y ? /* @__PURE__ */ h(o, {
201
201
  ref: _,
202
202
  headingText: y.attributes.targetFilename,
203
203
  closeOnBackdropClick: !0,
@@ -206,15 +206,15 @@ var _ = (e) => {
206
206
  children: /* @__PURE__ */ g("div", {
207
207
  className: "pkt-fileupload__image-preview",
208
208
  children: [
209
- b && /* @__PURE__ */ h(n, {
209
+ b && /* @__PURE__ */ h(t, {
210
210
  variant: "icon-only",
211
211
  iconName: "chevron-thin-left",
212
212
  skin: "secondary",
213
213
  size: "medium",
214
214
  className: "pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev",
215
215
  onClick: () => m("prev"),
216
- "aria-label": t(v.previewPrevious, {
217
- index: c,
216
+ "aria-label": e(v.previewPrevious, {
217
+ index: s,
218
218
  total: a.length
219
219
  })
220
220
  }),
@@ -222,14 +222,14 @@ var _ = (e) => {
222
222
  className: "pkt-fileupload__image-preview__content",
223
223
  children: x && !w ? /* @__PURE__ */ h("img", {
224
224
  src: x,
225
- alt: t(v.previewImageAlt, {
225
+ alt: e(v.previewImageAlt, {
226
226
  filename: y.attributes.targetFilename,
227
- index: c + 1,
227
+ index: s + 1,
228
228
  total: a.length
229
229
  }),
230
230
  className: "pkt-fileupload__image-preview__image",
231
231
  onError: () => C(x)
232
- }) : /* @__PURE__ */ h(e, {
232
+ }) : /* @__PURE__ */ h(n, {
233
233
  name: "picture",
234
234
  className: "pkt-fileupload__queue-display__item__icon pkt-icon--medium"
235
235
  })
@@ -237,20 +237,20 @@ var _ = (e) => {
237
237
  b && /* @__PURE__ */ g("span", {
238
238
  className: "pkt-fileupload__image-preview__counter",
239
239
  children: [
240
- c + 1,
240
+ s + 1,
241
241
  " / ",
242
242
  a.length
243
243
  ]
244
244
  }),
245
- b && /* @__PURE__ */ h(n, {
245
+ b && /* @__PURE__ */ h(t, {
246
246
  variant: "icon-only",
247
247
  iconName: "chevron-thin-right",
248
248
  skin: "secondary",
249
249
  size: "medium",
250
250
  className: "pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next",
251
251
  onClick: () => m("next"),
252
- "aria-label": t(v.previewNext, {
253
- index: c + 2,
252
+ "aria-label": e(v.previewNext, {
253
+ index: s + 2,
254
254
  total: a.length
255
255
  })
256
256
  })
@@ -258,5 +258,4 @@ var _ = (e) => {
258
258
  })
259
259
  }) : null;
260
260
  };
261
- //#endregion
262
261
  export { T as FilenameRenderer, D as ImagePreviewModal, w as OperationButton, E as ThumbnailRenderer, C as TransferError, y as TransferInProgress };
@@ -2,7 +2,7 @@ import { splitFilenameForTruncation as e } from "../../shared-utils/fileupload/t
2
2
  import "../../shared-utils/fileupload/index.js";
3
3
  import { createContext as t, useContext as n } from "react";
4
4
  import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
5
- //#region src/components/fileupload/Truncate.tsx
5
+ // src/components/fileupload/Truncate.tsx
6
6
  var o = t({ tail: 5 }), s = ({ children: t, tail: s }) => {
7
7
  let c = n(o), l = s === void 0 ? c.tail : s, u = e(t, l);
8
8
  return u ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
@@ -18,5 +18,4 @@ var o = t({ tail: 5 }), s = ({ children: t, tail: s }) => {
18
18
  children: t
19
19
  });
20
20
  };
21
- //#endregion
22
21
  export { s as Truncate, o as TruncateContext };
@@ -1,20 +1,20 @@
1
- import { PktIcon as e } from "../../icon/Icon.js";
2
- import { formatString as t } from "../../../shared-strings/format.js";
3
- import { PktButton as n } from "../../button/Button.js";
1
+ import { formatString as e } from "../../../shared-strings/format.js";
2
+ import { PktButton as t } from "../../button/Button.js";
3
+ import { PktIcon as n } from "../../icon/Icon.js";
4
4
  import { PktTextarea as r } from "../../textarea/Textarea.js";
5
5
  import { PktFileUploadContext as i } from "../FileUploadContext.js";
6
6
  import { useContext as a, useLayoutEffect as o, useRef as s } from "react";
7
7
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
- //#region src/components/fileupload/extensions/Comments.tsx
9
- var d = "comments", f = (e, n) => {
10
- let r = new Date(e);
11
- if (Number.isNaN(r.getTime())) return e;
8
+ // src/components/fileupload/extensions/Comments.tsx
9
+ var d = "comments", f = (t, n) => {
10
+ let r = new Date(t);
11
+ if (Number.isNaN(r.getTime())) return t;
12
12
  let i = String(r.getDate()).padStart(2, "0"), a = String(r.getMonth() + 1).padStart(2, "0"), o = r.getFullYear(), s = String(r.getHours()).padStart(2, "0"), c = String(r.getMinutes()).padStart(2, "0");
13
- return t(n.commentTimestamp, {
13
+ return e(n.commentTimestamp, {
14
14
  date: `${i}.${a}.${o}`,
15
15
  time: `${s}:${c}`
16
16
  });
17
- }, p = ({ fileItem: e, disabled: t, closeOperationUi: d, onAddComment: f, existingComment: p }) => {
17
+ }, p = ({ fileItem: e, disabled: n, closeOperationUi: d, onAddComment: f, existingComment: p }) => {
18
18
  let { strings: m } = a(i), h = s(null), g = !!p;
19
19
  return o(() => {
20
20
  let e = setTimeout(() => h.current?.focus({ preventScroll: !0 }), 0);
@@ -29,13 +29,13 @@ var d = "comments", f = (e, n) => {
29
29
  rows: 2,
30
30
  id: `comment-${e.fileId}`,
31
31
  ref: h,
32
- disabled: t,
32
+ disabled: n,
33
33
  defaultValue: p?.text
34
34
  }),
35
- /* @__PURE__ */ l(n, {
35
+ /* @__PURE__ */ l(t, {
36
36
  skin: "secondary",
37
37
  size: "small",
38
- disabled: t,
38
+ disabled: n,
39
39
  onClick: () => {
40
40
  let e = h.current?.value?.trim();
41
41
  e && f({
@@ -45,15 +45,15 @@ var d = "comments", f = (e, n) => {
45
45
  },
46
46
  children: g ? m.saveComment : m.addComment
47
47
  }),
48
- /* @__PURE__ */ l(n, {
48
+ /* @__PURE__ */ l(t, {
49
49
  skin: "tertiary",
50
50
  size: "small",
51
- disabled: t,
51
+ disabled: n,
52
52
  onClick: d,
53
53
  children: m.cancel
54
54
  })
55
55
  ] });
56
- }, m = ({ comment: t, disabled: n, onDeleteComment: r, onEditComment: o }) => {
56
+ }, m = ({ comment: e, disabled: t, onDeleteComment: r, onEditComment: o }) => {
57
57
  let { strings: s } = a(i);
58
58
  return /* @__PURE__ */ l("div", {
59
59
  className: "pkt-fileupload__queue-display__item__comments",
@@ -64,10 +64,10 @@ var d = "comments", f = (e, n) => {
64
64
  children: [/* @__PURE__ */ l("span", {
65
65
  className: "pkt-fileupload__queue-display__item__comment__text",
66
66
  "aria-label": s.commentText,
67
- children: t.text
67
+ children: e.text
68
68
  }), /* @__PURE__ */ l("time", {
69
69
  className: "pkt-fileupload__queue-display__item__comment__time",
70
- children: f(t.timestamp, s)
70
+ children: f(e.timestamp, s)
71
71
  })]
72
72
  }), /* @__PURE__ */ u("div", {
73
73
  className: "pkt-fileupload__queue-display__item__comment__actions",
@@ -75,16 +75,16 @@ var d = "comments", f = (e, n) => {
75
75
  type: "button",
76
76
  className: "pkt-fileupload__queue-display__item__comment__action",
77
77
  onClick: o,
78
- disabled: n,
78
+ disabled: t,
79
79
  "aria-label": s.editComment,
80
- children: /* @__PURE__ */ l(e, { name: "edit" })
80
+ children: /* @__PURE__ */ l(n, { name: "edit" })
81
81
  }), /* @__PURE__ */ l("button", {
82
82
  type: "button",
83
83
  className: "pkt-fileupload__queue-display__item__comment__action",
84
84
  onClick: r,
85
- disabled: n,
85
+ disabled: t,
86
86
  "aria-label": s.deleteComment,
87
- children: /* @__PURE__ */ l(e, { name: "trash-can" })
87
+ children: /* @__PURE__ */ l(n, { name: "trash-can" })
88
88
  })]
89
89
  })]
90
90
  })
@@ -124,5 +124,4 @@ var d = "comments", f = (e, n) => {
124
124
  },
125
125
  renderHidden: (e) => /* @__PURE__ */ l(h, { comments: e.getAttribute(d) }, `comments${e.file.fileId}`)
126
126
  });
127
- //#endregion
128
127
  export { _ as addCommentOperation };
@@ -1,9 +1,8 @@
1
- //#region src/components/fileupload/extensions/Remove.tsx
1
+ // src/components/fileupload/extensions/Remove.tsx
2
2
  var e = (e, t) => ({
3
3
  id: "remove",
4
4
  title: t.remove,
5
5
  ariaLabel: t.removeFile,
6
6
  onClick: ({ file: t }) => e(t.fileId)
7
7
  });
8
- //#endregion
9
8
  export { e as removeFileOperation };
@@ -1,11 +1,11 @@
1
- import { PktButton as e } from "../../button/Button.js";
2
- import { getDisplayFilename as t } from "../../../shared-utils/fileupload/filename.js";
3
1
  import "../../../shared-utils/fileupload/index.js";
2
+ import { getDisplayFilename as e } from "../../../shared-utils/fileupload/filename.js";
3
+ import { PktButton as t } from "../../button/Button.js";
4
4
  import { PktFileUploadContext as n } from "../FileUploadContext.js";
5
5
  import { useContext as r, useId as i, useRef as a } from "react";
6
6
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
7
- //#region src/components/fileupload/extensions/Rename.tsx
8
- var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
7
+ // src/components/fileupload/extensions/Rename.tsx
8
+ var l = ({ initialValue: e, disabled: l, onSave: u, onCancel: d }) => {
9
9
  let { strings: f } = r(n), p = a(null), m = i(), h = () => u(p.current?.value ?? "");
10
10
  return /* @__PURE__ */ c(o, { children: [
11
11
  /* @__PURE__ */ s("label", {
@@ -19,20 +19,20 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
19
19
  type: "text",
20
20
  autoFocus: !0,
21
21
  disabled: l,
22
- defaultValue: t,
22
+ defaultValue: e,
23
23
  className: "pkt-fileupload__queue-display__item__rename-input",
24
24
  onKeyDown: (e) => {
25
25
  e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), h()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), d());
26
26
  }
27
27
  }),
28
- /* @__PURE__ */ s(e, {
28
+ /* @__PURE__ */ s(t, {
29
29
  skin: "secondary",
30
30
  size: "small",
31
31
  disabled: l,
32
32
  onClick: h,
33
33
  children: f.save
34
34
  }),
35
- /* @__PURE__ */ s(e, {
35
+ /* @__PURE__ */ s(t, {
36
36
  skin: "tertiary",
37
37
  size: "small",
38
38
  disabled: l,
@@ -47,7 +47,7 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
47
47
  name: `${t.name}-targetFilename`,
48
48
  value: e
49
49
  });
50
- }, d = (e) => e.getAttribute("targetFilename") || t(e.file, ""), f = (e) => ({
50
+ }, d = (t) => t.getAttribute("targetFilename") || e(t.file, ""), f = (e) => ({
51
51
  id: "rename",
52
52
  title: e.rename,
53
53
  ariaLabel: e.renameFile,
@@ -62,5 +62,4 @@ var l = ({ initialValue: t, disabled: l, onSave: u, onCancel: d }) => {
62
62
  }),
63
63
  renderHidden: (e) => /* @__PURE__ */ s(u, { targetFilename: d(e) }, `rename${e.file.fileId}`)
64
64
  });
65
- //#endregion
66
65
  export { f as renameFileOperation };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useMemo as t } from "react";
2
- //#region src/components/fileupload/hooks/useFileAttributes.ts
2
+ // src/components/fileupload/hooks/useFileAttributes.ts
3
3
  var n = (n, r) => {
4
4
  let i = e((e, t) => n.find((t) => t.fileId === e)?.attributes?.[t], [n]), a = e((e, t, i) => {
5
5
  let a = n.find((t) => t.fileId === e);
@@ -21,5 +21,4 @@ var n = (n, r) => {
21
21
  }), [i, a])
22
22
  };
23
23
  };
24
- //#endregion
25
24
  export { n as useFileAttributes };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- //#region src/components/fileupload/hooks/useImageObjectUrl.ts
2
+ // src/components/fileupload/hooks/useImageObjectUrl.ts
3
3
  var n = (n) => {
4
4
  let [r, i] = t(null);
5
5
  return e(() => {
@@ -11,5 +11,4 @@ var n = (n) => {
11
11
  }), () => URL.revokeObjectURL(e);
12
12
  }, [n]), r && r.file === n ? r.url : null;
13
13
  };
14
- //#endregion
15
14
  export { n as useImageObjectUrl };
@@ -1,7 +1,7 @@
1
1
  import { navigateCyclic as e } from "../../../shared-utils/fileupload/navigation.js";
2
2
  import "../../../shared-utils/fileupload/index.js";
3
3
  import { useCallback as t, useRef as n, useState as r } from "react";
4
- //#region src/components/fileupload/hooks/useImagePreview.ts
4
+ // src/components/fileupload/hooks/useImagePreview.ts
5
5
  var i = (i) => {
6
6
  let [a, o] = r(!1), [s, c] = r(0), l = n(null);
7
7
  return {
@@ -20,5 +20,4 @@ var i = (i) => {
20
20
  }, [i.length])
21
21
  };
22
22
  };
23
- //#endregion
24
23
  export { i as useImagePreview };
@@ -1,5 +1,5 @@
1
1
  import { useCallback as e, useState as t } from "react";
2
- //#region src/components/fileupload/hooks/useOperationState.ts
2
+ // src/components/fileupload/hooks/useOperationState.ts
3
3
  var n = (n) => {
4
4
  let [r, i] = t({}), [a, o] = t(n);
5
5
  if (n !== a) {
@@ -27,5 +27,4 @@ var n = (n) => {
27
27
  }, [])
28
28
  };
29
29
  };
30
- //#endregion
31
30
  export { n as useOperationState };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e } from "react";
2
- //#region src/components/fileupload/hooks/useRequiredFormValidation.ts
2
+ // src/components/fileupload/hooks/useRequiredFormValidation.ts
3
3
  var t = (t, { uploadStrategy: n, required: r, currentFileCount: i, onMissingFiles: a }) => {
4
4
  e(() => {
5
5
  if (n !== "custom" || !r) return;
@@ -19,5 +19,4 @@ var t = (t, { uploadStrategy: n, required: r, currentFileCount: i, onMissingFile
19
19
  a
20
20
  ]);
21
21
  };
22
- //#endregion
23
22
  export { t as useRequiredFormValidation };
@@ -1,10 +1,9 @@
1
- import e from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.js";
2
- import { uuidish as t } from "../../utils/stringutils.js";
3
- //#region src/components/fileupload/types.ts
1
+ import { uuidish as e } from "../../utils/stringutils.js";
2
+ import t from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/defineProperty.js";
3
+ // src/components/fileupload/types.ts
4
4
  var n = class {
5
5
  constructor(n, r) {
6
- e(this, "fileId", void 0), e(this, "file", void 0), e(this, "attributes", void 0), this.fileId = r || t(), this.file = n, this.attributes = { targetFilename: n.name };
6
+ t(this, "fileId", void 0), t(this, "file", void 0), t(this, "attributes", void 0), this.fileId = r || e(), this.file = n, this.attributes = { targetFilename: n.name };
7
7
  }
8
8
  };
9
- //#endregion
10
9
  export { n as FileItem };