@eifi1/ui-kit 0.46.1 → 0.47.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 (98) hide show
  1. package/README.md +5 -5
  2. package/dist/components/data-table.js +18 -1
  3. package/dist/components/data-table.js.map +1 -1
  4. package/dist/components/row-actions.d.ts +25 -0
  5. package/dist/components/row-actions.js +13 -3
  6. package/dist/components/row-actions.js.map +1 -1
  7. package/dist/components/tabs.d.ts +24 -16
  8. package/dist/components/tabs.js +37 -31
  9. package/dist/components/tabs.js.map +1 -1
  10. package/dist/components/ui-labels.js +1 -1
  11. package/dist/components/ui-labels.js.map +1 -1
  12. package/dist/eslint/index.js +1 -1
  13. package/dist/feedback/feedback-attachment-download.d.ts +19 -0
  14. package/dist/feedback/feedback-attachment-download.js +59 -0
  15. package/dist/feedback/feedback-attachment-download.js.map +1 -0
  16. package/dist/feedback/feedback-comment-thread.d.ts +17 -6
  17. package/dist/feedback/feedback-comment-thread.js +21 -2
  18. package/dist/feedback/feedback-comment-thread.js.map +1 -1
  19. package/dist/feedback/feedback-entry-file.d.ts +61 -0
  20. package/dist/feedback/feedback-entry-file.js +76 -0
  21. package/dist/feedback/feedback-entry-file.js.map +1 -0
  22. package/dist/feedback/feedback-public-list.d.ts +18 -5
  23. package/dist/feedback/feedback-public-list.js +8 -0
  24. package/dist/feedback/feedback-public-list.js.map +1 -1
  25. package/dist/feedback/feedback-public-types.d.ts +7 -2
  26. package/dist/feedback/feedback-replies.d.ts +26 -9
  27. package/dist/feedback/feedback-replies.js +20 -10
  28. package/dist/feedback/feedback-replies.js.map +1 -1
  29. package/dist/feedback/feedback-row-detail-labels.js +0 -1
  30. package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
  31. package/dist/feedback/feedback-row-detail.d.ts +23 -10
  32. package/dist/feedback/feedback-row-detail.js +10 -54
  33. package/dist/feedback/feedback-row-detail.js.map +1 -1
  34. package/dist/feedback.d.ts +1 -0
  35. package/dist/feedback.js +1 -0
  36. package/dist/feedback.js.map +1 -1
  37. package/dist/i18n/german.js +1 -6
  38. package/dist/i18n/german.js.map +1 -1
  39. package/dist/i18n/locales/en.js +1 -6
  40. package/dist/i18n/locales/en.js.map +2 -2
  41. package/dist/i18n/locales/es.js +1 -6
  42. package/dist/i18n/locales/es.js.map +1 -1
  43. package/dist/i18n/locales/fr.js +1 -6
  44. package/dist/i18n/locales/fr.js.map +1 -1
  45. package/dist/i18n/locales/hu.js +1 -6
  46. package/dist/i18n/locales/hu.js.map +1 -1
  47. package/dist/i18n/locales/it.js +1 -6
  48. package/dist/i18n/locales/it.js.map +1 -1
  49. package/dist/i18n/locales/zh.js +1 -6
  50. package/dist/i18n/locales/zh.js.map +1 -1
  51. package/dist/i18n/review.js +0 -1
  52. package/dist/i18n/review.js.map +1 -1
  53. package/dist/index.d.ts +2 -4
  54. package/dist/index.js +11 -4
  55. package/dist/index.js.map +1 -1
  56. package/dist/notifications/device-zone-report.d.ts +1 -1
  57. package/dist/notifications/device-zone-report.js.map +1 -1
  58. package/dist/notifications/notification-types.d.ts +0 -3
  59. package/dist/notifications/notifications-labels.d.ts +2 -15
  60. package/dist/notifications/notifications-labels.js +0 -4
  61. package/dist/notifications/notifications-labels.js.map +1 -1
  62. package/dist/notifications/quiet-hours-setting.d.ts +3 -8
  63. package/dist/notifications/quiet-hours-setting.js +8 -3
  64. package/dist/notifications/quiet-hours-setting.js.map +1 -1
  65. package/dist/theme/theme-store.d.ts +4 -4
  66. package/dist/theme/theme-store.js +1 -0
  67. package/dist/theme/theme-store.js.map +1 -1
  68. package/package.json +2 -2
  69. package/src/components/data-table.tsx +29 -3
  70. package/src/components/row-actions.tsx +42 -3
  71. package/src/components/tabs.tsx +66 -44
  72. package/src/components/ui-labels.ts +1 -1
  73. package/src/feedback/feedback-attachment-download.tsx +77 -0
  74. package/src/feedback/feedback-comment-thread.tsx +42 -7
  75. package/src/feedback/feedback-entry-file.tsx +150 -0
  76. package/src/feedback/feedback-public-list.tsx +25 -4
  77. package/src/feedback/feedback-public-types.ts +7 -2
  78. package/src/feedback/feedback-replies.tsx +46 -19
  79. package/src/feedback/feedback-row-detail-labels.ts +0 -1
  80. package/src/feedback/feedback-row-detail.tsx +35 -86
  81. package/src/feedback.ts +1 -0
  82. package/src/i18n/german.ts +1 -6
  83. package/src/i18n/locales/es.ts +1 -6
  84. package/src/i18n/locales/fr.ts +1 -6
  85. package/src/i18n/locales/hu.ts +1 -6
  86. package/src/i18n/locales/it.ts +1 -6
  87. package/src/i18n/locales/zh.ts +1 -6
  88. package/src/i18n/review.ts +0 -1
  89. package/src/index.ts +10 -3
  90. package/src/notifications/device-zone-report.ts +1 -1
  91. package/src/notifications/notification-types.ts +0 -3
  92. package/src/notifications/notifications-labels.ts +2 -19
  93. package/src/notifications/quiet-hours-setting.tsx +16 -11
  94. package/src/theme/theme-store.ts +13 -5
  95. package/dist/notifications/time-zone-select.d.ts +0 -54
  96. package/dist/notifications/time-zone-select.js +0 -71
  97. package/dist/notifications/time-zone-select.js.map +0 -1
  98. package/src/notifications/time-zone-select.tsx +0 -125
