@handijitcom/ui 1.0.0 → 1.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 (107) hide show
  1. package/README.md +34 -32
  2. package/build/calendar.cjs.map +1 -1
  3. package/build/calendar.js.map +1 -1
  4. package/build/charts.cjs +1 -1
  5. package/build/charts.cjs.map +1 -1
  6. package/build/charts.js +1 -1
  7. package/build/charts.js.map +1 -1
  8. package/build/chat.cjs +1 -1
  9. package/build/chat.cjs.map +1 -1
  10. package/build/chat.js +1 -1
  11. package/build/chat.js.map +1 -1
  12. package/build/components/MoneyInput/index.cjs.map +1 -1
  13. package/build/components/MoneyInput/index.d.cts +1 -1
  14. package/build/components/MoneyInput/index.d.ts +1 -1
  15. package/build/components/MoneyInput/index.js.map +1 -1
  16. package/build/constants/breakpoint.constants.cjs +1 -1
  17. package/build/constants/breakpoint.constants.cjs.map +1 -1
  18. package/build/constants/breakpoint.constants.d.cts +1 -1
  19. package/build/constants/breakpoint.constants.d.ts +1 -1
  20. package/build/constants/breakpoint.constants.js +1 -1
  21. package/build/constants/breakpoint.constants.js.map +1 -1
  22. package/build/constants/scale.constants.cjs.map +1 -1
  23. package/build/constants/scale.constants.d.cts +2 -3
  24. package/build/constants/scale.constants.d.ts +2 -3
  25. package/build/constants/scale.constants.js.map +1 -1
  26. package/build/design/fonts/LICENSE-archivo.txt +93 -0
  27. package/build/design/fonts/LICENSE-ibm-plex-mono.txt +93 -0
  28. package/build/design/fonts/LICENSE-inter.txt +93 -0
  29. package/build/design/fonts/archivo-latin-ext-wdth-normal.woff2 +0 -0
  30. package/build/design/fonts/archivo-latin-wdth-normal.woff2 +0 -0
  31. package/build/design/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  32. package/build/design/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
  33. package/build/design/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
  34. package/build/design/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
  35. package/build/design/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  36. package/build/design/fonts/inter-latin-wght-normal.woff2 +0 -0
  37. package/build/design/fonts.css +75 -0
  38. package/build/design/fonts.d.css.ts +1 -0
  39. package/build/design/index.cjs +778 -0
  40. package/build/design/index.cjs.map +1 -0
  41. package/build/design/index.d.cts +263 -0
  42. package/build/design/index.d.mts +263 -0
  43. package/build/design/index.mjs +751 -0
  44. package/build/design/index.mjs.map +1 -0
  45. package/build/design/index.umd.cjs +2 -0
  46. package/build/design/index.umd.cjs.map +1 -0
  47. package/build/design/logos/horizontal.svg +1 -0
  48. package/build/design/logos/mark.svg +1 -0
  49. package/build/design/tokens.css +477 -0
  50. package/build/design/tokens.d.css.ts +1 -0
  51. package/build/design/tokens.json +542 -0
  52. package/build/design/tokens.scss +616 -0
  53. package/build/helpers/scaled-number.helper.cjs.map +1 -1
  54. package/build/helpers/scaled-number.helper.d.cts +3 -4
  55. package/build/helpers/scaled-number.helper.d.ts +3 -4
  56. package/build/helpers/scaled-number.helper.js.map +1 -1
  57. package/build/helpers/theme.helper.cjs +1 -1
  58. package/build/helpers/theme.helper.cjs.map +1 -1
  59. package/build/helpers/theme.helper.d.cts +2 -2
  60. package/build/helpers/theme.helper.d.ts +2 -2
  61. package/build/helpers/theme.helper.js +1 -1
  62. package/build/helpers/theme.helper.js.map +1 -1
  63. package/build/hooks/useUiTheme.cjs +1 -1
  64. package/build/hooks/useUiTheme.cjs.map +1 -1
  65. package/build/hooks/useUiTheme.d.cts +1 -1
  66. package/build/hooks/useUiTheme.d.ts +1 -1
  67. package/build/hooks/useUiTheme.js +1 -1
  68. package/build/hooks/useUiTheme.js.map +1 -1
  69. package/build/hooks/useUiTokens.cjs +1 -1
  70. package/build/hooks/useUiTokens.cjs.map +1 -1
  71. package/build/hooks/useUiTokens.d.cts +2 -2
  72. package/build/hooks/useUiTokens.d.ts +2 -2
  73. package/build/hooks/useUiTokens.js +1 -1
  74. package/build/hooks/useUiTokens.js.map +1 -1
  75. package/build/index.cjs +1 -1
  76. package/build/index.d.cts +1 -1
  77. package/build/index.d.ts +1 -1
  78. package/build/index.js +1 -1
  79. package/build/scss/_index.scss +1 -1
  80. package/build/scss/_variables.scss +3 -3
  81. package/build/theme/UiProvider.cjs.map +1 -1
  82. package/build/theme/UiProvider.d.cts +1 -1
  83. package/build/theme/UiProvider.d.ts +1 -1
  84. package/build/theme/UiProvider.js.map +1 -1
  85. package/build/theme/UiThemeScript.cjs +1 -1
  86. package/build/theme/UiThemeScript.cjs.map +1 -1
  87. package/build/theme/UiThemeScript.d.cts +1 -1
  88. package/build/theme/UiThemeScript.d.ts +1 -1
  89. package/build/theme/UiThemeScript.js +1 -1
  90. package/build/theme/UiThemeScript.js.map +1 -1
  91. package/build/types/calendar/Calendar/index.d.cts +2 -2
  92. package/build/types/calendar/Calendar/index.d.ts +2 -2
  93. package/build/types/calendar/core/time.d.cts +1 -1
  94. package/build/types/calendar/core/time.d.ts +1 -1
  95. package/build/types/calendar/core/types.d.cts +1 -1
  96. package/build/types/calendar/core/types.d.ts +1 -1
  97. package/build/types/calendar/index.d.cts +1 -1
  98. package/build/types/calendar/index.d.ts +1 -1
  99. package/build/types/charts/core/palette.d.cts +1 -1
  100. package/build/types/charts/core/palette.d.ts +1 -1
  101. package/build/types/chat/Legend/index.d.cts +1 -1
  102. package/build/types/chat/Legend/index.d.ts +1 -1
  103. package/build/types/theme.type.d.cts +2 -2
  104. package/build/types/theme.type.d.ts +2 -2
  105. package/build/types/types/theme.type.d.cts +2 -2
  106. package/build/types/types/theme.type.d.ts +2 -2
  107. package/package.json +30 -6
package/README.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Accessible React components for Han Dijit applications: the site, the staff
4
4
  panel and the desktop programs. Built on SCSS Modules and drawn with the tokens
