@ankhorage/zora 13.0.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +11 -5
  3. package/dist/features/accordion/adapters/inbound/Accordion.js +4 -4
  4. package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -1
  5. package/dist/features/accordion/adapters/inbound/AccordionItem.js +1 -1
  6. package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -1
  7. package/dist/features/date-picker/adapters/inbound/DatePicker.d.ts +1 -6
  8. package/dist/features/date-picker/adapters/inbound/DatePicker.d.ts.map +1 -1
  9. package/dist/features/date-picker/adapters/inbound/DatePicker.js +1 -175
  10. package/dist/features/date-picker/adapters/inbound/DatePicker.js.map +1 -1
  11. package/dist/features/date-picker/adapters/inbound/DatePicker.native.d.ts +5 -0
  12. package/dist/features/date-picker/adapters/inbound/DatePicker.native.d.ts.map +1 -0
  13. package/dist/features/date-picker/adapters/inbound/DatePicker.native.js +27 -0
  14. package/dist/features/date-picker/adapters/inbound/DatePicker.native.js.map +1 -0
  15. package/dist/features/date-picker/adapters/inbound/DatePicker.web.d.ts +5 -0
  16. package/dist/features/date-picker/adapters/inbound/DatePicker.web.d.ts.map +1 -0
  17. package/dist/features/date-picker/adapters/inbound/DatePicker.web.js +25 -0
  18. package/dist/features/date-picker/adapters/inbound/DatePicker.web.js.map +1 -0
  19. package/dist/features/date-picker/composition/DatePickerContent.d.ts +10 -0
  20. package/dist/features/date-picker/composition/DatePickerContent.d.ts.map +1 -0
  21. package/dist/features/date-picker/composition/DatePickerContent.js +129 -0
  22. package/dist/features/date-picker/composition/DatePickerContent.js.map +1 -0
  23. package/dist/features/date-picker/composition/DatePickerField.d.ts +9 -0
  24. package/dist/features/date-picker/composition/DatePickerField.d.ts.map +1 -0
  25. package/dist/features/date-picker/composition/DatePickerField.js +21 -0
  26. package/dist/features/date-picker/composition/DatePickerField.js.map +1 -0
  27. package/dist/features/date-picker/composition/DatePickerTrigger.d.ts +9 -0
  28. package/dist/features/date-picker/composition/DatePickerTrigger.d.ts.map +1 -0
  29. package/dist/features/date-picker/composition/DatePickerTrigger.js +18 -0
  30. package/dist/features/date-picker/composition/DatePickerTrigger.js.map +1 -0
  31. package/dist/features/time-picker/adapters/inbound/TimePicker.d.ts +1 -6
  32. package/dist/features/time-picker/adapters/inbound/TimePicker.d.ts.map +1 -1
  33. package/dist/features/time-picker/adapters/inbound/TimePicker.js +1 -116
  34. package/dist/features/time-picker/adapters/inbound/TimePicker.js.map +1 -1
  35. package/dist/features/time-picker/adapters/inbound/TimePicker.native.d.ts +5 -0
  36. package/dist/features/time-picker/adapters/inbound/TimePicker.native.d.ts.map +1 -0
  37. package/dist/features/time-picker/adapters/inbound/TimePicker.native.js +26 -0
  38. package/dist/features/time-picker/adapters/inbound/TimePicker.native.js.map +1 -0
  39. package/dist/features/time-picker/adapters/inbound/TimePicker.web.d.ts +5 -0
  40. package/dist/features/time-picker/adapters/inbound/TimePicker.web.d.ts.map +1 -0
  41. package/dist/features/time-picker/adapters/inbound/TimePicker.web.js +24 -0
  42. package/dist/features/time-picker/adapters/inbound/TimePicker.web.js.map +1 -0
  43. package/dist/features/time-picker/composition/TimePickerContent.d.ts +10 -0
  44. package/dist/features/time-picker/composition/TimePickerContent.d.ts.map +1 -0
  45. package/dist/features/time-picker/composition/TimePickerContent.js +78 -0
  46. package/dist/features/time-picker/composition/TimePickerContent.js.map +1 -0
  47. package/dist/features/time-picker/composition/TimePickerField.d.ts +9 -0
  48. package/dist/features/time-picker/composition/TimePickerField.d.ts.map +1 -0
  49. package/dist/features/time-picker/composition/TimePickerField.js +21 -0
  50. package/dist/features/time-picker/composition/TimePickerField.js.map +1 -0
  51. package/dist/features/time-picker/composition/TimePickerTrigger.d.ts +8 -0
  52. package/dist/features/time-picker/composition/TimePickerTrigger.d.ts.map +1 -0
  53. package/dist/features/time-picker/composition/TimePickerTrigger.js +9 -0
  54. package/dist/features/time-picker/composition/TimePickerTrigger.js.map +1 -0
  55. package/dist/features/toast/adapters/inbound/Toast.d.ts +5 -0
  56. package/dist/features/toast/adapters/inbound/Toast.d.ts.map +1 -0
  57. package/dist/features/toast/adapters/inbound/Toast.js +10 -0
  58. package/dist/features/toast/adapters/inbound/Toast.js.map +1 -0
  59. package/dist/features/toast/adapters/inbound/ToastProvider.d.ts +5 -0
  60. package/dist/features/toast/adapters/inbound/ToastProvider.d.ts.map +1 -0
  61. package/dist/features/toast/adapters/inbound/ToastProvider.js +7 -0
  62. package/dist/features/toast/adapters/inbound/ToastProvider.js.map +1 -0
  63. package/dist/features/toast/public.d.ts +5 -0
  64. package/dist/features/toast/public.d.ts.map +1 -0
  65. package/dist/features/toast/public.js +4 -0
  66. package/dist/features/toast/public.js.map +1 -0
  67. package/dist/features/toast/toastMeta.d.ts +9 -0
  68. package/dist/features/toast/toastMeta.d.ts.map +1 -0
  69. package/dist/features/toast/toastMeta.js +9 -0
  70. package/dist/features/toast/toastMeta.js.map +1 -0
  71. package/dist/features/toast/toastProviderMeta.d.ts +9 -0
  72. package/dist/features/toast/toastProviderMeta.d.ts.map +1 -0
  73. package/dist/features/toast/toastProviderMeta.js +9 -0
  74. package/dist/features/toast/toastProviderMeta.js.map +1 -0
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/index.js.map +1 -1
  79. package/dist/metadata/componentMeta.d.ts.map +1 -1
  80. package/dist/metadata/componentMeta.js +2 -1
  81. package/dist/metadata/componentMeta.js.map +1 -1
  82. package/dist/patterns/selection/SelectionProvider.d.ts +0 -4
  83. package/dist/patterns/selection/SelectionProvider.d.ts.map +1 -1
  84. package/dist/patterns/selection/SelectionProvider.js +4 -6
  85. package/dist/patterns/selection/SelectionProvider.js.map +1 -1
  86. package/dist/registry.js +1 -1
  87. package/dist/registry.js.map +1 -1
  88. package/dist/theme/ZoraProvider.d.ts +4 -10
  89. package/dist/theme/ZoraProvider.d.ts.map +1 -1
  90. package/dist/theme/ZoraProvider.js +8 -6
  91. package/dist/theme/ZoraProvider.js.map +1 -1
  92. package/dist/theme/ZoraRuntimeCapabilities.d.ts +2 -0
  93. package/dist/theme/ZoraRuntimeCapabilities.d.ts.map +1 -0
  94. package/dist/theme/ZoraRuntimeCapabilities.js +2 -0
  95. package/dist/theme/ZoraRuntimeCapabilities.js.map +1 -0
  96. package/dist/theme/ZoraRuntimeCapabilities.native.d.ts +4 -0
  97. package/dist/theme/ZoraRuntimeCapabilities.native.d.ts.map +1 -0
  98. package/dist/theme/ZoraRuntimeCapabilities.native.js +8 -0
  99. package/dist/theme/ZoraRuntimeCapabilities.native.js.map +1 -0
  100. package/dist/theme/ZoraRuntimeCapabilities.web.d.ts +4 -0
  101. package/dist/theme/ZoraRuntimeCapabilities.web.d.ts.map +1 -0
  102. package/dist/theme/ZoraRuntimeCapabilities.web.js +8 -0
  103. package/dist/theme/ZoraRuntimeCapabilities.web.js.map +1 -0
  104. package/dist/theme/ZoraThemeRuntimeContext.d.ts +1 -0
  105. package/dist/theme/ZoraThemeRuntimeContext.d.ts.map +1 -1
  106. package/dist/theme/ZoraThemeRuntimeContext.js +3 -2
  107. package/dist/theme/ZoraThemeRuntimeContext.js.map +1 -1
  108. package/dist/theme/ZoraThemeScope.d.ts +1 -0
  109. package/dist/theme/ZoraThemeScope.d.ts.map +1 -1
  110. package/dist/theme/ZoraThemeScope.js +12 -10
  111. package/dist/theme/ZoraThemeScope.js.map +1 -1
  112. package/dist/theme/index.d.ts +1 -1
  113. package/dist/theme/index.d.ts.map +1 -1
  114. package/dist/theme/index.js.map +1 -1
  115. package/dist/types/provider.d.ts +19 -0
  116. package/dist/types/provider.d.ts.map +1 -0
  117. package/dist/types/provider.js +2 -0
  118. package/dist/types/provider.js.map +1 -0
  119. package/dist/types/toast.d.ts +9 -0
  120. package/dist/types/toast.d.ts.map +1 -0
  121. package/dist/types/toast.js +2 -0
  122. package/dist/types/toast.js.map +1 -0
  123. package/package.json +2 -2
  124. package/src/features/accordion/adapters/inbound/Accordion.tsx +4 -4
  125. package/src/features/accordion/adapters/inbound/AccordionItem.tsx +1 -1
  126. package/src/features/bottom-sheet/public.test.ts +15 -12
  127. package/src/features/date-picker/adapters/inbound/DatePicker.native.tsx +46 -0
  128. package/src/features/date-picker/adapters/inbound/DatePicker.tsx +1 -356
  129. package/src/features/date-picker/adapters/inbound/DatePicker.web.tsx +48 -0
  130. package/src/features/date-picker/composition/DatePickerContent.tsx +256 -0
  131. package/src/features/date-picker/composition/DatePickerField.tsx +53 -0
  132. package/src/features/date-picker/composition/DatePickerTrigger.tsx +47 -0
  133. package/src/features/date-picker/public.test.ts +14 -4
  134. package/src/features/time-picker/adapters/inbound/TimePicker.native.tsx +47 -0
  135. package/src/features/time-picker/adapters/inbound/TimePicker.tsx +1 -258
  136. package/src/features/time-picker/adapters/inbound/TimePicker.web.tsx +49 -0
  137. package/src/features/time-picker/composition/TimePickerContent.tsx +164 -0
  138. package/src/features/time-picker/composition/TimePickerField.tsx +53 -0
  139. package/src/features/time-picker/composition/TimePickerTrigger.tsx +35 -0
  140. package/src/features/time-picker/public.test.ts +14 -3
  141. package/src/features/toast/adapters/inbound/Toast.tsx +13 -0
  142. package/src/features/toast/adapters/inbound/ToastProvider.tsx +9 -0
  143. package/src/features/toast/public.test.ts +19 -0
  144. package/src/features/toast/public.ts +10 -0
  145. package/src/features/toast/toastMeta.ts +10 -0
  146. package/src/features/toast/toastProviderMeta.ts +10 -0
  147. package/src/index.ts +8 -2
  148. package/src/metadata/componentMeta.ts +2 -1
  149. package/src/patterns/selection/SelectionProvider.tsx +4 -6
  150. package/src/registry.ts +1 -1
  151. package/src/theme/ZoraProvider.tsx +11 -13
  152. package/src/theme/ZoraRuntimeCapabilities.native.tsx +19 -0
  153. package/src/theme/ZoraRuntimeCapabilities.tsx +1 -0
  154. package/src/theme/ZoraRuntimeCapabilities.web.tsx +10 -0
  155. package/src/theme/ZoraThemeRuntimeContext.tsx +3 -2
  156. package/src/theme/ZoraThemeScope.tsx +14 -12
  157. package/src/theme/index.ts +1 -1
  158. package/src/theme/themeConfigScope.test.ts +4 -1
  159. package/src/theme/themeScopeStructure.test.ts +24 -16
  160. package/src/types/provider.ts +22 -0
  161. package/src/{components/toast/types.ts → types/toast.ts} +5 -7
  162. package/dist/components/toast/Toast.d.ts +0 -9
  163. package/dist/components/toast/Toast.d.ts.map +0 -1
  164. package/dist/components/toast/Toast.js +0 -13
  165. package/dist/components/toast/Toast.js.map +0 -1
  166. package/dist/components/toast/ToastProvider.d.ts +0 -9
  167. package/dist/components/toast/ToastProvider.d.ts.map +0 -1
  168. package/dist/components/toast/ToastProvider.js +0 -14
  169. package/dist/components/toast/ToastProvider.js.map +0 -1
  170. package/dist/components/toast/index.d.ts +0 -5
  171. package/dist/components/toast/index.d.ts.map +0 -1
  172. package/dist/components/toast/index.js +0 -4
  173. package/dist/components/toast/index.js.map +0 -1
  174. package/dist/components/toast/meta.d.ts +0 -17
  175. package/dist/components/toast/meta.d.ts.map +0 -1
  176. package/dist/components/toast/meta.js +0 -17
  177. package/dist/components/toast/meta.js.map +0 -1
  178. package/dist/components/toast/types.d.ts +0 -12
  179. package/dist/components/toast/types.d.ts.map +0 -1
  180. package/dist/components/toast/types.js +0 -2
  181. package/dist/components/toast/types.js.map +0 -1
  182. package/src/components/toast/Toast.tsx +0 -16
  183. package/src/components/toast/ToastProvider.tsx +0 -17
  184. package/src/components/toast/index.ts +0 -4
  185. package/src/components/toast/meta.ts +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 1b21ad4: Make toast and native bottom-sheet runtime hosts explicit `ZoraProvider` capabilities, migrate Toast to feature ownership, and render DatePicker/TimePicker through platform-specific hosts with BottomSheet on native and Popover on web.