@@ -1,125 +0,0 @@
1
- import { useMemo } from "react";
2
- import type { ReactNode } from "react";
3
-
4
- import type { LabelOverride } from "../i18n/kit-labels";
5
- import type { ComboOption } from "../components/combobox-core";
6
- import { InlineEntityCombobox } from "../components/inline-entity-combobox";
7
- import type { CommitScope } from "../components/write-lock";
8
- import { deviceTimeZone as zoneOfDevice } from "./device-zone-report";
9
- import { useNotificationsLabels } from "./notification-parts";
10
- import type { NotificationRegionLabels, NotificationsLabels } from "./notifications-labels";
11
-
12
- /**
13
- * This device's IANA zone — the same function as the package root's, which lives beside
14
- * `useDeviceZoneReport` now (0.46.1).
15
- * @deprecated 0.46 — import `deviceTimeZone` from `@eifi1/ui-kit` (notifications/device-zone-report); this
16
- * module is removed in 0.47.
17
- */
18
- export const deviceTimeZone: () => string = zoneOfDevice;
19
-
20
- /** Every zone the runtime lists; `[]` where `Intl.supportedValuesOf` is missing. */
21
- function runtimeZones(): string[] {
22
- const intl = Intl as typeof Intl & { supportedValuesOf?: (key: "timeZone") => string[] };
23
- return typeof intl.supportedValuesOf === "function" ? intl.supportedValuesOf("timeZone") : [];
24
- }
25
-
26
- /** "Argentina/Buenos_Aires" → "Argentina / Buenos Aires": the zone's city, as a row. */
27
- function cityOf(rest: string): string {
28
- return rest.replace(/_/g, " ").replace(/\//g, " / ");
29
- }
30
-
31
- /**
32
- * The zone picker's rows (keksdose `notifications-card.tsx:131-146`): every zone `Intl`
33
- * lists, as its city ("Argentina / Buenos Aires") under its region, the region named by
34
- * `regionLabel` — which answers `undefined` for a region it does not know, and the region
35
- * keeps its IANA name. A zone with no region ("UTC") comes first, ahead of every heading,
36
- * rather than trailing the last group as if it were Pacific. `current` is kept even when
37
- * the runtime does not list it (an old alias such as "Europe/Kiev"): a picker without its
38
- * own value would show an empty field.
39
- * @deprecated 0.46 — the zone is automatic (§10.3, amended 2026-10-20), no app picks one; removed in 0.47.
40
- */
41
- export function timeZoneOptions(
42
- current: string,
43
- regionLabel: (region: string) => string | undefined,
44
- ): ComboOption<string>[] {
45
- const zones = runtimeZones();
46
- const all = !current || zones.includes(current) ? zones : [...zones, current].sort();
47
- const rows = all.map((zone): ComboOption<string> => {
48
- const slash = zone.indexOf("/");
49
- if (slash < 0) return { value: zone, label: zone };
50
- const region = zone.slice(0, slash);
51
- return { value: zone, label: cityOf(zone.slice(slash + 1)), group: regionLabel(region) ?? region };
52
- });
53
- return [...rows.filter((row) => !row.group), ...rows.filter((row) => row.group)];
54
- }
55
-
56
- /** The region's name in `regions`, or `undefined` for one the labels do not know.
57
- * @internal Not part of the barrel. */
58
- export function regionName(regions: NotificationRegionLabels, region: string): string | undefined {
59
- return Object.prototype.hasOwnProperty.call(regions, region)
60
- ? regions[region as keyof NotificationRegionLabels]
61
- : undefined;
62
- }
63
-
64
- /** A zone as the picker shows it, for a sentence: "Europe / Zurich", the region in the
65
- * kit's words. @internal Not part of the barrel. */
66
- export function zoneName(zone: string, regions: NotificationRegionLabels): string {
67
- const slash = zone.indexOf("/");
68
- if (slash < 0) return zone;
69
- const region = zone.slice(0, slash);
70
- return `${regionName(regions, region) ?? region} / ${cityOf(zone.slice(slash + 1))}`;
71
- }
72
-
73
- /** @deprecated 0.46 — the zone is automatic (§10.3, amended 2026-10-20), no app picks one; removed in 0.47. */
74
- export interface TimeZoneSelectProps {
75
- /** The IANA zone. Not clearable: a zone can be changed, never emptied. */
76
- value: string;
77
- /** The zone picked. Never called for the value it already has. */
78
- onChange: (zone: string) => void;
79
- /** Default `labels.timeZone`. */
80
- label?: ReactNode;
81
- disabled?: boolean;
82
- /** The input's id. */
83
- id?: string;
84
- className?: string;
85
- /** The picker SAVES on change (quiet hours do): locked under a write lock in scope. */
86
- commit?: CommitScope;
87
- labels?: LabelOverride<NotificationsLabels>;
88
- }
89
-
90
- /**
91
- * An IANA time zone, searchable (docs/notifications-harmonization.md §4.2, keksdose's
92
- * quiet-hours picker): type "Zur" for Europe/Zurich, and on a phone the kit's sheet with
93
- * a search box instead of a 400-row wheel. Rows are the city under its region, the region
94
- * in the kit's words (`labels.regions`); a zone with no region first; a stored zone the
95
- * runtime does not list is kept. On the kit's {@link InlineEntityCombobox}.
96
- * @deprecated 0.46 — the zone is automatic (§10.3, amended 2026-10-20), no app picks one; removed in 0.47.
97
- */
98
- export function TimeZoneSelect({
99
- value,
100
- onChange,
101
- label,
102
- disabled,
103
- id,
104
- className,
105
- commit,
106
- labels: labelsProp,
107
- }: TimeZoneSelectProps) {
108
- const labels = useNotificationsLabels(labelsProp);
109
- const { regions } = labels;
110
- const options = useMemo(() => timeZoneOptions(value, (region) => regionName(regions, region)), [value, regions]);
111
- return (
112
- <InlineEntityCombobox<string>
113
- id={id}
114
- label={label ?? labels.timeZone}
115
- value={value}
116
- options={options}
117
- disabled={disabled}
118
- commit={commit}
119
- onChange={(zone) => {
120
- if (zone && zone !== value) onChange(zone);
121
- }}
122
- className={className}
123
- />
124
- );
125
- }