@cratis/components 4.40.0 → 4.41.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 (160) hide show
  1. package/compat-manifest.json +13 -13
  2. package/dist/esm/Chat/Kit/Emoji/EmojiOptions.d.ts +13 -0
  3. package/dist/esm/Chat/Kit/Emoji/EmojiOptions.d.ts.map +1 -0
  4. package/dist/esm/Chat/Kit/Emoji/EmojiOptions.js +12 -0
  5. package/dist/esm/Chat/Kit/Emoji/EmojiOptions.js.map +1 -0
  6. package/dist/esm/Chat/Kit/Emoji/EmojiPicker.d.ts +2 -2
  7. package/dist/esm/Chat/Kit/Emoji/EmojiPicker.d.ts.map +1 -1
  8. package/dist/esm/Chat/Kit/Emoji/EmojiPicker.js +7 -9
  9. package/dist/esm/Chat/Kit/Emoji/EmojiPicker.js.map +1 -1
  10. package/dist/esm/Chat/Kit/Emoji/movePickerFocus.d.ts +4 -0
  11. package/dist/esm/Chat/Kit/Emoji/movePickerFocus.d.ts.map +1 -0
  12. package/dist/esm/Chat/Kit/Emoji/movePickerFocus.js +21 -0
  13. package/dist/esm/Chat/Kit/Emoji/movePickerFocus.js.map +1 -0
  14. package/dist/esm/Chat/Kit/Emoji/useEmojiPickerFocus.d.ts +3 -0
  15. package/dist/esm/Chat/Kit/Emoji/useEmojiPickerFocus.d.ts.map +1 -0
  16. package/dist/esm/Chat/Kit/Emoji/useEmojiPickerFocus.js +15 -0
  17. package/dist/esm/Chat/Kit/Emoji/useEmojiPickerFocus.js.map +1 -0
  18. package/dist/esm/Chat/Kit/ReactionPicker.d.ts.map +1 -1
  19. package/dist/esm/Chat/Kit/ReactionPicker.js +8 -22
  20. package/dist/esm/Chat/Kit/ReactionPicker.js.map +1 -1
  21. package/dist/esm/Chat/Kit/useReactionPickerFocus.d.ts +7 -0
  22. package/dist/esm/Chat/Kit/useReactionPickerFocus.d.ts.map +1 -0
  23. package/dist/esm/Chat/Kit/useReactionPickerFocus.js +28 -0
  24. package/dist/esm/Chat/Kit/useReactionPickerFocus.js.map +1 -0
  25. package/dist/esm/CommandForm/fields/CalendarField.d.ts +2 -0
  26. package/dist/esm/CommandForm/fields/CalendarField.d.ts.map +1 -1
  27. package/dist/esm/CommandForm/fields/CalendarField.js +1 -1
  28. package/dist/esm/CommandForm/fields/CalendarField.js.map +1 -1
  29. package/dist/esm/Common/DatePickerButtonBar.d.ts +15 -0
  30. package/dist/esm/Common/DatePickerButtonBar.d.ts.map +1 -0
  31. package/dist/esm/Common/DatePickerButtonBar.js +17 -0
  32. package/dist/esm/Common/DatePickerButtonBar.js.map +1 -0
  33. package/dist/esm/Common/DatePickerCalendar.d.ts +8 -0
  34. package/dist/esm/Common/DatePickerCalendar.d.ts.map +1 -0
  35. package/dist/esm/Common/DatePickerCalendar.js +29 -0
  36. package/dist/esm/Common/DatePickerCalendar.js.map +1 -0
  37. package/dist/esm/Common/DatePickerDateInput.d.ts +14 -0
  38. package/dist/esm/Common/DatePickerDateInput.d.ts.map +1 -0
  39. package/dist/esm/Common/DatePickerDateInput.js +9 -0
  40. package/dist/esm/Common/DatePickerDateInput.js.map +1 -0
  41. package/dist/esm/Common/DatePickerGroup.d.ts +21 -0
  42. package/dist/esm/Common/DatePickerGroup.d.ts.map +1 -0
  43. package/dist/esm/Common/DatePickerGroup.js +10 -0
  44. package/dist/esm/Common/DatePickerGroup.js.map +1 -0
  45. package/dist/esm/Common/DatePickerInput.d.ts +2 -0
  46. package/dist/esm/Common/DatePickerInput.d.ts.map +1 -1
  47. package/dist/esm/Common/DatePickerInput.js.map +1 -1
  48. package/dist/esm/Common/DatePickerInputImplementation.d.ts +1 -1
  49. package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
  50. package/dist/esm/Common/DatePickerInputImplementation.js +35 -91
  51. package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
  52. package/dist/esm/Common/DatePickerPopover.d.ts +13 -0
  53. package/dist/esm/Common/DatePickerPopover.d.ts.map +1 -0
  54. package/dist/esm/Common/DatePickerPopover.js +11 -0
  55. package/dist/esm/Common/DatePickerPopover.js.map +1 -0
  56. package/dist/esm/Common/Page.d.ts +2 -0
  57. package/dist/esm/Common/Page.d.ts.map +1 -1
  58. package/dist/esm/Common/Page.js +3 -2
  59. package/dist/esm/Common/Page.js.map +1 -1
  60. package/dist/esm/Common/datePickerStateAttributes.d.ts +38 -0
  61. package/dist/esm/Common/datePickerStateAttributes.d.ts.map +1 -0
  62. package/dist/esm/Common/datePickerStateAttributes.js +26 -0
  63. package/dist/esm/Common/datePickerStateAttributes.js.map +1 -0
  64. package/dist/esm/Common/datePickerValues.d.ts +11 -0
  65. package/dist/esm/Common/datePickerValues.d.ts.map +1 -0
  66. package/dist/esm/Common/datePickerValues.js +23 -0
  67. package/dist/esm/Common/datePickerValues.js.map +1 -0
  68. package/dist/esm/Common/toolbarFocusQueries.d.ts +13 -0
  69. package/dist/esm/Common/toolbarFocusQueries.d.ts.map +1 -0
  70. package/dist/esm/Common/toolbarFocusQueries.js +46 -0
  71. package/dist/esm/Common/toolbarFocusQueries.js.map +1 -0
  72. package/dist/esm/Common/toolbarNavigationCandidates.d.ts +7 -0
  73. package/dist/esm/Common/toolbarNavigationCandidates.d.ts.map +1 -0
  74. package/dist/esm/Common/toolbarNavigationCandidates.js +44 -0
  75. package/dist/esm/Common/toolbarNavigationCandidates.js.map +1 -0
  76. package/dist/esm/Common/toolbarTabStop.d.ts +28 -0
  77. package/dist/esm/Common/toolbarTabStop.d.ts.map +1 -0
  78. package/dist/esm/Common/toolbarTabStop.js +94 -0
  79. package/dist/esm/Common/toolbarTabStop.js.map +1 -0
  80. package/dist/esm/Common/useDatePickerAccessibility.d.ts +10 -0
  81. package/dist/esm/Common/useDatePickerAccessibility.d.ts.map +1 -0
  82. package/dist/esm/Common/useDatePickerAccessibility.js +14 -0
  83. package/dist/esm/Common/useDatePickerAccessibility.js.map +1 -0
  84. package/dist/esm/Common/useDatePickerState.d.ts +591 -0
  85. package/dist/esm/Common/useDatePickerState.d.ts.map +1 -0
  86. package/dist/esm/Common/useDatePickerState.js +78 -0
  87. package/dist/esm/Common/useDatePickerState.js.map +1 -0
  88. package/dist/esm/Common/useMicrotaskScheduler.d.ts +3 -0
  89. package/dist/esm/Common/useMicrotaskScheduler.d.ts.map +1 -0
  90. package/dist/esm/Common/useMicrotaskScheduler.js +17 -0
  91. package/dist/esm/Common/useMicrotaskScheduler.js.map +1 -0
  92. package/dist/esm/Common/useToolbarKeyboardNavigation.d.ts +1 -2
  93. package/dist/esm/Common/useToolbarKeyboardNavigation.d.ts.map +1 -1
  94. package/dist/esm/Common/useToolbarKeyboardNavigation.js +12 -211
  95. package/dist/esm/Common/useToolbarKeyboardNavigation.js.map +1 -1
  96. package/dist/esm/Common/useToolbarTabStop.d.ts +9 -0
  97. package/dist/esm/Common/useToolbarTabStop.d.ts.map +1 -0
  98. package/dist/esm/Common/useToolbarTabStop.js +81 -0
  99. package/dist/esm/Common/useToolbarTabStop.js.map +1 -0
  100. package/dist/esm/DataPage/DataPage.d.ts +2 -0
  101. package/dist/esm/DataPage/DataPage.d.ts.map +1 -1
  102. package/dist/esm/DataPage/DataPage.js +1 -1
  103. package/dist/esm/DataPage/DataPage.js.map +1 -1
  104. package/dist/esm/Dropdown/ComboBoxCommitBridge.d.ts +13 -0
  105. package/dist/esm/Dropdown/ComboBoxCommitBridge.d.ts.map +1 -0
  106. package/dist/esm/Dropdown/ComboBoxCommitBridge.js +16 -0
  107. package/dist/esm/Dropdown/ComboBoxCommitBridge.js.map +1 -0
  108. package/dist/esm/Dropdown/DropdownBranchProps.d.ts +10 -0
  109. package/dist/esm/Dropdown/DropdownBranchProps.d.ts.map +1 -0
  110. package/dist/esm/Dropdown/DropdownBranchProps.js +4 -0
  111. package/dist/esm/Dropdown/DropdownBranchProps.js.map +1 -0
  112. package/dist/esm/Dropdown/DropdownImplementation.d.ts +1 -2
  113. package/dist/esm/Dropdown/DropdownImplementation.d.ts.map +1 -1
  114. package/dist/esm/Dropdown/DropdownImplementation.js +16 -192
  115. package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
  116. package/dist/esm/Dropdown/DropdownOptionLists.d.ts +15 -0
  117. package/dist/esm/Dropdown/DropdownOptionLists.d.ts.map +1 -0
  118. package/dist/esm/Dropdown/DropdownOptionLists.js +12 -0
  119. package/dist/esm/Dropdown/DropdownOptionLists.js.map +1 -0
  120. package/dist/esm/Dropdown/DropdownParts.d.ts +46 -0
  121. package/dist/esm/Dropdown/DropdownParts.d.ts.map +1 -0
  122. package/dist/esm/Dropdown/DropdownParts.js +14 -0
  123. package/dist/esm/Dropdown/DropdownParts.js.map +1 -0
  124. package/dist/esm/Dropdown/FilterDropdown.d.ts +7 -0
  125. package/dist/esm/Dropdown/FilterDropdown.d.ts.map +1 -0
  126. package/dist/esm/Dropdown/FilterDropdown.js +31 -0
  127. package/dist/esm/Dropdown/FilterDropdown.js.map +1 -0
  128. package/dist/esm/Dropdown/MultipleSelectDropdown.d.ts +4 -0
  129. package/dist/esm/Dropdown/MultipleSelectDropdown.d.ts.map +1 -0
  130. package/dist/esm/Dropdown/MultipleSelectDropdown.js +23 -0
  131. package/dist/esm/Dropdown/MultipleSelectDropdown.js.map +1 -0
  132. package/dist/esm/Dropdown/SingleSelectDropdown.d.ts +4 -0
  133. package/dist/esm/Dropdown/SingleSelectDropdown.d.ts.map +1 -0
  134. package/dist/esm/Dropdown/SingleSelectDropdown.js +16 -0
  135. package/dist/esm/Dropdown/SingleSelectDropdown.js.map +1 -0
  136. package/dist/esm/Dropdown/SingleSelectTrigger.d.ts +4 -0
  137. package/dist/esm/Dropdown/SingleSelectTrigger.d.ts.map +1 -0
  138. package/dist/esm/Dropdown/SingleSelectTrigger.js +16 -0
  139. package/dist/esm/Dropdown/SingleSelectTrigger.js.map +1 -0
  140. package/dist/esm/Dropdown/dropdownAttributes.d.ts +867 -0
  141. package/dist/esm/Dropdown/dropdownAttributes.d.ts.map +1 -0
  142. package/dist/esm/Dropdown/dropdownAttributes.js +9 -0
  143. package/dist/esm/Dropdown/dropdownAttributes.js.map +1 -0
  144. package/dist/esm/Dropdown/renderTriggerWithOpenState.d.ts +4 -0
  145. package/dist/esm/Dropdown/renderTriggerWithOpenState.d.ts.map +1 -0
  146. package/dist/esm/Dropdown/renderTriggerWithOpenState.js +8 -0
  147. package/dist/esm/Dropdown/renderTriggerWithOpenState.js.map +1 -0
  148. package/dist/esm/Dropdown/resolveOptions.d.ts +12 -0
  149. package/dist/esm/Dropdown/resolveOptions.d.ts.map +1 -0
  150. package/dist/esm/Dropdown/resolveOptions.js +36 -0
  151. package/dist/esm/Dropdown/resolveOptions.js.map +1 -0
  152. package/dist/esm/Dropdown/useDropdownHandlers.d.ts +12 -0
  153. package/dist/esm/Dropdown/useDropdownHandlers.d.ts.map +1 -0
  154. package/dist/esm/Dropdown/useDropdownHandlers.js +50 -0
  155. package/dist/esm/Dropdown/useDropdownHandlers.js.map +1 -0
  156. package/dist/esm/Dropdown/useDropdownState.d.ts +28 -0
  157. package/dist/esm/Dropdown/useDropdownState.d.ts.map +1 -0
  158. package/dist/esm/Dropdown/useDropdownState.js +91 -0
  159. package/dist/esm/Dropdown/useDropdownState.js.map +1 -0
  160. package/package.json +6 -4