8
+
9
+ BREAKING CHANGE: `ZoraProvider` no longer installs `BottomSheetProvider` automatically. Native apps using BottomSheet-backed interactions must enable `<ZoraProvider bottomSheet>`. Enable `<ZoraProvider toast>` or pass toast provider options when descendants use `useToast()`.
10
+
3
11
  ## 13.0.0
4
12
 
5
13
  ### Major Changes
package/README.md CHANGED
@@ -3,16 +3,17 @@
3
3
 
4
4
  # @ankhorage/zora
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v12.1.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v13.0.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.
9
9
 
10
10
  ## Usage
11
11
 
12
- ### Minimal ZORA app root.
12
+ ### ZORA app root with optional runtime capabilities.
13
13
 
14
- Use `ZoraProvider` once at the application root, place `AppShell` inside it,
15
- and use `AppBar` as the default header slot for a simple app frame.
14
+ Use `ZoraProvider` once at the application root. Enable `toast` when descendants use
15
+ `useToast()`. Enable `bottomSheet` for native BottomSheet-backed interactions such as native
16
+ DatePicker and TimePicker; web pickers use Popover instead. Omit capabilities the app does not use.
16
17
 
17
18
  Source: `examples/basic-app/App.tsx`
18
19
 
@@ -39,7 +40,12 @@ const basicTheme: ZoraTheme = {
39
40
  export default function BasicApp() {
40
41
  return (
41
42
  <GestureHandlerRootView style={{ flex: 1 }}>
42
- <ZoraProvider initialMode="light" theme={basicTheme}>
43
+ <ZoraProvider
44
+ bottomSheet
45
+ initialMode="light"
46
+ theme={basicTheme}
47
+ toast={{ defaultDuration: 4000 }}
48
+ >
43
49
  <AppShell header={<AppBar title="Dashboard" subtitle="Welcome to ZORA" />}>
44
50
  <Screen>
45
51
  <ScreenSection>
@@ -15,27 +15,27 @@ function AccordionInner(props) {
15
15
  function MultipleAccordion({ themeId: _themeId, mode: _mode, children, defaultValue, interactionPolicy, onValueChange, value, ...surfaceProps }) {
16
16
  const [presentationValues, setPresentationValues] = React.useState(() => value ?? defaultValue ?? []);
17
17
  const openValues = value ?? presentationValues;
18
- return (<AccordionPresentationContext.Provider value={{ mode: 'multiple', openValues }}>
18
+ return (<AccordionPresentationContext value={{ mode: 'multiple', openValues }}>
19
19
  <SurfaceAccordion {...surfaceProps} defaultValue={defaultValue} interactionPolicy={interactionPolicy} onValueChange={(nextValues) => {
20
20
  setPresentationValues(nextValues);
21
21
  onValueChange?.(nextValues);
22
22
  }} type="multiple" value={value}>
23
23
  {children}
24
24
  </SurfaceAccordion>
25
- </AccordionPresentationContext.Provider>);
25
+ </AccordionPresentationContext>);
26
26
  }
27
27
  /*** Mirrors Surface single-value state for ZORA presentation only. */
28
28
  function SingleAccordion({ themeId: _themeId, mode: _mode, children, defaultValue, interactionPolicy, onValueChange, type: _type, value, ...surfaceProps }) {
29
29
  const [presentationValue, setPresentationValue] = React.useState(() => value ?? defaultValue);
30
30
  const openValue = value ?? presentationValue;
31
31
  const openValues = openValue === undefined ? [] : [openValue];
32
- return (<AccordionPresentationContext.Provider value={{ mode: 'single', openValues }}>
32
+ return (<AccordionPresentationContext value={{ mode: 'single', openValues }}>
33
33
  <SurfaceAccordion {...surfaceProps} defaultValue={defaultValue} interactionPolicy={interactionPolicy} onValueChange={(nextValue) => {
34
34
  setPresentationValue(nextValue);
35
35
  onValueChange?.(nextValue);
36
36
  }} type="single" value={value}>
37
37
  {children}
38
38
  </SurfaceAccordion>
39
- </AccordionPresentationContext.Provider>);
39
+ </AccordionPresentationContext>);
40
40
  }
41
41
  //# sourceMappingURL=Accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAE9F,yFAAyF;AACzF,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAE5D,qFAAqF;AACrF,SAAS,cAAc,CAAC,KAAqB;IAC3C,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC1C,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACxC,CAAC;AAED,wEAAwE;AACxE,SAAS,iBAAiB,CAAC,EACzB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,GAAG,YAAY,EACQ;IACvB,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAChE,GAAG,EAAE,CAAC,KAAK,IAAI,YAAY,IAAI,EAAE,CAClC,CAAC;IACF,MAAM,UAAU,GAAG,KAAK,IAAI,kBAAkB,CAAC;IAE/C,OAAO,CACL,CAAC,4BAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAC7E;MAAA,CAAC,gBAAg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,CAAC,CAAC;YAChC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC,CAAC,CACF,IAAI,CAAC,QAAQ,CACb,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC","sourcesContent":["import { Accordion as SurfaceAccordion } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n} from '../../../../types/accordion';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders a ZORA accordion backed by Surface expansion and accessibility mechanics. */\nexport const Accordion = withZoraThemeScope(AccordionInner);\n\n/*** Routes the public accordion union to its single or multiple Surface contract. */\nfunction AccordionInner(props: AccordionProps) {\n if (props.type === 'multiple') {\n return <MultipleAccordion {...props} />;\n }\n\n return <SingleAccordion {...props} />;\n}\n\n/*** Mirrors Surface multiple-value state for ZORA presentation only. */\nfunction MultipleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n value,\n ...surfaceProps\n}: AccordionMultipleProps) {\n const [presentationValues, setPresentationValues] = React.useState<readonly string[]>(\n () => value ?? defaultValue ?? [],\n );\n const openValues = value ?? presentationValues;\n\n return (\n <AccordionPresentationContext.Provider value={{ mode: 'multiple', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValues) => {\n setPresentationValues(nextValues);\n onValueChange?.(nextValues);\n }}\n type=\"multiple\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext.Provider>\n );\n}\n\n/*** Mirrors Surface single-value state for ZORA presentation only. */\nfunction SingleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n type: _type,\n value,\n ...surfaceProps\n}: AccordionSingleProps) {\n const [presentationValue, setPresentationValue] = React.useState<string | undefined>(\n () => value ?? defaultValue,\n );\n const openValue = value ?? presentationValue;\n const openValues = openValue === undefined ? [] : [openValue];\n\n return (\n <AccordionPresentationContext.Provider value={{ mode: 'single', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValue) => {\n setPresentationValue(nextValue);\n onValueChange?.(nextValue);\n }}\n type=\"single\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"Accordion.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAE9F,yFAAyF;AACzF,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAE5D,qFAAqF;AACrF,SAAS,cAAc,CAAC,KAAqB;IAC3C,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IAC1C,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACxC,CAAC;AAED,wEAAwE;AACxE,SAAS,iBAAiB,CAAC,EACzB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,KAAK,EACL,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AE9D,OAAO,CACL,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAClE;MAAA,CAAC,gBAAgB,CACf,IAAI,YAAY,CAAC,CACjB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE;YAC3B,oBAAoB,CAAC,SAAS,CAAC,CAAC;YAChC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC,CAAC,CACF,IAAI,CAAC,QAAQ,CACb,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,gBAAgB,CACpB;IAAA,EAAE,4BAA4B,CAAC,CAChC,CAAC;AACJ,CAAC","sourcesContent":["import { Accordion as SurfaceAccordion } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type {\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n} from '../../../../types/accordion';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders a ZORA accordion backed by Surface expansion and accessibility mechanics. */\nexport const Accordion = withZoraThemeScope(AccordionInner);\n\n/*** Routes the public accordion union to its single or multiple Surface contract. */\nfunction AccordionInner(props: AccordionProps) {\n if (props.type === 'multiple') {\n return <MultipleAccordion {...props} />;\n }\n\n return <SingleAccordion {...props} />;\n}\n\n/*** Mirrors Surface multiple-value state for ZORA presentation only. */\nfunction MultipleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n value,\n ...surfaceProps\n}: AccordionMultipleProps) {\n const [presentationValues, setPresentationValues] = React.useState<readonly string[]>(\n () => value ?? defaultValue ?? [],\n );\n const openValues = value ?? presentationValues;\n\n return (\n <AccordionPresentationContext value={{ mode: 'multiple', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValues) => {\n setPresentationValues(nextValues);\n onValueChange?.(nextValues);\n }}\n type=\"multiple\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext>\n );\n}\n\n/*** Mirrors Surface single-value state for ZORA presentation only. */\nfunction SingleAccordion({\n themeId: _themeId,\n mode: _mode,\n children,\n defaultValue,\n interactionPolicy,\n onValueChange,\n type: _type,\n value,\n ...surfaceProps\n}: AccordionSingleProps) {\n const [presentationValue, setPresentationValue] = React.useState<string | undefined>(\n () => value ?? defaultValue,\n );\n const openValue = value ?? presentationValue;\n const openValues = openValue === undefined ? [] : [openValue];\n\n return (\n <AccordionPresentationContext value={{ mode: 'single', openValues }}>\n <SurfaceAccordion\n {...surfaceProps}\n defaultValue={defaultValue}\n interactionPolicy={interactionPolicy}\n onValueChange={(nextValue) => {\n setPresentationValue(nextValue);\n onValueChange?.(nextValue);\n }}\n type=\"single\"\n value={value}\n >\n {children}\n </SurfaceAccordion>\n </AccordionPresentationContext>\n );\n}\n"]}
@@ -10,7 +10,7 @@ export const AccordionItem = withZoraThemeScope(AccordionItemInner);
10
10
  const triggerStyle = { flex: 1 };
11
11
  /*** Composes the item header, optional actions, expanded content, and separator. */
12
12
  function AccordionItemInner({ themeId: _themeId, mode: _mode, actions, children, description, disabled, icon, interactionPolicy, testID, title, value, ...surfaceItemProps }) {
13
- const presentation = React.useContext(AccordionPresentationContext);
13
+ const presentation = React.use(AccordionPresentationContext);
14
14
  if (!presentation) {
15
15
  throw new Error('AccordionItem must be rendered inside Accordion.');
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,uBAAuB,EAC3C,aAAa,IAAI,oBAAoB,EACrC,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3B;UAAA,EAAE,GAAG,CACL;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC/C;QAAA,EAAE,KAAK,CAEP;;QAAA,CAAC,uBAAuB,CACtB;UAAA,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAChB;YAAA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAClC;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,uBAAuB,CAEzB;;QAAA,CAAC,OAAO,CAAC,AAAD,EACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n AccordionContent as SurfaceAccordionContent,\n AccordionItem as SurfaceAccordionItem,\n AccordionTrigger as SurfaceAccordionTrigger,\n} from '@ankhorage/surface';\nimport React from 'react';\nimport type { ViewStyle } from 'react-native';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { AccordionItemProps } from '../../../../types/accordion';\nimport { Icon } from '../../../icon/public';\nimport { Box, Divider, Stack } from '../../../layout/public';\nimport { Heading, Text } from '../../../typography/public';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */\nexport const AccordionItem = withZoraThemeScope(AccordionItemInner);\n\nconst triggerStyle: ViewStyle = { flex: 1 };\n\n/*** Composes the item header, optional actions, expanded content, and separator. */\nfunction AccordionItemInner({\n themeId: _themeId,\n mode: _mode,\n actions,\n children,\n description,\n disabled,\n icon,\n interactionPolicy,\n testID,\n title,\n value,\n ...surfaceItemProps\n}: AccordionItemProps) {\n const presentation = React.useContext(AccordionPresentationContext);\n if (!presentation) {\n throw new Error('AccordionItem must be rendered inside Accordion.');\n }\n\n const open = presentation.openValues.includes(value);\n\n return (\n <SurfaceAccordionItem\n {...surfaceItemProps}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n testID={testID}\n value={value}\n >\n <Stack gap=\"none\">\n <Stack align=\"center\" direction=\"row\" gap=\"s\">\n <Box flex={1}>\n <SurfaceAccordionTrigger interactionPolicy={interactionPolicy} style={triggerStyle}>\n <Box px=\"m\" py=\"m\">\n <Stack align=\"center\" direction=\"row\" gap=\"m\">\n {icon ? <Icon {...icon} /> : null}\n <Box flex={1}>\n <Stack gap=\"xs\">\n <Heading level={4}>{title}</Heading>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n <Icon name={open ? 'chevron-up-outline' : 'chevron-down-outline'} size=\"m\" />\n </Stack>\n </Box>\n </SurfaceAccordionTrigger>\n </Box>\n {actions ? <Box pr=\"m\">{actions}</Box> : null}\n </Stack>\n\n <SurfaceAccordionContent>\n <Box px=\"m\" pb=\"m\">\n <Stack gap=\"m\">{children}</Stack>\n </Box>\n </SurfaceAccordionContent>\n\n <Divider />\n </Stack>\n </SurfaceAccordionItem>\n );\n}\n"]}
1
+ {"version":3,"file":"AccordionItem.js","sourceRoot":"","sources":["../../../../../src/features/accordion/adapters/inbound/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,uBAAuB,EAC3C,aAAa,IAAI,oBAAoB,EACrC,gBAAgB,IAAI,uBAAuB,GAC5C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAA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AAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAClC;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,uBAAuB,CAEzB;;QAAA,CAAC,OAAO,CAAC,AAAD,EACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n AccordionContent as SurfaceAccordionContent,\n AccordionItem as SurfaceAccordionItem,\n AccordionTrigger as SurfaceAccordionTrigger,\n} from '@ankhorage/surface';\nimport React from 'react';\nimport type { ViewStyle } from 'react-native';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { AccordionItemProps } from '../../../../types/accordion';\nimport { Icon } from '../../../icon/public';\nimport { Box, Divider, Stack } from '../../../layout/public';\nimport { Heading, Text } from '../../../typography/public';\nimport { AccordionPresentationContext } from '../../composition/AccordionPresentationContext';\n\n/*** Renders one opinionated ZORA accordion item over Surface trigger/content primitives. */\nexport const AccordionItem = withZoraThemeScope(AccordionItemInner);\n\nconst triggerStyle: ViewStyle = { flex: 1 };\n\n/*** Composes the item header, optional actions, expanded content, and separator. */\nfunction AccordionItemInner({\n themeId: _themeId,\n mode: _mode,\n actions,\n children,\n description,\n disabled,\n icon,\n interactionPolicy,\n testID,\n title,\n value,\n ...surfaceItemProps\n}: AccordionItemProps) {\n const presentation = React.use(AccordionPresentationContext);\n if (!presentation) {\n throw new Error('AccordionItem must be rendered inside Accordion.');\n }\n\n const open = presentation.openValues.includes(value);\n\n return (\n <SurfaceAccordionItem\n {...surfaceItemProps}\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n testID={testID}\n value={value}\n >\n <Stack gap=\"none\">\n <Stack align=\"center\" direction=\"row\" gap=\"s\">\n <Box flex={1}>\n <SurfaceAccordionTrigger interactionPolicy={interactionPolicy} style={triggerStyle}>\n <Box px=\"m\" py=\"m\">\n <Stack align=\"center\" direction=\"row\" gap=\"m\">\n {icon ? <Icon {...icon} /> : null}\n <Box flex={1}>\n <Stack gap=\"xs\">\n <Heading level={4}>{title}</Heading>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n <Icon name={open ? 'chevron-up-outline' : 'chevron-down-outline'} size=\"m\" />\n </Stack>\n </Box>\n </SurfaceAccordionTrigger>\n </Box>\n {actions ? <Box pr=\"m\">{actions}</Box> : null}\n </Stack>\n\n <SurfaceAccordionContent>\n <Box px=\"m\" pb=\"m\">\n <Stack gap=\"m\">{children}</Stack>\n </Box>\n </SurfaceAccordionContent>\n\n <Divider />\n </Stack>\n </SurfaceAccordionItem>\n );\n}\n"]}
@@ -1,7 +1,2 @@
1
- import React from 'react';
2
- import type { DatePickerProps } from '../../../../types/date-picker';
3
- /***
4
- * Date input control with calendar selection and formatted display value.
5
- */
6
- export declare const DatePicker: (props: DatePickerProps) => React.ReactElement | null;
1
+ export { DatePicker } from './DatePicker.web';
7
2
  //# sourceMappingURL=DatePicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA4VrE;;GAEG;AACH,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
1
+ {"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,176 +1,2 @@
1
- import { Field } from '@ankhorage/surface';
2
- import React from 'react';
3
- import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
- import { useBottomSheet } from '../../../bottom-sheet/public';
5
- import { Button } from '../../../button/public';
6
- import { Box, Stack } from '../../../layout/public';
7
- import { Text } from '../../../typography/public';
8
- import { formatLocalDate, parseLocalDate } from '../../utils/localDate';
9
- const WEEKDAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
10
- const DAY_CELL_WIDTH = 42;
11
- /*** Render the field label and optional supporting description. */
12
- function renderLabel(label, description) {
13
- return (<Stack gap="xs">
14
- <Text variant="label" weight="semiBold">
15
- {label}
16
- </Text>
17
- {description ? (<Text emphasis="muted" variant="bodySmall">
18
- {description}
19
- </Text>) : null}
20
- </Stack>);
21
- }
22
- /*** Compare two values by local calendar day. */
23
- function isSameLocalDay(left, right) {
24
- return left === formatLocalDate(right);
25
- }
26
- /*** Normalize a Date to the start of its local calendar day for range comparisons. */
27
- function startOfLocalDay(value) {
28
- return new Date(value.getFullYear(), value.getMonth(), value.getDate());
29
- }
30
- /*** Report whether one local calendar day precedes another. */
31
- function isBeforeLocalDay(left, right) {
32
- return startOfLocalDay(left).getTime() < startOfLocalDay(right).getTime();
33
- }
34
- /*** Report whether one local calendar day follows another. */
35
- function isAfterLocalDay(left, right) {
36
- return startOfLocalDay(left).getTime() > startOfLocalDay(right).getTime();
37
- }
38
- /*** Resolve whether a date falls outside the configured picker range. */
39
- function isDateDisabled(value, minDate, maxDate) {
40
- if (minDate && isBeforeLocalDay(value, minDate))
41
- return true;
42
- if (maxDate && isAfterLocalDay(value, maxDate))
43
- return true;
44
- return false;
45
- }
46
- /*** Format the current calendar month for the picker heading. */
47
- function formatMonthLabel(value) {
48
- return value.toLocaleDateString(undefined, { month: 'long', year: 'numeric' });
49
- }
50
- /*** Format a selected date with the platform locale defaults. */
51
- function formatDefaultDate(value) {
52
- return parseLocalDate(value)?.toLocaleDateString() ?? value;
53
- }
54
- /*** Build the padded calendar grid for one month. */
55
- function createMonthDays(month) {
56
- const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
57
- const dayCount = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();
58
- const populatedLength = firstDay.getDay() + dayCount;
59
- const paddedLength = Math.ceil(populatedLength / 7) * 7;
60
- return Array.from({ length: paddedLength }, (_, index) => index < firstDay.getDay()
61
- ? null
62
- : new Date(month.getFullYear(), month.getMonth(), index - firstDay.getDay() + 1));
63
- }
64
- /*** Resolve the month initially shown by the calendar sheet. */
65
- function resolveInitialMonth(value, minDate) {
66
- const base = parseLocalDate(value) ?? parseLocalDate(minDate) ?? new Date();
67
- return new Date(base.getFullYear(), base.getMonth(), 1);
68
- }
69
- /*** Report whether the configured range intersects a candidate month. */
70
- function canNavigateToMonth(month, minDate, maxDate) {
71
- const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);
72
- const lastDay = new Date(month.getFullYear(), month.getMonth() + 1, 0);
73
- if (maxDate && isAfterLocalDay(firstDay, maxDate))
74
- return false;
75
- if (minDate && isBeforeLocalDay(lastDay, minDate))
76
- return false;
77
- return true;
78
- }
79
- function DatePickerInner({ themeId: _themeId, mode: _mode, value, onValueChange, label, description, error, placeholder = 'Choose date', minDate, maxDate, disabled = false, required = false, formatDate, testID, interactionPolicy, }) {
80
- const { dismiss, present } = useBottomSheet();
81
- const passive = interactionPolicy === 'passive';
82
- const displayValue = value
83
- ? formatDate
84
- ? formatDate(value)
85
- : formatDefaultDate(value)
86
- : placeholder;
87
- /*** Present the calendar content through the shared BottomSheet controller. */
88
- function openPicker() {
89
- if (passive)
90
- return;
91
- present({
92
- content: (<DatePickerSheet description={description} interactionPolicy={interactionPolicy} label={label} maxDate={maxDate} minDate={minDate} onDismiss={dismiss} onSelect={(date) => {
93
- onValueChange?.(formatLocalDate(date));
94
- dismiss();
95
- }} testID={testID} value={value}/>),
96
- });
97
- }
98
- return (<Field disabled={disabled} errorText={error} invalid={Boolean(error)} label={label ? renderLabel(label, description) : undefined} required={required} testID={testID}>
99
- <Button disabled={disabled} interactionPolicy={interactionPolicy} onPress={openPicker} testID={testID ? `${testID}-trigger` : undefined} trailingIcon={{ name: 'calendar-outline' }} variant="outline">
100
- {displayValue}
101
- </Button>
102
- </Field>);
103
- }
104
- /*** Render the calendar-specific content inside the shared BottomSheet host. */
105
- function DatePickerSheet({ description, interactionPolicy, label, maxDate, minDate, onDismiss, onSelect, testID, value, }) {
106
- const [displayMonth, setDisplayMonth] = React.useState(() => resolveInitialMonth(value, minDate));
107
- const monthDays = React.useMemo(() => createMonthDays(displayMonth), [displayMonth]);
108
- const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);
109
- const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);
110
- return (<Stack gap="m" p="m" testID={testID ? `${testID}-sheet` : undefined}>
111
- <PickerSheetHeader description={description} title={label ?? 'Choose date'}/>
112
- <DatePickerMonthNavigation displayMonth={displayMonth} interactionPolicy={interactionPolicy} maxDate={resolvedMaxDate} minDate={resolvedMinDate} onMonthChange={setDisplayMonth}/>
113
- <DatePickerWeekdays />
114
- <DatePickerCalendar interactionPolicy={interactionPolicy} maxDate={resolvedMaxDate} minDate={resolvedMinDate} monthDays={monthDays} onSelect={onSelect} testID={testID} value={value}/>
115
- <Button fullWidth interactionPolicy={interactionPolicy} onPress={onDismiss} variant="ghost">
116
- Cancel
117
- </Button>
118
- </Stack>);
119
- }
120
- /*** Render the shared title block used by the calendar sheet. */
121
- function PickerSheetHeader({ description, title, }) {
122
- return (<Stack gap="xxs">
123
- <Text align="center" variant="label" weight="semiBold">
124
- {title}
125
- </Text>
126
- {description ? (<Text align="center" emphasis="muted" variant="bodySmall">
127
- {description}
128
- </Text>) : null}
129
- </Stack>);
130
- }
131
- /*** Render previous/next month controls for the calendar sheet. */
132
- function DatePickerMonthNavigation({ displayMonth, interactionPolicy, maxDate, minDate, onMonthChange, }) {
133
- const previousMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() - 1, 1);
134
- const nextMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() + 1, 1);
135
- return (<Stack align="center" direction="row" justify="space-between">
136
- <Button disabled={!canNavigateToMonth(previousMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onMonthChange(previousMonth)} size="s" variant="ghost">
137
- Previous
138
- </Button>
139
- <Text align="center" variant="label" weight="semiBold">
140
- {formatMonthLabel(displayMonth)}
141
- </Text>
142
- <Button disabled={!canNavigateToMonth(nextMonth, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onMonthChange(nextMonth)} size="s" variant="ghost">
143
- Next
144
- </Button>
145
- </Stack>);
146
- }
147
- /*** Render weekday headings for the calendar grid. */
148
- function DatePickerWeekdays() {
149
- return (<Stack direction="row" justify="space-between">
150
- {WEEKDAY_LABELS.map((weekday) => (<Box key={weekday} width={DAY_CELL_WIDTH}>
151
- <Text align="center" emphasis="muted" variant="caption" weight="semiBold">
152
- {weekday}
153
- </Text>
154
- </Box>))}
155
- </Stack>);
156
- }
157
- /*** Render selectable day cells for the current calendar month. */
158
- function DatePickerCalendar({ interactionPolicy, maxDate, minDate, monthDays, onSelect, testID, value, }) {
159
- return (<Stack direction="row" gap="xs" wrap="wrap">
160
- {monthDays.map((day, index) => {
161
- if (!day)
162
- return <Box key={`empty-${index}`} width={DAY_CELL_WIDTH}/>;
163
- const selected = isSameLocalDay(value, day);
164
- return (<Box key={day.toISOString()} width={DAY_CELL_WIDTH}>
165
- <Button color={selected ? 'primary' : 'neutral'} disabled={isDateDisabled(day, minDate, maxDate)} interactionPolicy={interactionPolicy} onPress={() => onSelect(day)} size="s" testID={testID ? `${testID}-day-${day.getDate()}` : undefined} variant={selected ? 'solid' : 'ghost'}>
166
- {day.getDate()}
167
- </Button>
168
- </Box>);
169
- })}
170
- </Stack>);
171
- }
172
- /***
173
- * Date input control with calendar selection and formatted display value.
174
- */
175
- export const DatePicker = withZoraThemeScope(DatePickerInner);
1
+ export { DatePicker } from './DatePicker.web';
176
2
  //# sourceMappingURL=DatePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.ts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C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAEtC;cAAA,CAAC,GAAG,CAAC,OAAO,EAAE,CAChB;YAAA,EAAE,MAAM,CACV;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC","sourcesContent":["import { Field } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { DatePickerProps } from '../../../../types/date-picker';\nimport { useBottomSheet } from '../../../bottom-sheet/public';\nimport { Button } from '../../../button/public';\nimport { Box, Stack } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\nimport { formatLocalDate, parseLocalDate } from '../../utils/localDate';\n\nconst WEEKDAY_LABELS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] as const;\nconst DAY_CELL_WIDTH = 42;\n\n/*** Render the field label and optional supporting description. */\nfunction renderLabel(label: React.ReactNode, description: React.ReactNode | undefined) {\n return (\n <Stack gap=\"xs\">\n <Text variant=\"label\" weight=\"semiBold\">\n {label}\n </Text>\n {description ? (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n );\n}\n\n/*** Compare two values by local calendar day. */\nfunction isSameLocalDay(left: string | null, right: Date): boolean {\n return left === formatLocalDate(right);\n}\n\n/*** Normalize a Date to the start of its local calendar day for range comparisons. */\nfunction startOfLocalDay(value: Date): Date {\n return new Date(value.getFullYear(), value.getMonth(), value.getDate());\n}\n\n/*** Report whether one local calendar day precedes another. */\nfunction isBeforeLocalDay(left: Date, right: Date): boolean {\n return startOfLocalDay(left).getTime() < startOfLocalDay(right).getTime();\n}\n\n/*** Report whether one local calendar day follows another. */\nfunction isAfterLocalDay(left: Date, right: Date): boolean {\n return startOfLocalDay(left).getTime() > startOfLocalDay(right).getTime();\n}\n\n/*** Resolve whether a date falls outside the configured picker range. */\nfunction isDateDisabled(\n value: Date,\n minDate: Date | undefined,\n maxDate: Date | undefined,\n): boolean {\n if (minDate && isBeforeLocalDay(value, minDate)) return true;\n if (maxDate && isAfterLocalDay(value, maxDate)) return true;\n return false;\n}\n\n/*** Format the current calendar month for the picker heading. */\nfunction formatMonthLabel(value: Date): string {\n return value.toLocaleDateString(undefined, { month: 'long', year: 'numeric' });\n}\n\n/*** Format a selected date with the platform locale defaults. */\nfunction formatDefaultDate(value: string): string {\n return parseLocalDate(value)?.toLocaleDateString() ?? value;\n}\n\n/*** Build the padded calendar grid for one month. */\nfunction createMonthDays(month: Date): (Date | null)[] {\n const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);\n const dayCount = new Date(month.getFullYear(), month.getMonth() + 1, 0).getDate();\n const populatedLength = firstDay.getDay() + dayCount;\n const paddedLength = Math.ceil(populatedLength / 7) * 7;\n\n return Array.from({ length: paddedLength }, (_, index) =>\n index < firstDay.getDay()\n ? null\n : new Date(month.getFullYear(), month.getMonth(), index - firstDay.getDay() + 1),\n );\n}\n\n/*** Resolve the month initially shown by the calendar sheet. */\nfunction resolveInitialMonth(value: string | null, minDate: string | undefined): Date {\n const base = parseLocalDate(value) ?? parseLocalDate(minDate) ?? new Date();\n return new Date(base.getFullYear(), base.getMonth(), 1);\n}\n\n/*** Report whether the configured range intersects a candidate month. */\nfunction canNavigateToMonth(\n month: Date,\n minDate: Date | undefined,\n maxDate: Date | undefined,\n): boolean {\n const firstDay = new Date(month.getFullYear(), month.getMonth(), 1);\n const lastDay = new Date(month.getFullYear(), month.getMonth() + 1, 0);\n\n if (maxDate && isAfterLocalDay(firstDay, maxDate)) return false;\n if (minDate && isBeforeLocalDay(lastDay, minDate)) return false;\n return true;\n}\n\nfunction DatePickerInner({\n themeId: _themeId,\n mode: _mode,\n value,\n onValueChange,\n label,\n description,\n error,\n placeholder = 'Choose date',\n minDate,\n maxDate,\n disabled = false,\n required = false,\n formatDate,\n testID,\n interactionPolicy,\n}: DatePickerProps) {\n const { dismiss, present } = useBottomSheet();\n const passive = interactionPolicy === 'passive';\n const displayValue = value\n ? formatDate\n ? formatDate(value)\n : formatDefaultDate(value)\n : placeholder;\n\n /*** Present the calendar content through the shared BottomSheet controller. */\n function openPicker() {\n if (passive) return;\n present({\n content: (\n <DatePickerSheet\n description={description}\n interactionPolicy={interactionPolicy}\n label={label}\n maxDate={maxDate}\n minDate={minDate}\n onDismiss={dismiss}\n onSelect={(date) => {\n onValueChange?.(formatLocalDate(date));\n dismiss();\n }}\n testID={testID}\n value={value}\n />\n ),\n });\n }\n\n return (\n <Field\n disabled={disabled}\n errorText={error}\n invalid={Boolean(error)}\n label={label ? renderLabel(label, description) : undefined}\n required={required}\n testID={testID}\n >\n <Button\n disabled={disabled}\n interactionPolicy={interactionPolicy}\n onPress={openPicker}\n testID={testID ? `${testID}-trigger` : undefined}\n trailingIcon={{ name: 'calendar-outline' }}\n variant=\"outline\"\n >\n {displayValue}\n </Button>\n </Field>\n );\n}\n\ninterface DatePickerSheetProps extends Pick<\n DatePickerProps,\n 'description' | 'interactionPolicy' | 'label' | 'maxDate' | 'minDate' | 'testID' | 'value'\n> {\n onDismiss: () => void;\n onSelect: (value: Date) => void;\n}\n\n/*** Render the calendar-specific content inside the shared BottomSheet host. */\nfunction DatePickerSheet({\n description,\n interactionPolicy,\n label,\n maxDate,\n minDate,\n onDismiss,\n onSelect,\n testID,\n value,\n}: DatePickerSheetProps) {\n const [displayMonth, setDisplayMonth] = React.useState(() => resolveInitialMonth(value, minDate));\n const monthDays = React.useMemo(() => createMonthDays(displayMonth), [displayMonth]);\n const resolvedMaxDate = React.useMemo(() => parseLocalDate(maxDate), [maxDate]);\n const resolvedMinDate = React.useMemo(() => parseLocalDate(minDate), [minDate]);\n\n return (\n <Stack gap=\"m\" p=\"m\" testID={testID ? `${testID}-sheet` : undefined}>\n <PickerSheetHeader description={description} title={label ?? 'Choose date'} />\n <DatePickerMonthNavigation\n displayMonth={displayMonth}\n interactionPolicy={interactionPolicy}\n maxDate={resolvedMaxDate}\n minDate={resolvedMinDate}\n onMonthChange={setDisplayMonth}\n />\n <DatePickerWeekdays />\n <DatePickerCalendar\n interactionPolicy={interactionPolicy}\n maxDate={resolvedMaxDate}\n minDate={resolvedMinDate}\n monthDays={monthDays}\n onSelect={onSelect}\n testID={testID}\n value={value}\n />\n <Button fullWidth interactionPolicy={interactionPolicy} onPress={onDismiss} variant=\"ghost\">\n Cancel\n </Button>\n </Stack>\n );\n}\n\n/*** Render the shared title block used by the calendar sheet. */\nfunction PickerSheetHeader({\n description,\n title,\n}: {\n description: React.ReactNode | undefined;\n title: React.ReactNode;\n}) {\n return (\n <Stack gap=\"xxs\">\n <Text align=\"center\" variant=\"label\" weight=\"semiBold\">\n {title}\n </Text>\n {description ? (\n <Text align=\"center\" emphasis=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n );\n}\n\n/*** Render previous/next month controls for the calendar sheet. */\nfunction DatePickerMonthNavigation({\n displayMonth,\n interactionPolicy,\n maxDate,\n minDate,\n onMonthChange,\n}: {\n displayMonth: Date;\n interactionPolicy: DatePickerProps['interactionPolicy'];\n maxDate: Date | undefined;\n minDate: Date | undefined;\n onMonthChange: (month: Date) => void;\n}) {\n const previousMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() - 1, 1);\n const nextMonth = new Date(displayMonth.getFullYear(), displayMonth.getMonth() + 1, 1);\n\n return (\n <Stack align=\"center\" direction=\"row\" justify=\"space-between\">\n <Button\n disabled={!canNavigateToMonth(previousMonth, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onMonthChange(previousMonth)}\n size=\"s\"\n variant=\"ghost\"\n >\n Previous\n </Button>\n <Text align=\"center\" variant=\"label\" weight=\"semiBold\">\n {formatMonthLabel(displayMonth)}\n </Text>\n <Button\n disabled={!canNavigateToMonth(nextMonth, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onMonthChange(nextMonth)}\n size=\"s\"\n variant=\"ghost\"\n >\n Next\n </Button>\n </Stack>\n );\n}\n\n/*** Render weekday headings for the calendar grid. */\nfunction DatePickerWeekdays() {\n return (\n <Stack direction=\"row\" justify=\"space-between\">\n {WEEKDAY_LABELS.map((weekday) => (\n <Box key={weekday} width={DAY_CELL_WIDTH}>\n <Text align=\"center\" emphasis=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {weekday}\n </Text>\n </Box>\n ))}\n </Stack>\n );\n}\n\n/*** Render selectable day cells for the current calendar month. */\nfunction DatePickerCalendar({\n interactionPolicy,\n maxDate,\n minDate,\n monthDays,\n onSelect,\n testID,\n value,\n}: {\n interactionPolicy: DatePickerProps['interactionPolicy'];\n maxDate: Date | undefined;\n minDate: Date | undefined;\n monthDays: readonly (Date | null)[];\n onSelect: (value: Date) => void;\n testID: string | undefined;\n value: DatePickerProps['value'];\n}) {\n return (\n <Stack direction=\"row\" gap=\"xs\" wrap=\"wrap\">\n {monthDays.map((day, index) => {\n if (!day) return <Box key={`empty-${index}`} width={DAY_CELL_WIDTH} />;\n const selected = isSameLocalDay(value, day);\n return (\n <Box key={day.toISOString()} width={DAY_CELL_WIDTH}>\n <Button\n color={selected ? 'primary' : 'neutral'}\n disabled={isDateDisabled(day, minDate, maxDate)}\n interactionPolicy={interactionPolicy}\n onPress={() => onSelect(day)}\n size=\"s\"\n testID={testID ? `${testID}-day-${day.getDate()}` : undefined}\n variant={selected ? 'solid' : 'ghost'}\n >\n {day.getDate()}\n </Button>\n </Box>\n );\n })}\n </Stack>\n );\n}\n\n/***\n * Date input control with calendar selection and formatted display value.\n */\nexport const DatePicker = withZoraThemeScope(DatePickerInner);\n"]}
1
+ {"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { DatePicker } from './DatePicker.web';\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { DatePickerProps } from '../../../../types/date-picker';
3
+ /*** Renders DatePicker with native BottomSheet presentation. */
4
+ export declare const DatePicker: (props: DatePickerProps) => React.ReactElement | null;
5
+ //# sourceMappingURL=DatePicker.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.native.d.ts","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOrE,gEAAgE;AAChE,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
3
+ import { useBottomSheet } from '../../../bottom-sheet/public';
4
+ import { DatePickerContent } from '../../composition/DatePickerContent';
5
+ import { DatePickerField } from '../../composition/DatePickerField';
6
+ import { DatePickerTrigger } from '../../composition/DatePickerTrigger';
7
+ import { formatLocalDate } from '../../utils/localDate';
8
+ /*** Renders DatePicker with native BottomSheet presentation. */
9
+ export const DatePicker = withZoraThemeScope(DatePickerInner);
10
+ /*** Connects the shared DatePicker field and content to the native BottomSheet host. */
11
+ function DatePickerInner({ themeId: _themeId, mode: _mode, ...props }) {
12
+ const { dismiss, present } = useBottomSheet();
13
+ const openPicker = React.useCallback(() => {
14
+ if (props.interactionPolicy === 'passive')
15
+ return;
16
+ present({
17
+ content: (<DatePickerContent description={props.description} interactionPolicy={props.interactionPolicy} label={props.label} maxDate={props.maxDate} minDate={props.minDate} onDismiss={dismiss} onSelect={(date) => {
18
+ props.onValueChange?.(formatLocalDate(date));
19
+ dismiss();
20
+ }} testID={props.testID} value={props.value}/>),
21
+ });
22
+ }, [dismiss, present, props]);
23
+ return (<DatePickerField {...props}>
24
+ <DatePickerTrigger {...props} onPress={openPicker}/>
25
+ </DatePickerField>);
26
+ }
27
+ //# sourceMappingURL=DatePicker.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.native.js","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,wFAAwF;AACxF,SAAS,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAmB;IACpF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAE9C,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACxC,IAAI,KAAK,CAAC,iBAAiB,KAAK,SAAS;YAAE,OAAO;QAElD,OAAO,CAAC;YACN,OAAO,EAAE,CACP,CAAC,iBAAiB,CAChB,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,OAAO,CAAC,CACnB,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;oBACjB,KAAK,CAAC,aAAa,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;oBAC7C,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CACF,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CACrB,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACnB,CACH;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAE9B,OAAO,CACL,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,CACzB;MAAA,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,EACpD;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { DatePickerProps } from '../../../../types/date-picker';\nimport { useBottomSheet } from '../../../bottom-sheet/public';\nimport { DatePickerContent } from '../../composition/DatePickerContent';\nimport { DatePickerField } from '../../composition/DatePickerField';\nimport { DatePickerTrigger } from '../../composition/DatePickerTrigger';\nimport { formatLocalDate } from '../../utils/localDate';\n\n/*** Renders DatePicker with native BottomSheet presentation. */\nexport const DatePicker = withZoraThemeScope(DatePickerInner);\n\n/*** Connects the shared DatePicker field and content to the native BottomSheet host. */\nfunction DatePickerInner({ themeId: _themeId, mode: _mode, ...props }: DatePickerProps) {\n const { dismiss, present } = useBottomSheet();\n\n const openPicker = React.useCallback(() => {\n if (props.interactionPolicy === 'passive') return;\n\n present({\n content: (\n <DatePickerContent\n description={props.description}\n interactionPolicy={props.interactionPolicy}\n label={props.label}\n maxDate={props.maxDate}\n minDate={props.minDate}\n onDismiss={dismiss}\n onSelect={(date) => {\n props.onValueChange?.(formatLocalDate(date));\n dismiss();\n }}\n testID={props.testID}\n value={props.value}\n />\n ),\n });\n }, [dismiss, present, props]);\n\n return (\n <DatePickerField {...props}>\n <DatePickerTrigger {...props} onPress={openPicker} />\n </DatePickerField>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { DatePickerProps } from '../../../../types/date-picker';
3
+ /*** Renders DatePicker with anchored web Popover presentation. */
4
+ export declare const DatePicker: (props: DatePickerProps) => React.ReactElement | null;
5
+ //# sourceMappingURL=DatePicker.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.web.d.ts","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAOrE,kEAAkE;AAClE,eAAO,MAAM,UAAU,uDAAsC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { Popover } from '@ankhorage/surface';
2
+ import React from 'react';
3
+ import { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';
4
+ import { Surface } from '../../../surface/public';
5
+ import { DatePickerContent } from '../../composition/DatePickerContent';
6
+ import { DatePickerField } from '../../composition/DatePickerField';
7
+ import { DatePickerTrigger } from '../../composition/DatePickerTrigger';
8
+ import { formatLocalDate } from '../../utils/localDate';
9
+ /*** Renders DatePicker with anchored web Popover presentation. */
10
+ export const DatePicker = withZoraThemeScope(DatePickerInner);
11
+ /*** Connects the shared DatePicker field and content to the web Popover host. */
12
+ function DatePickerInner({ themeId: _themeId, mode: _mode, ...props }) {
13
+ const [open, setOpen] = React.useState(false);
14
+ return (<DatePickerField {...props}>
15
+ <Popover anchor={({ toggle }) => <DatePickerTrigger {...props} onPress={toggle}/>} interactionPolicy={props.interactionPolicy} onOpenChange={setOpen} open={open} placement="bottom-start" testID={props.testID ? `${props.testID}-popover` : undefined}>
16
+ <Surface variant="raised">
17
+ <DatePickerContent description={props.description} interactionPolicy={props.interactionPolicy} label={props.label} maxDate={props.maxDate} minDate={props.minDate} onDismiss={() => setOpen(false)} onSelect={(date) => {
18
+ props.onValueChange?.(formatLocalDate(date));
19
+ setOpen(false);
20
+ }} testID={props.testID} value={props.value}/>
21
+ </Surface>
22
+ </Popover>
23
+ </DatePickerField>);
24
+ }
25
+ //# sourceMappingURL=DatePicker.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePicker.web.js","sourceRoot":"","sources":["../../../../../src/features/date-picker/adapters/inbound/DatePicker.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,kEAAkE;AAClE,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,iFAAiF;AACjF,SAAS,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAmB;IACpF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,CACzB;MAAA,CAAC,OAAO,CACN,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAG,CAAC,CAC1E,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,YAAY,CAAC,CAAC,OAAO,CAAC,CACtB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,SAAS,CAAC,cAAc,CACxB,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAE7D;QAAA,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CACvB;UAAA,CAAC,iBAAiB,CAChB,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CACvB,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAChC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;YACjB,KAAK,CAAC,aAAa,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7C,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,CAAC,CACF,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CACrB,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAEvB;QAAA,EAAE,OAAO,CACX;MAAA,EAAE,OAAO,CACX;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { Popover } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../../../theme/withZoraThemeScope';\nimport type { DatePickerProps } from '../../../../types/date-picker';\nimport { Surface } from '../../../surface/public';\nimport { DatePickerContent } from '../../composition/DatePickerContent';\nimport { DatePickerField } from '../../composition/DatePickerField';\nimport { DatePickerTrigger } from '../../composition/DatePickerTrigger';\nimport { formatLocalDate } from '../../utils/localDate';\n\n/*** Renders DatePicker with anchored web Popover presentation. */\nexport const DatePicker = withZoraThemeScope(DatePickerInner);\n\n/*** Connects the shared DatePicker field and content to the web Popover host. */\nfunction DatePickerInner({ themeId: _themeId, mode: _mode, ...props }: DatePickerProps) {\n const [open, setOpen] = React.useState(false);\n\n return (\n <DatePickerField {...props}>\n <Popover\n anchor={({ toggle }) => <DatePickerTrigger {...props} onPress={toggle} />}\n interactionPolicy={props.interactionPolicy}\n onOpenChange={setOpen}\n open={open}\n placement=\"bottom-start\"\n testID={props.testID ? `${props.testID}-popover` : undefined}\n >\n <Surface variant=\"raised\">\n <DatePickerContent\n description={props.description}\n interactionPolicy={props.interactionPolicy}\n label={props.label}\n maxDate={props.maxDate}\n minDate={props.minDate}\n onDismiss={() => setOpen(false)}\n onSelect={(date) => {\n props.onValueChange?.(formatLocalDate(date));\n setOpen(false);\n }}\n testID={props.testID}\n value={props.value}\n />\n </Surface>\n </Popover>\n </DatePickerField>\n );\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { DatePickerProps } from '../../../types/date-picker';
3
+ /*** Renders the shared calendar content used by native BottomSheet and web Popover hosts. */
4
+ export declare function DatePickerContent({ description, interactionPolicy, label, maxDate, minDate, onDismiss, onSelect, testID, value, }: DatePickerContentProps): React.JSX.Element;
5
+ interface DatePickerContentProps extends Pick<DatePickerProps, 'description' | 'interactionPolicy' | 'label' | 'maxDate' | 'minDate' | 'testID' | 'value'> {
6
+ onDismiss: () => void;
7
+ onSelect: (value: Date) => void;
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=DatePickerContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatePickerContent.d.ts","sourceRoot":"","sources":["../../../../src/features/date-picker/composition/DatePickerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AASlE,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,iBAAiB,EACjB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,GACN,EAAE,sBAAsB,qBA+BxB;AAED,UAAU,sBAAuB,SAAQ,IAAI,CAC3C,eAAe,EACf,aAAa,GAAG,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAC3F;IACC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;CACjC"}