@studio-piot/native-ui 0.17.0 → 0.20.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 (97) hide show
  1. package/README.md +13 -7
  2. package/dist/components/DateTime/DateTimePresenter.android.d.ts +4 -0
  3. package/dist/components/DateTime/DateTimePresenter.android.d.ts.map +1 -0
  4. package/dist/components/DateTime/DateTimePresenter.android.js +47 -0
  5. package/dist/components/DateTime/DateTimePresenter.android.js.map +1 -0
  6. package/dist/components/DateTime/DateTimePresenter.d.ts +4 -0
  7. package/dist/components/DateTime/DateTimePresenter.d.ts.map +1 -0
  8. package/dist/components/DateTime/DateTimePresenter.ios.d.ts +9 -0
  9. package/dist/components/DateTime/DateTimePresenter.ios.d.ts.map +1 -0
  10. package/dist/components/DateTime/DateTimePresenter.ios.js +69 -0
  11. package/dist/components/DateTime/DateTimePresenter.ios.js.map +1 -0
  12. package/dist/components/DateTime/DateTimePresenter.js +8 -0
  13. package/dist/components/DateTime/DateTimePresenter.js.map +1 -0
  14. package/dist/components/DateTime/FieldDateTime.d.ts +8 -0
  15. package/dist/components/DateTime/FieldDateTime.d.ts.map +1 -0
  16. package/dist/components/DateTime/FieldDateTime.js +90 -0
  17. package/dist/components/DateTime/FieldDateTime.js.map +1 -0
  18. package/dist/components/DateTime/dateTimeThemeRoles.d.ts +13 -0
  19. package/dist/components/DateTime/dateTimeThemeRoles.d.ts.map +1 -0
  20. package/dist/components/DateTime/dateTimeThemeRoles.js +15 -0
  21. package/dist/components/DateTime/dateTimeThemeRoles.js.map +1 -0
  22. package/dist/components/DateTime/dateTimeValue.d.ts +11 -0
  23. package/dist/components/DateTime/dateTimeValue.d.ts.map +1 -0
  24. package/dist/components/DateTime/dateTimeValue.js +40 -0
  25. package/dist/components/DateTime/dateTimeValue.js.map +1 -0
  26. package/dist/components/DateTime/index.d.ts +5 -0
  27. package/dist/components/DateTime/index.d.ts.map +1 -0
  28. package/dist/components/DateTime/index.js +10 -0
  29. package/dist/components/DateTime/index.js.map +1 -0
  30. package/dist/components/DateTime/types.d.ts +57 -0
  31. package/dist/components/DateTime/types.d.ts.map +1 -0
  32. package/dist/components/DateTime/types.js +3 -0
  33. package/dist/components/DateTime/types.js.map +1 -0
  34. package/dist/components/Select/Select.d.ts.map +1 -1
  35. package/dist/components/Select/Select.js +2 -9
  36. package/dist/components/Select/Select.js.map +1 -1
  37. package/dist/components/Tabs/Tabs.d.ts +8 -0
  38. package/dist/components/Tabs/Tabs.d.ts.map +1 -0
  39. package/dist/components/Tabs/Tabs.js +124 -0
  40. package/dist/components/Tabs/Tabs.js.map +1 -0
  41. package/dist/components/Tabs/index.d.ts +4 -0
  42. package/dist/components/Tabs/index.d.ts.map +1 -0
  43. package/dist/components/Tabs/index.js +8 -0
  44. package/dist/components/Tabs/index.js.map +1 -0
  45. package/dist/components/Tabs/tabsLayout.d.ts +13 -0
  46. package/dist/components/Tabs/tabsLayout.d.ts.map +1 -0
  47. package/dist/components/Tabs/tabsLayout.js +20 -0
  48. package/dist/components/Tabs/tabsLayout.js.map +1 -0
  49. package/dist/components/Tabs/tabsThemeRoles.d.ts +8 -0
  50. package/dist/components/Tabs/tabsThemeRoles.d.ts.map +1 -0
  51. package/dist/components/Tabs/tabsThemeRoles.js +10 -0
  52. package/dist/components/Tabs/tabsThemeRoles.js.map +1 -0
  53. package/dist/components/Tabs/types.d.ts +30 -0
  54. package/dist/components/Tabs/types.d.ts.map +1 -0
  55. package/dist/components/Tabs/types.js +3 -0
  56. package/dist/components/Tabs/types.js.map +1 -0
  57. package/dist/components/index.d.ts +1 -0
  58. package/dist/components/index.d.ts.map +1 -1
  59. package/dist/components/index.js +5 -2
  60. package/dist/components/index.js.map +1 -1
  61. package/dist/date-time.d.ts +6 -0
  62. package/dist/date-time.d.ts.map +1 -0
  63. package/dist/date-time.js +22 -0
  64. package/dist/date-time.js.map +1 -0
  65. package/dist/index.d.ts +2 -1
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +5 -2
  68. package/dist/index.js.map +1 -1
  69. package/dist/layout/SheetContainer.d.ts +6 -0
  70. package/dist/layout/SheetContainer.d.ts.map +1 -0
  71. package/dist/layout/SheetContainer.js +14 -0
  72. package/dist/layout/SheetContainer.js.map +1 -0
  73. package/docs/components/field-date-time.md +89 -0
  74. package/docs/components/tabs.md +85 -0
  75. package/package.json +16 -2
  76. package/src/components/DateTime/DateTimePresenter.android.tsx +76 -0
  77. package/src/components/DateTime/DateTimePresenter.ios.tsx +122 -0
  78. package/src/components/DateTime/DateTimePresenter.tsx +6 -0
  79. package/src/components/DateTime/FieldDateTime.tsx +164 -0
  80. package/src/components/DateTime/dateTimeThemeRoles.test.ts +18 -0
  81. package/src/components/DateTime/dateTimeThemeRoles.ts +13 -0
  82. package/src/components/DateTime/dateTimeValue.test.ts +49 -0
  83. package/src/components/DateTime/dateTimeValue.ts +36 -0
  84. package/src/components/DateTime/index.ts +4 -0
  85. package/src/components/DateTime/types.ts +58 -0
  86. package/src/components/Select/Select.tsx +1 -9
  87. package/src/components/Tabs/Tabs.tsx +148 -0
  88. package/src/components/Tabs/index.ts +3 -0
  89. package/src/components/Tabs/tabsLayout.test.ts +36 -0
  90. package/src/components/Tabs/tabsLayout.ts +23 -0
  91. package/src/components/Tabs/tabsThemeRoles.test.ts +14 -0
  92. package/src/components/Tabs/tabsThemeRoles.ts +8 -0
  93. package/src/components/Tabs/types.ts +31 -0
  94. package/src/components/index.ts +7 -0
  95. package/src/date-time.ts +5 -0
  96. package/src/index.ts +8 -1
  97. package/src/layout/SheetContainer.tsx +11 -0