5
- of [`@handijit/design`](https://www.npmjs.com/package/@handijit/design).
5
+ of [`@handijitcom/ui/design`](https://www.npmjs.com/package/@handijitcom/ui/design).
6
6
 
7
7
  - **One design source.** Colours, type, radii, spacing, motion and layers come
8
- from `@handijit/design` (`--hd-*`). This package holds no palette of its own.
8
+ from `@handijitcom/ui/design` (`--hd-*`). This package holds no palette of its own.
9
9
  - **Light and dark.** Both themes ship; the choice rides on `data-theme`, the
10
- contract `@handijit/design` defines.
10
+ contract `@handijitcom/ui/design` defines.
11
11
  - **The router is injected.** `next/link`, `react-router`, a plain `<a>`: the
12
12
  application decides.
13
13
  - **Text comes from outside, once.** The library invents no string in any
@@ -15,21 +15,22 @@ of [`@handijit/design`](https://www.npmjs.com/package/@handijit/design).
15
15
  - **Native elements are kept.** `<dialog>`, `<input type="range">`,
16
16
  `<input type="radio">`: focus trapping, keyboard handling and screen reader
17
17
  announcements come from the browser.
18
- - **Three sub-entries, zero bytes in the main bundle.** `@handijitcom/ui/chat`
18
+ - **Sub-entries, zero bytes in the main bundle.** `@handijitcom/ui/chat`
19
19
  (chat and tool interfaces), `@handijitcom/ui/charts` (dependency-free SVG
20
- charts), `@handijitcom/ui/scss` (token variables and mixins).
20
+ charts), `@handijitcom/ui/calendar`, `@handijitcom/ui/scss` (token variables
21
+ and mixins) and `@handijitcom/ui/design` (the design tokens: JavaScript API,
22
+ `tokens.css`, `fonts.css`, `tokens.scss`, `tokens.json`, fonts and logos).
21
23
 
22
24
  ```bash
23
- npm install @handijitcom/ui @handijit/design @handijitcom/utils react-bootstrap-icons
25
+ npm install @handijitcom/ui @handijitcom/utils react-bootstrap-icons
24
26
  ```
25
27
 
26
- `react`, `react-dom`, `@handijit/design` (`^1.1.0`), `@handijitcom/utils`
27
- (`^2.0.0`) and `react-bootstrap-icons` are **peer** dependencies. The design
28
- package is a peer on purpose: an application has exactly one copy of the tokens,
29
- and the site, the panel and the components all read the same custom properties.
30
-
31
- Coming from 1.x? The migration is in [`CHANGELOG.md`](./CHANGELOG.md) under
32
- 2.0.0, old name → new name for every token, variable, prop, variant and export.
28
+ `react`, `react-dom`, `@handijitcom/utils` (`^1.0.0`) and `react-bootstrap-icons`
29
+ are **peer** dependencies. The design tokens ship inside the package
30
+ (`@handijitcom/ui/design`, `@handijitcom/ui/tokens.css`, see
31
+ [`docs/design.md`](./docs/design.md)): an application has exactly one copy of the
32
+ tokens, and the site, the panel and the components all read the same custom
33
+ properties.
33
34
 
34
35
  ---
35
36
 
@@ -37,8 +38,8 @@ Coming from 1.x? The migration is in [`CHANGELOG.md`](./CHANGELOG.md) under
37
38
 
38
39
  ```tsx
39
40
  // Once, at the root of the application. The order matters.
40
- import '@handijit/design/tokens.css'; // the --hd-* custom properties, both themes
41
- import '@handijit/design/fonts.css'; // optional: Archivo, Inter, IBM Plex Mono
41
+ import '@handijitcom/ui/tokens.css'; // the --hd-* custom properties, both themes
42
+ import '@handijitcom/ui/fonts.css'; // optional: Archivo, Inter, IBM Plex Mono
42
43
  import '@handijitcom/ui/styles.css';
43
44
  ```
44
45
 
@@ -58,7 +59,7 @@ The provider is **optional**: the package works with no configuration. Links
58
59
  are plain `<a>` elements and labels are whatever each call passes.
59
60
 
60
61
  `@handijitcom/ui/styles.css` carries **no tokens**. Without
61
- `@handijit/design/tokens.css` every colour resolves to nothing. `fonts.css` is
62
+ `@handijitcom/ui/tokens.css` every colour resolves to nothing. `fonts.css` is
62
63
  optional: load the three families your own way (`next/font`, self-hosted
63
64
  `@font-face`) if you prefer, the tokens only name them.
64
65
 
@@ -96,7 +97,7 @@ The sub-entries have their own stylesheets, imported **after** `styles.css`:
96
97
  <html data-theme="dark"></html>
97
98
  ```
98
99
 
99
- This is the contract of `@handijit/design`, not a setting of this package:
100
+ This is the contract of `@handijitcom/ui/design`, not a setting of this package:
100
101
  `data-theme="light"` or `"dark"` on the root element picks the theme, and
101
102
  without the attribute `prefers-color-scheme` decides. An explicit choice is
102
103
  never overridden by the system setting. The attribute also works on any
@@ -113,7 +114,7 @@ import { UiThemeScript } from '@handijitcom/ui';
113
114
  </head>;
114
115
  ```
115
116
 
116
- It renders the boot script of `@handijit/design` (`THEME_BOOT_SCRIPT`) as an
117
+ It renders the boot script of `@handijitcom/ui/design` (`THEME_BOOT_SCRIPT`) as an
117
118
  inline `<script>`. The script reads `localStorage["hd-theme"]` (`light` or
118
119
  `dark`; anything else means "follow the system"), writes `data-theme` while the
119
120
  HTML is still being parsed, and follows the system setting when it changes.
@@ -133,7 +134,7 @@ The boot script is the **only** element this library injects. It injects no
133
134
  | Static hash | add `'${THEME_BOOT_SCRIPT_HASH}'` to `script-src`; the page stays cacheable |
134
135
 
135
136
  ```ts
136
- import { THEME_BOOT_SCRIPT_HASH } from '@handijitcom/ui'; // re-exported from @handijit/design
137
+ import { THEME_BOOT_SCRIPT_HASH } from '@handijitcom/ui'; // re-exported from @handijitcom/ui/design
137
138
 
138
139
  const policy = `script-src 'self' '${THEME_BOOT_SCRIPT_HASH}'`;
139
140
  ```
@@ -187,7 +188,7 @@ property, in the application's own stylesheet:
187
188
  }
188
189
  ```
189
190
 
190
- Change the tokens of `@handijit/design` sparingly: the contrast of every text
191
+ Change the tokens of `@handijitcom/ui/design` sparingly: the contrast of every text
191
192
  and focus pair is measured against the published values.
192
193
 
193
194
  ### Overriding our CSS: `@layer ui`
@@ -247,7 +248,7 @@ const colors = useUiTokens(['border', 'chart-1']); // { border: '#…', 'chart-1
247
248
  `useUiTokens` returns the resolved values of design tokens and follows theme
248
249
  changes; it is for canvas and third-party charts that cannot read `var()`. On
249
250
  the server and the first frame it returns `currentColor`. The names are
250
- `TokenName` of `@handijit/design`.
251
+ `TokenName` of `@handijitcom/ui/design`.
251
252
 
252
253
  ---
253
254
 
@@ -553,7 +554,7 @@ data contract. `123450` with two decimal places is "1.234,50".
553
554
  `null` while the field is empty or holds a number still being typed ("-",
554
555
  "1.250.0"). Left with such a text, the field keeps it and marks itself
555
556
  `aria-invalid`.
556
- - **The grammar is the one of app-kit's `parseDecimal`**: the comma is the
557
+ - **The grammar is the data contract's (§4.3)**: the comma is the
557
558
  decimal point; with a comma, dots only group by three; without one, "1.250"
558
559
  is a thousand two hundred and fifty, "0.250" and "12.5" are decimals (the dot
559
560
  key of a number pad). Spaces and signs around the number are dropped, so a
@@ -567,9 +568,9 @@ data contract. `123450` with two decimal places is "1.234,50".
567
568
  - `Field`'s contract (`id`, `aria-invalid`, `aria-describedby`, `required`),
568
569
  `ref`, `size`, `prefix`/`suffix`, `disabled` and `readOnly` pass to the
569
570
  input. Right-aligned, tabular figures.
570
- - The scale is never guessed: `minorDigits` comes from the currency table of
571
- `@handijit/tr-codes`, `unitDigits` from the unit. Display elsewhere is
572
- app-kit's formatters' (`formatMoney`, `formatQuantity` …); `Price` stays a
571
+ - The scale is never guessed: `minorDigits` comes from the caller's currency table,
572
+ `unitDigits` from the unit. Display elsewhere is the application's
573
+ formatters' (`formatMoney`, `formatQuantity` …); `Price` stays a
573
574
  display of an already formatted text.
574
575
 
575
576
  ### TypeScript resolution
@@ -650,8 +651,8 @@ const nextConfig = {
650
651
 
651
652
  ```tsx
652
653
  // app/layout.tsx, a server component
653
- import '@handijit/design/tokens.css';
654
- import '@handijit/design/fonts.css';
654
+ import '@handijitcom/ui/tokens.css';
655
+ import '@handijitcom/ui/fonts.css';
655
656
  import '@handijitcom/ui/styles.css';
656
657
  import '@handijitcom/ui/chat.css'; // only if /chat is used
657
658
  import '@handijitcom/ui/charts.css'; // only if /charts is used
@@ -805,7 +806,7 @@ Colours come from the data series of the design (`tone`: `chart-1` … `chart-6`
805
806
 
806
807
  ## Calendar: `@handijitcom/ui/calendar`
807
808
 
808
- The base of app-kit's `takvim` pattern (2.4): a **time grid** (days as
809
+ The base of a scheduling screen (2.4): a **time grid** (days as
809
810
  columns, the drawn hours as rows; with `resources` a column per teacher, room
810
811
  or technician under every day) or a **month** of day cells. A separate entry,
811
812
  so the main entry's budget does not grow (5,9 kB gzip, `calendar.css` 2 kB).
@@ -835,7 +836,7 @@ import { Calendar, type CalendarEvent } from '@handijitcom/ui/calendar';
835
836
 
836
837
  - **Times are the data contract's wall clock** (`YYYY-MM-DDTHH:MM`, the firm's
837
838
  time zone) and **days come from the caller**: the calendar converts no time
838
- zone and does no day arithmetic (that is `@handijit/tr`'s). The month takes
839
+ zone and does no day arithmetic (that is the caller's). The month takes
839
840
  its 35 or 42 `days` (`isOutside` for the neighbouring months), `weekdays`,
840
841
  `maxEventsPerDay` (3; the rest behind "+N" → `onDaySelect`) and
841
842
  `selectedDate`.
@@ -910,7 +911,7 @@ Sass colour functions do not work either; mix in CSS:
910
911
  Next.js (Turbopack and webpack) resolves the package `exports`. For a compiler
911
912
  that cannot, add `node_modules/@handijitcom/ui/build/scss` to `loadPaths` and
912
913
  write `@use 'index' as ui`. An application that needs only the tokens can use
913
- `@handijit/design/tokens.scss` directly.
914
+ `@handijitcom/ui/tokens.scss` directly.
914
915
 
915
916
  ---
916
917
 
@@ -943,7 +944,7 @@ npm run playground # component gallery → http://localhost:5273
943
944
 
944
945
  - **Design contract** (`__tests__/styles/design-contract.test.ts`): every
945
946
  `--hd-*` name in the compiled stylesheets, the SCSS aliases and the
946
- TypeScript sources exists in the installed `@handijit/design`; breakpoints
947
+ TypeScript sources exists in the tokens of `src/design`; breakpoints
947
948
  and layers match it; no stylesheet declares an `--hd-*` property or carries
948
949
  a literal colour.
949
950
  - **Colour footprint** (`colour-footprint.test.ts`): coral and turquoise tokens
@@ -1009,9 +1010,10 @@ section must exist before the push.
1009
1010
  Which element to use when, the surface ladder, colour roles, typography roles,
1010
1011
  accessibility thresholds and the motion scale are in **`CLAUDE.md`**. That file
1011
1012
  is normative for applications that use the library too. The visual language
1012
- itself (palette, type, logo) belongs to `@handijit/design`.
1013
+ itself (palette, type, logo) belongs to `@handijitcom/ui/design`.
1013
1014
 
1014
1015
  <!-- handijit:about:start -->
1016
+
1015
1017
  ## About Han Dijit
1016
1018
 
1017
1019
  `@handijitcom/ui` is built and maintained by **[Han Dijit](https://www.handijit.com)**, a software company serving businesses across Türkiye: web, e-commerce, mobile, artificial intelligence, cyber security and enterprise software projects.
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.cjs","sources":["../src/helpers/class-name.helper.ts","../src/helpers/component.helper.ts","../src/helpers/label.helper.ts","../src/calendar/core/time.ts","../src/calendar/core/layout.ts","../src/calendar/core/moves.ts","../src/calendar/core/useCalendarDrag.ts","../src/calendar/Calendar/EventBlock.tsx","../src/calendar/Calendar/MonthGrid.tsx","../src/calendar/Calendar/TimeGrid.tsx","../src/calendar/Calendar/index.tsx"],"sourcesContent":["import { ClassValue } from '@/types/common-element-props.type';\n\n/** Sınıf adı birleştirici. */\nexport const cx = (...values: ClassValue[]): string => {\n let result = '';\n\n for (const value of values) {\n if (!value) continue;\n result = result === '' ? value : `${result} ${value}`;\n }\n\n return result;\n};\n","/**\n * DevTools adı — modül düzeyinde YAN ETKİ bırakmadan.\n *\n * ⚠ `X.displayName = 'X'` KULLANILMAZ: modül düzeyindeki özellik ataması\n * bundler için yan etkidir ve hedefinin tüm bağımlılık zincirini ayakta tutar.\n * Ölçüldü: yalnızca `Badge` import eden uygulama 20,7 kB indiriyordu (paketin\n * tamamı 21,8 kB). Atama çağrıya dönüşünce `#__PURE__` işaretlenebiliyor →\n * `Badge` 2,71 kB. Nöbetçi `.size-limit.json`.\n *\n * @example\n * export default memo(named(Button, 'Button')) as typeof Button;\n */\nexport const named = <TComponent extends object>(\n component: TComponent,\n displayName: string,\n): TComponent => Object.assign(component, { displayName });\n","/** Metin çözümlemesi: prop → sağlayıcı config'i → geliştirme uyarısı. */\n\nimport type { Formatter } from '@/types/theme.type';\n\n/* Uyari ANAHTAR BASINA bir kez verilir. */\nconst warned = new Set<string>();\n\n/** Uyarı durumu testler arasında sızmamalı; her test kendi durumundan başlar. */\nexport const resetLabelWarnings = (): void => warned.clear();\n\n/**\n * Verilen metni çözer.\n * @param key Uyarıda gösterilecek yol (`Modal.closeLabel`).\n * @param values Öncelik sırasına göre adaylar: prop önce, config sonra.\n */\nexport const resolveLabel = (key: string, ...values: (string | undefined)[]): string => {\n for (const value of values) if (value !== undefined) return value;\n\n if (process.env.NODE_ENV !== 'production' && !warned.has(key)) {\n warned.add(key);\n console.error(\n `[@handijitcom/ui] Eksik metin: ${key}. Prop olarak geçin ya da ` +\n '<UiProvider labels={…}> içinde bir kez tanımlayın. ' +\n 'Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.',\n );\n }\n\n return '';\n};\n\n/** Biçimlendirici çözümü — değere bağlı metinler için. */\nexport const resolveFormatter = <TArgs extends unknown[]>(\n key: string,\n formatter: Formatter<TArgs> | undefined,\n ...args: TArgs\n): string => {\n if (formatter) return formatter(...args);\n\n return resolveLabel(key);\n};\n","/**\n * Minutes of a day and the wall-clock text around them — string work only. Day arithmetic (adding\n * a day, the weekday of a date) is NOT here: it belongs to `@handijit/tr` and the caller passes\n * the days already computed.\n */\n\nexport const MINUTES_PER_DAY = 1440;\n\n/** \"09:30\" → 570. */\nexport const toMinutes = (time: string): number => {\n const [hours, minutes] = time.split(':') as [string, string?];\n\n return Number(hours) * 60 + Number(minutes ?? 0);\n};\n\n/** 570 → \"09:30\". */\nexport const toTime = (minutes: number): string =>\n `${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`;\n\n/** \"2026-11-12T09:30\" → \"2026-11-12\". */\nexport const dateOf = (wall: string): string => wall.slice(0, 10);\n\n/** \"2026-11-12T09:30\" → 570. */\nexport const minutesOf = (wall: string): number => toMinutes(wall.slice(11, 16));\n\n/** (\"2026-11-12\", 570) → \"2026-11-12T09:30\". */\nexport const toWall = (date: string, minutes: number): string => `${date}T${toTime(minutes)}`;\n\n/** The time range an event or a segment covers, as it is read: \"09:30–11:00\". */\nexport const timeRange = (start: number, end: number): string => `${toTime(start)}–${toTime(end)}`;\n\nexport const clamp = (value: number, low: number, high: number): number =>\n Math.min(Math.max(value, low), high);\n","import { dateOf, MINUTES_PER_DAY, minutesOf, toMinutes } from './time';\nimport type { CalendarBand, CalendarDay, CalendarEvent, CalendarResource } from './types';\n\n/** One column of the time grid: a day, or a day of one resource. */\nexport type CalendarColumn = {\n index: number;\n day: CalendarDay;\n resource?: CalendarResource;\n /** What a screen reader hears for the column: \"Salı 12 Kasım, Derslik 2\". */\n label: string;\n};\n\n/** An event as drawn in one column (time grid) or one day cell (month). */\nexport type PlacedEvent = {\n /** `<id>@<column>`: a multi-day event is drawn once per day it covers. */\n key: string;\n event: CalendarEvent;\n column: number;\n /** The drawn stretch, clipped to the visible hours (time grid). */\n startMin: number;\n endMin: number;\n /** Side-by-side position among overlapping events: lane `lane` of `lanes`. */\n lane: number;\n lanes: number;\n /** Starts and ends on the same day inside the drawn hours, not locked: it can be moved. */\n isMovable: boolean;\n};\n\nconst columnKey = (date: string, resourceId?: string) => `${date}|${resourceId ?? ''}`;\n\n/** The columns, day by day; with resources, every resource of a day under that day. */\nexport const buildColumns = (\n days: readonly CalendarDay[],\n resources: readonly CalendarResource[] | undefined,\n): CalendarColumn[] =>\n resources && resources.length > 0\n ? days.flatMap((day, dayIndex) =>\n resources.map((resource, resourceIndex) => ({\n index: dayIndex * resources.length + resourceIndex,\n day,\n resource,\n label: `${day.label}, ${resource.label}`,\n })),\n )\n : days.map((day, index) => ({ index, day, label: day.label }));\n\n/** Does the event cover the day? Days compare as text: `YYYY-MM-DD` sorts in time. */\nconst covers = (event: CalendarEvent, date: string): boolean => {\n const startDate = dateOf(event.start);\n const endDate = dateOf(event.end);\n\n return startDate <= date && (date < endDate || (date === endDate && minutesOf(event.end) > 0));\n};\n\nconst isSameDay = (event: CalendarEvent) => dateOf(event.start) === dateOf(event.end);\n\n/**\n * Lanes: overlapping events share a column side by side. A cluster is a run of events that\n * overlap one another directly or through a neighbour; every member is as wide as the cluster has\n * lanes, and each takes the first lane that is free at its start.\n */\nconst assignLanes = (items: PlacedEvent[]): void => {\n items.sort((a, b) => a.startMin - b.startMin || b.endMin - a.endMin);\n\n let cluster: PlacedEvent[] = [];\n let laneEnds: number[] = [];\n let clusterEnd = -1;\n\n const close = () => {\n for (const item of cluster) item.lanes = laneEnds.length;\n cluster = [];\n laneEnds = [];\n };\n\n for (const item of items) {\n if (item.startMin >= clusterEnd) close();\n\n const free = laneEnds.findIndex(end => end <= item.startMin);\n item.lane = free === -1 ? laneEnds.length : free;\n /* A zero-length event still holds its lane for a minute: two at 09:00 sit side by side. */\n const laneEnd = Math.max(item.endMin, item.startMin + 1);\n laneEnds[item.lane] = laneEnd;\n clusterEnd = Math.max(clusterEnd, laneEnd);\n cluster.push(item);\n }\n\n close();\n};\n\n/**\n * Places the events in the time grid, column by column, clipped to `[rangeStart, rangeEnd)`.\n * With resources an event goes to its resource's column; one without a known resource is not\n * drawn (it belongs to the caller's pool of unassigned work).\n */\nexport const placeTimeEvents = (\n events: readonly CalendarEvent[],\n columns: readonly CalendarColumn[],\n rangeStart: number,\n rangeEnd: number,\n isEditable: boolean,\n): PlacedEvent[][] => {\n const byKey = new Map(\n columns.map(column => [columnKey(column.day.date, column.resource?.id), column]),\n );\n const hasResources = columns.some(column => column.resource);\n const placed = columns.map((): PlacedEvent[] => []);\n\n const place = (event: CalendarEvent, column: CalendarColumn) => {\n const date = column.day.date;\n const start = dateOf(event.start) === date ? minutesOf(event.start) : 0;\n const end = dateOf(event.end) === date ? minutesOf(event.end) : MINUTES_PER_DAY;\n if (end <= rangeStart || start >= rangeEnd) return;\n\n placed[column.index].push({\n key: `${event.id}@${column.index}`,\n event,\n column: column.index,\n startMin: Math.max(start, rangeStart),\n endMin: Math.min(end, rangeEnd),\n lane: 0,\n lanes: 1,\n isMovable:\n isEditable && !event.isLocked && isSameDay(event) && start >= rangeStart && end <= rangeEnd,\n });\n };\n\n for (const event of events) {\n const resourceId = hasResources ? event.resourceId : undefined;\n if (hasResources && resourceId === undefined) continue;\n\n if (isSameDay(event)) {\n const column = byKey.get(columnKey(dateOf(event.start), resourceId));\n if (column) place(event, column);\n continue;\n }\n\n for (const column of columns)\n if (column.resource?.id === resourceId && covers(event, column.day.date))\n place(event, column);\n }\n\n for (const column of placed) assignLanes(column);\n\n return placed;\n};\n\n/** The events of every day cell of the month, in time order. */\nexport const placeMonthEvents = (\n events: readonly CalendarEvent[],\n days: readonly CalendarDay[],\n isEditable: boolean,\n): PlacedEvent[][] => {\n const byDate = new Map(days.map((day, index) => [day.date, index]));\n const placed = days.map((): PlacedEvent[] => []);\n\n const place = (event: CalendarEvent, index: number) =>\n placed[index].push({\n key: `${event.id}@${index}`,\n event,\n column: index,\n startMin: minutesOf(event.start),\n endMin: minutesOf(event.end),\n lane: 0,\n lanes: 1,\n isMovable: isEditable && !event.isLocked && isSameDay(event),\n });\n\n for (const event of events) {\n if (isSameDay(event)) {\n const index = byDate.get(dateOf(event.start));\n if (index !== undefined) place(event, index);\n continue;\n }\n\n days.forEach((day, index) => {\n if (covers(event, day.date)) place(event, index);\n });\n }\n\n for (const cell of placed)\n cell.sort((a, b) =>\n a.event.start < b.event.start ? -1 : a.event.start > b.event.start ? 1 : 0,\n );\n\n return placed;\n};\n\n/** A band as drawn: its stretch in minutes, clipped to the drawn hours. */\nexport type PlacedBand = {\n key: string;\n label: string;\n startMin: number;\n endMin: number;\n};\n\n/** The bands inside the drawn hours, clipped to them; one that falls outside them is left out. */\nexport const placeBands = (\n bands: readonly CalendarBand[] | undefined,\n rangeStart: number,\n rangeEnd: number,\n): PlacedBand[] =>\n (bands ?? []).flatMap((band, index) => {\n const startMin = Math.max(toMinutes(band.start), rangeStart);\n const endMin = Math.min(toMinutes(band.end), rangeEnd);\n\n return endMin > startMin ? [{ key: `${index}`, label: band.label, startMin, endMin }] : [];\n });\n","import type { CalendarColumn, PlacedEvent } from './layout';\nimport { clamp, toWall } from './time';\nimport type { CalendarDay, CalendarEventChange } from './types';\n\nexport type CalendarView = 'time' | 'month';\n\n/** Where a moved or resized event lands: a column (or day cell) and its minutes. */\nexport type CalendarTarget = { column: number; startMin: number; endMin: number };\n\nexport type MoveBounds = {\n view: CalendarView;\n columnCount: number;\n rangeStart: number;\n rangeEnd: number;\n slotMinutes: number;\n};\n\n/**\n * The target of moving (`resize: false`) or stretching an event by `deltaMinutes` into `column`.\n * The time grid keeps the event inside the drawn hours and at least one slot long; the month\n * keeps the time of day and refuses a day off the drawn grid (`undefined`).\n */\nexport const targetOf = (\n item: PlacedEvent,\n isResize: boolean,\n deltaMinutes: number,\n column: number,\n bounds: MoveBounds,\n): CalendarTarget | undefined => {\n if (bounds.view === 'month')\n return column < 0 || column >= bounds.columnCount\n ? undefined\n : { column, startMin: item.startMin, endMin: item.endMin };\n\n if (isResize) {\n const shortest = Math.min(item.startMin + bounds.slotMinutes, bounds.rangeEnd);\n return {\n column: item.column,\n startMin: item.startMin,\n endMin: clamp(item.endMin + deltaMinutes, shortest, bounds.rangeEnd),\n };\n }\n\n const duration = item.endMin - item.startMin;\n const startMin = clamp(\n item.startMin + deltaMinutes,\n bounds.rangeStart,\n bounds.rangeEnd - duration,\n );\n\n return {\n column: clamp(column, 0, bounds.columnCount - 1),\n startMin,\n endMin: startMin + duration,\n };\n};\n\n/** The change a target means for the caller, or `undefined` when nothing moved. */\nexport const changeOf = (\n item: PlacedEvent,\n target: CalendarTarget,\n view: CalendarView,\n columns: readonly CalendarColumn[],\n days: readonly CalendarDay[],\n): CalendarEventChange | undefined => {\n const isSame =\n target.column === item.column &&\n target.startMin === item.startMin &&\n target.endMin === item.endMin;\n if (isSame) return undefined;\n\n const column = view === 'time' ? columns[target.column] : undefined;\n const date = column ? column.day.date : days[target.column].date;\n\n return {\n id: item.event.id,\n start: toWall(date, target.startMin),\n end: toWall(date, target.endMin),\n resourceId: column?.resource?.id ?? item.event.resourceId,\n };\n};\n\nexport type ArrowKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';\n\nexport const isArrowKey = (key: string): key is ArrowKey =>\n key === 'ArrowUp' || key === 'ArrowDown' || key === 'ArrowLeft' || key === 'ArrowRight';\n\n/**\n * The event an arrow key moves the focus to: ↑ ↓ the previous and next in the same column (or\n * day), ← → the nearest in time in the closest column that has one.\n */\nexport const neighbourOf = (\n lists: readonly (readonly PlacedEvent[])[],\n from: PlacedEvent,\n key: ArrowKey,\n): PlacedEvent | undefined => {\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const list = lists[from.column];\n const index = list.findIndex(item => item.key === from.key);\n\n return list[index + (key === 'ArrowDown' ? 1 : -1)];\n }\n\n const step = key === 'ArrowRight' ? 1 : -1;\n for (let column = from.column + step; column >= 0 && column < lists.length; column += step) {\n const list = lists[column];\n if (list.length === 0) continue;\n\n return list.reduce((best, item) =>\n Math.abs(item.startMin - from.startMin) < Math.abs(best.startMin - from.startMin)\n ? item\n : best,\n );\n }\n\n return undefined;\n};\n\n/**\n * The keyboard move of a focused event — ⌘/Ctrl with an arrow: ↑ ↓ one slot earlier or later\n * (month: a week), ← → the previous or next column (month: a day). ⌘/Ctrl ⇧ ↑ ↓ shortens or\n * lengthens it by one slot (time grid only).\n */\nexport const keyboardTarget = (\n item: PlacedEvent,\n key: ArrowKey,\n isResize: boolean,\n bounds: MoveBounds,\n): CalendarTarget | undefined => {\n const isVertical = key === 'ArrowUp' || key === 'ArrowDown';\n const direction = key === 'ArrowDown' || key === 'ArrowRight' ? 1 : -1;\n\n if (bounds.view === 'month') {\n if (isResize) return undefined;\n return targetOf(item, false, 0, item.column + direction * (isVertical ? 7 : 1), bounds);\n }\n\n if (isResize && !isVertical) return undefined;\n\n return isVertical\n ? targetOf(item, isResize, direction * bounds.slotMinutes, item.column, bounds)\n : targetOf(item, false, 0, item.column + direction, bounds);\n};\n","'use client';\n\nimport { type RefObject, useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { PlacedEvent } from './layout';\nimport { type CalendarTarget, type MoveBounds, targetOf } from './moves';\n\n/** A press that travels less than this is a click, not a drag (px). */\nconst DRAG_THRESHOLD = 4;\n\nconst WEEK = 7;\n\ntype Origin = { item: PlacedEvent; isResize: boolean; x: number; y: number; isStarted: boolean };\n\nexport type DragPreview = { key: string; isResize: boolean; target: CalendarTarget };\n\n/**\n * POINTER DRAG of an event: move it (the body) or stretch it (the bottom handle), snapped to the\n * slot, with a preview while the pointer travels and `Escape` to give up.\n *\n * The listeners go on `window` for the length of one drag, not on the event's element: the\n * preview is drawn in the target column while the source stays where it is, and a pointer\n * released outside the calendar still ends the drag. The click a drag ends with is swallowed\n * (`isClickSwallowed`) so that dropping an event does not also open it.\n */\nconst useCalendarDrag = ({\n bodyRef,\n bounds,\n onDrop,\n}: {\n /** The element whose box is the grid of columns (time) or of day cells (month). */\n bodyRef: RefObject<HTMLElement | null>;\n bounds: MoveBounds;\n onDrop: (item: PlacedEvent, target: CalendarTarget) => void;\n}) => {\n const [preview, setPreview] = useState<DragPreview | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n const isSwallowingRef = useRef(false);\n const latest = useRef({ bounds, onDrop });\n latest.current = { bounds, onDrop };\n\n const targetAt = (event: PointerEvent, origin: Origin): CalendarTarget | undefined => {\n const box = bodyRef.current?.getBoundingClientRect();\n const { bounds: current } = latest.current;\n if (!box || box.width === 0 || box.height === 0) return undefined;\n\n if (current.view === 'time') {\n const minutesPerPixel = (current.rangeEnd - current.rangeStart) / box.height;\n const minutes = (event.clientY - origin.y) * minutesPerPixel;\n const delta = Math.round(minutes / current.slotMinutes) * current.slotMinutes;\n const column = Math.floor(((event.clientX - box.left) / box.width) * current.columnCount);\n\n return targetOf(origin.item, origin.isResize, delta, column, current);\n }\n\n const rows = Math.ceil(current.columnCount / WEEK);\n const column = Math.floor(((event.clientX - box.left) / box.width) * WEEK);\n const row = Math.floor(((event.clientY - box.top) / box.height) * rows);\n if (column < 0 || column >= WEEK || row < 0 || row >= rows) return undefined;\n\n return targetOf(origin.item, false, 0, row * WEEK + column, current);\n };\n\n const begin = useCallback(\n (\n item: PlacedEvent,\n event: { button: number; clientX: number; clientY: number },\n isResize: boolean,\n ) => {\n isSwallowingRef.current = false;\n if (event.button !== 0 || !item.isMovable) return;\n\n cleanupRef.current?.();\n const origin: Origin = {\n item,\n isResize,\n x: event.clientX,\n y: event.clientY,\n isStarted: false,\n };\n\n const stop = () => {\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', end);\n window.removeEventListener('pointercancel', cancel);\n window.removeEventListener('keydown', escape, true);\n cleanupRef.current = null;\n setPreview(null);\n };\n\n /* The click that follows the release in the same task is the drag's, not an \"open\". */\n const swallowNextClick = () => {\n isSwallowingRef.current = true;\n window.setTimeout(() => {\n isSwallowingRef.current = false;\n }, 0);\n };\n\n const move = (moveEvent: PointerEvent) => {\n const travelled = Math.hypot(moveEvent.clientX - origin.x, moveEvent.clientY - origin.y);\n if (!origin.isStarted && travelled < DRAG_THRESHOLD) return;\n origin.isStarted = true;\n\n const target = targetAt(moveEvent, origin);\n setPreview(target ? { key: origin.item.key, isResize: origin.isResize, target } : null);\n };\n\n const end = (upEvent: PointerEvent) => {\n stop();\n if (!origin.isStarted) return;\n\n swallowNextClick();\n const target = targetAt(upEvent, origin);\n if (target) latest.current.onDrop(origin.item, target);\n };\n\n const cancel = () => stop();\n\n /* Captured: the `Escape` that gives up a drag must not also close the dialog around it. */\n const escape = (keyEvent: KeyboardEvent) => {\n if (keyEvent.key !== 'Escape' || !origin.isStarted) return;\n keyEvent.preventDefault();\n keyEvent.stopPropagation();\n swallowNextClick();\n stop();\n };\n\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', end);\n window.addEventListener('pointercancel', cancel);\n window.addEventListener('keydown', escape, true);\n cleanupRef.current = stop;\n },\n // `targetAt` reads the box and the bounds through refs at the moment of the event.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n /* A calendar unmounted mid-drag leaves no listener behind. */\n useEffect(() => () => cleanupRef.current?.(), []);\n\n const isClickSwallowed = useCallback(() => isSwallowingRef.current, []);\n\n return { preview, begin, isClickSwallowed };\n};\n\nexport default useCalendarDrag;\n","'use client';\n\nimport {\n type CSSProperties,\n type KeyboardEvent,\n memo,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n} from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { PlacedEvent } from '../core/layout';\nimport { minutesOf, timeRange, toTime } from '../core/time';\nimport type { CalendarEvent } from '../core/types';\n\nimport styles from './index.module.scss';\n\nexport type EventHandlers = {\n onPointerDown: (item: PlacedEvent, event: PointerEvent, isResize: boolean) => void;\n onClick: (item: PlacedEvent, event: MouseEvent) => void;\n onKeyDown: (item: PlacedEvent, event: KeyboardEvent) => void;\n onFocus: (item: PlacedEvent) => void;\n};\n\ntype Props = {\n item: PlacedEvent;\n view: 'time' | 'month';\n /** The one event of the calendar in the tab order (roving `tabindex`). */\n isActive: boolean;\n /** Being dragged: the source keeps its place, marked, while the preview travels. */\n isDragSource: boolean;\n /** Can be resized with the pointer (time grid, movable, a change handler given). */\n isResizable: boolean;\n /** Time grid: the drawn hours, for the position in the column. */\n rangeStart: number;\n rangeLength: number;\n /** The day (and resource) of the column, read after the event. */\n columnLabel: string;\n cancelledLabel: string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n handlers: EventHandlers;\n};\n\n/** Percentages of the column for the time grid; the month cell lists its events instead. */\nconst placement = (item: PlacedEvent, rangeStart: number, rangeLength: number): CSSProperties =>\n ({\n '--ui-calendar-top': `${((item.startMin - rangeStart) / rangeLength) * 100}%`,\n '--ui-calendar-height': `${((item.endMin - item.startMin) / rangeLength) * 100}%`,\n '--ui-calendar-lane': item.lane,\n '--ui-calendar-lanes': item.lanes,\n }) as CSSProperties;\n\n/**\n * One event: a button (Enter opens it), its time and its body, the day of its column read after\n * it. A struck-through title is not the only sign of a cancelled event: the \"cancelled\" text is\n * read first.\n */\nconst EventBlock = ({\n item,\n view,\n isActive,\n isDragSource,\n isResizable,\n rangeStart,\n rangeLength,\n columnLabel,\n cancelledLabel,\n renderEvent,\n handlers,\n}: Props) => {\n const { event } = item;\n const time =\n view === 'time'\n ? timeRange(minutesOf(event.start), minutesOf(event.end))\n : toTime(minutesOf(event.start));\n\n return (\n <button\n type=\"button\"\n className={cx(\n styles.event,\n styles[`event--${view}`],\n styles[`event--${event.tone ?? 'primary'}`],\n event.isCancelled && styles['event--cancelled'],\n item.isMovable && styles['event--movable'],\n isDragSource && styles['event--dragging'],\n )}\n style={view === 'time' ? placement(item, rangeStart, rangeLength) : undefined}\n tabIndex={isActive ? 0 : -1}\n data-key={item.key}\n onPointerDown={pointerEvent => handlers.onPointerDown(item, pointerEvent, false)}\n onClick={mouseEvent => handlers.onClick(item, mouseEvent)}\n onKeyDown={keyEvent => handlers.onKeyDown(item, keyEvent)}\n onFocus={() => handlers.onFocus(item)}\n >\n {event.isCancelled && <span className={styles.srOnly}>{`${cancelledLabel}: `}</span>}\n <span className={styles.event__time}>{time}</span>\n <span className={styles.event__body}>{renderEvent ? renderEvent(event) : event.title}</span>\n <span className={styles.srOnly}>{`, ${columnLabel}`}</span>\n {isResizable && (\n <span\n className={styles.event__handle}\n aria-hidden\n onPointerDown={pointerEvent => {\n pointerEvent.stopPropagation();\n handlers.onPointerDown(item, pointerEvent, true);\n }}\n />\n )}\n </button>\n );\n};\n\nexport default /*#__PURE__*/ memo(EventBlock);\n","'use client';\n\nimport { type CSSProperties, type ReactNode, type RefObject } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { PlacedEvent } from '../core/layout';\nimport type { CalendarDay, CalendarEvent } from '../core/types';\nimport type { DragPreview } from '../core/useCalendarDrag';\n\nimport EventBlock, { type EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\n\ntype Props = {\n days: readonly CalendarDay[];\n /** The events of each day, already cut to the ones the cell shows. */\n shown: readonly (readonly PlacedEvent[])[];\n /** How many more events each day has than it shows. */\n hiddenCounts: readonly number[];\n weekdays?: readonly string[];\n selectedDate?: string;\n bodyRef: RefObject<HTMLDivElement | null>;\n activeKey: string | undefined;\n preview: DragPreview | null;\n cancelledLabel: string;\n formatMore: (count: number) => string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n handlers: EventHandlers;\n onDaySelect?: (date: string) => void;\n};\n\nconst WEEK = 7;\n\n/**\n * The month — a cell per day, seven to a row, each listing its first events in time order and a\n * \"+N\" for the rest. The day number opens the day (`onDaySelect`), so does the \"+N\".\n */\nconst MonthGrid = ({\n days,\n shown,\n hiddenCounts,\n weekdays,\n selectedDate,\n bodyRef,\n activeKey,\n preview,\n cancelledLabel,\n formatMore,\n renderEvent,\n handlers,\n onDaySelect,\n}: Props) => (\n <div\n className={styles.month}\n style={{ '--ui-calendar-rows': Math.ceil(days.length / WEEK) } as CSSProperties}\n >\n {weekdays && (\n /* Each cell is named by its full day; the row of weekday names is for the eye. */\n <div className={styles.weekdays} aria-hidden>\n {weekdays.map(weekday => (\n <span key={weekday}>{weekday}</span>\n ))}\n </div>\n )}\n <div ref={bodyRef} className={styles.cells}>\n {days.map((day, index) => {\n const hidden = hiddenCounts[index];\n const dayText = day.shortLabel ?? day.label;\n\n return (\n <div\n key={day.date}\n role=\"group\"\n aria-label={day.label}\n className={cx(\n styles.cell,\n day.isOff && styles['cell--off'],\n day.isOutside && styles['cell--outside'],\n preview?.target.column === index && styles['cell--target'],\n )}\n >\n {onDaySelect ? (\n <button\n type=\"button\"\n className={cx(styles.cell__day, day.isToday && styles['cell__day--today'])}\n aria-label={day.label}\n aria-current={day.isToday ? 'date' : undefined}\n aria-pressed={selectedDate === undefined ? undefined : day.date === selectedDate}\n onClick={() => onDaySelect(day.date)}\n >\n {dayText}\n </button>\n ) : (\n <span\n className={cx(styles.cell__day, day.isToday && styles['cell__day--today'])}\n aria-hidden\n >\n {dayText}\n </span>\n )}\n {shown[index].map(item => (\n <EventBlock\n key={item.key}\n item={item}\n view=\"month\"\n isActive={item.key === activeKey}\n isDragSource={item.key === preview?.key}\n isResizable={false}\n rangeStart={0}\n rangeLength={1}\n columnLabel={day.label}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n handlers={handlers}\n />\n ))}\n {hidden > 0 &&\n (onDaySelect ? (\n <button\n type=\"button\"\n className={styles.cell__more}\n onClick={() => onDaySelect(day.date)}\n >\n {formatMore(hidden)}\n </button>\n ) : (\n <span className={styles.cell__more}>{formatMore(hidden)}</span>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n);\n\nexport default MonthGrid;\n","'use client';\n\nimport {\n type CSSProperties,\n type DragEvent,\n type MouseEvent,\n type ReactNode,\n type RefObject,\n} from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { CalendarColumn, PlacedBand, PlacedEvent } from '../core/layout';\nimport { clamp, timeRange, toTime, toWall } from '../core/time';\nimport type { CalendarDay, CalendarEvent, CalendarResource, CalendarSlot } from '../core/types';\nimport type { DragPreview } from '../core/useCalendarDrag';\n\nimport EventBlock, { type EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\n\ntype Props = {\n label: string;\n days: readonly CalendarDay[];\n resources?: readonly CalendarResource[];\n columns: readonly CalendarColumn[];\n bands: readonly PlacedBand[];\n placed: readonly (readonly PlacedEvent[])[];\n rangeStart: number;\n rangeEnd: number;\n slotMinutes: number;\n bodyRef: RefObject<HTMLDivElement | null>;\n activeKey: string | undefined;\n preview: DragPreview | null;\n isEditable: boolean;\n cancelledLabel: string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n renderResource?: (resource: CalendarResource) => ReactNode;\n handlers: EventHandlers;\n /** True for the click that ends a drag: released on an empty slot, it is not a new event. */\n isClickSwallowed: () => boolean;\n onSlotSelect?: (slot: CalendarSlot) => void;\n onExternalDrop?: (drop: CalendarSlot & { data: string }) => void;\n};\n\n/** The header of a day: the short text shown, the full name read. */\nconst DayHeader = ({ day, span }: { day: CalendarDay; span: number }) => (\n <div\n className={cx(styles.header, day.isToday && styles['header--today'])}\n style={{ gridColumn: `span ${span}` }}\n aria-current={day.isToday ? 'date' : undefined}\n >\n {day.shortLabel ? (\n <>\n <span aria-hidden>{day.shortLabel}</span>\n <span className={styles.srOnly}>{day.label}</span>\n </>\n ) : (\n day.label\n )}\n </div>\n);\n\n/** The header of a resource column: its label and detail, tinted by its tone. */\nconst ResourceHeader = ({\n resource,\n renderResource,\n}: {\n resource: CalendarResource;\n renderResource?: (resource: CalendarResource) => ReactNode;\n}) => (\n <div\n className={cx(styles.resource, resource.tone && styles[`resource--${resource.tone}`])}\n data-tone={resource.tone}\n >\n {renderResource ? (\n renderResource(resource)\n ) : (\n <>\n {resource.label}\n {resource.detail && <span className={styles.resource__detail}>{resource.detail}</span>}\n </>\n )}\n </div>\n);\n\n/**\n * The time grid — days (and their resources) as columns, the drawn hours as rows. Events sit at\n * their time; overlapping ones share the column side by side. One scroll box: the headers stay\n * on top and the hours on the left while it scrolls both ways.\n */\nconst TimeGrid = ({\n label,\n days,\n resources,\n columns,\n bands,\n placed,\n rangeStart,\n rangeEnd,\n slotMinutes,\n bodyRef,\n activeKey,\n preview,\n isEditable,\n cancelledLabel,\n renderEvent,\n renderResource,\n handlers,\n isClickSwallowed,\n onSlotSelect,\n onExternalDrop,\n}: Props) => {\n const rangeLength = rangeEnd - rangeStart;\n const resourceCount = resources?.length ?? 0;\n const hasResources = resourceCount > 0;\n const hours = Array.from(\n { length: Math.floor((rangeEnd - 1) / 60) - Math.ceil(rangeStart / 60) + 1 },\n (_, index) => (Math.ceil(rangeStart / 60) + index) * 60,\n );\n /** A length of minutes as a share of the drawn hours; `percent(t)` is where time `t` sits. */\n const share = (minutes: number) => `${(minutes / rangeLength) * 100}%`;\n const percent = (minutes: number) => share(minutes - rangeStart);\n const previewItem = preview ? placed.flat().find(item => item.key === preview.key) : undefined;\n\n /** The slot under a pointer in a column, snapped down to the slot. */\n const slotAt = (column: CalendarColumn, element: HTMLElement, clientY: number): CalendarSlot => {\n const box = element.getBoundingClientRect();\n const ratio = box.height > 0 ? clamp((clientY - box.top) / box.height, 0, 1) : 0;\n const minutes = Math.floor((ratio * rangeLength) / slotMinutes) * slotMinutes;\n const start = clamp(rangeStart + minutes, rangeStart, rangeEnd - slotMinutes);\n\n return {\n start: toWall(column.day.date, start),\n end: toWall(column.day.date, start + slotMinutes),\n resourceId: column.resource?.id,\n };\n };\n\n const style = {\n '--ui-calendar-columns': columns.length,\n '--ui-calendar-hours': rangeLength / 60,\n '--ui-calendar-slot-ratio': slotMinutes / 60,\n } as CSSProperties;\n\n return (\n /*\n * With no event to focus, the scroll box itself takes the focus (2.1.1): the hours past the\n * fold are reached with the arrow keys of the box.\n */\n <div\n className={styles.scroller}\n {...(placed.some(list => list.length > 0)\n ? {}\n : { tabIndex: 0, role: 'region', 'aria-label': label })}\n >\n <div className={cx(styles.time, bands.length > 0 && styles['time--bands'])} style={style}>\n <div className={styles.corner} />\n <div className={styles.headers}>\n {days.map(day => (\n <DayHeader key={day.date} day={day} span={hasResources ? resourceCount : 1} />\n ))}\n {hasResources &&\n columns.map(column => (\n <ResourceHeader\n key={column.index}\n resource={column.resource as CalendarResource}\n renderResource={renderResource}\n />\n ))}\n </div>\n\n <div className={styles.gutter} aria-hidden>\n {hours.map(minutes => (\n <span key={minutes} className={styles.gutter__hour} style={{ top: percent(minutes) }}>\n {toTime(minutes)}\n </span>\n ))}\n {bands.map(band => (\n <span\n key={band.key}\n className={styles.gutter__band}\n style={{ top: percent(band.startMin), height: share(band.endMin - band.startMin) }}\n >\n {band.label}\n </span>\n ))}\n </div>\n\n <div ref={bodyRef} className={styles.columns}>\n {columns.map(column => (\n <div\n key={column.index}\n role=\"group\"\n aria-label={column.label}\n className={cx(styles.column, column.day.isOff && styles['column--off'])}\n onClick={\n onSlotSelect\n ? (event: MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget || isClickSwallowed()) return;\n onSlotSelect(slotAt(column, event.currentTarget, event.clientY));\n }\n : undefined\n }\n onDragOver={\n onExternalDrop\n ? (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n }\n : undefined\n }\n onDrop={\n onExternalDrop\n ? (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n onExternalDrop({\n ...slotAt(column, event.currentTarget, event.clientY),\n data: event.dataTransfer.getData('text/plain'),\n });\n }\n : undefined\n }\n >\n {bands.map((band, index) => (\n <div\n key={band.key}\n className={cx(styles.band, index % 2 === 1 && styles['band--alternate'])}\n style={{\n top: percent(band.startMin),\n height: share(band.endMin - band.startMin),\n }}\n aria-hidden\n />\n ))}\n {placed[column.index].map(item => (\n <EventBlock\n key={item.key}\n item={item}\n view=\"time\"\n isActive={item.key === activeKey}\n isDragSource={item.key === preview?.key}\n isResizable={isEditable && item.isMovable}\n rangeStart={rangeStart}\n rangeLength={rangeLength}\n columnLabel={column.label}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n handlers={handlers}\n />\n ))}\n {preview && previewItem && preview.target.column === column.index && (\n <div\n className={styles.preview}\n style={\n {\n '--ui-calendar-top': percent(preview.target.startMin),\n '--ui-calendar-height': `${((preview.target.endMin - preview.target.startMin) / rangeLength) * 100}%`,\n } as CSSProperties\n }\n aria-hidden\n >\n {timeRange(preview.target.startMin, preview.target.endMin)}\n <span className={styles.preview__title}>{previewItem.event.title}</span>\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\nexport default TimeGrid;\n","'use client';\n\nimport {\n type KeyboardEvent,\n memo,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useAnnounce, useUi } from '@handijitcom/ui';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveFormatter, resolveLabel } from '../../helpers/label.helper';\nimport {\n buildColumns,\n placeBands,\n type PlacedEvent,\n placeMonthEvents,\n placeTimeEvents,\n} from '../core/layout';\nimport {\n type CalendarTarget,\n type CalendarView,\n changeOf,\n isArrowKey,\n keyboardTarget,\n type MoveBounds,\n neighbourOf,\n} from '../core/moves';\nimport { timeRange, toMinutes } from '../core/time';\nimport type {\n CalendarBand,\n CalendarDay,\n CalendarEvent,\n CalendarEventChange,\n CalendarResource,\n CalendarSlot,\n} from '../core/types';\nimport useCalendarDrag from '../core/useCalendarDrag';\n\nimport type { EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\nimport MonthGrid from './MonthGrid';\nimport TimeGrid from './TimeGrid';\n\ntype Props = {\n /** The calendar's accessible name (\"Ders planı\"). */\n label: string;\n /** The days to draw, in order — computed by the caller (`@handijit/tr` owns day arithmetic). */\n days: readonly CalendarDay[];\n events: readonly CalendarEvent[];\n /** `time` (default): days as columns, hours as rows — day and week. `month`: day cells. */\n view?: CalendarView;\n /**\n * Time grid: a column per resource under every day (teacher, room, technician). A resource's\n * `detail` is a second header line and its `tone` tints the header (a full day: `warning`).\n */\n resources?: readonly CalendarResource[];\n /** Time grid (2.5): the header of a resource column; its label and detail by default. */\n renderResource?: (resource: CalendarResource) => ReactNode;\n /**\n * Time grid (2.5): named stretches of the day (\"Sabah\", \"Öğle\", \"Akşam\") drawn beside the hours\n * and shaded across the columns, under the events and the hour blocks.\n */\n bands?: readonly CalendarBand[];\n /** Time grid: the first drawn hour, `HH:MM`. */\n startTime?: string;\n /** Time grid: the end of the drawn hours, `HH:MM` (at most \"24:00\"). */\n endTime?: string;\n /** Time grid: the snap of a move, a resize and a keyboard step, and the grid lines (minutes). */\n slotMinutes?: number;\n /** Month: the weekday names over the columns (\"Pzt\" … \"Paz\"). */\n weekdays?: readonly string[];\n /** Month: how many events a day cell lists before its \"+N\". */\n maxEventsPerDay?: number;\n /** Month: the day whose list the caller shows beside the calendar (`aria-pressed`). */\n selectedDate?: string;\n /**\n * An event dropped, stretched or moved with the keyboard. Without it the calendar only shows\n * and opens. The calendar is controlled: the move stands once `events` carries it, and a\n * refused move (a conflict) is simply not applied — say why in a toast.\n */\n onEventChange?: (change: CalendarEventChange) => void;\n /** Enter or a click on an event. */\n onEventOpen?: (id: string) => void;\n /** Time grid: a click on an empty slot (a new lesson there). */\n onSlotSelect?: (slot: CalendarSlot) => void;\n /** Month: the day number or the \"+N\" of a cell. */\n onDaySelect?: (date: string) => void;\n /**\n * Time grid: something dragged in from outside (an unassigned job of a pool) and dropped on a\n * slot; `data` is its `text/plain` drag data.\n */\n onExternalDrop?: (drop: CalendarSlot & { data: string }) => void;\n /** The body of an event under its time; its title by default. */\n renderEvent?: (event: CalendarEvent) => ReactNode;\n className?: string;\n testId?: string;\n};\n\nconst DEFAULT_MAX_PER_DAY = 3;\n\ntype Pending = { key: string; before: CalendarEvent };\n\n/**\n * Calendar (2.4) — the base of app-kit's `takvim` pattern: a time grid of days or of days and\n * resources, or a month; events moved and stretched with the pointer and with the keyboard.\n *\n * Keyboard: Tab reaches ONE event (roving `tabindex`; 500 lessons are not 500 tab stops);\n * ← ↑ → ↓ go to the neighbouring event; Enter opens it; ⌘/Ctrl + an arrow moves it one slot or\n * one column (month: a day or a week); ⌘/Ctrl ⇧ ↑ ↓ shortens or lengthens it. The move is\n * announced once `events` carries it. A short event can be smaller than the 44px touch target:\n * its size is its duration, and every pointer action has the keyboard way above.\n */\nconst Calendar = ({\n label,\n days,\n events,\n view = 'time',\n resources,\n renderResource,\n bands,\n startTime = '08:00',\n endTime = '20:00',\n slotMinutes = 30,\n weekdays,\n maxEventsPerDay = DEFAULT_MAX_PER_DAY,\n selectedDate,\n onEventChange,\n onEventOpen,\n onSlotSelect,\n onDaySelect,\n onExternalDrop,\n renderEvent,\n className,\n testId,\n}: Props) => {\n const { labels } = useUi();\n const announce = useAnnounce();\n const instructionsId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const [activeKey, setActiveKey] = useState<string>();\n const pendingRef = useRef<Pending | null>(null);\n\n const isEditable = Boolean(onEventChange);\n const rangeStart = toMinutes(startTime);\n const rangeEnd = toMinutes(endTime);\n\n const columns = useMemo(() => buildColumns(days, resources), [days, resources]);\n const placedBands = useMemo(\n () => placeBands(bands, rangeStart, rangeEnd),\n [bands, rangeStart, rangeEnd],\n );\n const placed = useMemo(\n () =>\n view === 'time'\n ? placeTimeEvents(events, columns, rangeStart, rangeEnd, isEditable)\n : placeMonthEvents(events, days, isEditable),\n [view, events, columns, days, rangeStart, rangeEnd, isEditable],\n );\n /* The month shows the first events of a day; the rest are behind \"+N\" and out of the tab order. */\n const focusable = useMemo(\n () => (view === 'month' ? placed.map(list => list.slice(0, maxEventsPerDay)) : placed),\n [view, placed, maxEventsPerDay],\n );\n\n const bounds: MoveBounds = {\n view,\n columnCount: view === 'time' ? columns.length : days.length,\n rangeStart,\n rangeEnd,\n slotMinutes,\n };\n\n const items = focusable.flat();\n const tabbableKey = items.some(item => item.key === activeKey) ? activeKey : items[0]?.key;\n\n const columnLabel = (item: PlacedEvent) =>\n view === 'time' ? columns[item.column].label : days[item.column].label;\n\n /* The latest props for the stable handlers the memoised events hold. */\n const latest = useRef({ view, columns, days, onEventChange, onEventOpen, focusable, bounds });\n latest.current = { view, columns, days, onEventChange, onEventOpen, focusable, bounds };\n\n const apply = useCallback((item: PlacedEvent, target: CalendarTarget) => {\n const current = latest.current;\n const change = changeOf(item, target, current.view, current.columns, current.days);\n if (!change || !current.onEventChange) return undefined;\n current.onEventChange(change);\n\n return change;\n }, []);\n\n const drag = useCalendarDrag({ bodyRef, bounds, onDrop: apply });\n\n const focusKey = (key: string) => {\n /* Only called from the calendar's own handlers and effect: the root is there. */\n const root = rootRef.current as HTMLDivElement;\n const element = [...root.querySelectorAll<HTMLElement>('[data-key]')].find(\n candidate => candidate.dataset.key === key,\n );\n element?.focus();\n };\n\n const handlers = useMemo<EventHandlers>(\n () => ({\n onPointerDown: (item: PlacedEvent, event: PointerEvent, isResize: boolean) => {\n pendingRef.current = null;\n if (latest.current.onEventChange) drag.begin(item, event, isResize);\n },\n onClick: (item: PlacedEvent, _event: MouseEvent) => {\n if (drag.isClickSwallowed()) return;\n latest.current.onEventOpen?.(item.event.id);\n },\n onFocus: (item: PlacedEvent) => setActiveKey(item.key),\n onKeyDown: (item: PlacedEvent, event: KeyboardEvent) => {\n pendingRef.current = null;\n if (!isArrowKey(event.key)) return;\n const current = latest.current;\n\n if (event.metaKey || event.ctrlKey) {\n event.preventDefault();\n if (!item.isMovable) return;\n const target = keyboardTarget(item, event.key, event.shiftKey, current.bounds);\n if (!target) return;\n pendingRef.current = {\n key: `${item.event.id}@${target.column}`,\n before: item.event,\n };\n if (!apply(item, target)) pendingRef.current = null;\n return;\n }\n\n const next = neighbourOf(current.focusable, item, event.key);\n if (!next) return;\n event.preventDefault();\n setActiveKey(next.key);\n focusKey(next.key);\n },\n }),\n // `drag.begin` and `drag.isClickSwallowed` are stable; the rest is read through `latest`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apply],\n );\n\n /*\n * A keyboard move stands once `events` carries it: the focus follows the event into its new\n * column (its button there is a new element) and the new place is announced.\n */\n useEffect(() => {\n const pending = pendingRef.current;\n if (!pending) return;\n const item = placed.flat().find(candidate => candidate.key === pending.key);\n const { before } = pending;\n const isMoved =\n item !== undefined &&\n (item.event.start !== before.start ||\n item.event.end !== before.end ||\n item.event.resourceId !== before.resourceId);\n if (!isMoved) return;\n\n pendingRef.current = null;\n setActiveKey(item.key);\n focusKey(item.key);\n announce(\n resolveFormatter(\n 'Calendar.moved',\n labels?.calendar?.moved,\n item.event.title,\n `${columnLabel(item)}, ${timeRange(item.startMin, item.endMin)}`,\n ),\n );\n // Runs when the events change: that is when a move stands.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [events]);\n\n const cancelledLabel = resolveLabel('Calendar.cancelled', labels?.calendar?.cancelled);\n const instructions = resolveLabel('Calendar.instructions', labels?.calendar?.instructions);\n\n return (\n <div\n ref={rootRef}\n className={cx(styles.calendar, className)}\n role=\"group\"\n aria-label={label}\n aria-describedby={instructionsId}\n data-testid={testId}\n >\n <span id={instructionsId} className={styles.srOnly}>\n {instructions}\n </span>\n {view === 'time' ? (\n <TimeGrid\n label={label}\n days={days}\n resources={resources}\n columns={columns}\n bands={placedBands}\n placed={placed}\n rangeStart={rangeStart}\n rangeEnd={rangeEnd}\n slotMinutes={slotMinutes}\n bodyRef={bodyRef}\n activeKey={tabbableKey}\n preview={drag.preview}\n isEditable={isEditable}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n renderResource={renderResource}\n handlers={handlers}\n isClickSwallowed={drag.isClickSwallowed}\n onSlotSelect={onSlotSelect}\n onExternalDrop={onExternalDrop}\n />\n ) : (\n <MonthGrid\n days={days}\n shown={focusable}\n hiddenCounts={placed.map((list, index) => list.length - focusable[index].length)}\n weekdays={weekdays}\n selectedDate={selectedDate}\n bodyRef={bodyRef}\n activeKey={tabbableKey}\n preview={drag.preview}\n cancelledLabel={cancelledLabel}\n formatMore={count => resolveFormatter('Calendar.more', labels?.calendar?.more, count)}\n renderEvent={renderEvent}\n handlers={handlers}\n onDaySelect={onDaySelect}\n />\n )}\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Calendar, 'Calendar')) as typeof Calendar;\n"],"names":["cx","values","result","value","named","component","displayName","warned","resolveLabel","key","resolveFormatter","formatter","args","MINUTES_PER_DAY","toMinutes","time","hours","minutes","toTime","dateOf","wall","minutesOf","toWall","date","timeRange","start","end","clamp","low","high","columnKey","resourceId","buildColumns","days","resources","day","dayIndex","resource","resourceIndex","index","covers","event","startDate","endDate","isSameDay","assignLanes","items","a","b","cluster","laneEnds","clusterEnd","close","item","free","laneEnd","placeTimeEvents","events","columns","rangeStart","rangeEnd","isEditable","byKey","column","_a","hasResources","placed","place","placeMonthEvents","byDate","cell","placeBands","bands","band","startMin","endMin","targetOf","isResize","deltaMinutes","bounds","shortest","duration","changeOf","target","view","isArrowKey","neighbourOf","lists","from","list","step","best","keyboardTarget","isVertical","direction","DRAG_THRESHOLD","WEEK","useCalendarDrag","bodyRef","onDrop","preview","setPreview","useState","cleanupRef","useRef","isSwallowingRef","latest","targetAt","origin","box","current","minutesPerPixel","delta","rows","row","begin","useCallback","stop","move","cancel","escape","swallowNextClick","moveEvent","travelled","upEvent","keyEvent","useEffect","isClickSwallowed","placement","rangeLength","EventBlock","isActive","isDragSource","isResizable","columnLabel","cancelledLabel","renderEvent","handlers","jsxs","styles","pointerEvent","mouseEvent","jsx","MonthGrid","shown","hiddenCounts","weekdays","selectedDate","activeKey","formatMore","onDaySelect","weekday","hidden","dayText","DayHeader","span","Fragment","ResourceHeader","renderResource","TimeGrid","label","slotMinutes","onSlotSelect","onExternalDrop","resourceCount","_","share","percent","previewItem","slotAt","element","clientY","ratio","style","DEFAULT_MAX_PER_DAY","Calendar","startTime","endTime","maxEventsPerDay","onEventChange","onEventOpen","className","testId","labels","useUi","announce","useAnnounce","instructionsId","useId","rootRef","setActiveKey","pendingRef","useMemo","placedBands","focusable","tabbableKey","apply","change","drag","focusKey","candidate","_event","_b","next","pending","before","instructions","_c","count","memo"],"mappings":"mLAGaA,EAAK,IAAIC,IAAiC,CACrD,IAAIC,EAAS,GAEb,UAAWC,KAASF,EACbE,IACLD,EAASA,IAAW,GAAKC,EAAQ,GAAGD,CAAM,IAAIC,CAAK,IAGrD,OAAOD,CACT,ECAaE,GAAQ,CACnBC,EACAC,IACe,OAAO,OAAOD,EAAW,CAAE,YAAAC,EAAa,ECVnDC,OAAa,IAUNC,GAAe,CAACC,KAAgBR,IAA2C,CACtF,UAAWE,KAASF,EAAQ,GAAIE,IAAU,OAAW,OAAOA,EAE5D,OAAI,QAAQ,IAAI,WAAa,cAAgB,CAACI,GAAO,IAAIE,CAAG,IAC1DF,GAAO,IAAIE,CAAG,EACd,QAAQ,MACN,kCAAkCA,CAAG,kIAAA,GAMlC,EACT,EAGaC,GAAmB,CAC9BD,EACAE,KACGC,IAECD,EAAkBA,EAAU,GAAGC,CAAI,EAEhCJ,GAAaC,CAAG,EChCZI,GAAkB,KAGlBC,EAAaC,GAAyB,CACjD,KAAM,CAACC,EAAOC,CAAO,EAAIF,EAAK,MAAM,GAAG,EAEvC,OAAO,OAAOC,CAAK,EAAI,GAAK,OAAOC,GAAW,CAAC,CACjD,EAGaC,EAAUD,GACrB,GAAG,OAAO,KAAK,MAAMA,EAAU,EAAE,CAAC,EAAE,SAAS,EAAG,GAAG,CAAC,IAAI,OAAOA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,GACA,WAAYyE,GAAA,OAAS,OAAAtM,GAAiB,iBAAiBsD,EAAAuH,GAAA,YAAAA,EAAQ,WAAR,YAAAvH,EAAkB,KAAMgJ,CAAK,GACpF,YAAAxE,EACA,SAAAC,GACA,YAAAa,CAAA,CAAA,CACF,CAAA,CAAA,CAIR,EAEA/G,GAA6B0K,OAAmB7M,GAAM2K,GAAU,UAAU,CAAC"}
1
+ {"version":3,"file":"calendar.cjs","sources":["../src/helpers/class-name.helper.ts","../src/helpers/component.helper.ts","../src/helpers/label.helper.ts","../src/calendar/core/time.ts","../src/calendar/core/layout.ts","../src/calendar/core/moves.ts","../src/calendar/core/useCalendarDrag.ts","../src/calendar/Calendar/EventBlock.tsx","../src/calendar/Calendar/MonthGrid.tsx","../src/calendar/Calendar/TimeGrid.tsx","../src/calendar/Calendar/index.tsx"],"sourcesContent":["import { ClassValue } from '@/types/common-element-props.type';\n\n/** Sınıf adı birleştirici. */\nexport const cx = (...values: ClassValue[]): string => {\n let result = '';\n\n for (const value of values) {\n if (!value) continue;\n result = result === '' ? value : `${result} ${value}`;\n }\n\n return result;\n};\n","/**\n * DevTools adı — modül düzeyinde YAN ETKİ bırakmadan.\n *\n * ⚠ `X.displayName = 'X'` KULLANILMAZ: modül düzeyindeki özellik ataması\n * bundler için yan etkidir ve hedefinin tüm bağımlılık zincirini ayakta tutar.\n * Ölçüldü: yalnızca `Badge` import eden uygulama 20,7 kB indiriyordu (paketin\n * tamamı 21,8 kB). Atama çağrıya dönüşünce `#__PURE__` işaretlenebiliyor →\n * `Badge` 2,71 kB. Nöbetçi `.size-limit.json`.\n *\n * @example\n * export default memo(named(Button, 'Button')) as typeof Button;\n */\nexport const named = <TComponent extends object>(\n component: TComponent,\n displayName: string,\n): TComponent => Object.assign(component, { displayName });\n","/** Metin çözümlemesi: prop → sağlayıcı config'i → geliştirme uyarısı. */\n\nimport type { Formatter } from '@/types/theme.type';\n\n/* Uyari ANAHTAR BASINA bir kez verilir. */\nconst warned = new Set<string>();\n\n/** Uyarı durumu testler arasında sızmamalı; her test kendi durumundan başlar. */\nexport const resetLabelWarnings = (): void => warned.clear();\n\n/**\n * Verilen metni çözer.\n * @param key Uyarıda gösterilecek yol (`Modal.closeLabel`).\n * @param values Öncelik sırasına göre adaylar: prop önce, config sonra.\n */\nexport const resolveLabel = (key: string, ...values: (string | undefined)[]): string => {\n for (const value of values) if (value !== undefined) return value;\n\n if (process.env.NODE_ENV !== 'production' && !warned.has(key)) {\n warned.add(key);\n console.error(\n `[@handijitcom/ui] Eksik metin: ${key}. Prop olarak geçin ya da ` +\n '<UiProvider labels={…}> içinde bir kez tanımlayın. ' +\n 'Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.',\n );\n }\n\n return '';\n};\n\n/** Biçimlendirici çözümü — değere bağlı metinler için. */\nexport const resolveFormatter = <TArgs extends unknown[]>(\n key: string,\n formatter: Formatter<TArgs> | undefined,\n ...args: TArgs\n): string => {\n if (formatter) return formatter(...args);\n\n return resolveLabel(key);\n};\n","/**\n * Minutes of a day and the wall-clock text around them — string work only. Day arithmetic (adding\n * a day, the weekday of a date) is NOT here: it belongs to the caller, who passes\n * the days already computed.\n */\n\nexport const MINUTES_PER_DAY = 1440;\n\n/** \"09:30\" → 570. */\nexport const toMinutes = (time: string): number => {\n const [hours, minutes] = time.split(':') as [string, string?];\n\n return Number(hours) * 60 + Number(minutes ?? 0);\n};\n\n/** 570 → \"09:30\". */\nexport const toTime = (minutes: number): string =>\n `${String(Math.floor(minutes / 60)).padStart(2, '0')}:${String(minutes % 60).padStart(2, '0')}`;\n\n/** \"2026-11-12T09:30\" → \"2026-11-12\". */\nexport const dateOf = (wall: string): string => wall.slice(0, 10);\n\n/** \"2026-11-12T09:30\" → 570. */\nexport const minutesOf = (wall: string): number => toMinutes(wall.slice(11, 16));\n\n/** (\"2026-11-12\", 570) → \"2026-11-12T09:30\". */\nexport const toWall = (date: string, minutes: number): string => `${date}T${toTime(minutes)}`;\n\n/** The time range an event or a segment covers, as it is read: \"09:30–11:00\". */\nexport const timeRange = (start: number, end: number): string => `${toTime(start)}–${toTime(end)}`;\n\nexport const clamp = (value: number, low: number, high: number): number =>\n Math.min(Math.max(value, low), high);\n","import { dateOf, MINUTES_PER_DAY, minutesOf, toMinutes } from './time';\nimport type { CalendarBand, CalendarDay, CalendarEvent, CalendarResource } from './types';\n\n/** One column of the time grid: a day, or a day of one resource. */\nexport type CalendarColumn = {\n index: number;\n day: CalendarDay;\n resource?: CalendarResource;\n /** What a screen reader hears for the column: \"Salı 12 Kasım, Derslik 2\". */\n label: string;\n};\n\n/** An event as drawn in one column (time grid) or one day cell (month). */\nexport type PlacedEvent = {\n /** `<id>@<column>`: a multi-day event is drawn once per day it covers. */\n key: string;\n event: CalendarEvent;\n column: number;\n /** The drawn stretch, clipped to the visible hours (time grid). */\n startMin: number;\n endMin: number;\n /** Side-by-side position among overlapping events: lane `lane` of `lanes`. */\n lane: number;\n lanes: number;\n /** Starts and ends on the same day inside the drawn hours, not locked: it can be moved. */\n isMovable: boolean;\n};\n\nconst columnKey = (date: string, resourceId?: string) => `${date}|${resourceId ?? ''}`;\n\n/** The columns, day by day; with resources, every resource of a day under that day. */\nexport const buildColumns = (\n days: readonly CalendarDay[],\n resources: readonly CalendarResource[] | undefined,\n): CalendarColumn[] =>\n resources && resources.length > 0\n ? days.flatMap((day, dayIndex) =>\n resources.map((resource, resourceIndex) => ({\n index: dayIndex * resources.length + resourceIndex,\n day,\n resource,\n label: `${day.label}, ${resource.label}`,\n })),\n )\n : days.map((day, index) => ({ index, day, label: day.label }));\n\n/** Does the event cover the day? Days compare as text: `YYYY-MM-DD` sorts in time. */\nconst covers = (event: CalendarEvent, date: string): boolean => {\n const startDate = dateOf(event.start);\n const endDate = dateOf(event.end);\n\n return startDate <= date && (date < endDate || (date === endDate && minutesOf(event.end) > 0));\n};\n\nconst isSameDay = (event: CalendarEvent) => dateOf(event.start) === dateOf(event.end);\n\n/**\n * Lanes: overlapping events share a column side by side. A cluster is a run of events that\n * overlap one another directly or through a neighbour; every member is as wide as the cluster has\n * lanes, and each takes the first lane that is free at its start.\n */\nconst assignLanes = (items: PlacedEvent[]): void => {\n items.sort((a, b) => a.startMin - b.startMin || b.endMin - a.endMin);\n\n let cluster: PlacedEvent[] = [];\n let laneEnds: number[] = [];\n let clusterEnd = -1;\n\n const close = () => {\n for (const item of cluster) item.lanes = laneEnds.length;\n cluster = [];\n laneEnds = [];\n };\n\n for (const item of items) {\n if (item.startMin >= clusterEnd) close();\n\n const free = laneEnds.findIndex(end => end <= item.startMin);\n item.lane = free === -1 ? laneEnds.length : free;\n /* A zero-length event still holds its lane for a minute: two at 09:00 sit side by side. */\n const laneEnd = Math.max(item.endMin, item.startMin + 1);\n laneEnds[item.lane] = laneEnd;\n clusterEnd = Math.max(clusterEnd, laneEnd);\n cluster.push(item);\n }\n\n close();\n};\n\n/**\n * Places the events in the time grid, column by column, clipped to `[rangeStart, rangeEnd)`.\n * With resources an event goes to its resource's column; one without a known resource is not\n * drawn (it belongs to the caller's pool of unassigned work).\n */\nexport const placeTimeEvents = (\n events: readonly CalendarEvent[],\n columns: readonly CalendarColumn[],\n rangeStart: number,\n rangeEnd: number,\n isEditable: boolean,\n): PlacedEvent[][] => {\n const byKey = new Map(\n columns.map(column => [columnKey(column.day.date, column.resource?.id), column]),\n );\n const hasResources = columns.some(column => column.resource);\n const placed = columns.map((): PlacedEvent[] => []);\n\n const place = (event: CalendarEvent, column: CalendarColumn) => {\n const date = column.day.date;\n const start = dateOf(event.start) === date ? minutesOf(event.start) : 0;\n const end = dateOf(event.end) === date ? minutesOf(event.end) : MINUTES_PER_DAY;\n if (end <= rangeStart || start >= rangeEnd) return;\n\n placed[column.index].push({\n key: `${event.id}@${column.index}`,\n event,\n column: column.index,\n startMin: Math.max(start, rangeStart),\n endMin: Math.min(end, rangeEnd),\n lane: 0,\n lanes: 1,\n isMovable:\n isEditable && !event.isLocked && isSameDay(event) && start >= rangeStart && end <= rangeEnd,\n });\n };\n\n for (const event of events) {\n const resourceId = hasResources ? event.resourceId : undefined;\n if (hasResources && resourceId === undefined) continue;\n\n if (isSameDay(event)) {\n const column = byKey.get(columnKey(dateOf(event.start), resourceId));\n if (column) place(event, column);\n continue;\n }\n\n for (const column of columns)\n if (column.resource?.id === resourceId && covers(event, column.day.date))\n place(event, column);\n }\n\n for (const column of placed) assignLanes(column);\n\n return placed;\n};\n\n/** The events of every day cell of the month, in time order. */\nexport const placeMonthEvents = (\n events: readonly CalendarEvent[],\n days: readonly CalendarDay[],\n isEditable: boolean,\n): PlacedEvent[][] => {\n const byDate = new Map(days.map((day, index) => [day.date, index]));\n const placed = days.map((): PlacedEvent[] => []);\n\n const place = (event: CalendarEvent, index: number) =>\n placed[index].push({\n key: `${event.id}@${index}`,\n event,\n column: index,\n startMin: minutesOf(event.start),\n endMin: minutesOf(event.end),\n lane: 0,\n lanes: 1,\n isMovable: isEditable && !event.isLocked && isSameDay(event),\n });\n\n for (const event of events) {\n if (isSameDay(event)) {\n const index = byDate.get(dateOf(event.start));\n if (index !== undefined) place(event, index);\n continue;\n }\n\n days.forEach((day, index) => {\n if (covers(event, day.date)) place(event, index);\n });\n }\n\n for (const cell of placed)\n cell.sort((a, b) =>\n a.event.start < b.event.start ? -1 : a.event.start > b.event.start ? 1 : 0,\n );\n\n return placed;\n};\n\n/** A band as drawn: its stretch in minutes, clipped to the drawn hours. */\nexport type PlacedBand = {\n key: string;\n label: string;\n startMin: number;\n endMin: number;\n};\n\n/** The bands inside the drawn hours, clipped to them; one that falls outside them is left out. */\nexport const placeBands = (\n bands: readonly CalendarBand[] | undefined,\n rangeStart: number,\n rangeEnd: number,\n): PlacedBand[] =>\n (bands ?? []).flatMap((band, index) => {\n const startMin = Math.max(toMinutes(band.start), rangeStart);\n const endMin = Math.min(toMinutes(band.end), rangeEnd);\n\n return endMin > startMin ? [{ key: `${index}`, label: band.label, startMin, endMin }] : [];\n });\n","import type { CalendarColumn, PlacedEvent } from './layout';\nimport { clamp, toWall } from './time';\nimport type { CalendarDay, CalendarEventChange } from './types';\n\nexport type CalendarView = 'time' | 'month';\n\n/** Where a moved or resized event lands: a column (or day cell) and its minutes. */\nexport type CalendarTarget = { column: number; startMin: number; endMin: number };\n\nexport type MoveBounds = {\n view: CalendarView;\n columnCount: number;\n rangeStart: number;\n rangeEnd: number;\n slotMinutes: number;\n};\n\n/**\n * The target of moving (`resize: false`) or stretching an event by `deltaMinutes` into `column`.\n * The time grid keeps the event inside the drawn hours and at least one slot long; the month\n * keeps the time of day and refuses a day off the drawn grid (`undefined`).\n */\nexport const targetOf = (\n item: PlacedEvent,\n isResize: boolean,\n deltaMinutes: number,\n column: number,\n bounds: MoveBounds,\n): CalendarTarget | undefined => {\n if (bounds.view === 'month')\n return column < 0 || column >= bounds.columnCount\n ? undefined\n : { column, startMin: item.startMin, endMin: item.endMin };\n\n if (isResize) {\n const shortest = Math.min(item.startMin + bounds.slotMinutes, bounds.rangeEnd);\n return {\n column: item.column,\n startMin: item.startMin,\n endMin: clamp(item.endMin + deltaMinutes, shortest, bounds.rangeEnd),\n };\n }\n\n const duration = item.endMin - item.startMin;\n const startMin = clamp(\n item.startMin + deltaMinutes,\n bounds.rangeStart,\n bounds.rangeEnd - duration,\n );\n\n return {\n column: clamp(column, 0, bounds.columnCount - 1),\n startMin,\n endMin: startMin + duration,\n };\n};\n\n/** The change a target means for the caller, or `undefined` when nothing moved. */\nexport const changeOf = (\n item: PlacedEvent,\n target: CalendarTarget,\n view: CalendarView,\n columns: readonly CalendarColumn[],\n days: readonly CalendarDay[],\n): CalendarEventChange | undefined => {\n const isSame =\n target.column === item.column &&\n target.startMin === item.startMin &&\n target.endMin === item.endMin;\n if (isSame) return undefined;\n\n const column = view === 'time' ? columns[target.column] : undefined;\n const date = column ? column.day.date : days[target.column].date;\n\n return {\n id: item.event.id,\n start: toWall(date, target.startMin),\n end: toWall(date, target.endMin),\n resourceId: column?.resource?.id ?? item.event.resourceId,\n };\n};\n\nexport type ArrowKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight';\n\nexport const isArrowKey = (key: string): key is ArrowKey =>\n key === 'ArrowUp' || key === 'ArrowDown' || key === 'ArrowLeft' || key === 'ArrowRight';\n\n/**\n * The event an arrow key moves the focus to: ↑ ↓ the previous and next in the same column (or\n * day), ← → the nearest in time in the closest column that has one.\n */\nexport const neighbourOf = (\n lists: readonly (readonly PlacedEvent[])[],\n from: PlacedEvent,\n key: ArrowKey,\n): PlacedEvent | undefined => {\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n const list = lists[from.column];\n const index = list.findIndex(item => item.key === from.key);\n\n return list[index + (key === 'ArrowDown' ? 1 : -1)];\n }\n\n const step = key === 'ArrowRight' ? 1 : -1;\n for (let column = from.column + step; column >= 0 && column < lists.length; column += step) {\n const list = lists[column];\n if (list.length === 0) continue;\n\n return list.reduce((best, item) =>\n Math.abs(item.startMin - from.startMin) < Math.abs(best.startMin - from.startMin)\n ? item\n : best,\n );\n }\n\n return undefined;\n};\n\n/**\n * The keyboard move of a focused event — ⌘/Ctrl with an arrow: ↑ ↓ one slot earlier or later\n * (month: a week), ← → the previous or next column (month: a day). ⌘/Ctrl ⇧ ↑ ↓ shortens or\n * lengthens it by one slot (time grid only).\n */\nexport const keyboardTarget = (\n item: PlacedEvent,\n key: ArrowKey,\n isResize: boolean,\n bounds: MoveBounds,\n): CalendarTarget | undefined => {\n const isVertical = key === 'ArrowUp' || key === 'ArrowDown';\n const direction = key === 'ArrowDown' || key === 'ArrowRight' ? 1 : -1;\n\n if (bounds.view === 'month') {\n if (isResize) return undefined;\n return targetOf(item, false, 0, item.column + direction * (isVertical ? 7 : 1), bounds);\n }\n\n if (isResize && !isVertical) return undefined;\n\n return isVertical\n ? targetOf(item, isResize, direction * bounds.slotMinutes, item.column, bounds)\n : targetOf(item, false, 0, item.column + direction, bounds);\n};\n","'use client';\n\nimport { type RefObject, useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { PlacedEvent } from './layout';\nimport { type CalendarTarget, type MoveBounds, targetOf } from './moves';\n\n/** A press that travels less than this is a click, not a drag (px). */\nconst DRAG_THRESHOLD = 4;\n\nconst WEEK = 7;\n\ntype Origin = { item: PlacedEvent; isResize: boolean; x: number; y: number; isStarted: boolean };\n\nexport type DragPreview = { key: string; isResize: boolean; target: CalendarTarget };\n\n/**\n * POINTER DRAG of an event: move it (the body) or stretch it (the bottom handle), snapped to the\n * slot, with a preview while the pointer travels and `Escape` to give up.\n *\n * The listeners go on `window` for the length of one drag, not on the event's element: the\n * preview is drawn in the target column while the source stays where it is, and a pointer\n * released outside the calendar still ends the drag. The click a drag ends with is swallowed\n * (`isClickSwallowed`) so that dropping an event does not also open it.\n */\nconst useCalendarDrag = ({\n bodyRef,\n bounds,\n onDrop,\n}: {\n /** The element whose box is the grid of columns (time) or of day cells (month). */\n bodyRef: RefObject<HTMLElement | null>;\n bounds: MoveBounds;\n onDrop: (item: PlacedEvent, target: CalendarTarget) => void;\n}) => {\n const [preview, setPreview] = useState<DragPreview | null>(null);\n const cleanupRef = useRef<(() => void) | null>(null);\n const isSwallowingRef = useRef(false);\n const latest = useRef({ bounds, onDrop });\n latest.current = { bounds, onDrop };\n\n const targetAt = (event: PointerEvent, origin: Origin): CalendarTarget | undefined => {\n const box = bodyRef.current?.getBoundingClientRect();\n const { bounds: current } = latest.current;\n if (!box || box.width === 0 || box.height === 0) return undefined;\n\n if (current.view === 'time') {\n const minutesPerPixel = (current.rangeEnd - current.rangeStart) / box.height;\n const minutes = (event.clientY - origin.y) * minutesPerPixel;\n const delta = Math.round(minutes / current.slotMinutes) * current.slotMinutes;\n const column = Math.floor(((event.clientX - box.left) / box.width) * current.columnCount);\n\n return targetOf(origin.item, origin.isResize, delta, column, current);\n }\n\n const rows = Math.ceil(current.columnCount / WEEK);\n const column = Math.floor(((event.clientX - box.left) / box.width) * WEEK);\n const row = Math.floor(((event.clientY - box.top) / box.height) * rows);\n if (column < 0 || column >= WEEK || row < 0 || row >= rows) return undefined;\n\n return targetOf(origin.item, false, 0, row * WEEK + column, current);\n };\n\n const begin = useCallback(\n (\n item: PlacedEvent,\n event: { button: number; clientX: number; clientY: number },\n isResize: boolean,\n ) => {\n isSwallowingRef.current = false;\n if (event.button !== 0 || !item.isMovable) return;\n\n cleanupRef.current?.();\n const origin: Origin = {\n item,\n isResize,\n x: event.clientX,\n y: event.clientY,\n isStarted: false,\n };\n\n const stop = () => {\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', end);\n window.removeEventListener('pointercancel', cancel);\n window.removeEventListener('keydown', escape, true);\n cleanupRef.current = null;\n setPreview(null);\n };\n\n /* The click that follows the release in the same task is the drag's, not an \"open\". */\n const swallowNextClick = () => {\n isSwallowingRef.current = true;\n window.setTimeout(() => {\n isSwallowingRef.current = false;\n }, 0);\n };\n\n const move = (moveEvent: PointerEvent) => {\n const travelled = Math.hypot(moveEvent.clientX - origin.x, moveEvent.clientY - origin.y);\n if (!origin.isStarted && travelled < DRAG_THRESHOLD) return;\n origin.isStarted = true;\n\n const target = targetAt(moveEvent, origin);\n setPreview(target ? { key: origin.item.key, isResize: origin.isResize, target } : null);\n };\n\n const end = (upEvent: PointerEvent) => {\n stop();\n if (!origin.isStarted) return;\n\n swallowNextClick();\n const target = targetAt(upEvent, origin);\n if (target) latest.current.onDrop(origin.item, target);\n };\n\n const cancel = () => stop();\n\n /* Captured: the `Escape` that gives up a drag must not also close the dialog around it. */\n const escape = (keyEvent: KeyboardEvent) => {\n if (keyEvent.key !== 'Escape' || !origin.isStarted) return;\n keyEvent.preventDefault();\n keyEvent.stopPropagation();\n swallowNextClick();\n stop();\n };\n\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', end);\n window.addEventListener('pointercancel', cancel);\n window.addEventListener('keydown', escape, true);\n cleanupRef.current = stop;\n },\n // `targetAt` reads the box and the bounds through refs at the moment of the event.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n /* A calendar unmounted mid-drag leaves no listener behind. */\n useEffect(() => () => cleanupRef.current?.(), []);\n\n const isClickSwallowed = useCallback(() => isSwallowingRef.current, []);\n\n return { preview, begin, isClickSwallowed };\n};\n\nexport default useCalendarDrag;\n","'use client';\n\nimport {\n type CSSProperties,\n type KeyboardEvent,\n memo,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n} from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { PlacedEvent } from '../core/layout';\nimport { minutesOf, timeRange, toTime } from '../core/time';\nimport type { CalendarEvent } from '../core/types';\n\nimport styles from './index.module.scss';\n\nexport type EventHandlers = {\n onPointerDown: (item: PlacedEvent, event: PointerEvent, isResize: boolean) => void;\n onClick: (item: PlacedEvent, event: MouseEvent) => void;\n onKeyDown: (item: PlacedEvent, event: KeyboardEvent) => void;\n onFocus: (item: PlacedEvent) => void;\n};\n\ntype Props = {\n item: PlacedEvent;\n view: 'time' | 'month';\n /** The one event of the calendar in the tab order (roving `tabindex`). */\n isActive: boolean;\n /** Being dragged: the source keeps its place, marked, while the preview travels. */\n isDragSource: boolean;\n /** Can be resized with the pointer (time grid, movable, a change handler given). */\n isResizable: boolean;\n /** Time grid: the drawn hours, for the position in the column. */\n rangeStart: number;\n rangeLength: number;\n /** The day (and resource) of the column, read after the event. */\n columnLabel: string;\n cancelledLabel: string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n handlers: EventHandlers;\n};\n\n/** Percentages of the column for the time grid; the month cell lists its events instead. */\nconst placement = (item: PlacedEvent, rangeStart: number, rangeLength: number): CSSProperties =>\n ({\n '--ui-calendar-top': `${((item.startMin - rangeStart) / rangeLength) * 100}%`,\n '--ui-calendar-height': `${((item.endMin - item.startMin) / rangeLength) * 100}%`,\n '--ui-calendar-lane': item.lane,\n '--ui-calendar-lanes': item.lanes,\n }) as CSSProperties;\n\n/**\n * One event: a button (Enter opens it), its time and its body, the day of its column read after\n * it. A struck-through title is not the only sign of a cancelled event: the \"cancelled\" text is\n * read first.\n */\nconst EventBlock = ({\n item,\n view,\n isActive,\n isDragSource,\n isResizable,\n rangeStart,\n rangeLength,\n columnLabel,\n cancelledLabel,\n renderEvent,\n handlers,\n}: Props) => {\n const { event } = item;\n const time =\n view === 'time'\n ? timeRange(minutesOf(event.start), minutesOf(event.end))\n : toTime(minutesOf(event.start));\n\n return (\n <button\n type=\"button\"\n className={cx(\n styles.event,\n styles[`event--${view}`],\n styles[`event--${event.tone ?? 'primary'}`],\n event.isCancelled && styles['event--cancelled'],\n item.isMovable && styles['event--movable'],\n isDragSource && styles['event--dragging'],\n )}\n style={view === 'time' ? placement(item, rangeStart, rangeLength) : undefined}\n tabIndex={isActive ? 0 : -1}\n data-key={item.key}\n onPointerDown={pointerEvent => handlers.onPointerDown(item, pointerEvent, false)}\n onClick={mouseEvent => handlers.onClick(item, mouseEvent)}\n onKeyDown={keyEvent => handlers.onKeyDown(item, keyEvent)}\n onFocus={() => handlers.onFocus(item)}\n >\n {event.isCancelled && <span className={styles.srOnly}>{`${cancelledLabel}: `}</span>}\n <span className={styles.event__time}>{time}</span>\n <span className={styles.event__body}>{renderEvent ? renderEvent(event) : event.title}</span>\n <span className={styles.srOnly}>{`, ${columnLabel}`}</span>\n {isResizable && (\n <span\n className={styles.event__handle}\n aria-hidden\n onPointerDown={pointerEvent => {\n pointerEvent.stopPropagation();\n handlers.onPointerDown(item, pointerEvent, true);\n }}\n />\n )}\n </button>\n );\n};\n\nexport default /*#__PURE__*/ memo(EventBlock);\n","'use client';\n\nimport { type CSSProperties, type ReactNode, type RefObject } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { PlacedEvent } from '../core/layout';\nimport type { CalendarDay, CalendarEvent } from '../core/types';\nimport type { DragPreview } from '../core/useCalendarDrag';\n\nimport EventBlock, { type EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\n\ntype Props = {\n days: readonly CalendarDay[];\n /** The events of each day, already cut to the ones the cell shows. */\n shown: readonly (readonly PlacedEvent[])[];\n /** How many more events each day has than it shows. */\n hiddenCounts: readonly number[];\n weekdays?: readonly string[];\n selectedDate?: string;\n bodyRef: RefObject<HTMLDivElement | null>;\n activeKey: string | undefined;\n preview: DragPreview | null;\n cancelledLabel: string;\n formatMore: (count: number) => string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n handlers: EventHandlers;\n onDaySelect?: (date: string) => void;\n};\n\nconst WEEK = 7;\n\n/**\n * The month — a cell per day, seven to a row, each listing its first events in time order and a\n * \"+N\" for the rest. The day number opens the day (`onDaySelect`), so does the \"+N\".\n */\nconst MonthGrid = ({\n days,\n shown,\n hiddenCounts,\n weekdays,\n selectedDate,\n bodyRef,\n activeKey,\n preview,\n cancelledLabel,\n formatMore,\n renderEvent,\n handlers,\n onDaySelect,\n}: Props) => (\n <div\n className={styles.month}\n style={{ '--ui-calendar-rows': Math.ceil(days.length / WEEK) } as CSSProperties}\n >\n {weekdays && (\n /* Each cell is named by its full day; the row of weekday names is for the eye. */\n <div className={styles.weekdays} aria-hidden>\n {weekdays.map(weekday => (\n <span key={weekday}>{weekday}</span>\n ))}\n </div>\n )}\n <div ref={bodyRef} className={styles.cells}>\n {days.map((day, index) => {\n const hidden = hiddenCounts[index];\n const dayText = day.shortLabel ?? day.label;\n\n return (\n <div\n key={day.date}\n role=\"group\"\n aria-label={day.label}\n className={cx(\n styles.cell,\n day.isOff && styles['cell--off'],\n day.isOutside && styles['cell--outside'],\n preview?.target.column === index && styles['cell--target'],\n )}\n >\n {onDaySelect ? (\n <button\n type=\"button\"\n className={cx(styles.cell__day, day.isToday && styles['cell__day--today'])}\n aria-label={day.label}\n aria-current={day.isToday ? 'date' : undefined}\n aria-pressed={selectedDate === undefined ? undefined : day.date === selectedDate}\n onClick={() => onDaySelect(day.date)}\n >\n {dayText}\n </button>\n ) : (\n <span\n className={cx(styles.cell__day, day.isToday && styles['cell__day--today'])}\n aria-hidden\n >\n {dayText}\n </span>\n )}\n {shown[index].map(item => (\n <EventBlock\n key={item.key}\n item={item}\n view=\"month\"\n isActive={item.key === activeKey}\n isDragSource={item.key === preview?.key}\n isResizable={false}\n rangeStart={0}\n rangeLength={1}\n columnLabel={day.label}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n handlers={handlers}\n />\n ))}\n {hidden > 0 &&\n (onDaySelect ? (\n <button\n type=\"button\"\n className={styles.cell__more}\n onClick={() => onDaySelect(day.date)}\n >\n {formatMore(hidden)}\n </button>\n ) : (\n <span className={styles.cell__more}>{formatMore(hidden)}</span>\n ))}\n </div>\n );\n })}\n </div>\n </div>\n);\n\nexport default MonthGrid;\n","'use client';\n\nimport {\n type CSSProperties,\n type DragEvent,\n type MouseEvent,\n type ReactNode,\n type RefObject,\n} from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport type { CalendarColumn, PlacedBand, PlacedEvent } from '../core/layout';\nimport { clamp, timeRange, toTime, toWall } from '../core/time';\nimport type { CalendarDay, CalendarEvent, CalendarResource, CalendarSlot } from '../core/types';\nimport type { DragPreview } from '../core/useCalendarDrag';\n\nimport EventBlock, { type EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\n\ntype Props = {\n label: string;\n days: readonly CalendarDay[];\n resources?: readonly CalendarResource[];\n columns: readonly CalendarColumn[];\n bands: readonly PlacedBand[];\n placed: readonly (readonly PlacedEvent[])[];\n rangeStart: number;\n rangeEnd: number;\n slotMinutes: number;\n bodyRef: RefObject<HTMLDivElement | null>;\n activeKey: string | undefined;\n preview: DragPreview | null;\n isEditable: boolean;\n cancelledLabel: string;\n renderEvent?: (event: CalendarEvent) => ReactNode;\n renderResource?: (resource: CalendarResource) => ReactNode;\n handlers: EventHandlers;\n /** True for the click that ends a drag: released on an empty slot, it is not a new event. */\n isClickSwallowed: () => boolean;\n onSlotSelect?: (slot: CalendarSlot) => void;\n onExternalDrop?: (drop: CalendarSlot & { data: string }) => void;\n};\n\n/** The header of a day: the short text shown, the full name read. */\nconst DayHeader = ({ day, span }: { day: CalendarDay; span: number }) => (\n <div\n className={cx(styles.header, day.isToday && styles['header--today'])}\n style={{ gridColumn: `span ${span}` }}\n aria-current={day.isToday ? 'date' : undefined}\n >\n {day.shortLabel ? (\n <>\n <span aria-hidden>{day.shortLabel}</span>\n <span className={styles.srOnly}>{day.label}</span>\n </>\n ) : (\n day.label\n )}\n </div>\n);\n\n/** The header of a resource column: its label and detail, tinted by its tone. */\nconst ResourceHeader = ({\n resource,\n renderResource,\n}: {\n resource: CalendarResource;\n renderResource?: (resource: CalendarResource) => ReactNode;\n}) => (\n <div\n className={cx(styles.resource, resource.tone && styles[`resource--${resource.tone}`])}\n data-tone={resource.tone}\n >\n {renderResource ? (\n renderResource(resource)\n ) : (\n <>\n {resource.label}\n {resource.detail && <span className={styles.resource__detail}>{resource.detail}</span>}\n </>\n )}\n </div>\n);\n\n/**\n * The time grid — days (and their resources) as columns, the drawn hours as rows. Events sit at\n * their time; overlapping ones share the column side by side. One scroll box: the headers stay\n * on top and the hours on the left while it scrolls both ways.\n */\nconst TimeGrid = ({\n label,\n days,\n resources,\n columns,\n bands,\n placed,\n rangeStart,\n rangeEnd,\n slotMinutes,\n bodyRef,\n activeKey,\n preview,\n isEditable,\n cancelledLabel,\n renderEvent,\n renderResource,\n handlers,\n isClickSwallowed,\n onSlotSelect,\n onExternalDrop,\n}: Props) => {\n const rangeLength = rangeEnd - rangeStart;\n const resourceCount = resources?.length ?? 0;\n const hasResources = resourceCount > 0;\n const hours = Array.from(\n { length: Math.floor((rangeEnd - 1) / 60) - Math.ceil(rangeStart / 60) + 1 },\n (_, index) => (Math.ceil(rangeStart / 60) + index) * 60,\n );\n /** A length of minutes as a share of the drawn hours; `percent(t)` is where time `t` sits. */\n const share = (minutes: number) => `${(minutes / rangeLength) * 100}%`;\n const percent = (minutes: number) => share(minutes - rangeStart);\n const previewItem = preview ? placed.flat().find(item => item.key === preview.key) : undefined;\n\n /** The slot under a pointer in a column, snapped down to the slot. */\n const slotAt = (column: CalendarColumn, element: HTMLElement, clientY: number): CalendarSlot => {\n const box = element.getBoundingClientRect();\n const ratio = box.height > 0 ? clamp((clientY - box.top) / box.height, 0, 1) : 0;\n const minutes = Math.floor((ratio * rangeLength) / slotMinutes) * slotMinutes;\n const start = clamp(rangeStart + minutes, rangeStart, rangeEnd - slotMinutes);\n\n return {\n start: toWall(column.day.date, start),\n end: toWall(column.day.date, start + slotMinutes),\n resourceId: column.resource?.id,\n };\n };\n\n const style = {\n '--ui-calendar-columns': columns.length,\n '--ui-calendar-hours': rangeLength / 60,\n '--ui-calendar-slot-ratio': slotMinutes / 60,\n } as CSSProperties;\n\n return (\n /*\n * With no event to focus, the scroll box itself takes the focus (2.1.1): the hours past the\n * fold are reached with the arrow keys of the box.\n */\n <div\n className={styles.scroller}\n {...(placed.some(list => list.length > 0)\n ? {}\n : { tabIndex: 0, role: 'region', 'aria-label': label })}\n >\n <div className={cx(styles.time, bands.length > 0 && styles['time--bands'])} style={style}>\n <div className={styles.corner} />\n <div className={styles.headers}>\n {days.map(day => (\n <DayHeader key={day.date} day={day} span={hasResources ? resourceCount : 1} />\n ))}\n {hasResources &&\n columns.map(column => (\n <ResourceHeader\n key={column.index}\n resource={column.resource as CalendarResource}\n renderResource={renderResource}\n />\n ))}\n </div>\n\n <div className={styles.gutter} aria-hidden>\n {hours.map(minutes => (\n <span key={minutes} className={styles.gutter__hour} style={{ top: percent(minutes) }}>\n {toTime(minutes)}\n </span>\n ))}\n {bands.map(band => (\n <span\n key={band.key}\n className={styles.gutter__band}\n style={{ top: percent(band.startMin), height: share(band.endMin - band.startMin) }}\n >\n {band.label}\n </span>\n ))}\n </div>\n\n <div ref={bodyRef} className={styles.columns}>\n {columns.map(column => (\n <div\n key={column.index}\n role=\"group\"\n aria-label={column.label}\n className={cx(styles.column, column.day.isOff && styles['column--off'])}\n onClick={\n onSlotSelect\n ? (event: MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget || isClickSwallowed()) return;\n onSlotSelect(slotAt(column, event.currentTarget, event.clientY));\n }\n : undefined\n }\n onDragOver={\n onExternalDrop\n ? (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n }\n : undefined\n }\n onDrop={\n onExternalDrop\n ? (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n onExternalDrop({\n ...slotAt(column, event.currentTarget, event.clientY),\n data: event.dataTransfer.getData('text/plain'),\n });\n }\n : undefined\n }\n >\n {bands.map((band, index) => (\n <div\n key={band.key}\n className={cx(styles.band, index % 2 === 1 && styles['band--alternate'])}\n style={{\n top: percent(band.startMin),\n height: share(band.endMin - band.startMin),\n }}\n aria-hidden\n />\n ))}\n {placed[column.index].map(item => (\n <EventBlock\n key={item.key}\n item={item}\n view=\"time\"\n isActive={item.key === activeKey}\n isDragSource={item.key === preview?.key}\n isResizable={isEditable && item.isMovable}\n rangeStart={rangeStart}\n rangeLength={rangeLength}\n columnLabel={column.label}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n handlers={handlers}\n />\n ))}\n {preview && previewItem && preview.target.column === column.index && (\n <div\n className={styles.preview}\n style={\n {\n '--ui-calendar-top': percent(preview.target.startMin),\n '--ui-calendar-height': `${((preview.target.endMin - preview.target.startMin) / rangeLength) * 100}%`,\n } as CSSProperties\n }\n aria-hidden\n >\n {timeRange(preview.target.startMin, preview.target.endMin)}\n <span className={styles.preview__title}>{previewItem.event.title}</span>\n </div>\n )}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\nexport default TimeGrid;\n","'use client';\n\nimport {\n type KeyboardEvent,\n memo,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useAnnounce, useUi } from '@handijitcom/ui';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { resolveFormatter, resolveLabel } from '../../helpers/label.helper';\nimport {\n buildColumns,\n placeBands,\n type PlacedEvent,\n placeMonthEvents,\n placeTimeEvents,\n} from '../core/layout';\nimport {\n type CalendarTarget,\n type CalendarView,\n changeOf,\n isArrowKey,\n keyboardTarget,\n type MoveBounds,\n neighbourOf,\n} from '../core/moves';\nimport { timeRange, toMinutes } from '../core/time';\nimport type {\n CalendarBand,\n CalendarDay,\n CalendarEvent,\n CalendarEventChange,\n CalendarResource,\n CalendarSlot,\n} from '../core/types';\nimport useCalendarDrag from '../core/useCalendarDrag';\n\nimport type { EventHandlers } from './EventBlock';\nimport styles from './index.module.scss';\nimport MonthGrid from './MonthGrid';\nimport TimeGrid from './TimeGrid';\n\ntype Props = {\n /** The calendar's accessible name (\"Ders planı\"). */\n label: string;\n /** The days to draw, in order — computed by the caller (the caller owns day arithmetic). */\n days: readonly CalendarDay[];\n events: readonly CalendarEvent[];\n /** `time` (default): days as columns, hours as rows — day and week. `month`: day cells. */\n view?: CalendarView;\n /**\n * Time grid: a column per resource under every day (teacher, room, technician). A resource's\n * `detail` is a second header line and its `tone` tints the header (a full day: `warning`).\n */\n resources?: readonly CalendarResource[];\n /** Time grid (2.5): the header of a resource column; its label and detail by default. */\n renderResource?: (resource: CalendarResource) => ReactNode;\n /**\n * Time grid (2.5): named stretches of the day (\"Sabah\", \"Öğle\", \"Akşam\") drawn beside the hours\n * and shaded across the columns, under the events and the hour blocks.\n */\n bands?: readonly CalendarBand[];\n /** Time grid: the first drawn hour, `HH:MM`. */\n startTime?: string;\n /** Time grid: the end of the drawn hours, `HH:MM` (at most \"24:00\"). */\n endTime?: string;\n /** Time grid: the snap of a move, a resize and a keyboard step, and the grid lines (minutes). */\n slotMinutes?: number;\n /** Month: the weekday names over the columns (\"Pzt\" … \"Paz\"). */\n weekdays?: readonly string[];\n /** Month: how many events a day cell lists before its \"+N\". */\n maxEventsPerDay?: number;\n /** Month: the day whose list the caller shows beside the calendar (`aria-pressed`). */\n selectedDate?: string;\n /**\n * An event dropped, stretched or moved with the keyboard. Without it the calendar only shows\n * and opens. The calendar is controlled: the move stands once `events` carries it, and a\n * refused move (a conflict) is simply not applied — say why in a toast.\n */\n onEventChange?: (change: CalendarEventChange) => void;\n /** Enter or a click on an event. */\n onEventOpen?: (id: string) => void;\n /** Time grid: a click on an empty slot (a new lesson there). */\n onSlotSelect?: (slot: CalendarSlot) => void;\n /** Month: the day number or the \"+N\" of a cell. */\n onDaySelect?: (date: string) => void;\n /**\n * Time grid: something dragged in from outside (an unassigned job of a pool) and dropped on a\n * slot; `data` is its `text/plain` drag data.\n */\n onExternalDrop?: (drop: CalendarSlot & { data: string }) => void;\n /** The body of an event under its time; its title by default. */\n renderEvent?: (event: CalendarEvent) => ReactNode;\n className?: string;\n testId?: string;\n};\n\nconst DEFAULT_MAX_PER_DAY = 3;\n\ntype Pending = { key: string; before: CalendarEvent };\n\n/**\n * Calendar (2.4) — the base of a scheduling screen: a time grid of days or of days and\n * resources, or a month; events moved and stretched with the pointer and with the keyboard.\n *\n * Keyboard: Tab reaches ONE event (roving `tabindex`; 500 lessons are not 500 tab stops);\n * ← ↑ → ↓ go to the neighbouring event; Enter opens it; ⌘/Ctrl + an arrow moves it one slot or\n * one column (month: a day or a week); ⌘/Ctrl ⇧ ↑ ↓ shortens or lengthens it. The move is\n * announced once `events` carries it. A short event can be smaller than the 44px touch target:\n * its size is its duration, and every pointer action has the keyboard way above.\n */\nconst Calendar = ({\n label,\n days,\n events,\n view = 'time',\n resources,\n renderResource,\n bands,\n startTime = '08:00',\n endTime = '20:00',\n slotMinutes = 30,\n weekdays,\n maxEventsPerDay = DEFAULT_MAX_PER_DAY,\n selectedDate,\n onEventChange,\n onEventOpen,\n onSlotSelect,\n onDaySelect,\n onExternalDrop,\n renderEvent,\n className,\n testId,\n}: Props) => {\n const { labels } = useUi();\n const announce = useAnnounce();\n const instructionsId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const [activeKey, setActiveKey] = useState<string>();\n const pendingRef = useRef<Pending | null>(null);\n\n const isEditable = Boolean(onEventChange);\n const rangeStart = toMinutes(startTime);\n const rangeEnd = toMinutes(endTime);\n\n const columns = useMemo(() => buildColumns(days, resources), [days, resources]);\n const placedBands = useMemo(\n () => placeBands(bands, rangeStart, rangeEnd),\n [bands, rangeStart, rangeEnd],\n );\n const placed = useMemo(\n () =>\n view === 'time'\n ? placeTimeEvents(events, columns, rangeStart, rangeEnd, isEditable)\n : placeMonthEvents(events, days, isEditable),\n [view, events, columns, days, rangeStart, rangeEnd, isEditable],\n );\n /* The month shows the first events of a day; the rest are behind \"+N\" and out of the tab order. */\n const focusable = useMemo(\n () => (view === 'month' ? placed.map(list => list.slice(0, maxEventsPerDay)) : placed),\n [view, placed, maxEventsPerDay],\n );\n\n const bounds: MoveBounds = {\n view,\n columnCount: view === 'time' ? columns.length : days.length,\n rangeStart,\n rangeEnd,\n slotMinutes,\n };\n\n const items = focusable.flat();\n const tabbableKey = items.some(item => item.key === activeKey) ? activeKey : items[0]?.key;\n\n const columnLabel = (item: PlacedEvent) =>\n view === 'time' ? columns[item.column].label : days[item.column].label;\n\n /* The latest props for the stable handlers the memoised events hold. */\n const latest = useRef({ view, columns, days, onEventChange, onEventOpen, focusable, bounds });\n latest.current = { view, columns, days, onEventChange, onEventOpen, focusable, bounds };\n\n const apply = useCallback((item: PlacedEvent, target: CalendarTarget) => {\n const current = latest.current;\n const change = changeOf(item, target, current.view, current.columns, current.days);\n if (!change || !current.onEventChange) return undefined;\n current.onEventChange(change);\n\n return change;\n }, []);\n\n const drag = useCalendarDrag({ bodyRef, bounds, onDrop: apply });\n\n const focusKey = (key: string) => {\n /* Only called from the calendar's own handlers and effect: the root is there. */\n const root = rootRef.current as HTMLDivElement;\n const element = [...root.querySelectorAll<HTMLElement>('[data-key]')].find(\n candidate => candidate.dataset.key === key,\n );\n element?.focus();\n };\n\n const handlers = useMemo<EventHandlers>(\n () => ({\n onPointerDown: (item: PlacedEvent, event: PointerEvent, isResize: boolean) => {\n pendingRef.current = null;\n if (latest.current.onEventChange) drag.begin(item, event, isResize);\n },\n onClick: (item: PlacedEvent, _event: MouseEvent) => {\n if (drag.isClickSwallowed()) return;\n latest.current.onEventOpen?.(item.event.id);\n },\n onFocus: (item: PlacedEvent) => setActiveKey(item.key),\n onKeyDown: (item: PlacedEvent, event: KeyboardEvent) => {\n pendingRef.current = null;\n if (!isArrowKey(event.key)) return;\n const current = latest.current;\n\n if (event.metaKey || event.ctrlKey) {\n event.preventDefault();\n if (!item.isMovable) return;\n const target = keyboardTarget(item, event.key, event.shiftKey, current.bounds);\n if (!target) return;\n pendingRef.current = {\n key: `${item.event.id}@${target.column}`,\n before: item.event,\n };\n if (!apply(item, target)) pendingRef.current = null;\n return;\n }\n\n const next = neighbourOf(current.focusable, item, event.key);\n if (!next) return;\n event.preventDefault();\n setActiveKey(next.key);\n focusKey(next.key);\n },\n }),\n // `drag.begin` and `drag.isClickSwallowed` are stable; the rest is read through `latest`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [apply],\n );\n\n /*\n * A keyboard move stands once `events` carries it: the focus follows the event into its new\n * column (its button there is a new element) and the new place is announced.\n */\n useEffect(() => {\n const pending = pendingRef.current;\n if (!pending) return;\n const item = placed.flat().find(candidate => candidate.key === pending.key);\n const { before } = pending;\n const isMoved =\n item !== undefined &&\n (item.event.start !== before.start ||\n item.event.end !== before.end ||\n item.event.resourceId !== before.resourceId);\n if (!isMoved) return;\n\n pendingRef.current = null;\n setActiveKey(item.key);\n focusKey(item.key);\n announce(\n resolveFormatter(\n 'Calendar.moved',\n labels?.calendar?.moved,\n item.event.title,\n `${columnLabel(item)}, ${timeRange(item.startMin, item.endMin)}`,\n ),\n );\n // Runs when the events change: that is when a move stands.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [events]);\n\n const cancelledLabel = resolveLabel('Calendar.cancelled', labels?.calendar?.cancelled);\n const instructions = resolveLabel('Calendar.instructions', labels?.calendar?.instructions);\n\n return (\n <div\n ref={rootRef}\n className={cx(styles.calendar, className)}\n role=\"group\"\n aria-label={label}\n aria-describedby={instructionsId}\n data-testid={testId}\n >\n <span id={instructionsId} className={styles.srOnly}>\n {instructions}\n </span>\n {view === 'time' ? (\n <TimeGrid\n label={label}\n days={days}\n resources={resources}\n columns={columns}\n bands={placedBands}\n placed={placed}\n rangeStart={rangeStart}\n rangeEnd={rangeEnd}\n slotMinutes={slotMinutes}\n bodyRef={bodyRef}\n activeKey={tabbableKey}\n preview={drag.preview}\n isEditable={isEditable}\n cancelledLabel={cancelledLabel}\n renderEvent={renderEvent}\n renderResource={renderResource}\n handlers={handlers}\n isClickSwallowed={drag.isClickSwallowed}\n onSlotSelect={onSlotSelect}\n onExternalDrop={onExternalDrop}\n />\n ) : (\n <MonthGrid\n days={days}\n shown={focusable}\n hiddenCounts={placed.map((list, index) => list.length - focusable[index].length)}\n weekdays={weekdays}\n selectedDate={selectedDate}\n bodyRef={bodyRef}\n activeKey={tabbableKey}\n preview={drag.preview}\n cancelledLabel={cancelledLabel}\n formatMore={count => resolveFormatter('Calendar.more', labels?.calendar?.more, count)}\n renderEvent={renderEvent}\n handlers={handlers}\n onDaySelect={onDaySelect}\n />\n )}\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Calendar, 'Calendar')) as typeof Calendar;\n"],"names":["cx","values","result","value","named","component","displayName","warned","resolveLabel","key","resolveFormatter","formatter","args","MINUTES_PER_DAY","toMinutes","time","hours","minutes","toTime","dateOf","wall","minutesOf","toWall","date","timeRange","start","end","clamp","low","high","columnKey","resourceId","buildColumns","days","resources","day","dayIndex","resource","resourceIndex","index","covers","event","startDate","endDate","isSameDay","assignLanes","items","a","b","cluster","laneEnds","clusterEnd","close","item","free","laneEnd","placeTimeEvents","events","columns","rangeStart","rangeEnd","isEditable","byKey","column","_a","hasResources","placed","place","placeMonthEvents","byDate","cell","placeBands","bands","band","startMin","endMin","targetOf","isResize","deltaMinutes","bounds","shortest","duration","changeOf","target","view","isArrowKey","neighbourOf","lists","from","list","step","best","keyboardTarget","isVertical","direction","DRAG_THRESHOLD","WEEK","useCalendarDrag","bodyRef","onDrop","preview","setPreview","useState","cleanupRef","useRef","isSwallowingRef","latest","targetAt","origin","box","current","minutesPerPixel","delta","rows","row","begin","useCallback","stop","move","cancel","escape","swallowNextClick","moveEvent","travelled","upEvent","keyEvent","useEffect","isClickSwallowed","placement","rangeLength","EventBlock","isActive","isDragSource","isResizable","columnLabel","cancelledLabel","renderEvent","handlers","jsxs","styles","pointerEvent","mouseEvent","jsx","MonthGrid","shown","hiddenCounts","weekdays","selectedDate","activeKey","formatMore","onDaySelect","weekday","hidden","dayText","DayHeader","span","Fragment","ResourceHeader","renderResource","TimeGrid","label","slotMinutes","onSlotSelect","onExternalDrop","resourceCount","_","share","percent","previewItem","slotAt","element","clientY","ratio","style","DEFAULT_MAX_PER_DAY","Calendar","startTime","endTime","maxEventsPerDay","onEventChange","onEventOpen","className","testId","labels","useUi","announce","useAnnounce","instructionsId","useId","rootRef","setActiveKey","pendingRef","useMemo","placedBands","focusable","tabbableKey","apply","change","drag","focusKey","candidate","_event","_b","next","pending","before","instructions","_c","count","memo"],"mappings":"mLAGaA,EAAK,IAAIC,IAAiC,CACrD,IAAIC,EAAS,GAEb,UAAWC,KAASF,EACbE,IACLD,EAASA,IAAW,GAAKC,EAAQ,GAAGD,CAAM,IAAIC,CAAK,IAGrD,OAAOD,CACT,ECAaE,GAAQ,CACnBC,EACAC,IACe,OAAO,OAAOD,EAAW,CAAE,YAAAC,EAAa,ECVnDC,OAAa,IAUNC,GAAe,CAACC,KAAgBR,IAA2C,CACtF,UAAWE,KAASF,EAAQ,GAAIE,IAAU,OAAW,OAAOA,EAE5D,OAAI,QAAQ,IAAI,WAAa,cAAgB,CAACI,GAAO,IAAIE,CAAG,IAC1DF,GAAO,IAAIE,CAAG,EACd,QAAQ,MACN,kCAAkCA,CAAG,kIAAA,GAMlC,EACT,EAGaC,GAAmB,CAC9BD,EACAE,KACGC,IAECD,EAAkBA,EAAU,GAAGC,CAAI,EAEhCJ,GAAaC,CAAG,EChCZI,GAAkB,KAGlB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