@@ -0,0 +1,8 @@
1
+ import type { DatePickerInputPassThrough } from './DatePickerInput.js';
2
+ interface DatePickerCalendarProps {
3
+ pt: DatePickerInputPassThrough | undefined;
4
+ }
5
+ /** The calendar of the date picker popover: month navigation header and day grid. */
6
+ export declare const DatePickerCalendar: ({ pt }: DatePickerCalendarProps) => import("react").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=DatePickerCalendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerCalendar.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerCalendar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAmB,CAAC;AAEpE,UAAU,uBAAuB;IAC7B,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAAC;CAC9C;AA8ED,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,WAAY,uBAAuB,gCAUjE,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Calendar, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, Button } from 'react-aria-components/DatePicker';
3
+ import { Heading } from 'react-aria-components/Heading';
4
+ import { useCratisIcon } from '../configuration/useCratisIcon.js';
5
+ import { classNames } from '../ClassNames/classNames.js';
6
+ import 'react';
7
+ import 'react-aria-components/I18nProvider';
8
+ import 'react-aria-components';
9
+ import 'ts-deepmerge';
10
+ import 'react-dom';
11
+ import { useCratisComponentsConfig } from '../configuration/CratisComponentsContext.js';
12
+ import '../Notifications/toast.js';
13
+ import '../renderer/RendererContext.js';
14
+ import { asReactAriaButtonProps } from './reactAriaProps.js';
15
+
16
+ const NavigationButton = ({ pt, slot, message, fallbackLabel, fallbackGlyph }) => {
17
+ const icon = useCratisIcon();
18
+ const part = pt?.[slot];
19
+ return (jsx(Button, { ...asReactAriaButtonProps(part), slot: slot, className: classNames('cratis-date-picker__nav', part?.className), "data-cratis-part": slot, "aria-label": part?.['aria-label'] ?? message ?? fallbackLabel, children: jsx("span", { "aria-hidden": 'true', children: icon(slot, fallbackGlyph) }) }));
20
+ };
21
+ const CalendarHeader = ({ pt }) => {
22
+ const datePickerMessages = useCratisComponentsConfig().messages?.datePicker;
23
+ return (jsxs("header", { ...pt?.header, className: classNames('cratis-date-picker__header', pt?.header?.className), "data-cratis-part": 'header', children: [jsx(NavigationButton, { pt: pt, slot: 'previous', message: datePickerMessages?.previousMonth, fallbackLabel: 'Previous month', fallbackGlyph: '\u2039' }), jsx(Heading, { ...pt?.heading, className: classNames('cratis-date-picker__heading', pt?.heading?.className), "data-cratis-part": 'heading' }), jsx(NavigationButton, { pt: pt, slot: 'next', message: datePickerMessages?.nextMonth, fallbackLabel: 'Next month', fallbackGlyph: '\u203A' })] }));
24
+ };
25
+ const CalendarMonthGrid = ({ pt }) => (jsxs(CalendarGrid, { ...pt?.grid, className: classNames('cratis-date-picker__grid', pt?.grid?.className), "data-cratis-part": 'grid', children: [jsx(CalendarGridHeader, { children: (day) => jsx(CalendarHeaderCell, { children: day }) }), jsx(CalendarGridBody, { children: (date) => (jsx(CalendarCell, { ...pt?.cell, date: date, className: classNames('cratis-date-picker__cell', pt?.cell?.className), "data-cratis-part": 'cell' })) })] }));
26
+ const DatePickerCalendar = ({ pt }) => (jsxs(Calendar, { ...pt?.calendar, className: classNames('cratis-date-picker__calendar', pt?.calendar?.className), "data-cratis-part": 'calendar', "data-open": true, children: [jsx(CalendarHeader, { pt: pt }), jsx(CalendarMonthGrid, { pt: pt })] }));
27
+
28
+ export { DatePickerCalendar };
29
+ //# sourceMappingURL=DatePickerCalendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerCalendar.js","sources":["../../../Common/DatePickerCalendar.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n} from 'react-aria-components/DatePicker';\nimport { Heading } from 'react-aria-components/Heading';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport { classNames } from '../ClassNames/classNames';\nimport { useCratisComponentsConfig } from './CratisComponentsProvider';\nimport { asReactAriaButtonProps } from './reactAriaProps';\nimport type { DatePickerInputPassThrough } from './DatePickerInput';\n\ninterface DatePickerCalendarProps {\n pt: DatePickerInputPassThrough | undefined;\n}\n\ninterface NavigationButtonProps extends DatePickerCalendarProps {\n slot: 'previous' | 'next';\n message: string | undefined;\n fallbackLabel: string;\n fallbackGlyph: string;\n}\n\nconst NavigationButton = ({ pt, slot, message, fallbackLabel, fallbackGlyph }: NavigationButtonProps) => {\n const icon = useCratisIcon();\n const part = pt?.[slot];\n return (\n <Button\n {...asReactAriaButtonProps(part)}\n slot={slot}\n className={classNames('cratis-date-picker__nav', part?.className)}\n data-cratis-part={slot}\n aria-label={part?.['aria-label'] ?? message ?? fallbackLabel}\n >\n <span aria-hidden='true'>{icon(slot, fallbackGlyph)}</span>\n </Button>\n );\n};\n\nconst CalendarHeader = ({ pt }: DatePickerCalendarProps) => {\n const datePickerMessages = useCratisComponentsConfig().messages?.datePicker;\n return (\n <header\n {...pt?.header}\n className={classNames('cratis-date-picker__header', pt?.header?.className)}\n data-cratis-part='header'\n >\n <NavigationButton\n pt={pt}\n slot='previous'\n message={datePickerMessages?.previousMonth}\n fallbackLabel='Previous month'\n fallbackGlyph='‹'\n />\n <Heading\n {...pt?.heading}\n className={classNames('cratis-date-picker__heading', pt?.heading?.className)}\n data-cratis-part='heading'\n />\n <NavigationButton\n pt={pt}\n slot='next'\n message={datePickerMessages?.nextMonth}\n fallbackLabel='Next month'\n fallbackGlyph='›'\n />\n </header>\n );\n};\n\nconst CalendarMonthGrid = ({ pt }: DatePickerCalendarProps) => (\n <CalendarGrid\n {...pt?.grid}\n className={classNames('cratis-date-picker__grid', pt?.grid?.className)}\n data-cratis-part='grid'\n >\n <CalendarGridHeader>\n {(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n {...pt?.cell}\n date={date}\n className={classNames('cratis-date-picker__cell', pt?.cell?.className)}\n data-cratis-part='cell'\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n);\n\n/** The calendar of the date picker popover: month navigation header and day grid. */\nexport const DatePickerCalendar = ({ pt }: DatePickerCalendarProps) => (\n <Calendar\n {...pt?.calendar}\n className={classNames('cratis-date-picker__calendar', pt?.calendar?.className)}\n data-cratis-part='calendar'\n data-open\n >\n <CalendarHeader pt={pt} />\n <CalendarMonthGrid pt={pt} />\n </Calendar>\n);\n"],"names":["_jsx","_jsx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EAAE,EAAE,EAAE,EAAA,CAAI,CAAA,EAAA,CACtB;;"}
@@ -0,0 +1,14 @@
1
+ import type { DatePickerInputPassThrough } from './DatePickerInput.js';
2
+ import { type DatePickerFieldState } from './datePickerStateAttributes.js';
3
+ import type { DatePickerInputPartAttributes } from './useDatePickerState.js';
4
+ interface DatePickerDateInputProps {
5
+ pt: DatePickerInputPassThrough | undefined;
6
+ inputPartAttributes: DatePickerInputPartAttributes;
7
+ placeholder: string | undefined;
8
+ state: DatePickerFieldState;
9
+ isOpen: boolean;
10
+ }
11
+ /** The segmented date input, whose parts carry the picker's state as data attributes. */
12
+ export declare const DatePickerDateInput: ({ pt, inputPartAttributes, placeholder, state, isOpen, }: DatePickerDateInputProps) => import("react").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=DatePickerDateInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerDateInput.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerDateInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAmB,CAAC;AACpE,OAAO,EAGH,KAAK,oBAAoB,EAC5B,MAAM,gCAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAsB,CAAC;AAE1E,UAAU,wBAAwB;IAC9B,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAC3C,mBAAmB,EAAE,6BAA6B,CAAC;IACnD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,yFAAyF;AACzF,eAAO,MAAM,mBAAmB,6DAM7B,wBAAwB,gCAqB1B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DateInput, DateSegment } from 'react-aria-components/DatePicker';
3
+ import { classNames } from '../ClassNames/classNames.js';
4
+ import { segmentStateAttributes, fieldStateAttributes } from './datePickerStateAttributes.js';
5
+
6
+ const DatePickerDateInput = ({ pt, inputPartAttributes, placeholder, state, isOpen, }) => (jsx(DateInput, { ...inputPartAttributes, className: classNames('cratis-date-picker__input', pt?.input?.className), style: pt?.input?.style, "data-cratis-part": 'input', "data-placeholder": placeholder, render: (inputProps) => jsx("div", { ...inputProps, ...fieldStateAttributes(state, isOpen) }), children: (segment) => (jsx(DateSegment, { ...pt?.segment, segment: segment, className: classNames('cratis-date-picker__segment', pt?.segment?.className), "data-cratis-part": 'segment', render: (segmentProps) => (jsx("span", { ...segmentProps, ...segmentStateAttributes(state) })) })) }));
7
+
8
+ export { DatePickerDateInput };
9
+ //# sourceMappingURL=DatePickerDateInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerDateInput.js","sources":["../../../Common/DatePickerDateInput.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DateInput, DateSegment } from 'react-aria-components/DatePicker';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DatePickerInputPassThrough } from './DatePickerInput';\nimport {\n fieldStateAttributes,\n segmentStateAttributes,\n type DatePickerFieldState,\n} from './datePickerStateAttributes';\nimport type { DatePickerInputPartAttributes } from './useDatePickerState';\n\ninterface DatePickerDateInputProps {\n pt: DatePickerInputPassThrough | undefined;\n inputPartAttributes: DatePickerInputPartAttributes;\n placeholder: string | undefined;\n state: DatePickerFieldState;\n isOpen: boolean;\n}\n\n/** The segmented date input, whose parts carry the picker's state as data attributes. */\nexport const DatePickerDateInput = ({\n pt,\n inputPartAttributes,\n placeholder,\n state,\n isOpen,\n}: DatePickerDateInputProps) => (\n <DateInput\n {...inputPartAttributes}\n className={classNames('cratis-date-picker__input', pt?.input?.className)}\n style={pt?.input?.style}\n data-cratis-part='input'\n data-placeholder={placeholder}\n render={(inputProps) => <div {...inputProps} {...fieldStateAttributes(state, isOpen)} />}\n >\n {(segment) => (\n <DateSegment\n {...pt?.segment}\n segment={segment}\n className={classNames('cratis-date-picker__segment', pt?.segment?.className)}\n data-cratis-part='segment'\n render={(segmentProps) => (\n <span {...segmentProps} {...segmentStateAttributes(state)} />\n )}\n />\n )}\n </DateInput>\n);\n"],"names":["_jsx"],"mappings":";;;;;AAsBO,MAAM,mBAAmB,GAAG,CAAC,EAChC,EAAE,EACF,mBAAmB,EACnB,WAAW,EACX,KAAK,EACL,MAAM,GACiB,MACvBA,GAAA,CAAC,SAAS,EAAA,EAAA,GACF,mBAAmB,EACvB,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EACxE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAA,kBAAA,EACN,OAAO,EAAA,kBAAA,EACN,WAAW,EAC7B,MAAM,EAAE,CAAC,UAAU,KAAKA,GAAA,CAAA,KAAA,EAAA,EAAA,GAAS,UAAU,EAAA,GAAM,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,EAAA,CAAI,EAAA,QAAA,EAEvF,CAAC,OAAO,MACLA,GAAA,CAAC,WAAW,EAAA,EAAA,GACJ,EAAE,EAAE,OAAO,EACf,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,CAAC,6BAA6B,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC3D,SAAS,EAC1B,MAAM,EAAE,CAAC,YAAY,MACjBA,GAAA,CAAA,MAAA,EAAA,EAAA,GAAU,YAAY,EAAA,GAAM,sBAAsB,CAAC,KAAK,CAAC,EAAA,CAAI,CAChE,EAAA,CACH,CACL,EAAA,CACO;;"}
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { DatePickerInputPassThrough } from './DatePickerInput.js';
3
+ import { type DatePickerFieldState } from './datePickerStateAttributes.js';
4
+ interface DatePickerGroupProps {
5
+ pt: DatePickerInputPassThrough | undefined;
6
+ inputId: string | undefined;
7
+ state: DatePickerFieldState;
8
+ isOpen: boolean;
9
+ children: ReactNode;
10
+ }
11
+ /** The focusable group that holds the segmented input, the placeholder and the calendar trigger. */
12
+ export declare const DatePickerGroup: ({ pt, inputId, state, isOpen, children }: DatePickerGroupProps) => import("react").JSX.Element;
13
+ interface DatePickerPlaceholderProps {
14
+ pt: DatePickerInputPassThrough | undefined;
15
+ placeholder: string | undefined;
16
+ selected: boolean;
17
+ }
18
+ /** The visible placeholder shown while the picker has no value. */
19
+ export declare const DatePickerPlaceholder: ({ pt, placeholder, selected }: DatePickerPlaceholderProps) => import("react").JSX.Element | null;
20
+ export {};
21
+ //# sourceMappingURL=DatePickerGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerGroup.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAmB,CAAC;AACpE,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,gCAA6B,CAAC;AAE9F,UAAU,oBAAoB;IAC1B,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAC3C,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,oGAAoG;AACpG,eAAO,MAAM,eAAe,6CAA8C,oBAAoB,gCAY7F,CAAC;AAEF,UAAU,0BAA0B;IAChC,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAC3C,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,kCAAmC,0BAA0B,uCAUnF,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Group } from 'react-aria-components/DatePicker';
3
+ import { classNames } from '../ClassNames/classNames.js';
4
+ import { fieldStateAttributes } from './datePickerStateAttributes.js';
5
+
6
+ const DatePickerGroup = ({ pt, inputId, state, isOpen, children }) => (jsx(Group, { ...pt?.group, id: inputId, "aria-invalid": state.invalid || undefined, className: classNames('cratis-date-picker__group', pt?.group?.className), "data-cratis-part": 'group', "data-empty": !state.selected || undefined, render: (groupProps) => jsx("div", { ...groupProps, ...fieldStateAttributes(state, isOpen) }), children: children }));
7
+ const DatePickerPlaceholder = ({ pt, placeholder, selected }) => !selected && placeholder ? (jsx("span", { ...pt?.placeholder, className: classNames('cratis-date-picker__placeholder', pt?.placeholder?.className), "data-cratis-part": 'placeholder', "aria-hidden": 'true', children: placeholder })) : null;
8
+
9
+ export { DatePickerGroup, DatePickerPlaceholder };
10
+ //# sourceMappingURL=DatePickerGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerGroup.js","sources":["../../../Common/DatePickerGroup.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ReactNode } from 'react';\nimport { Group } from 'react-aria-components/DatePicker';\nimport { classNames } from '../ClassNames/classNames';\nimport type { DatePickerInputPassThrough } from './DatePickerInput';\nimport { fieldStateAttributes, type DatePickerFieldState } from './datePickerStateAttributes';\n\ninterface DatePickerGroupProps {\n pt: DatePickerInputPassThrough | undefined;\n inputId: string | undefined;\n state: DatePickerFieldState;\n isOpen: boolean;\n children: ReactNode;\n}\n\n/** The focusable group that holds the segmented input, the placeholder and the calendar trigger. */\nexport const DatePickerGroup = ({ pt, inputId, state, isOpen, children }: DatePickerGroupProps) => (\n <Group\n {...pt?.group}\n id={inputId}\n aria-invalid={state.invalid || undefined}\n className={classNames('cratis-date-picker__group', pt?.group?.className)}\n data-cratis-part='group'\n data-empty={!state.selected || undefined}\n render={(groupProps) => <div {...groupProps} {...fieldStateAttributes(state, isOpen)} />}\n >\n {children}\n </Group>\n);\n\ninterface DatePickerPlaceholderProps {\n pt: DatePickerInputPassThrough | undefined;\n placeholder: string | undefined;\n selected: boolean;\n}\n\n/** The visible placeholder shown while the picker has no value. */\nexport const DatePickerPlaceholder = ({ pt, placeholder, selected }: DatePickerPlaceholderProps) =>\n !selected && placeholder ? (\n <span\n {...pt?.placeholder}\n className={classNames('cratis-date-picker__placeholder', pt?.placeholder?.className)}\n data-cratis-part='placeholder'\n aria-hidden='true'\n >\n {placeholder}\n </span>\n ) : null;\n"],"names":["_jsx"],"mappings":";;;;;AAkBO,MAAM,eAAe,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAwB,MAC1FA,GAAA,CAAC,KAAK,EAAA,EAAA,GACE,EAAE,EAAE,KAAK,EACb,EAAE,EAAE,OAAO,EAAA,cAAA,EACG,KAAK,CAAC,OAAO,IAAI,SAAS,EACxC,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAA,kBAAA,EACvD,OAAO,EAAA,YAAA,EACZ,CAAC,KAAK,CAAC,QAAQ,IAAI,SAAS,EACxC,MAAM,EAAE,CAAC,UAAU,KAAKA,GAAA,CAAA,KAAA,EAAA,EAAA,GAAS,UAAU,KAAM,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,EAAA,CAAI,YAEvF,QAAQ,EAAA,CACL;AAUL,MAAM,qBAAqB,GAAG,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,QAAQ,EAA8B,KAC3F,CAAC,QAAQ,IAAI,WAAW,IACpBA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,WAAW,EACnB,SAAS,EAAE,UAAU,CAAC,iCAAiC,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,sBACnE,aAAa,EAAA,aAAA,EAClB,MAAM,EAAA,QAAA,EAEjB,WAAW,EAAA,CACT,IACP;;"}
@@ -104,6 +104,8 @@ export interface DatePickerInputProps {
104
104
  * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.
105
105
  */
106
106
  unstyled?: boolean;
107
+ /** Localized accessible name for the calendar trigger. Defaults to the provider's label or "Open calendar". */
108
+ openCalendarLabel?: string;
107
109
  /** Localized label for the Today action. */
108
110
  todayLabel?: string;
109
111
  /** Localized label for the Clear action. */
@@ -1 +1 @@
1
- {"version":3,"file":"DatePickerInput.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACjB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAAwB,CAAC;AAM5D,UAAU,wBAAyB,SAAQ,IAAI,CAC3C,cAAc,CAAC,WAAW,CAAC,EAC3B,cAAc,GAAG,UAAU,GAAG,MAAM,CACvC;IACG,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,CAAC,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACxE;AAED,KAAK,0BAA0B,GAAG,IAAI,CAClC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,SAAS,GAAG,OAAO,CACtB,CAAC;AAEF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E,OAAO,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,gCAAgC;IAChC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,wCAAwC;IACxC,EAAE,CAAC,EAAE,0BAA0B,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+GAA+G;IAC/G,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAQD;;;GAGG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,+FAG1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DatePickerInput.js","sources":["../../../Common/DatePickerInput.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type {\n ButtonHTMLAttributes,\n CSSProperties,\n FocusEventHandler,\n HTMLAttributes,\n} from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { DatePickerInputImplementation } from './DatePickerInputImplementation';\n\ninterface DatePickerPartAttributes extends Omit<\n HTMLAttributes<HTMLElement>,\n 'defaultValue' | 'onChange' | 'role'\n> {\n id?: string;\n className?: string;\n style?: CSSProperties;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean;\n [attribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\ntype DatePickerButtonAttributes = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'value'\n>;\n\n/** Stable Cratis-owned parts for styling a {@link DatePickerInput}. */\nexport interface DatePickerInputPassThrough {\n /** Outer wrapper. */\n root?: DatePickerPartAttributes;\n /** Focusable segmented-input group. */\n group?: DatePickerPartAttributes;\n /** Segmented date input. */\n input?: DatePickerPartAttributes;\n /** Visible empty-value placeholder. */\n placeholder?: DatePickerPartAttributes;\n /** Individual editable date/time segment. */\n segment?: DatePickerPartAttributes;\n /** Calendar popup trigger. */\n trigger?: DatePickerButtonAttributes;\n /** Portaled calendar popover. */\n popover?: DatePickerPartAttributes;\n /** Calendar dialog. */\n dialog?: DatePickerPartAttributes;\n /** Calendar root. */\n calendar?: DatePickerPartAttributes;\n /** Calendar navigation header. */\n header?: DatePickerPartAttributes;\n /** Current month/year heading. */\n heading?: DatePickerPartAttributes;\n /** Previous-month action. */\n previous?: DatePickerButtonAttributes;\n /** Next-month action. */\n next?: DatePickerButtonAttributes;\n /** Calendar grid. */\n grid?: DatePickerPartAttributes;\n /** One calendar cell. */\n cell?: DatePickerPartAttributes;\n /** Today/clear action row. */\n buttonBar?: DatePickerPartAttributes;\n /** Today action; disabled and non-interactive when today falls outside `minDate`/`maxDate`. */\n today?: DatePickerButtonAttributes;\n /** Clear action. */\n clear?: DatePickerButtonAttributes;\n}\n\n/** Props for {@link DatePickerInput}. */\nexport interface DatePickerInputProps {\n /** Controlled JavaScript date value. */\n value: Date | null;\n /** Invoked with the selected JavaScript date or `null` and optional change-origin metadata. */\n onChange: ChangeHandler<Date | null>;\n /** Invoked when focus leaves the picker wrapper. */\n onBlur?: FocusEventHandler<HTMLElement>;\n /** Marks the picker invalid. */\n invalid?: boolean;\n /** Disables every picker control. */\n disabled?: boolean;\n /** Prevents editing while retaining focus semantics. */\n readOnly?: boolean;\n /** DOM id for the segmented-input group. */\n id?: string;\n /** Shows Today and Clear actions. */\n showButtonBar?: boolean;\n /**\n * Keep outside controls interactive while the calendar is open. An outside\n * click dismisses the popover and reaches its target. Defaults to false.\n */\n isNonModal?: boolean;\n /** Visible text while no date is selected. */\n placeholder?: string;\n /** Deprecated renderer mask; locale controls formatting now. */\n dateFormat?: string;\n /** Shows the calendar trigger button. Defaults to `true`. */\n showIcon?: boolean;\n /** Adds hour/minute segments. */\n showTime?: boolean;\n /** Preferred 12- or 24-hour cycle. */\n hourFormat?: '12' | '24';\n /** Earliest selectable date. */\n minDate?: Date;\n /** Latest selectable date. */\n maxDate?: Date;\n /** Extra class name for the outer wrapper. */\n className?: string;\n /** Inline style for the outer wrapper. */\n style?: CSSProperties;\n /** Cratis-owned per-part attributes. */\n pt?: DatePickerInputPassThrough;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n /** Localized label for the Today action. */\n todayLabel?: string;\n /** Localized label for the Clear action. */\n clearLabel?: string;\n /** Accessible name when no external label is supplied. */\n 'aria-label'?: string;\n /** Id of the element that labels the picker. */\n 'aria-labelledby'?: string;\n /** Id of the element that describes the picker. */\n 'aria-describedby'?: string;\n}\n\nconst coreDatePickerDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: DatePickerInputImplementation,\n}) satisfies unstable_SlotDeclaration<'display.datePicker'>;\n\n/**\n * An internationalized date or date-time picker with Cratis-owned markup parts.\n * The public boundary remains `Date | null`; React Aria's calendar values stay internal.\n */\nexport const DatePickerInput = (props: DatePickerInputProps) => {\n const declaration = unstable_useSlot('display.datePicker', coreDatePickerDeclaration);\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;AA4IA,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,6BAA6B;AACxC,CAAA,CAA0D;AAMpD,MAAM,eAAe,GAAG,CAAC,KAA2B,KAAI;IAC3D,MAAM,WAAW,GAAG,gBAAgB,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;AACrF,IAAA,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC;AACzC;;"}
1
+ {"version":3,"file":"DatePickerInput.js","sources":["../../../Common/DatePickerInput.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type {\n ButtonHTMLAttributes,\n CSSProperties,\n FocusEventHandler,\n HTMLAttributes,\n} from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { DatePickerInputImplementation } from './DatePickerInputImplementation';\n\ninterface DatePickerPartAttributes extends Omit<\n HTMLAttributes<HTMLElement>,\n 'defaultValue' | 'onChange' | 'role'\n> {\n id?: string;\n className?: string;\n style?: CSSProperties;\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean;\n [attribute: `data-${string}`]: string | number | boolean | undefined;\n}\n\ntype DatePickerButtonAttributes = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'value'\n>;\n\n/** Stable Cratis-owned parts for styling a {@link DatePickerInput}. */\nexport interface DatePickerInputPassThrough {\n /** Outer wrapper. */\n root?: DatePickerPartAttributes;\n /** Focusable segmented-input group. */\n group?: DatePickerPartAttributes;\n /** Segmented date input. */\n input?: DatePickerPartAttributes;\n /** Visible empty-value placeholder. */\n placeholder?: DatePickerPartAttributes;\n /** Individual editable date/time segment. */\n segment?: DatePickerPartAttributes;\n /** Calendar popup trigger. */\n trigger?: DatePickerButtonAttributes;\n /** Portaled calendar popover. */\n popover?: DatePickerPartAttributes;\n /** Calendar dialog. */\n dialog?: DatePickerPartAttributes;\n /** Calendar root. */\n calendar?: DatePickerPartAttributes;\n /** Calendar navigation header. */\n header?: DatePickerPartAttributes;\n /** Current month/year heading. */\n heading?: DatePickerPartAttributes;\n /** Previous-month action. */\n previous?: DatePickerButtonAttributes;\n /** Next-month action. */\n next?: DatePickerButtonAttributes;\n /** Calendar grid. */\n grid?: DatePickerPartAttributes;\n /** One calendar cell. */\n cell?: DatePickerPartAttributes;\n /** Today/clear action row. */\n buttonBar?: DatePickerPartAttributes;\n /** Today action; disabled and non-interactive when today falls outside `minDate`/`maxDate`. */\n today?: DatePickerButtonAttributes;\n /** Clear action. */\n clear?: DatePickerButtonAttributes;\n}\n\n/** Props for {@link DatePickerInput}. */\nexport interface DatePickerInputProps {\n /** Controlled JavaScript date value. */\n value: Date | null;\n /** Invoked with the selected JavaScript date or `null` and optional change-origin metadata. */\n onChange: ChangeHandler<Date | null>;\n /** Invoked when focus leaves the picker wrapper. */\n onBlur?: FocusEventHandler<HTMLElement>;\n /** Marks the picker invalid. */\n invalid?: boolean;\n /** Disables every picker control. */\n disabled?: boolean;\n /** Prevents editing while retaining focus semantics. */\n readOnly?: boolean;\n /** DOM id for the segmented-input group. */\n id?: string;\n /** Shows Today and Clear actions. */\n showButtonBar?: boolean;\n /**\n * Keep outside controls interactive while the calendar is open. An outside\n * click dismisses the popover and reaches its target. Defaults to false.\n */\n isNonModal?: boolean;\n /** Visible text while no date is selected. */\n placeholder?: string;\n /** Deprecated renderer mask; locale controls formatting now. */\n dateFormat?: string;\n /** Shows the calendar trigger button. Defaults to `true`. */\n showIcon?: boolean;\n /** Adds hour/minute segments. */\n showTime?: boolean;\n /** Preferred 12- or 24-hour cycle. */\n hourFormat?: '12' | '24';\n /** Earliest selectable date. */\n minDate?: Date;\n /** Latest selectable date. */\n maxDate?: Date;\n /** Extra class name for the outer wrapper. */\n className?: string;\n /** Inline style for the outer wrapper. */\n style?: CSSProperties;\n /** Cratis-owned per-part attributes. */\n pt?: DatePickerInputPassThrough;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n /** Localized accessible name for the calendar trigger. Defaults to the provider's label or \"Open calendar\". */\n openCalendarLabel?: string;\n /** Localized label for the Today action. */\n todayLabel?: string;\n /** Localized label for the Clear action. */\n clearLabel?: string;\n /** Accessible name when no external label is supplied. */\n 'aria-label'?: string;\n /** Id of the element that labels the picker. */\n 'aria-labelledby'?: string;\n /** Id of the element that describes the picker. */\n 'aria-describedby'?: string;\n}\n\nconst coreDatePickerDeclaration = Object.freeze({\n mode: 'atomic',\n fidelity: 'native',\n render: DatePickerInputImplementation,\n}) satisfies unstable_SlotDeclaration<'display.datePicker'>;\n\n/**\n * An internationalized date or date-time picker with Cratis-owned markup parts.\n * The public boundary remains `Date | null`; React Aria's calendar values stay internal.\n */\nexport const DatePickerInput = (props: DatePickerInputProps) => {\n const declaration = unstable_useSlot('display.datePicker', coreDatePickerDeclaration);\n return renderSlot(declaration, props);\n};\n"],"names":[],"mappings":";;;;AA8IA,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5C,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,6BAA6B;AACxC,CAAA,CAA0D;AAMpD,MAAM,eAAe,GAAG,CAAC,KAA2B,KAAI;IAC3D,MAAM,WAAW,GAAG,gBAAgB,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;AACrF,IAAA,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC;AACzC;;"}
@@ -3,5 +3,5 @@ import type { DatePickerInputProps } from './DatePickerInput.js';
3
3
  * An internationalized date or date-time picker with Cratis-owned markup parts.
4
4
  * The public boundary remains `Date | null`; React Aria's calendar values stay internal.
5
5
  */
6
- export declare const DatePickerInputImplementation: ({ value, onChange, onBlur, invalid, disabled, readOnly, id, showButtonBar, isNonModal, placeholder, showIcon, showTime, hourFormat, minDate, maxDate, className, style, pt, todayLabel, clearLabel, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, }: DatePickerInputProps) => import("react").JSX.Element;
6
+ export declare const DatePickerInputImplementation: (props: DatePickerInputProps) => import("react").JSX.Element;
7
7
  //# sourceMappingURL=DatePickerInputImplementation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePickerInputImplementation.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerInputImplementation.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAmB,CAAC;AAe9D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,2SAwBvC,oBAAoB,gCA8YtB,CAAC"}
1
+ {"version":3,"file":"DatePickerInputImplementation.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerInputImplementation.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAmB,CAAC;AAe9D;;;GAGG;AACH,eAAO,MAAM,6BAA6B,UAAW,oBAAoB,gCA0GxE,CAAC"}
@@ -1,106 +1,50 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
- import { DatePicker, Group, DateInput, DateSegment, Button, Popover, Calendar, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell } from 'react-aria-components/DatePicker';
4
- import { Dialog } from 'react-aria-components/Dialog';
5
- import { Heading } from 'react-aria-components/Heading';
3
+ import { DatePicker, Button } from 'react-aria-components/DatePicker';
6
4
  import { UNSAFE_PortalProvider } from 'react-aria';
7
5
  import { unstable_useOverlayEnvironment } from '../renderer/RendererContext.js';
8
- import 'react-aria-components/I18nProvider';
9
- import 'react-aria-components';
10
- import 'ts-deepmerge';
11
- import 'react-dom';
12
- import { useCratisComponentsConfig } from '../configuration/CratisComponentsContext.js';
13
- import { useCratisIcon } from '../configuration/useCratisIcon.js';
14
- import '../Notifications/toast.js';
15
- import { classNames } from '../ClassNames/classNames.js';
16
- import { zIndexAboveDialog, OVERLAY_OFFSET } from '../renderer/dialogStack.js';
17
- import { useNearestDialogZIndex } from '../renderer/DialogStackContext.js';
18
6
  import { asReactAriaButtonProps } from './reactAriaProps.js';
19
- import { getLocalTimeZone, today, fromDate, toCalendarDate } from '@internationalized/date';
7
+ import { classNames } from '../ClassNames/classNames.js';
8
+ import { DatePickerDateInput } from './DatePickerDateInput.js';
9
+ import { DatePickerGroup, DatePickerPlaceholder } from './DatePickerGroup.js';
10
+ import { DatePickerPopover } from './DatePickerPopover.js';
11
+ import { asDate, asDateValue } from './datePickerValues.js';
12
+ import { triggerStateAttributes, rootStateAttributes } from './datePickerStateAttributes.js';
13
+ import { useDatePickerState } from './useDatePickerState.js';
14
+ import { useDatePickerAccessibility } from './useDatePickerAccessibility.js';
20
15
 
21
- const asDateValue = (value, showTime) => {
22
- if (!value)
23
- return null;
24
- const zoned = fromDate(value, getLocalTimeZone());
25
- return showTime ? zoned : toCalendarDate(zoned);
16
+ const resolveHourCycle = (hourFormat) => {
17
+ if (hourFormat === '12')
18
+ return 12;
19
+ return hourFormat === '24' ? 24 : undefined;
26
20
  };
27
- const asDate = (value) => value ? value.toDate(getLocalTimeZone()) : null;
28
- const DatePickerInputImplementation = ({ value, onChange, onBlur, invalid, disabled, readOnly, id, showButtonBar, isNonModal = false, placeholder, showIcon = true, showTime, hourFormat, minDate, maxDate, className, style, pt, todayLabel, clearLabel, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, }) => {
21
+ const DatePickerInputImplementation = (props) => {
22
+ const { value, onChange, onBlur, showButtonBar, isNonModal = false, showIcon = true, showTime, hourFormat, style, pt } = props;
29
23
  const [isPickerOpen, setIsPickerOpen] = useState(false);
30
24
  const overlayEnvironment = unstable_useOverlayEnvironment();
31
- const nearestDialogZIndex = useNearestDialogZIndex();
32
- const resolvedPopoverZIndex = nearestDialogZIndex === null
33
- ? 'var(--cratis-z-index-overlay)'
34
- : zIndexAboveDialog(nearestDialogZIndex, OVERLAY_OFFSET);
35
- const { messages } = useCratisComponentsConfig();
36
- const datePickerMessages = messages?.datePicker;
37
- const icon = useCratisIcon();
38
- const resolvedTodayLabel = todayLabel ?? datePickerMessages?.today ?? 'Today';
39
- const resolvedClearLabel = clearLabel ?? datePickerMessages?.clear ?? 'Clear';
40
- const timeZone = getLocalTimeZone();
41
- const minValue = asDateValue(minDate ?? null, showTime) ?? undefined;
42
- const maxValue = asDateValue(maxDate ?? null, showTime) ?? undefined;
43
- const todayDate = today(timeZone).toDate(timeZone);
44
- const todayValue = asDateValue(todayDate, showTime);
45
- const isTodayOutOfBounds = (minValue !== undefined && todayValue.compare(minValue) < 0) ||
46
- (maxValue !== undefined && todayValue.compare(maxValue) > 0);
47
- const rootClassName = classNames('cratis-date-picker', pt?.root?.className, className);
48
- const inputId = id ?? pt?.input?.id;
49
- const effectiveDisabled = disabled ?? pt?.input?.disabled ?? false;
50
- const effectiveReadOnly = readOnly ?? pt?.input?.readOnly ?? false;
51
- const effectiveInvalid = invalid ?? pt?.input?.['aria-invalid'] ?? false;
52
- const actionsDisabled = effectiveDisabled || effectiveReadOnly;
53
- const clearDisabled = actionsDisabled || pt?.clear?.disabled || false;
54
- const effectivePlaceholder = placeholder ?? pt?.input?.placeholder;
55
- const effectiveAriaLabel = ariaLabel ??
56
- pt?.input?.['aria-label'] ??
57
- effectivePlaceholder ??
58
- datePickerMessages?.label ??
59
- 'Date';
60
- const effectiveAriaLabelledby = ariaLabelledby ?? pt?.input?.['aria-labelledby'];
61
- const effectiveAriaDescribedby = ariaDescribedby ?? pt?.input?.['aria-describedby'];
62
- const inputPartAttributes = {
63
- ...pt?.input,
64
- id: undefined,
65
- className: undefined,
66
- style: undefined,
67
- disabled: undefined,
68
- readOnly: undefined,
69
- placeholder: undefined,
70
- 'aria-label': undefined,
71
- 'aria-labelledby': undefined,
72
- 'aria-describedby': undefined,
73
- 'aria-invalid': undefined,
25
+ const state = useDatePickerState(props);
26
+ const { calendarId, triggerLabel, triggerAttributes } = useDatePickerAccessibility(props, state.datePickerMessages?.openCalendar);
27
+ const { effectiveDisabled, effectiveReadOnly } = state;
28
+ const fieldState = {
29
+ invalid: state.effectiveInvalid,
30
+ disabled: effectiveDisabled,
31
+ readOnly: effectiveReadOnly,
32
+ selected: value !== null,
74
33
  };
75
- return (jsx("div", { ...pt?.root, className: rootClassName, style: { ...pt?.root?.style, ...style }, "data-cratis-part": 'root', "data-cratis-component": 'DatePickerInput', "data-invalid": effectiveInvalid || undefined, "data-disabled": effectiveDisabled || undefined, "data-readonly": effectiveReadOnly || undefined, "data-open": isPickerOpen || undefined, "data-selected": value !== null || undefined, onBlur: onBlur, children: jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsx(DatePicker, { value: asDateValue(value, showTime), onChange: (next) => onChange(asDate(next), { source: 'user' }), isDisabled: effectiveDisabled, isReadOnly: effectiveReadOnly, isInvalid: effectiveInvalid, isOpen: isPickerOpen, onOpenChange: (nextIsOpen) => {
34
+ const buttonBar = showButtonBar ? {
35
+ pt,
36
+ todayLabel: state.resolvedTodayLabel,
37
+ clearLabel: state.resolvedClearLabel,
38
+ actionsDisabled: state.actionsDisabled,
39
+ clearDisabled: state.clearDisabled,
40
+ isTodayOutOfBounds: state.isTodayOutOfBounds,
41
+ todayDate: state.todayDate,
42
+ onChange,
43
+ } : null;
44
+ return (jsx("div", { ...pt?.root, className: state.rootClassName, style: { ...pt?.root?.style, ...style }, "data-cratis-part": 'root', "data-cratis-component": 'DatePickerInput', ...rootStateAttributes(fieldState, isPickerOpen), onBlur: onBlur, children: jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsx(DatePicker, { value: asDateValue(value, showTime), onChange: (next) => onChange(asDate(next), { source: 'user' }), isDisabled: effectiveDisabled, isReadOnly: effectiveReadOnly, isInvalid: state.effectiveInvalid, isOpen: isPickerOpen, onOpenChange: (nextIsOpen) => {
76
45
  if (!nextIsOpen || !effectiveReadOnly)
77
46
  setIsPickerOpen(nextIsOpen);
78
- }, minValue: minValue, maxValue: maxValue, granularity: showTime ? 'minute' : 'day', hourCycle: hourFormat === '12' ? 12 : hourFormat === '24' ? 24 : undefined, "aria-label": effectiveAriaLabel, "aria-labelledby": effectiveAriaLabelledby, "aria-describedby": effectiveAriaDescribedby, className: 'cratis-date-picker__picker', children: ({ isOpen }) => (jsxs(Fragment, { children: [jsxs(Group, { ...pt?.group, id: inputId, "aria-invalid": effectiveInvalid || undefined, className: classNames('cratis-date-picker__group', pt?.group?.className), "data-cratis-part": 'group', "data-empty": value === null || undefined, render: (groupProps) => (jsx("div", { ...groupProps, "data-open": isOpen || undefined, "data-invalid": effectiveInvalid || undefined, "data-disabled": effectiveDisabled || undefined, "data-readonly": effectiveReadOnly || undefined, "data-selected": value !== null || undefined })), children: [jsx(DateInput, { ...inputPartAttributes, className: classNames('cratis-date-picker__input', pt?.input?.className), style: pt?.input?.style, "data-cratis-part": 'input', "data-placeholder": effectivePlaceholder, render: (inputProps) => (jsx("div", { ...inputProps, "data-open": isOpen || undefined, "data-invalid": effectiveInvalid || undefined, "data-disabled": effectiveDisabled || undefined, "data-readonly": effectiveReadOnly || undefined, "data-selected": value !== null || undefined })), children: (segment) => (jsx(DateSegment, { ...pt?.segment, segment: segment, className: classNames('cratis-date-picker__segment', pt?.segment?.className), "data-cratis-part": 'segment', render: (segmentProps) => (jsx("span", { ...segmentProps, "data-invalid": effectiveInvalid || undefined, "data-disabled": effectiveDisabled || undefined, "data-readonly": effectiveReadOnly || undefined })) })) }), value === null && effectivePlaceholder && (jsx("span", { ...pt?.placeholder, className: classNames('cratis-date-picker__placeholder', pt?.placeholder?.className), "data-cratis-part": 'placeholder', "aria-hidden": 'true', children: effectivePlaceholder })), showIcon && (jsx(Button, { ...asReactAriaButtonProps(pt?.trigger), isDisabled: effectiveDisabled || effectiveReadOnly, className: classNames('cratis-date-picker__trigger', pt?.trigger?.className), "data-cratis-part": 'trigger', render: (triggerProps) => (jsx("button", { ...triggerProps, "data-open": isOpen || undefined, "data-invalid": effectiveInvalid || undefined, "data-disabled": effectiveDisabled ||
79
- effectiveReadOnly ||
80
- undefined, "data-readonly": effectiveReadOnly || undefined, "data-selected": value !== null || undefined })), "aria-label": pt?.trigger?.['aria-label'] ??
81
- datePickerMessages?.openCalendar ??
82
- 'Open calendar', children: jsx("span", { "aria-hidden": 'true', children: "\u25A6" }) }))] }), jsx(Popover, { ...pt?.popover, isNonModal: isNonModal, className: classNames('cratis-date-picker__popover', pt?.popover?.className), style: {
83
- zIndex: resolvedPopoverZIndex,
84
- ...pt?.popover?.style,
85
- }, "data-cratis-part": 'popover', "data-open": true, placement: 'bottom start', children: jsxs(Dialog, { ...pt?.dialog, className: classNames('cratis-date-picker__dialog', pt?.dialog?.className), "data-cratis-part": 'dialog', "data-open": true, children: [jsxs(Calendar, { ...pt?.calendar, className: classNames('cratis-date-picker__calendar', pt?.calendar?.className), "data-cratis-part": 'calendar', "data-open": true, children: [jsxs("header", { ...pt?.header, className: classNames('cratis-date-picker__header', pt?.header?.className), "data-cratis-part": 'header', children: [jsx(Button, { ...asReactAriaButtonProps(pt?.previous), slot: 'previous', className: classNames('cratis-date-picker__nav', pt?.previous?.className), "data-cratis-part": 'previous', "aria-label": pt?.previous?.['aria-label'] ??
86
- datePickerMessages?.previousMonth ??
87
- 'Previous month', children: jsx("span", { "aria-hidden": 'true', children: icon('previous', '‹') }) }), jsx(Heading, { ...pt?.heading, className: classNames('cratis-date-picker__heading', pt?.heading?.className), "data-cratis-part": 'heading' }), jsx(Button, { ...asReactAriaButtonProps(pt?.next), slot: 'next', className: classNames('cratis-date-picker__nav', pt?.next?.className), "data-cratis-part": 'next', "aria-label": pt?.next?.['aria-label'] ??
88
- datePickerMessages?.nextMonth ??
89
- 'Next month', children: jsx("span", { "aria-hidden": 'true', children: icon('next', '›') }) })] }), jsxs(CalendarGrid, { ...pt?.grid, className: classNames('cratis-date-picker__grid', pt?.grid?.className), "data-cratis-part": 'grid', children: [jsx(CalendarGridHeader, { children: (day) => (jsx(CalendarHeaderCell, { children: day })) }), jsx(CalendarGridBody, { children: (date) => (jsx(CalendarCell, { ...pt?.cell, date: date, className: classNames('cratis-date-picker__cell', pt?.cell?.className), "data-cratis-part": 'cell' })) })] })] }), showButtonBar && (jsxs("div", { ...pt?.buttonBar, className: classNames('cratis-date-picker__button-bar', pt?.buttonBar?.className), "data-cratis-part": 'button-bar', children: [jsx("button", { ...pt?.today, type: 'button', className: classNames('cratis-date-picker__action', pt?.today?.className), "data-cratis-part": 'today', "data-disabled": actionsDisabled || isTodayOutOfBounds || undefined, disabled: actionsDisabled || isTodayOutOfBounds, "aria-disabled": actionsDisabled || isTodayOutOfBounds || undefined, onClick: (event) => {
90
- if (actionsDisabled || isTodayOutOfBounds)
91
- return;
92
- onChange(todayDate, {
93
- source: 'user',
94
- nativeEvent: event.nativeEvent,
95
- });
96
- }, children: resolvedTodayLabel }), jsx("button", { ...pt?.clear, type: 'button', className: classNames('cratis-date-picker__action', pt?.clear?.className), "data-cratis-part": 'clear', "data-disabled": clearDisabled || undefined, disabled: clearDisabled, "aria-disabled": clearDisabled || pt?.clear?.['aria-disabled'] || undefined, onClick: (event) => {
97
- if (clearDisabled)
98
- return;
99
- onChange(null, {
100
- source: 'user',
101
- nativeEvent: event.nativeEvent,
102
- });
103
- }, children: resolvedClearLabel })] }))] }) })] })) }) }) }));
47
+ }, minValue: state.minValue, maxValue: state.maxValue, granularity: showTime ? 'minute' : 'day', hourCycle: resolveHourCycle(hourFormat), "aria-label": state.effectiveAriaLabel, "aria-labelledby": state.effectiveAriaLabelledby, "aria-describedby": state.effectiveAriaDescribedby, className: 'cratis-date-picker__picker', children: ({ isOpen }) => (jsxs(Fragment, { children: [jsxs(DatePickerGroup, { pt: pt, inputId: state.inputId, state: fieldState, isOpen: isOpen, children: [jsx(DatePickerDateInput, { pt: pt, inputPartAttributes: state.inputPartAttributes, placeholder: state.effectivePlaceholder, state: fieldState, isOpen: isOpen }), jsx(DatePickerPlaceholder, { pt: pt, placeholder: state.effectivePlaceholder, selected: fieldState.selected }), showIcon && (jsx(Button, { ...asReactAriaButtonProps(pt?.trigger), isDisabled: effectiveDisabled || effectiveReadOnly, className: classNames('cratis-date-picker__trigger', pt?.trigger?.className), "data-cratis-part": 'trigger', render: (triggerProps) => (jsx("button", { ...triggerProps, ...triggerStateAttributes(fieldState, isOpen), ...triggerAttributes(isOpen) })), "aria-label": triggerLabel, children: jsx("span", { "aria-hidden": 'true', children: "\u25A6" }) }))] }), jsx(DatePickerPopover, { id: calendarId, pt: pt, isNonModal: isNonModal, zIndex: state.resolvedPopoverZIndex, buttonBar: buttonBar })] })) }) }) }));
104
48
  };
105
49
 
106
50
  export { DatePickerInputImplementation };
@@ -1 +1 @@
1
- {"version":3,"file":"DatePickerInputImplementation.js","sources":["../../../Common/DatePickerInputImplementation.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DatePicker as AriaDatePicker,\n DateSegment,\n Group,\n Popover,\n type DateValue,\n} from 'react-aria-components/DatePicker';\nimport { Dialog } from 'react-aria-components/Dialog';\nimport { Heading } from 'react-aria-components/Heading';\nimport { UNSAFE_PortalProvider } from 'react-aria';\nimport { unstable_useOverlayEnvironment } from '../renderer/RendererContext';\nimport { useCratisComponentsConfig } from './CratisComponentsProvider';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\nimport { OVERLAY_OFFSET, zIndexAboveDialog } from '../renderer/dialogStack';\nimport { useNearestDialogZIndex } from '../renderer/DialogStackContext';\nimport { asReactAriaButtonProps } from './reactAriaProps';\nimport {\n fromDate,\n getLocalTimeZone,\n today,\n toCalendarDate,\n} from '@internationalized/date';\nimport type { DatePickerInputProps } from './DatePickerInput';\nimport { classNames } from '../ClassNames/classNames';\n\nconst asDateValue = (\n value: Date | null,\n showTime: boolean | undefined,\n): DateValue | null => {\n if (!value) return null;\n const zoned = fromDate(value, getLocalTimeZone());\n return showTime ? zoned : toCalendarDate(zoned);\n};\n\nconst asDate = (value: DateValue | null): Date | null =>\n value ? value.toDate(getLocalTimeZone()) : null;\n\n/**\n * An internationalized date or date-time picker with Cratis-owned markup parts.\n * The public boundary remains `Date | null`; React Aria's calendar values stay internal.\n */\nexport const DatePickerInputImplementation = ({\n value,\n onChange,\n onBlur,\n invalid,\n disabled,\n readOnly,\n id,\n showButtonBar,\n isNonModal = false,\n placeholder,\n showIcon = true,\n showTime,\n hourFormat,\n minDate,\n maxDate,\n className,\n style,\n pt,\n todayLabel,\n clearLabel,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n}: DatePickerInputProps) => {\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const overlayEnvironment = unstable_useOverlayEnvironment();\n const nearestDialogZIndex = useNearestDialogZIndex();\n const resolvedPopoverZIndex =\n nearestDialogZIndex === null\n ? 'var(--cratis-z-index-overlay)'\n : zIndexAboveDialog(nearestDialogZIndex, OVERLAY_OFFSET);\n const { messages } = useCratisComponentsConfig();\n const datePickerMessages = messages?.datePicker;\n const icon = useCratisIcon();\n const resolvedTodayLabel = todayLabel ?? datePickerMessages?.today ?? 'Today';\n const resolvedClearLabel = clearLabel ?? datePickerMessages?.clear ?? 'Clear';\n const timeZone = getLocalTimeZone();\n const minValue = asDateValue(minDate ?? null, showTime) ?? undefined;\n const maxValue = asDateValue(maxDate ?? null, showTime) ?? undefined;\n const todayDate = today(timeZone).toDate(timeZone);\n // Compare the same granularity that the action emits. In date-time mode the Today action\n // retains its existing local-midnight value, which can legitimately fall before a same-day\n // minDate carrying a later time.\n const todayValue = asDateValue(todayDate, showTime)!;\n const isTodayOutOfBounds =\n (minValue !== undefined && todayValue.compare(minValue) < 0) ||\n (maxValue !== undefined && todayValue.compare(maxValue) > 0);\n const rootClassName = classNames(\n 'cratis-date-picker',\n pt?.root?.className,\n className,\n );\n const inputId = id ?? pt?.input?.id;\n const effectiveDisabled = disabled ?? pt?.input?.disabled ?? false;\n const effectiveReadOnly = readOnly ?? pt?.input?.readOnly ?? false;\n const effectiveInvalid = invalid ?? pt?.input?.['aria-invalid'] ?? false;\n const actionsDisabled = effectiveDisabled || effectiveReadOnly;\n const clearDisabled = actionsDisabled || pt?.clear?.disabled || false;\n const effectivePlaceholder = placeholder ?? pt?.input?.placeholder;\n const effectiveAriaLabel =\n ariaLabel ??\n pt?.input?.['aria-label'] ??\n effectivePlaceholder ??\n datePickerMessages?.label ??\n 'Date';\n const effectiveAriaLabelledby = ariaLabelledby ?? pt?.input?.['aria-labelledby'];\n const effectiveAriaDescribedby = ariaDescribedby ?? pt?.input?.['aria-describedby'];\n const inputPartAttributes = {\n ...pt?.input,\n id: undefined,\n className: undefined,\n style: undefined,\n disabled: undefined,\n readOnly: undefined,\n placeholder: undefined,\n 'aria-label': undefined,\n 'aria-labelledby': undefined,\n 'aria-describedby': undefined,\n 'aria-invalid': undefined,\n };\n\n return (\n <div\n {...pt?.root}\n className={rootClassName}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-cratis-component='DatePickerInput'\n data-invalid={effectiveInvalid || undefined}\n data-disabled={effectiveDisabled || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-open={isPickerOpen || undefined}\n data-selected={value !== null || undefined}\n onBlur={onBlur}\n >\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n <AriaDatePicker\n value={asDateValue(value, showTime)}\n onChange={(next) => onChange(asDate(next), { source: 'user' })}\n isDisabled={effectiveDisabled}\n isReadOnly={effectiveReadOnly}\n isInvalid={effectiveInvalid}\n isOpen={isPickerOpen}\n onOpenChange={(nextIsOpen) => {\n if (!nextIsOpen || !effectiveReadOnly) setIsPickerOpen(nextIsOpen);\n }}\n minValue={minValue}\n maxValue={maxValue}\n granularity={showTime ? 'minute' : 'day'}\n hourCycle={\n hourFormat === '12' ? 12 : hourFormat === '24' ? 24 : undefined\n }\n aria-label={effectiveAriaLabel}\n aria-labelledby={effectiveAriaLabelledby}\n aria-describedby={effectiveAriaDescribedby}\n className='cratis-date-picker__picker'\n >\n {({ isOpen }) => (\n <>\n <Group\n {...pt?.group}\n id={inputId}\n aria-invalid={effectiveInvalid || undefined}\n className={classNames(\n 'cratis-date-picker__group',\n pt?.group?.className,\n )}\n data-cratis-part='group'\n data-empty={value === null || undefined}\n render={(groupProps) => (\n <div\n {...groupProps}\n data-open={isOpen || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-disabled={effectiveDisabled || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={value !== null || undefined}\n />\n )}\n >\n <DateInput\n {...inputPartAttributes}\n className={classNames(\n 'cratis-date-picker__input',\n pt?.input?.className,\n )}\n style={pt?.input?.style}\n data-cratis-part='input'\n data-placeholder={effectivePlaceholder}\n render={(inputProps) => (\n <div\n {...inputProps}\n data-open={isOpen || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-disabled={effectiveDisabled || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={value !== null || undefined}\n />\n )}\n >\n {(segment) => (\n <DateSegment\n {...pt?.segment}\n segment={segment}\n className={classNames(\n 'cratis-date-picker__segment',\n pt?.segment?.className,\n )}\n data-cratis-part='segment'\n render={(segmentProps) => (\n <span\n {...segmentProps}\n data-invalid={\n effectiveInvalid || undefined\n }\n data-disabled={\n effectiveDisabled || undefined\n }\n data-readonly={\n effectiveReadOnly || undefined\n }\n />\n )}\n />\n )}\n </DateInput>\n {value === null && effectivePlaceholder && (\n <span\n {...pt?.placeholder}\n className={classNames(\n 'cratis-date-picker__placeholder',\n pt?.placeholder?.className,\n )}\n data-cratis-part='placeholder'\n aria-hidden='true'\n >\n {effectivePlaceholder}\n </span>\n )}\n {showIcon && (\n <Button\n {...asReactAriaButtonProps(pt?.trigger)}\n isDisabled={\n effectiveDisabled || effectiveReadOnly\n }\n className={classNames(\n 'cratis-date-picker__trigger',\n pt?.trigger?.className,\n )}\n data-cratis-part='trigger'\n render={(triggerProps) => (\n <button\n {...triggerProps}\n data-open={isOpen || undefined}\n data-invalid={\n effectiveInvalid || undefined\n }\n data-disabled={\n effectiveDisabled ||\n effectiveReadOnly ||\n undefined\n }\n data-readonly={\n effectiveReadOnly || undefined\n }\n data-selected={\n value !== null || undefined\n }\n />\n )}\n aria-label={\n pt?.trigger?.['aria-label'] ??\n datePickerMessages?.openCalendar ??\n 'Open calendar'\n }\n >\n <span aria-hidden='true'>▦</span>\n </Button>\n )}\n </Group>\n <Popover\n {...pt?.popover}\n isNonModal={isNonModal}\n className={classNames(\n 'cratis-date-picker__popover',\n pt?.popover?.className,\n )}\n style={{\n zIndex: resolvedPopoverZIndex,\n ...pt?.popover?.style,\n }}\n data-cratis-part='popover'\n data-open\n placement='bottom start'\n >\n <Dialog\n {...pt?.dialog}\n className={classNames(\n 'cratis-date-picker__dialog',\n pt?.dialog?.className,\n )}\n data-cratis-part='dialog'\n data-open\n >\n <Calendar\n {...pt?.calendar}\n className={classNames(\n 'cratis-date-picker__calendar',\n pt?.calendar?.className,\n )}\n data-cratis-part='calendar'\n data-open\n >\n <header\n {...pt?.header}\n className={classNames(\n 'cratis-date-picker__header',\n pt?.header?.className,\n )}\n data-cratis-part='header'\n >\n <Button\n {...asReactAriaButtonProps(pt?.previous)}\n slot='previous'\n className={classNames(\n 'cratis-date-picker__nav',\n pt?.previous?.className,\n )}\n data-cratis-part='previous'\n aria-label={\n pt?.previous?.['aria-label'] ??\n datePickerMessages?.previousMonth ??\n 'Previous month'\n }\n >\n <span aria-hidden='true'>\n {icon('previous', '‹')}\n </span>\n </Button>\n <Heading\n {...pt?.heading}\n className={classNames(\n 'cratis-date-picker__heading',\n pt?.heading?.className,\n )}\n data-cratis-part='heading'\n />\n <Button\n {...asReactAriaButtonProps(pt?.next)}\n slot='next'\n className={classNames(\n 'cratis-date-picker__nav',\n pt?.next?.className,\n )}\n data-cratis-part='next'\n aria-label={\n pt?.next?.['aria-label'] ??\n datePickerMessages?.nextMonth ??\n 'Next month'\n }\n >\n <span aria-hidden='true'>\n {icon('next', '›')}\n </span>\n </Button>\n </header>\n <CalendarGrid\n {...pt?.grid}\n className={classNames(\n 'cratis-date-picker__grid',\n pt?.grid?.className,\n )}\n data-cratis-part='grid'\n >\n <CalendarGridHeader>\n {(day) => (\n <CalendarHeaderCell>\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n {...pt?.cell}\n date={date}\n className={classNames(\n 'cratis-date-picker__cell',\n pt?.cell?.className,\n )}\n data-cratis-part='cell'\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </Calendar>\n {showButtonBar && (\n <div\n {...pt?.buttonBar}\n className={classNames(\n 'cratis-date-picker__button-bar',\n pt?.buttonBar?.className,\n )}\n data-cratis-part='button-bar'\n >\n <button\n {...pt?.today}\n type='button'\n className={classNames(\n 'cratis-date-picker__action',\n pt?.today?.className,\n )}\n data-cratis-part='today'\n data-disabled={\n actionsDisabled || isTodayOutOfBounds || undefined\n }\n disabled={actionsDisabled || isTodayOutOfBounds}\n aria-disabled={\n actionsDisabled || isTodayOutOfBounds || undefined\n }\n onClick={(event) => {\n if (actionsDisabled || isTodayOutOfBounds) return;\n onChange(todayDate, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n });\n }}\n >\n {resolvedTodayLabel}\n </button>\n <button\n {...pt?.clear}\n type='button'\n className={classNames(\n 'cratis-date-picker__action',\n pt?.clear?.className,\n )}\n data-cratis-part='clear'\n data-disabled={clearDisabled || undefined}\n disabled={clearDisabled}\n aria-disabled={clearDisabled || pt?.clear?.['aria-disabled'] || undefined}\n onClick={(event) => {\n if (clearDisabled) return;\n onChange(null, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n });\n }}\n >\n {resolvedClearLabel}\n </button>\n </div>\n )}\n </Dialog>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n </UNSAFE_PortalProvider>\n </div>\n );\n};\n"],"names":["_jsx","AriaDatePicker","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,WAAW,GAAG,CAChB,KAAkB,EAClB,QAA6B,KACX;AAClB,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;IACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,CAAC;AACjD,IAAA,OAAO,QAAQ,GAAG,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC;AACnD,CAAC;AAED,MAAM,MAAM,GAAG,CAAC,KAAuB,KACnC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,GAAG,IAAI;AAM5C,MAAM,6BAA6B,GAAG,CAAC,EAC1C,KAAK,EACL,QAAQ,EACR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AM;wDACd,WAAW,EAAE,KAAK,CAAC,WAAW;AACjC,qDAAA,CAAC;gDACN,CAAC,EAAA,QAAA,EAEA,kBAAkB,EAAA,CACd,EACTA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAU,CACjB,4BAA4B,EAC5B,EAAE,EAAE,KAAK,EAAE,SAAS,CACvB,EAAA,kBAAA,EACgB,OAAO,EAAA,eAAA,EACT,aAAa,IAAI,SAAS,EACzC,QAAQ,EAAE,aAAa,EAAA,eAAA,EACR,aAAa,IAAI,EAAE,EAAE,KAAK,GAAG,eAAe,CAAC,IAAI,SAAS,EACzE,OAAO,EAAE,CAAC,KAAK,KAAI;AACf,oDAAA,IAAI,aAAa;wDAAE;oDACnB,QAAQ,CAAC,IAAI,EAAE;AACX,wDAAA,MAAM,EAAE,MAAM;wDACd,WAAW,EAAE,KAAK,CAAC,WAAW;AACjC,qDAAA,CAAC;AACN,gDAAA,CAAC,EAAA,QAAA,EAEA,kBAAkB,EAAA,CACd,CAAA,EAAA,CACP,CACT,CAAA,EAAA,CACI,EAAA,CACH,CAAA,EAAA,CACX,CACN,EAAA,CACY,EAAA,CACG,EAAA,CACtB;AAEd;;"}
1
+ {"version":3,"file":"DatePickerInputImplementation.js","sources":["../../../Common/DatePickerInputImplementation.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport {\n Button,\n DatePicker as AriaDatePicker,\n} from 'react-aria-components/DatePicker';\nimport { UNSAFE_PortalProvider } from 'react-aria';\nimport { unstable_useOverlayEnvironment } from '../renderer/RendererContext';\nimport { asReactAriaButtonProps } from './reactAriaProps';\nimport type { DatePickerInputProps } from './DatePickerInput';\nimport { classNames } from '../ClassNames/classNames';\nimport { DatePickerDateInput } from './DatePickerDateInput';\nimport { DatePickerGroup, DatePickerPlaceholder } from './DatePickerGroup';\nimport { DatePickerPopover } from './DatePickerPopover';\nimport { asDate, asDateValue } from './datePickerValues';\nimport { rootStateAttributes, triggerStateAttributes } from './datePickerStateAttributes';\nimport { useDatePickerState } from './useDatePickerState';\nimport { useDatePickerAccessibility } from './useDatePickerAccessibility';\n\nconst resolveHourCycle = (hourFormat: DatePickerInputProps['hourFormat']) => {\n if (hourFormat === '12') return 12;\n return hourFormat === '24' ? 24 : undefined;\n};\n\n/**\n * An internationalized date or date-time picker with Cratis-owned markup parts.\n * The public boundary remains `Date | null`; React Aria's calendar values stay internal.\n */\nexport const DatePickerInputImplementation = (props: DatePickerInputProps) => {\n const { value, onChange, onBlur, showButtonBar, isNonModal = false, showIcon = true, showTime, hourFormat, style, pt } = props;\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const overlayEnvironment = unstable_useOverlayEnvironment();\n const state = useDatePickerState(props);\n const { calendarId, triggerLabel, triggerAttributes } = useDatePickerAccessibility(props, state.datePickerMessages?.openCalendar);\n const { effectiveDisabled, effectiveReadOnly } = state;\n const fieldState = {\n invalid: state.effectiveInvalid,\n disabled: effectiveDisabled,\n readOnly: effectiveReadOnly,\n selected: value !== null,\n };\n const buttonBar = showButtonBar ? {\n pt,\n todayLabel: state.resolvedTodayLabel,\n clearLabel: state.resolvedClearLabel,\n actionsDisabled: state.actionsDisabled,\n clearDisabled: state.clearDisabled,\n isTodayOutOfBounds: state.isTodayOutOfBounds,\n todayDate: state.todayDate,\n onChange,\n } : null;\n\n return (\n <div\n {...pt?.root}\n className={state.rootClassName}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-cratis-component='DatePickerInput'\n {...rootStateAttributes(fieldState, isPickerOpen)}\n onBlur={onBlur}\n >\n <UNSAFE_PortalProvider getContainer={overlayEnvironment.getContainer}>\n <AriaDatePicker\n value={asDateValue(value, showTime)}\n onChange={(next) => onChange(asDate(next), { source: 'user' })}\n isDisabled={effectiveDisabled}\n isReadOnly={effectiveReadOnly}\n isInvalid={state.effectiveInvalid}\n isOpen={isPickerOpen}\n onOpenChange={(nextIsOpen) => {\n if (!nextIsOpen || !effectiveReadOnly) setIsPickerOpen(nextIsOpen);\n }}\n minValue={state.minValue}\n maxValue={state.maxValue}\n granularity={showTime ? 'minute' : 'day'}\n hourCycle={resolveHourCycle(hourFormat)}\n aria-label={state.effectiveAriaLabel}\n aria-labelledby={state.effectiveAriaLabelledby}\n aria-describedby={state.effectiveAriaDescribedby}\n className='cratis-date-picker__picker'\n >\n {({ isOpen }) => (\n <>\n <DatePickerGroup pt={pt} inputId={state.inputId} state={fieldState} isOpen={isOpen}>\n <DatePickerDateInput\n pt={pt}\n inputPartAttributes={state.inputPartAttributes}\n placeholder={state.effectivePlaceholder}\n state={fieldState}\n isOpen={isOpen}\n />\n <DatePickerPlaceholder\n pt={pt}\n placeholder={state.effectivePlaceholder}\n selected={fieldState.selected}\n />\n {showIcon && (\n <Button\n {...asReactAriaButtonProps(pt?.trigger)}\n isDisabled={\n effectiveDisabled || effectiveReadOnly\n }\n className={classNames(\n 'cratis-date-picker__trigger',\n pt?.trigger?.className,\n )}\n data-cratis-part='trigger'\n render={(triggerProps) => (\n <button\n {...triggerProps}\n {...triggerStateAttributes(fieldState, isOpen)}\n {...triggerAttributes(isOpen)}\n />\n )}\n aria-label={triggerLabel}\n >\n <span aria-hidden='true'>▦</span>\n </Button>\n )}\n </DatePickerGroup>\n <DatePickerPopover\n id={calendarId}\n pt={pt}\n isNonModal={isNonModal}\n zIndex={state.resolvedPopoverZIndex}\n buttonBar={buttonBar}\n />\n </>\n )}\n </AriaDatePicker>\n </UNSAFE_PortalProvider>\n </div>\n );\n};\n"],"names":["_jsx","AriaDatePicker","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAM,gBAAgB,GAAG,CAAC,UAA8C,KAAI;IACxE,IAAI,UAAU,KAAK,IAAI;AAAE,QAAA,OAAO,EAAE;IAClC,OAAO,UAAU,KAAK,IAAI,GAAG,EAAE,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+1,13 @@
1
+ import { type DatePickerButtonBarProps } from './DatePickerButtonBar.js';
2
+ import type { DatePickerInputPassThrough } from './DatePickerInput.js';
3
+ interface DatePickerPopoverProps {
4
+ id: string;
5
+ pt: DatePickerInputPassThrough | undefined;
6
+ isNonModal: boolean;
7
+ zIndex: string;
8
+ buttonBar: DatePickerButtonBarProps | null;
9
+ }
10
+ /** The portaled popover with the calendar dialog and, when requested, the Today and Clear actions. */
11
+ export declare const DatePickerPopover: ({ id, pt, isNonModal, zIndex, buttonBar }: DatePickerPopoverProps) => import("react").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=DatePickerPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerPopover.d.ts","sourceRoot":"","sources":["../../../Common/DatePickerPopover.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,0BAAuB,CAAC;AAE3F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,sBAAmB,CAAC;AAEpE,UAAU,sBAAsB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,0BAA0B,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC9C;AAED,sGAAsG;AACtG,eAAO,MAAM,iBAAiB,8CAA+C,sBAAsB,gCAqBlG,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Popover } from 'react-aria-components/DatePicker';
3
+ import { Dialog } from 'react-aria-components/Dialog';
4
+ import { classNames } from '../ClassNames/classNames.js';
5
+ import { DatePickerButtonBar } from './DatePickerButtonBar.js';
6
+ import { DatePickerCalendar } from './DatePickerCalendar.js';
7
+
8
+ const DatePickerPopover = ({ id, pt, isNonModal, zIndex, buttonBar }) => (jsx(Popover, { ...pt?.popover, isNonModal: isNonModal, className: classNames('cratis-date-picker__popover', pt?.popover?.className), style: { zIndex, ...pt?.popover?.style }, "data-cratis-part": 'popover', "data-open": true, placement: 'bottom start', children: jsxs(Dialog, { ...pt?.dialog, id: id, className: classNames('cratis-date-picker__dialog', pt?.dialog?.className), "data-cratis-part": 'dialog', "data-open": true, children: [jsx(DatePickerCalendar, { pt: pt }), buttonBar && jsx(DatePickerButtonBar, { ...buttonBar })] }) }));
9
+
10
+ export { DatePickerPopover };
11
+ //# sourceMappingURL=DatePickerPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerPopover.js","sources":["../../../Common/DatePickerPopover.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Popover } from 'react-aria-components/DatePicker';\nimport { Dialog } from 'react-aria-components/Dialog';\nimport { classNames } from '../ClassNames/classNames';\nimport { DatePickerButtonBar, type DatePickerButtonBarProps } from './DatePickerButtonBar';\nimport { DatePickerCalendar } from './DatePickerCalendar';\nimport type { DatePickerInputPassThrough } from './DatePickerInput';\n\ninterface DatePickerPopoverProps {\n id: string;\n pt: DatePickerInputPassThrough | undefined;\n isNonModal: boolean;\n zIndex: string;\n buttonBar: DatePickerButtonBarProps | null;\n}\n\n/** The portaled popover with the calendar dialog and, when requested, the Today and Clear actions. */\nexport const DatePickerPopover = ({ id, pt, isNonModal, zIndex, buttonBar }: DatePickerPopoverProps) => (\n <Popover\n {...pt?.popover}\n isNonModal={isNonModal}\n className={classNames('cratis-date-picker__popover', pt?.popover?.className)}\n style={{ zIndex, ...pt?.popover?.style }}\n data-cratis-part='popover'\n data-open\n placement='bottom start'\n >\n <Dialog\n {...pt?.dialog}\n id={id}\n className={classNames('cratis-date-picker__dialog', pt?.dialog?.className)}\n data-cratis-part='dialog'\n data-open\n >\n <DatePickerCalendar pt={pt} />\n {buttonBar && <DatePickerButtonBar {...buttonBar} />}\n </Dialog>\n </Popover>\n);\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;MAmBa,iBAAiB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAA0B,MAC/FA,GAAA,CAAC,OAAO,EAAA,EAAA,GACA,EAAE,EAAE,OAAO,EACf,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,UAAU,CAAC,6BAA6B,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,EAC5E,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAA,kBAAA,EACvB,SAAS,EAAA,WAAA,EAAA,IAAA,EAE1B,SAAS,EAAC,cAAc,EAAA,QAAA,EAExBC,IAAA,CAAC,MAAM,EAAA,EAAA,GACC,EAAE,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAA,kBAAA,EACzD,QAAQ,gCAGzBD,GAAA,CAAC,kBAAkB,EAAA,EAAC,EAAE,EAAE,EAAE,GAAI,EAC7B,SAAS,IAAIA,GAAA,CAAC,mBAAmB,EAAA,EAAA,GAAK,SAAS,EAAA,CAAI,CAAA,EAAA,CAC/C,EAAA,CACH;;"}
@@ -17,6 +17,8 @@ export interface PageProps extends HTMLAttributes<HTMLDivElement> {
17
17
  * trail rendered inside `children` instead.
18
18
  */
19
19
  showTitle?: boolean;
20
+ /** Whether the content region is a main landmark. Defaults to true; set false inside an existing main. */
21
+ landmark?: boolean;
20
22
  /** Page body content. */
21
23
  children?: ReactNode;
22
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../Common/Page.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC7D;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB;AASD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,kBAAmB,SAAS,gCAW5C,CAAC"}
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../Common/Page.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlD;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC7D;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB;AASD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI,kBAAmB,SAAS,gCAY5C,CAAC"}
@@ -9,8 +9,9 @@ const pageDescriptor = describeComponent('Page', [
9
9
  ]);
10
10
  const Page = (incomingProps) => {
11
11
  const [props, marker] = useComponentPresentation(pageDescriptor, incomingProps, incomingProps.id);
12
- const { title, showTitle = false, children, panel, className, ...rest } = props;
13
- return (jsxs("div", { ...marker, className: `cratis:flex cratis:flex-col cratis:h-full cratis:flex-1${className ? ` ${className}` : ''}`, ...rest, children: [showTitle && jsx("h1", { className: 'cratis:text-3xl cratis:mt-3 cratis:mb-4', children: title }), jsx("main", { className: `cratis:overflow-hidden cratis:h-full cratis:flex cratis:flex-col cratis:flex-1 ${panel ? 'panel' : ''}`, children: children })] }));
12
+ const { title, showTitle = false, landmark = true, children, panel, className, ...rest } = props;
13
+ const Content = landmark ? 'main' : 'div';
14
+ return (jsxs("div", { ...marker, className: `cratis:flex cratis:flex-col cratis:h-full cratis:flex-1${className ? ` ${className}` : ''}`, ...rest, children: [showTitle && jsx("h1", { className: 'cratis:text-3xl cratis:mt-3 cratis:mb-4', children: title }), jsx(Content, { className: `cratis:overflow-hidden cratis:h-full cratis:flex cratis:flex-col cratis:flex-1 ${panel ? 'panel' : ''}`, children: children })] }));
14
15
  };
15
16
 
16
17
  export { Page };