package/README.md CHANGED
@@ -7,10 +7,10 @@ The package is the native counterpart of `@studio-piot/ui`. Apps own their palet
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install @studio-piot/native-ui
10
+ pnpm add @studio-piot/native-ui
11
11
  ```
12
12
 
13
- `Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`, and `react-native-screens` (iOS `FullWindowOverlay` so the sheet appears above React Navigation modals). `SegmentedControl` uses that same `react-native-reanimated` peer to slide the selection fill. `Slider` peers `@react-native-community/slider`. `ErrorBanner` peers `react-native-svg` for the megaphone and row arrow. `HeaderIcon` and `HeaderCapsule` take an icon render function, so they add no peer; pass `expo-symbols` `SymbolView` or any icon component.
13
+ `Select` peers `@gorhom/bottom-sheet`, `react-native-reanimated`, `react-native-gesture-handler`, and `react-native-screens` (iOS `FullWindowOverlay` so the sheet appears above React Navigation modals). `SegmentedControl` uses that same `react-native-reanimated` peer to slide the selection fill. `Slider` peers `@react-native-community/slider`. `ErrorBanner` peers `react-native-svg` for the megaphone and row arrow. `FieldDateTime` (from `@studio-piot/native-ui/date-time`) needs `@expo/ui`, an optional peer only that entry uses. `HeaderIcon` and `HeaderCapsule` take an icon render function, so they add no peer; pass `expo-symbols` `SymbolView` or any icon component.
14
14
 
15
15
  ## Theme roles
16
16
 
@@ -30,7 +30,9 @@ Each component doc lists its roles.
30
30
  - [Theme provider and Button usage](./docs/components/button.md)
31
31
  - [LinkBlocks usage](./docs/components/link-blocks.md)
32
32
  - [Field usage](./docs/components/field.md)
33
+ - [FieldDateTime usage](./docs/components/field-date-time.md)
33
34
  - [Choice usage](./docs/components/choice.md)
35
+ - [Tabs usage](./docs/components/tabs.md)
34
36
  - [Form usage](./docs/components/form.md)
35
37
  - [HeaderWash usage](./docs/components/header-wash.md)
36
38
  - [FormSheet usage](./docs/components/form-sheet.md)
@@ -71,11 +73,13 @@ export function App() {
71
73
  ## Local development
72
74
 
73
75
  ```bash
74
- npm install
75
- npm run dev
76
+ pnpm install
77
+ pnpm dev
76
78
  ```
77
79
 
78
- `npm run dev` rebuilds `dist` as you edit. `prepare` also builds on install, so a `file:` dependency in a consumer app stays usable after `npm install`.
80
+ This repo uses **pnpm** (`pnpm-lock.yaml`); don't run `npm install` here.
81
+
82
+ `pnpm dev` rebuilds `dist` as you edit. `prepare` also builds on install, so a linked or `file:` dependency in a consumer app stays usable after installing.
79
83
 
80
84
  When this package lives outside the consumer app root (e.g. a monorepo sibling), configure Metro `watchFolders` so the app picks up source changes; add `nodeModulesPaths` if resolution needs it.
81
85
 
@@ -84,14 +88,16 @@ When this package lives outside the consumer app root (e.g. a monorepo sibling),
84
88
  1. Add `src/components/YourComponent.tsx`.
85
89
  2. Export it from `src/components/index.ts` and `src/index.ts`.
86
90
  3. Document it under `docs/components/` and link it from this README.
87
- 4. Run `npm run build` before publishing.
91
+ 4. Run `pnpm build` and `pnpm test` before publishing.
88
92
 
89
93
  ## Publish
90
94
 
91
95
  ```bash
92
- npm publish
96
+ pnpm publish
93
97
  ```
94
98
 
99
+ `pnpm publish` checks you're on a clean `main`; publish from there.
100
+
95
101
  `prepublishOnly` builds `dist` first. The package is public (`publishConfig.access`).
96
102
 
97
103
  ## License
@@ -0,0 +1,4 @@
1
+ import type { DateTimePresenterProps } from "./types";
2
+ /** Android: the system date dialog, then the time dialog (for datetime). */
3
+ export declare function DateTimePresenter({ open, value, mode, minimumDate, maximumDate, colors, onConfirm, onClose, }: DateTimePresenterProps): import("react").JSX.Element | null;
4
+ //# sourceMappingURL=DateTimePresenter.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.android.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.android.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAItD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE,sBAAsB,sCA0DxB"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateTimePresenter = DateTimePresenter;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const jetpack_compose_1 = require("@expo/ui/jetpack-compose");
6
+ const react_1 = require("react");
7
+ const dateTimeValue_1 = require("./dateTimeValue");
8
+ /** Android: the system date dialog, then the time dialog (for datetime). */
9
+ function DateTimePresenter({ open, value, mode, minimumDate, maximumDate, colors, onConfirm, onClose, }) {
10
+ const [step, setStep] = (0, react_1.useState)(null);
11
+ const [draft, setDraft] = (0, react_1.useState)(value);
12
+ (0, react_1.useEffect)(() => {
13
+ if (open) {
14
+ setDraft(value);
15
+ setStep(mode === "time" ? "time" : "date");
16
+ }
17
+ else {
18
+ setStep(null);
19
+ }
20
+ // Restart from the value only when opened.
21
+ }, [open]);
22
+ const close = () => {
23
+ setStep(null);
24
+ onClose();
25
+ };
26
+ if (step === "date") {
27
+ return ((0, jsx_runtime_1.jsx)(jetpack_compose_1.Host, { children: (0, jsx_runtime_1.jsx)(jetpack_compose_1.DatePickerDialog, { color: colors.accent, initialDate: draft.toISOString(), onDateSelected: (day) => {
28
+ const next = (0, dateTimeValue_1.withDay)(draft, day);
29
+ if (mode === "datetime") {
30
+ setDraft(next);
31
+ setStep("time");
32
+ }
33
+ else {
34
+ setStep(null);
35
+ onConfirm(next);
36
+ }
37
+ }, onDismissRequest: close, selectableDates: { start: minimumDate, end: maximumDate } }) }));
38
+ }
39
+ if (step === "time") {
40
+ return ((0, jsx_runtime_1.jsx)(jetpack_compose_1.Host, { children: (0, jsx_runtime_1.jsx)(jetpack_compose_1.TimePickerDialog, { color: colors.accent, initialDate: draft.toISOString(), is24Hour: true, onDateSelected: (time) => {
41
+ setStep(null);
42
+ onConfirm((0, dateTimeValue_1.withTime)(draft, time));
43
+ }, onDismissRequest: close }) }));
44
+ }
45
+ return null;
46
+ }
47
+ //# sourceMappingURL=DateTimePresenter.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.android.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.android.tsx"],"names":[],"mappings":";;AAQA,8CAmEC;;AA3ED,8DAAoF;AACpF,iCAA4C;AAC5C,mDAAoD;AAKpD,4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AS,CAAC,IAAI,CAAC,CAAC;oBAClB,CAAC;gBACH,CAAC,EACD,gBAAgB,EAAE,KAAK,EACvB,eAAe,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,EAAE,GACzD,GACG,CACR,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CACL,uBAAC,sBAAI,cACH,uBAAC,kCAAgB,IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EACpB,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,EAChC,QAAQ,QACR,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;oBACvB,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,SAAS,CAAC,IAAA,wBAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;gBACnC,CAAC,EACD,gBAAgB,EAAE,KAAK,GACvB,GACG,CACR,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DateTimePresenterProps } from "./types";
2
+ /** Web and other platforms: no native picker; the field shows its value only. */
3
+ export declare function DateTimePresenter(_props: DateTimePresenterProps): null;
4
+ //# sourceMappingURL=DateTimePresenter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,sBAAsB,QAE/D"}
@@ -0,0 +1,9 @@
1
+ import type { DateTimePresenterProps } from "./types";
2
+ /**
3
+ * iOS: a bottom panel in a React Native Modal with SwiftUI's picker — a
4
+ * calendar for dates, wheels for times — and Done. Tapping outside keeps
5
+ * the old value. A Modal (not a bottom-sheet modal) so it opens from
6
+ * anywhere, including inside another sheet or a native modal.
7
+ */
8
+ export declare function DateTimePresenter({ open, value, mode, minimumDate, maximumDate, title, doneLabel, colors, onConfirm, onClose, }: DateTimePresenterProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=DateTimePresenter.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.ios.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.ios.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAItD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,GACR,EAAE,sBAAsB,+BA2DxB"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateTimePresenter = DateTimePresenter;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const swift_ui_1 = require("@expo/ui/swift-ui");
6
+ const modifiers_1 = require("@expo/ui/swift-ui/modifiers");
7
+ const react_1 = require("react");
8
+ const react_native_1 = require("react-native");
9
+ const react_native_safe_area_context_1 = require("react-native-safe-area-context");
10
+ const sheet_1 = require("../../layout/sheet");
11
+ const BACKDROP = "rgba(0, 0, 0, 0.4)";
12
+ /**
13
+ * iOS: a bottom panel in a React Native Modal with SwiftUI's picker — a
14
+ * calendar for dates, wheels for times — and Done. Tapping outside keeps
15
+ * the old value. A Modal (not a bottom-sheet modal) so it opens from
16
+ * anywhere, including inside another sheet or a native modal.
17
+ */
18
+ function DateTimePresenter({ open, value, mode, minimumDate, maximumDate, title, doneLabel, colors, onConfirm, onClose, }) {
19
+ const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
20
+ const [draft, setDraft] = (0, react_1.useState)(value);
21
+ (0, react_1.useEffect)(() => {
22
+ // Start from the field's value each time the picker opens.
23
+ if (open)
24
+ setDraft(value);
25
+ }, [open]);
26
+ const components = mode === "date" ? ["date"] : mode === "time" ? ["hourAndMinute"] : ["date", "hourAndMinute"];
27
+ return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { animationType: "slide", onRequestClose: onClose, transparent: true, visible: open, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.root, children: [(0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityLabel: "Close", accessibilityRole: "button", onPress: onClose, style: [react_native_1.StyleSheet.absoluteFill, { backgroundColor: BACKDROP }] }), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
28
+ styles.panel,
29
+ { backgroundColor: colors.background, paddingBottom: insets.bottom + 16 },
30
+ ], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.header, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "header", style: [styles.title, { color: colors.text }], children: title }), (0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityRole: "button", hitSlop: 8, onPress: () => onConfirm(draft), children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.done, { color: colors.accent }], children: doneLabel }) })] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.divider, { backgroundColor: colors.border }] }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.picker, children: (0, jsx_runtime_1.jsx)(swift_ui_1.Host, { matchContents: true, children: (0, jsx_runtime_1.jsx)(swift_ui_1.DatePicker, { displayedComponents: components, modifiers: [
31
+ (0, modifiers_1.datePickerStyle)(mode === "date" ? "graphical" : "wheel"),
32
+ (0, modifiers_1.tint)(colors.accent),
33
+ ], onDateChange: setDraft, range: { start: minimumDate, end: maximumDate }, selection: draft }) }) })] })] }) }));
34
+ }
35
+ const styles = react_native_1.StyleSheet.create({
36
+ root: {
37
+ flex: 1,
38
+ justifyContent: "flex-end",
39
+ },
40
+ panel: {
41
+ borderTopLeftRadius: sheet_1.SHEET_TOP_RADIUS,
42
+ borderTopRightRadius: sheet_1.SHEET_TOP_RADIUS,
43
+ },
44
+ header: {
45
+ alignItems: "center",
46
+ flexDirection: "row",
47
+ gap: 12,
48
+ paddingHorizontal: 16,
49
+ paddingVertical: 14,
50
+ },
51
+ title: {
52
+ flex: 1,
53
+ fontSize: 17,
54
+ fontWeight: "600",
55
+ },
56
+ done: {
57
+ fontSize: 17,
58
+ fontWeight: "600",
59
+ },
60
+ divider: {
61
+ height: react_native_1.StyleSheet.hairlineWidth,
62
+ },
63
+ picker: {
64
+ alignItems: "center",
65
+ paddingHorizontal: 16,
66
+ paddingTop: 8,
67
+ },
68
+ });
69
+ //# sourceMappingURL=DateTimePresenter.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.ios.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.ios.tsx"],"names":[],"mappings":";;AAgBA,8CAsEC;;AAtFD,gDAAqD;AACrD,2DAAoE;AACpE,iCAA4C;AAC5C,+CAAwE;AACxE,mFAAmE;AACnE,8CAAsD;AAGtD,MAAM,QAAQ,GAAG,oBAAoB,CAAC;AAEtC;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,GACgB;IACvB,MAAM,MAAM,GAAG,IAAA,kDAAiB,GAAE,CAAC;IACnC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE1C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,2DAA2D;QAC3D,IAAI,IAAI;YAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,MAAM,UAAU,GACd,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,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1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateTimePresenter = DateTimePresenter;
4
+ /** Web and other platforms: no native picker; the field shows its value only. */
5
+ function DateTimePresenter(_props) {
6
+ return null;
7
+ }
8
+ //# sourceMappingURL=DateTimePresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateTimePresenter.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTimePresenter.tsx"],"names":[],"mappings":";;AAGA,8CAEC;AAHD,iFAAiF;AACjF,SAAgB,iBAAiB,CAAC,MAA8B;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FieldDateTimeProps } from "./types";
2
+ /**
3
+ * A date, time, or date-and-time field. Looks like Select: label, value,
4
+ * description or error. Tapping opens the native picker — a sheet with
5
+ * Done on iOS, the system dialogs on Android. Needs `@expo/ui`.
6
+ */
7
+ export declare function FieldDateTime({ name, value, onChange, mode, label, description, error, placeholder, minimumDate, maximumDate, formatValue, sheetTitle, doneLabel, radius, editable, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, accentColor: accentColorProp, style, }: FieldDateTimeProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=FieldDateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldDateTime.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/FieldDateTime.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,IAAiB,EACjB,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAiE,EACjE,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAkB,EAClB,MAAa,EACb,QAAe,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,eAAe,EAC5B,KAAK,GACN,EAAE,kBAAkB,+BAsFpB"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldDateTime = FieldDateTime;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const react_native_1 = require("react-native");
7
+ const buttonRadius_1 = require("../Button/buttonRadius");
8
+ const ErrorBanner_1 = require("../ErrorBanner");
9
+ const useResolvedFieldColor_1 = require("../Field/useResolvedFieldColor");
10
+ const DateTimePresenter_1 = require("./DateTimePresenter");
11
+ const dateTimeThemeRoles_1 = require("./dateTimeThemeRoles");
12
+ const dateTimeValue_1 = require("./dateTimeValue");
13
+ /**
14
+ * A date, time, or date-and-time field. Looks like Select: label, value,
15
+ * description or error. Tapping opens the native picker — a sheet with
16
+ * Done on iOS, the system dialogs on Android. Needs `@expo/ui`.
17
+ */
18
+ function FieldDateTime({ name, value, onChange, mode = "datetime", label, description, error, placeholder = mode === "time" ? "Choose a time" : "Choose a date", minimumDate, maximumDate, formatValue, sheetTitle, doneLabel = "Done", radius = "xl", editable = true, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, accentColor: accentColorProp, style, }) {
19
+ const backgroundColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(backgroundColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.backgroundColor);
20
+ const textColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(textColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.textColor);
21
+ const placeholderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(placeholderColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.placeholderColor);
22
+ const labelColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(labelColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.labelColor);
23
+ const descriptionColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(descriptionColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.descriptionColor);
24
+ const borderColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(borderColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.borderColor);
25
+ const errorColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(errorColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.errorColor);
26
+ const accentColor = (0, useResolvedFieldColor_1.useResolvedFieldColor)(accentColorProp, dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES.accentColor);
27
+ const [open, setOpen] = (0, react_1.useState)(false);
28
+ const dismissBanner = (0, ErrorBanner_1.useErrorBannerDismiss)();
29
+ const { viewRef, listed } = (0, ErrorBanner_1.useErrorBannerField)(name, () => setOpen(true));
30
+ const hasError = Boolean(error) || Boolean(listed);
31
+ const inlineError = listed ? undefined : error;
32
+ const display = value
33
+ ? (formatValue ?? ((date) => (0, dateTimeValue_1.formatDateTimeValue)(date, mode)))(value)
34
+ : placeholder;
35
+ return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { ref: viewRef, collapsable: false, style: [styles.column, !editable && styles.blocked, style], children: [label ? (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.label, { color: labelColor }], children: label }) : null, (0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityHint: listed?.message ?? "Opens a date and time picker", accessibilityLabel: label ? `${label}. ${display}` : display, accessibilityRole: "button", accessibilityState: { disabled: !editable }, disabled: !editable, onPress: () => setOpen(true), style: [
36
+ styles.trigger,
37
+ {
38
+ backgroundColor,
39
+ borderColor: hasError ? errorColor : borderColor,
40
+ borderRadius: (0, buttonRadius_1.buttonRadiusValue)(radius),
41
+ },
42
+ ], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { numberOfLines: 1, style: [styles.triggerText, { color: value ? textColor : placeholderColor }], children: display }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityElementsHidden: true, importantForAccessibility: "no", style: [styles.chevron, { color: placeholderColor }], children: "\u203A" })] }), inlineError ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: errorColor }], children: inlineError })) : description ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.helper, { color: descriptionColor }], children: description })) : null, (0, jsx_runtime_1.jsx)(DateTimePresenter_1.DateTimePresenter, { colors: {
43
+ background: backgroundColor,
44
+ text: textColor,
45
+ handle: placeholderColor,
46
+ border: borderColor,
47
+ accent: accentColor,
48
+ }, doneLabel: doneLabel, maximumDate: maximumDate, minimumDate: minimumDate, mode: mode, onClose: () => setOpen(false), onConfirm: (next) => {
49
+ setOpen(false);
50
+ onChange((0, dateTimeValue_1.clampDate)(next, minimumDate, maximumDate));
51
+ dismissBanner();
52
+ }, open: open, title: sheetTitle ?? label ?? "Date and time", value: (0, dateTimeValue_1.clampDate)(value ?? new Date(), minimumDate, maximumDate) })] }));
53
+ }
54
+ const styles = react_native_1.StyleSheet.create({
55
+ column: {
56
+ gap: 6,
57
+ width: "100%",
58
+ },
59
+ blocked: {
60
+ opacity: 0.4,
61
+ },
62
+ label: {
63
+ fontSize: 13,
64
+ fontWeight: "600",
65
+ },
66
+ trigger: {
67
+ alignItems: "center",
68
+ borderWidth: 1,
69
+ flexDirection: "row",
70
+ gap: 8,
71
+ minHeight: 48,
72
+ paddingHorizontal: 14,
73
+ paddingVertical: 12,
74
+ width: "100%",
75
+ },
76
+ triggerText: {
77
+ flex: 1,
78
+ fontSize: 17,
79
+ },
80
+ chevron: {
81
+ fontSize: 22,
82
+ fontWeight: "300",
83
+ lineHeight: 24,
84
+ transform: [{ rotate: "90deg" }],
85
+ },
86
+ helper: {
87
+ fontSize: 13,
88
+ },
89
+ });
90
+ //# sourceMappingURL=FieldDateTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldDateTime.js","sourceRoot":"","sources":["../../../src/components/DateTime/FieldDateTime.tsx"],"names":[],"mappings":";;AAeA,sCA+GC;;AA9HD,iCAAiC;AACjC,+CAAiE;AACjE,yDAA2D;AAC3D,gDAA4E;AAC5E,0EAAuE;AACvE,2DAAwD;AACxD,6DAA6D;AAC7D,mDAAiE;AAGjE;;;;GAIG;AACH,SAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,UAAU,EACjB,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,EACjE,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,GAAG,MAAM,EAClB,MAAM,GAAG,IAAI,EACb,QAAQ,GAAG,IAAI,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,WAAW,EAAE,eAAe,EAC5B,KAAK,GACc;IACnB,MAAM,eAAe,GAAG,IAAA,6CAAqB,EAAC,mBAAmB,EAAE,0CAAqB,CAAC,eAAe,CAAC,CAAC;IAC1G,MAAM,SAAS,GAAG,IAAA,6CAAqB,EAAC,aAAa,EAAE,0CAAqB,CAAC,SAAS,CAAC,CAAC;IACxF,MAAM,gBAAgB,GAAG,IAAA,6CAAqB,EAAC,oBAAoB,EAAE,0CAAqB,CAAC,gBAAgB,CAAC,CAAC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AAK;KAClB;IACD,OAAO,EAAE;QACP,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,KAAK,EAAE,MAAM;KACd;IACD,WAAW,EAAE;QACX,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;KACjC;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE;KACb;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** The same roles as FieldText and Select, so date fields match the form. */
2
+ export declare const DATE_TIME_THEME_ROLES: {
3
+ readonly backgroundColor: "fieldBackground";
4
+ readonly textColor: "fieldText";
5
+ readonly placeholderColor: "fieldPlaceholder";
6
+ readonly labelColor: "fieldLabel";
7
+ readonly descriptionColor: "fieldDescription";
8
+ readonly borderColor: "fieldBorder";
9
+ readonly errorColor: "fieldError";
10
+ readonly accentColor: "fieldSelectSelected";
11
+ };
12
+ export type DateTimeThemeColorProp = keyof typeof DATE_TIME_THEME_ROLES;
13
+ //# sourceMappingURL=dateTimeThemeRoles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeThemeRoles.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/dateTimeThemeRoles.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;CASxB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,qBAAqB,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DATE_TIME_THEME_ROLES = void 0;
4
+ /** The same roles as FieldText and Select, so date fields match the form. */
5
+ exports.DATE_TIME_THEME_ROLES = {
6
+ backgroundColor: "fieldBackground",
7
+ textColor: "fieldText",
8
+ placeholderColor: "fieldPlaceholder",
9
+ labelColor: "fieldLabel",
10
+ descriptionColor: "fieldDescription",
11
+ borderColor: "fieldBorder",
12
+ errorColor: "fieldError",
13
+ accentColor: "fieldSelectSelected",
14
+ };
15
+ //# sourceMappingURL=dateTimeThemeRoles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeThemeRoles.js","sourceRoot":"","sources":["../../../src/components/DateTime/dateTimeThemeRoles.ts"],"names":[],"mappings":";;;AAAA,6EAA6E;AAChE,QAAA,qBAAqB,GAAG;IACnC,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,qBAAqB;CAC1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Which parts of the value the field edits. */
2
+ export type DateTimeMode = "date" | "time" | "datetime";
3
+ /** Default display: "Sat 3 Oct 2026", "08:05" or "Sat 3 Oct 2026 · 08:05", local time. Pure. */
4
+ export declare function formatDateTimeValue(value: Date, mode: DateTimeMode): string;
5
+ /** `value` moved to the calendar day of `day`, keeping its time. */
6
+ export declare function withDay(value: Date, day: Date): Date;
7
+ /** `value` at the hour and minute of `time`, keeping its day. */
8
+ export declare function withTime(value: Date, time: Date): Date;
9
+ /** `value` moved inside the optional limits. */
10
+ export declare function clampDate(value: Date, minimum?: Date, maximum?: Date): Date;
11
+ //# sourceMappingURL=dateTimeValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeValue.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/dateTimeValue.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAMxD,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAM3E;AAED,oEAAoE;AACpE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,CAIpD;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAItD;AAED,gDAAgD;AAChD,wBAAgB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAI3E"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatDateTimeValue = formatDateTimeValue;
4
+ exports.withDay = withDay;
5
+ exports.withTime = withTime;
6
+ exports.clampDate = clampDate;
7
+ const WEEKDAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
8
+ const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
9
+ const pad = (value) => String(value).padStart(2, "0");
10
+ /** Default display: "Sat 3 Oct 2026", "08:05" or "Sat 3 Oct 2026 · 08:05", local time. Pure. */
11
+ function formatDateTimeValue(value, mode) {
12
+ const day = `${WEEKDAYS[value.getDay()]} ${value.getDate()} ${MONTHS[value.getMonth()]} ${value.getFullYear()}`;
13
+ const time = `${pad(value.getHours())}:${pad(value.getMinutes())}`;
14
+ if (mode === "date")
15
+ return day;
16
+ if (mode === "time")
17
+ return time;
18
+ return `${day} · ${time}`;
19
+ }
20
+ /** `value` moved to the calendar day of `day`, keeping its time. */
21
+ function withDay(value, day) {
22
+ const next = new Date(value);
23
+ next.setFullYear(day.getFullYear(), day.getMonth(), day.getDate());
24
+ return next;
25
+ }
26
+ /** `value` at the hour and minute of `time`, keeping its day. */
27
+ function withTime(value, time) {
28
+ const next = new Date(value);
29
+ next.setHours(time.getHours(), time.getMinutes(), 0, 0);
30
+ return next;
31
+ }
32
+ /** `value` moved inside the optional limits. */
33
+ function clampDate(value, minimum, maximum) {
34
+ if (minimum && value < minimum)
35
+ return new Date(minimum);
36
+ if (maximum && value > maximum)
37
+ return new Date(maximum);
38
+ return value;
39
+ }
40
+ //# sourceMappingURL=dateTimeValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeValue.js","sourceRoot":"","sources":["../../../src/components/DateTime/dateTimeValue.ts"],"names":[],"mappings":";;AAQA,kDAMC;AAGD,0BAIC;AAGD,4BAIC;AAGD,8BAIC;AAhCD,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnE,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACpG,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAE9D,gGAAgG;AAChG,SAAgB,mBAAmB,CAAC,KAAW,EAAE,IAAkB;IACjE,MAAM,GAAG,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IAChH,MAAM,IAAI,GA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eThemeRoles";
3
+ export { formatDateTimeValue, type DateTimeMode } from "./dateTimeValue";
4
+ export type { FieldDateTimeProps } from "./types";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatDateTimeValue = exports.DATE_TIME_THEME_ROLES = exports.FieldDateTime = void 0;
4
+ var FieldDateTime_1 = require("./FieldDateTime");
5
+ Object.defineProperty(exports, "FieldDateTime", { enumerable: true, get: function () { return FieldDateTime_1.FieldDateTime; } });
6
+ var dateTimeThemeRoles_1 = require("./dateTimeThemeRoles");
7
+ Object.defineProperty(exports, "DATE_TIME_THEME_ROLES", { enumerable: true, get: function () { return dateTimeThemeRoles_1.DATE_TIME_THEME_ROLES; } });
8
+ var dateTimeValue_1 = require("./dateTimeValue");
9
+ Object.defineProperty(exports, "formatDateTimeValue", { enumerable: true, get: function () { return dateTimeValue_1.formatDateTimeValue; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,2DAA0F;AAAjF,2HAAA,qBAAqB,OAAA;AAC9B,iDAAyE;AAAhE,oHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,57 @@
1
+ import type { StyleProp, ViewStyle } from "react-native";
2
+ import type { ButtonRadius } from "../Button/buttonRadius";
3
+ import type { DateTimeMode } from "./dateTimeValue";
4
+ export type FieldDateTimeProps = {
5
+ /** Matches `FieldError.field` for the error banner. */
6
+ name?: string;
7
+ value: Date | null;
8
+ onChange: (value: Date) => void;
9
+ /** Default `"datetime"`. */
10
+ mode?: DateTimeMode;
11
+ label?: string;
12
+ description?: string;
13
+ error?: string;
14
+ /** Shown while `value` is null. Default "Choose a date" / "Choose a time". */
15
+ placeholder?: string;
16
+ minimumDate?: Date;
17
+ maximumDate?: Date;
18
+ /** Field text. Default: "Sat 3 Oct 2026 · 08:05" style. */
19
+ formatValue?: (value: Date) => string;
20
+ /** iOS sheet title. Defaults to `label`. */
21
+ sheetTitle?: string;
22
+ /** Default "Done". */
23
+ doneLabel?: string;
24
+ radius?: ButtonRadius;
25
+ editable?: boolean;
26
+ backgroundColor?: string;
27
+ textColor?: string;
28
+ placeholderColor?: string;
29
+ labelColor?: string;
30
+ descriptionColor?: string;
31
+ borderColor?: string;
32
+ errorColor?: string;
33
+ /** Done button (iOS) and picker tint. */
34
+ accentColor?: string;
35
+ style?: StyleProp<ViewStyle>;
36
+ };
37
+ /** Platform picker opened by the field. */
38
+ export type DateTimePresenterProps = {
39
+ open: boolean;
40
+ /** Starting point: the value, or now within the limits. */
41
+ value: Date;
42
+ mode: DateTimeMode;
43
+ minimumDate?: Date;
44
+ maximumDate?: Date;
45
+ title: string;
46
+ doneLabel: string;
47
+ colors: {
48
+ background: string;
49
+ text: string;
50
+ handle: string;
51
+ border: string;
52
+ accent: string;
53
+ };
54
+ onConfirm: (value: Date) => void;
55
+ onClose: () => void;
56
+ };
57
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KA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MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,2DAA2D;IAC3D,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/DateTime/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAYzD,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAgC,EAChC,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW;AACX,4GAA4G;AAC5G,OAAqC,EACrC,aAAa,EAAE,cAAc,EAC7B,MAAa,EACb,QAAe,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,oBAAoB,EAAE,wBAAwB,EAC9C,cAAc,EAAE,kBAAkB,EAClC,KAAK,GACN,EAAE,WAAW,+BAkQb"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,SAAS,CAAC;AAIzD,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAgC,EAChC,KAAK,EACL,WAAW,EACX,KAAK,EACL,UAAU,EACV,WAAW;AACX,4GAA4G;AAC5G,OAAqC,EACrC,aAAa,EAAE,cAAc,EAC7B,MAAa,EACb,QAAe,EACf,eAAe,EAAE,mBAAmB,EACpC,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,oBAAoB,EACtC,WAAW,EAAE,eAAe,EAC5B,UAAU,EAAE,cAAc,EAC1B,aAAa,EAAE,iBAAiB,EAChC,oBAAoB,EAAE,wBAAwB,EAC9C,cAAc,EAAE,kBAAkB,EAClC,KAAK,GACN,EAAE,WAAW,+BAkQb"}
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_native_1 = require("react-native");
7
7
  const bottom_sheet_1 = require("@gorhom/bottom-sheet");
8
- const react_native_screens_1 = require("react-native-screens");
8
+ const SheetContainer_1 = require("../../layout/SheetContainer");
9
9
  const sheet_1 = require("../../layout/sheet");
10
10
  const buttonRadius_1 = require("../Button/buttonRadius");
11
11
  const ErrorBanner_1 = require("../ErrorBanner");
@@ -14,13 +14,6 @@ const resolveSelectDetentIndex_1 = require("./resolveSelectDetentIndex");
14
14
  const SelectCloseButton_1 = require("./SelectCloseButton");
15
15
  const selectThemeRoles_1 = require("./selectThemeRoles");
16
16
  const BACKDROP_OPACITY = 0.72;
17
- /** Renders the sheet above React Navigation native modals (iOS). */
18
- function SheetContainer({ children }) {
19
- if (react_native_1.Platform.OS === "ios") {
20
- return (0, jsx_runtime_1.jsx)(react_native_screens_1.FullWindowOverlay, { children: children });
21
- }
22
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
23
- }
24
17
  function Select({ name, value, onChange, options, placeholder = "Select an option", label, description, error, sheetTitle, closeButton,
25
18
  /** Max sheet height as a fraction of the window (largest value wins). Default `[0.25, 0.5, 0.75]` → 75%. */
26
19
  detents = [...resolveSelectDetentIndex_1.DEFAULT_SELECT_DETENTS], initialDetent: _initialDetent, radius = "xl", editable = true, backgroundColor: backgroundColorProp, textColor: textColorProp, placeholderColor: placeholderColorProp, labelColor: labelColorProp, descriptionColor: descriptionColorProp, borderColor: borderColorProp, errorColor: errorColorProp, selectedColor: selectedColorProp, closeBackgroundColor: closeBackgroundColorProp, closeIconColor: closeIconColorProp, style, }) {
@@ -104,7 +97,7 @@ detents = [...resolveSelectDetentIndex_1.DEFAULT_SELECT_DETENTS], initialDetent:
104
97
  backgroundColor,
105
98
  borderTopLeftRadius: sheet_1.SHEET_TOP_RADIUS,
106
99
  borderTopRightRadius: sheet_1.SHEET_TOP_RADIUS,
107
- }, containerComponent: SheetContainer, enableDynamicSizing: true, enablePanDownToClose: true, handleComponent: renderHandle, handleStyle: styles.handleShell, maxDynamicContentSize: maxDynamicContentSize, stackBehavior: "push", children: (0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetScrollView, { contentContainerStyle: styles.sheetContent, enableFooterMarginAdjustment: false, children: options.length === 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.empty, { color: placeholderColor }], children: "No options" })) : (options.map((option) => {
100
+ }, containerComponent: SheetContainer_1.SheetContainer, enableDynamicSizing: true, enablePanDownToClose: true, handleComponent: renderHandle, handleStyle: styles.handleShell, maxDynamicContentSize: maxDynamicContentSize, stackBehavior: "push", children: (0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetScrollView, { contentContainerStyle: styles.sheetContent, enableFooterMarginAdjustment: false, children: options.length === 0 ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.empty, { color: placeholderColor }], children: "No options" })) : (options.map((option) => {
108
101
  const isSelected = option.value === value;
109
102
  return ((0, jsx_runtime_1.jsxs)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityState: {
110
103
  selected: isSelected,