@dcs-tech/ui-native 0.0.0-stage → 0.15.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 (187) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +178 -2
  3. package/dist/components/Button/Button.js +61 -0
  4. package/dist/components/Button/buttonStyle.js +100 -0
  5. package/dist/components/Button/index.js +1 -0
  6. package/dist/components/Checkbox/Checkbox.js +60 -0
  7. package/dist/components/Checkbox/checkboxStyle.js +44 -0
  8. package/dist/components/Checkbox/index.js +1 -0
  9. package/dist/components/DataTable/BulkRun.js +85 -0
  10. package/dist/components/DataTable/CardList.js +70 -0
  11. package/dist/components/DataTable/DataTable.js +53 -0
  12. package/dist/components/DataTable/DataTableScrollView.js +33 -0
  13. package/dist/components/DataTable/DragSelect.js +153 -0
  14. package/dist/components/DataTable/LayoutSwitcher.js +48 -0
  15. package/dist/components/DataTable/Pager.js +15 -0
  16. package/dist/components/DataTable/RowActions.js +28 -0
  17. package/dist/components/DataTable/RowDetail.js +80 -0
  18. package/dist/components/DataTable/RowMenuSheet.js +72 -0
  19. package/dist/components/DataTable/SortSheet.js +25 -0
  20. package/dist/components/DataTable/SplitList.js +30 -0
  21. package/dist/components/DataTable/StatusRow.js +48 -0
  22. package/dist/components/DataTable/SwipeRow.js +125 -0
  23. package/dist/components/DataTable/ToolButton.js +9 -0
  24. package/dist/components/DataTable/Toolbar.js +53 -0
  25. package/dist/components/DataTable/cells.js +21 -0
  26. package/dist/components/DataTable/dataTableStyle.js +218 -0
  27. package/dist/components/DataTable/filters/FilterConditionRow.js +48 -0
  28. package/dist/components/DataTable/filters/FilterGroupEditor.js +21 -0
  29. package/dist/components/DataTable/filters/FilterSheet.js +67 -0
  30. package/dist/components/DataTable/filters/SavedFilterBar.js +39 -0
  31. package/dist/components/DataTable/filters/filterStyle.js +82 -0
  32. package/dist/components/DataTable/index.js +3 -0
  33. package/dist/components/DataTable/persistence/adapters.js +78 -0
  34. package/dist/components/DataTable/persistence/useViewPrefs.js +76 -0
  35. package/dist/components/DataTable/rowParts.js +47 -0
  36. package/dist/components/DataTable/useTableState.js +328 -0
  37. package/dist/components/DatePicker/Calendar.js +28 -0
  38. package/dist/components/DatePicker/DatePicker.js +296 -0
  39. package/dist/components/DatePicker/PeriodGrid.js +17 -0
  40. package/dist/components/DatePicker/PeriodPicker.js +213 -0
  41. package/dist/components/DatePicker/TimeField.js +50 -0
  42. package/dist/components/DatePicker/datePickerStyle.js +157 -0
  43. package/dist/components/DatePicker/index.js +2 -0
  44. package/dist/components/Dialog/Dialog.js +104 -0
  45. package/dist/components/Dialog/DialogHost.js +71 -0
  46. package/dist/components/Dialog/dialogStyle.js +72 -0
  47. package/dist/components/Dialog/index.js +2 -0
  48. package/dist/components/FieldContext/FieldContext.js +50 -0
  49. package/dist/components/FieldContext/index.js +1 -0
  50. package/dist/components/FieldWrapper/FieldWrapper.js +23 -0
  51. package/dist/components/FieldWrapper/fieldWrapperStyle.js +64 -0
  52. package/dist/components/FieldWrapper/index.js +1 -0
  53. package/dist/components/Icon/Icon.js +124 -0
  54. package/dist/components/Icon/IconContext.js +12 -0
  55. package/dist/components/Icon/iconStyle.js +59 -0
  56. package/dist/components/Icon/icons.js +239 -0
  57. package/dist/components/Icon/index.js +4 -0
  58. package/dist/components/Icon/useIconDone.js +19 -0
  59. package/dist/components/Input/Input.js +71 -0
  60. package/dist/components/Input/index.js +1 -0
  61. package/dist/components/Input/inputStyle.js +47 -0
  62. package/dist/components/Press/Ripple.js +92 -0
  63. package/dist/components/Press/index.js +1 -0
  64. package/dist/components/Press/measure.js +3 -0
  65. package/dist/components/Radio/Radio.js +54 -0
  66. package/dist/components/Radio/index.js +1 -0
  67. package/dist/components/Radio/radioStyle.js +45 -0
  68. package/dist/components/Select/Select.js +83 -0
  69. package/dist/components/Select/SelectSheet.js +85 -0
  70. package/dist/components/Select/index.js +1 -0
  71. package/dist/components/Suggest/Suggest.js +101 -0
  72. package/dist/components/Suggest/index.js +1 -0
  73. package/dist/components/Switch/Switch.js +71 -0
  74. package/dist/components/Switch/index.js +1 -0
  75. package/dist/components/Switch/switchStyle.js +59 -0
  76. package/dist/components/Toast/ToastHost.js +76 -0
  77. package/dist/components/Toast/ToastItem.js +115 -0
  78. package/dist/components/Toast/ToastLayer.js +21 -0
  79. package/dist/components/Toast/index.js +2 -0
  80. package/dist/components/Toast/toast.types.js +1 -0
  81. package/dist/components/Toast/toastStyle.js +73 -0
  82. package/dist/components/Toggle/ToggleField.js +20 -0
  83. package/dist/components/Toggle/ToggleGroupFrame.js +10 -0
  84. package/dist/components/UIProvider/UIProvider.js +14 -0
  85. package/dist/components/UIProvider/context.js +57 -0
  86. package/dist/components/UIProvider/index.js +1 -0
  87. package/dist/components/styles/color.js +35 -0
  88. package/dist/components/styles/fieldControl.js +102 -0
  89. package/dist/components/styles/popupList.js +102 -0
  90. package/dist/components/styles/toggle.js +64 -0
  91. package/dist/components/styles/webValues.js +147 -0
  92. package/dist/index.js +15 -0
  93. package/dist/locales/hi.js +1 -0
  94. package/dist/locales/ta.js +1 -0
  95. package/dist/types/components/Button/Button.d.ts +31 -0
  96. package/dist/types/components/Button/buttonStyle.d.ts +46 -0
  97. package/dist/types/components/Button/index.d.ts +3 -0
  98. package/dist/types/components/Checkbox/Checkbox.d.ts +60 -0
  99. package/dist/types/components/Checkbox/checkboxStyle.d.ts +16 -0
  100. package/dist/types/components/Checkbox/index.d.ts +3 -0
  101. package/dist/types/components/DataTable/BulkRun.d.ts +11 -0
  102. package/dist/types/components/DataTable/CardList.d.ts +18 -0
  103. package/dist/types/components/DataTable/DataTable.d.ts +11 -0
  104. package/dist/types/components/DataTable/DataTableScrollView.d.ts +10 -0
  105. package/dist/types/components/DataTable/DragSelect.d.ts +12 -0
  106. package/dist/types/components/DataTable/LayoutSwitcher.d.ts +23 -0
  107. package/dist/types/components/DataTable/Pager.d.ts +5 -0
  108. package/dist/types/components/DataTable/RowActions.d.ts +13 -0
  109. package/dist/types/components/DataTable/RowDetail.d.ts +15 -0
  110. package/dist/types/components/DataTable/RowMenuSheet.d.ts +5 -0
  111. package/dist/types/components/DataTable/SortSheet.d.ts +8 -0
  112. package/dist/types/components/DataTable/SplitList.d.ts +9 -0
  113. package/dist/types/components/DataTable/StatusRow.d.ts +7 -0
  114. package/dist/types/components/DataTable/SwipeRow.d.ts +25 -0
  115. package/dist/types/components/DataTable/ToolButton.d.ts +13 -0
  116. package/dist/types/components/DataTable/Toolbar.d.ts +8 -0
  117. package/dist/types/components/DataTable/cells.d.ts +13 -0
  118. package/dist/types/components/DataTable/dataTableStyle.d.ts +139 -0
  119. package/dist/types/components/DataTable/filters/FilterConditionRow.d.ts +12 -0
  120. package/dist/types/components/DataTable/filters/FilterGroupEditor.d.ts +13 -0
  121. package/dist/types/components/DataTable/filters/FilterSheet.d.ts +5 -0
  122. package/dist/types/components/DataTable/filters/SavedFilterBar.d.ts +20 -0
  123. package/dist/types/components/DataTable/filters/filterStyle.d.ts +46 -0
  124. package/dist/types/components/DataTable/index.d.ts +5 -0
  125. package/dist/types/components/DataTable/persistence/adapters.d.ts +12 -0
  126. package/dist/types/components/DataTable/persistence/useViewPrefs.d.ts +20 -0
  127. package/dist/types/components/DataTable/rowParts.d.ts +32 -0
  128. package/dist/types/components/DataTable/useTableState.d.ts +103 -0
  129. package/dist/types/components/DatePicker/Calendar.d.ts +11 -0
  130. package/dist/types/components/DatePicker/DatePicker.d.ts +65 -0
  131. package/dist/types/components/DatePicker/PeriodGrid.d.ts +11 -0
  132. package/dist/types/components/DatePicker/PeriodPicker.d.ts +10 -0
  133. package/dist/types/components/DatePicker/TimeField.d.ts +15 -0
  134. package/dist/types/components/DatePicker/datePickerStyle.d.ts +75 -0
  135. package/dist/types/components/DatePicker/index.d.ts +4 -0
  136. package/dist/types/components/Dialog/Dialog.d.ts +35 -0
  137. package/dist/types/components/Dialog/DialogHost.d.ts +45 -0
  138. package/dist/types/components/Dialog/dialogStyle.d.ts +23 -0
  139. package/dist/types/components/Dialog/index.d.ts +4 -0
  140. package/dist/types/components/FieldContext/FieldContext.d.ts +43 -0
  141. package/dist/types/components/FieldContext/index.d.ts +3 -0
  142. package/dist/types/components/FieldWrapper/FieldWrapper.d.ts +23 -0
  143. package/dist/types/components/FieldWrapper/fieldWrapperStyle.d.ts +24 -0
  144. package/dist/types/components/FieldWrapper/index.d.ts +3 -0
  145. package/dist/types/components/Icon/Icon.d.ts +37 -0
  146. package/dist/types/components/Icon/IconContext.d.ts +12 -0
  147. package/dist/types/components/Icon/iconStyle.d.ts +10 -0
  148. package/dist/types/components/Icon/icons.d.ts +237 -0
  149. package/dist/types/components/Icon/index.d.ts +7 -0
  150. package/dist/types/components/Icon/useIconDone.d.ts +4 -0
  151. package/dist/types/components/Input/Input.d.ts +53 -0
  152. package/dist/types/components/Input/index.d.ts +3 -0
  153. package/dist/types/components/Input/inputStyle.d.ts +11 -0
  154. package/dist/types/components/Press/Ripple.d.ts +20 -0
  155. package/dist/types/components/Press/index.d.ts +2 -0
  156. package/dist/types/components/Press/measure.d.ts +8 -0
  157. package/dist/types/components/Radio/Radio.d.ts +58 -0
  158. package/dist/types/components/Radio/index.d.ts +3 -0
  159. package/dist/types/components/Radio/radioStyle.d.ts +17 -0
  160. package/dist/types/components/Select/Select.d.ts +49 -0
  161. package/dist/types/components/Select/SelectSheet.d.ts +34 -0
  162. package/dist/types/components/Select/index.d.ts +3 -0
  163. package/dist/types/components/Suggest/Suggest.d.ts +44 -0
  164. package/dist/types/components/Suggest/index.d.ts +3 -0
  165. package/dist/types/components/Switch/Switch.d.ts +42 -0
  166. package/dist/types/components/Switch/index.d.ts +3 -0
  167. package/dist/types/components/Switch/switchStyle.d.ts +29 -0
  168. package/dist/types/components/Toast/ToastHost.d.ts +12 -0
  169. package/dist/types/components/Toast/ToastItem.d.ts +17 -0
  170. package/dist/types/components/Toast/ToastLayer.d.ts +11 -0
  171. package/dist/types/components/Toast/index.d.ts +5 -0
  172. package/dist/types/components/Toast/toast.types.d.ts +37 -0
  173. package/dist/types/components/Toast/toastStyle.d.ts +22 -0
  174. package/dist/types/components/Toggle/ToggleField.d.ts +31 -0
  175. package/dist/types/components/Toggle/ToggleGroupFrame.d.ts +14 -0
  176. package/dist/types/components/UIProvider/UIProvider.d.ts +16 -0
  177. package/dist/types/components/UIProvider/context.d.ts +20 -0
  178. package/dist/types/components/UIProvider/index.d.ts +2 -0
  179. package/dist/types/components/styles/color.d.ts +2 -0
  180. package/dist/types/components/styles/fieldControl.d.ts +26 -0
  181. package/dist/types/components/styles/popupList.d.ts +48 -0
  182. package/dist/types/components/styles/toggle.d.ts +26 -0
  183. package/dist/types/components/styles/webValues.d.ts +157 -0
  184. package/dist/types/index.d.ts +15 -0
  185. package/dist/types/locales/hi.d.ts +1 -0
  186. package/dist/types/locales/ta.d.ts +1 -0
  187. package/package.json +85 -4
@@ -0,0 +1,139 @@
1
+ import type { TextStyle, ViewStyle } from 'react-native';
2
+ import type { Tokens } from '@dcs-tech/tokens';
3
+ export interface TableColors {
4
+ surface: string;
5
+ canvas: string;
6
+ line: string;
7
+ lineSoft: string;
8
+ rowHover: string;
9
+ accentSoft: string;
10
+ }
11
+ export declare function tableColors(t: Tokens): TableColors;
12
+ export declare function containerLook(t: Tokens): ViewStyle;
13
+ export type AvatarPlace = 'card' | 'cardPhone' | 'split';
14
+ export declare function avatarLook(t: Tokens, hue: number, place: AvatarPlace): {
15
+ box: ViewStyle;
16
+ text: TextStyle;
17
+ };
18
+ export interface CardLook {
19
+ list: ViewStyle;
20
+ gap: number;
21
+ card: ViewStyle;
22
+ head: ViewStyle;
23
+ titles: ViewStyle;
24
+ title: TextStyle;
25
+ subtitle: TextStyle;
26
+ badge: ViewStyle;
27
+ badgeText: TextStyle;
28
+ fields: ViewStyle;
29
+ moreFields: ViewStyle;
30
+ fieldLine: ViewStyle;
31
+ field: ViewStyle;
32
+ fieldName: TextStyle;
33
+ fieldValue: TextStyle;
34
+ foot: ViewStyle;
35
+ expand: ViewStyle;
36
+ expandIcon: number;
37
+ }
38
+ export declare function cardLook(t: Tokens, phone: boolean): CardLook;
39
+ export interface SplitLook {
40
+ split: ViewStyle;
41
+ side: ViewStyle;
42
+ pane: ViewStyle;
43
+ item: ViewStyle;
44
+ itemPressed: ViewStyle;
45
+ itemOpen: ViewStyle;
46
+ text: ViewStyle;
47
+ line: ViewStyle;
48
+ title: TextStyle;
49
+ subtitle: TextStyle;
50
+ badge: ViewStyle;
51
+ badgeText: TextStyle;
52
+ actions: ViewStyle;
53
+ group: ViewStyle;
54
+ }
55
+ export declare function splitLook(t: Tokens, phone: boolean, both: boolean, narrowList: boolean): SplitLook;
56
+ export declare function emptyLook(t: Tokens): {
57
+ box: ViewStyle;
58
+ text: TextStyle;
59
+ };
60
+ export declare function pagerLook(t: Tokens): {
61
+ bar: ViewStyle;
62
+ info: TextStyle;
63
+ };
64
+ export interface DetailLook {
65
+ bar: ViewStyle;
66
+ nav: ViewStyle;
67
+ position: TextStyle;
68
+ navButton: ViewStyle;
69
+ body: ViewStyle;
70
+ empty: ViewStyle;
71
+ emptyText: TextStyle;
72
+ fields: ViewStyle;
73
+ field: ViewStyle;
74
+ fieldLast: ViewStyle;
75
+ label: TextStyle;
76
+ value: TextStyle;
77
+ }
78
+ export declare function detailLook(t: Tokens): DetailLook;
79
+ export declare function viewTabsLook(t: Tokens, phone: boolean): {
80
+ frame: ViewStyle;
81
+ tabs: ViewStyle;
82
+ };
83
+ export declare function viewTabLook(t: Tokens, phone: boolean, active: boolean): {
84
+ tab: ViewStyle;
85
+ text: TextStyle;
86
+ };
87
+ export declare function toolbarLook(t: Tokens, phone: boolean): {
88
+ bar: ViewStyle;
89
+ search: ViewStyle;
90
+ quick: ViewStyle;
91
+ tools: ViewStyle;
92
+ button: number;
93
+ };
94
+ export declare function iconButtonLook(t: Tokens, size: number, active: boolean, pressed: boolean): {
95
+ box: ViewStyle;
96
+ color: string;
97
+ };
98
+ type BulkVariant = 'primary' | 'secondary' | 'danger' | 'success' | 'warning';
99
+ export interface StatusLook {
100
+ row: ViewStyle;
101
+ inner: ViewStyle;
102
+ summary: TextStyle;
103
+ order: TextStyle;
104
+ selected: TextStyle;
105
+ link: ViewStyle;
106
+ linkText: TextStyle;
107
+ clearText: TextStyle;
108
+ linkPressed: ViewStyle;
109
+ chip: ViewStyle;
110
+ chipBody: ViewStyle;
111
+ chipText: TextStyle;
112
+ filterChip: ViewStyle;
113
+ filterChipText: TextStyle;
114
+ chipOperator: TextStyle;
115
+ chipValue: TextStyle;
116
+ chipIcon: number;
117
+ chipRemove: ViewStyle;
118
+ chipRemovePressed: ViewStyle;
119
+ divider: ViewStyle;
120
+ dividerSoft: ViewStyle;
121
+ spacer: ViewStyle;
122
+ }
123
+ export declare function statusLook(t: Tokens, phone: boolean, mode: 'selecting' | 'idle' | 'chips'): StatusLook;
124
+ export declare function bulkButtonLook(t: Tokens, variant: BulkVariant | undefined, first: boolean, state: {
125
+ disabled: boolean;
126
+ busy: boolean;
127
+ pressed: boolean;
128
+ }): {
129
+ box: ViewStyle;
130
+ text: TextStyle;
131
+ color: string;
132
+ };
133
+ export declare function cardCheckLook(): {
134
+ box: ViewStyle;
135
+ headPad: number;
136
+ };
137
+ export declare function cardTickedLook(t: Tokens): ViewStyle;
138
+ export declare const splitCheckLook: () => ViewStyle;
139
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { DataTableColumn, DataTableFilterCondition, DataTableLabels } from '@dcs-tech/core';
3
+ export interface FilterConditionRowProps<T> {
4
+ condition: DataTableFilterCondition;
5
+ columns: readonly DataTableColumn<T>[];
6
+ onChange: (next: DataTableFilterCondition) => void;
7
+ onRemove: () => void;
8
+ L: DataTableLabels;
9
+ operators?: readonly string[];
10
+ rows?: readonly T[];
11
+ }
12
+ export declare function FilterConditionRow<T>({ condition, columns, onChange, onRemove, L, operators, rows }: FilterConditionRowProps<T>): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { DataTableColumn, DataTableFilterGroup, DataTableLabels } from '@dcs-tech/core';
3
+ export interface FilterGroupEditorProps<T> {
4
+ group: DataTableFilterGroup;
5
+ columns: readonly DataTableColumn<T>[];
6
+ onChange: (next: DataTableFilterGroup) => void;
7
+ onRemove?: () => void;
8
+ L: DataTableLabels;
9
+ operators?: readonly string[];
10
+ rows?: readonly T[];
11
+ depth?: number;
12
+ }
13
+ export declare function FilterGroupEditor<T>({ group, columns, onChange, onRemove, L, operators, rows, depth }: FilterGroupEditorProps<T>): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { TableState } from '../useTableState';
3
+ export declare function FilterSheet<T>({ state }: {
4
+ state: TableState<T>;
5
+ }): React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { DataTableColumn, DataTableLabels, DataTableSavedFilter, TableFormat } from '@dcs-tech/core';
3
+ export interface SavedFilterBarProps<T> {
4
+ saved: readonly DataTableSavedFilter[];
5
+ columns: readonly DataTableColumn<T>[];
6
+ activeId: string | null;
7
+ onPick: (id: string | null) => void;
8
+ onDelete?: (id: string) => void;
9
+ offer: {
10
+ update: boolean;
11
+ saveAsNew: boolean;
12
+ };
13
+ onUpdate: () => void;
14
+ name: string | null;
15
+ onName: (name: string | null) => void;
16
+ onSaveAsNew: () => void;
17
+ L: DataTableLabels;
18
+ format: TableFormat;
19
+ }
20
+ export declare function SavedFilterBar<T>(p: SavedFilterBarProps<T>): React.JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { type TextStyle, type ViewStyle } from 'react-native';
2
+ import type { Tokens } from '@dcs-tech/tokens';
3
+ export declare function filterLook(t: Tokens): {
4
+ headRow: ViewStyle;
5
+ tile: ViewStyle;
6
+ titleRow: ViewStyle;
7
+ title: TextStyle;
8
+ badge: ViewStyle;
9
+ badgeText: TextStyle;
10
+ subtitle: TextStyle;
11
+ saved: ViewStyle;
12
+ savedRow: ViewStyle;
13
+ savedSelect: ViewStyle;
14
+ savedActions: ViewStyle;
15
+ saveRow: ViewStyle;
16
+ saveInput: ViewStyle;
17
+ option: ViewStyle;
18
+ optionLabel: ViewStyle;
19
+ optionName: (active: boolean, off: boolean) => TextStyle;
20
+ optionReason: TextStyle;
21
+ optionCount: TextStyle;
22
+ optionDelete: (pressed: boolean) => ViewStyle;
23
+ optionHead: ViewStyle;
24
+ optionHeadText: TextStyle;
25
+ optionHeadCount: ViewStyle;
26
+ optionHeadCountText: TextStyle;
27
+ group: (or: boolean, depth: number) => ViewStyle;
28
+ groupHead: ViewStyle;
29
+ tabs: ViewStyle;
30
+ tab: (on: boolean) => ViewStyle;
31
+ tabText: (on: boolean, or: boolean) => TextStyle;
32
+ groupHeadRight: ViewStyle;
33
+ groupActions: ViewStyle;
34
+ condition: (on: boolean) => ViewStyle;
35
+ fields: ViewStyle;
36
+ between: ViewStyle;
37
+ betweenText: TextStyle;
38
+ conditionActions: ViewStyle;
39
+ json: ViewStyle;
40
+ jsonToggle: (pressed: boolean) => ViewStyle;
41
+ jsonToggleText: TextStyle;
42
+ jsonBody: ViewStyle;
43
+ jsonText: TextStyle;
44
+ foot: ViewStyle;
45
+ footRight: ViewStyle;
46
+ };
@@ -0,0 +1,5 @@
1
+ export { DataTable } from './DataTable';
2
+ export type { DataTableProps } from './DataTable';
3
+ export { DataTableScrollView } from './DataTableScrollView';
4
+ export { asyncStorageAdapter, memoryAdapter } from './persistence/adapters';
5
+ export type { KeyValueStorage } from './persistence/adapters';
@@ -0,0 +1,12 @@
1
+ import type { DataTablePersistence } from '@dcs-tech/core';
2
+ export interface KeyValueStorage {
3
+ getItem: (key: string) => Promise<string | null> | string | null | undefined;
4
+ setItem: (key: string, value: string) => Promise<void> | void;
5
+ removeItem?: (key: string) => Promise<void> | void;
6
+ getAllKeys?: () => Promise<readonly string[]> | readonly string[];
7
+ }
8
+ export declare function asyncStorageAdapter(storage: KeyValueStorage, prefix?: string): DataTablePersistence;
9
+ export declare function memoryAdapter(initial?: Record<string, Record<string, any>>): DataTablePersistence & {
10
+ store: Map<string, Record<string, any>>;
11
+ };
12
+ export declare function defaultPersistence(): DataTablePersistence;
@@ -0,0 +1,20 @@
1
+ import { type DataTableLayout, type DataTablePersistence, type DataTableSavedFilter, type DataTableView, type PrefsReport } from '@dcs-tech/core';
2
+ export interface ViewPrefsApplied {
3
+ layout?: DataTableLayout;
4
+ savedFilters: DataTableSavedFilter[];
5
+ }
6
+ export interface UseViewPrefsOptions<T> {
7
+ persistence: DataTablePersistence | null;
8
+ tableId?: string;
9
+ view: DataTableView<T>;
10
+ operators?: readonly string[];
11
+ renamedViews?: Record<string, string>;
12
+ version?: number;
13
+ migrate?: (doc: Record<string, any>, fromVersion: number, key: string) => Record<string, any>;
14
+ apply: (prefs: ViewPrefsApplied) => void;
15
+ onReport: (report: PrefsReport) => void;
16
+ }
17
+ export declare function useViewPrefs<T>(o: UseViewPrefsOptions<T>): {
18
+ loaded: boolean;
19
+ save: (path: string, value: unknown) => void;
20
+ };
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type CellTextLabels, type DataTableCardFields, type DataTableColumn, type DataTableListFields, type DataTableView } from '@dcs-tech/core';
3
+ export interface RowField {
4
+ key: string;
5
+ header: string;
6
+ node: ReactNode;
7
+ }
8
+ export type RowAvatar = {
9
+ node: ReactNode;
10
+ } | {
11
+ initials: string;
12
+ } | null;
13
+ export interface RowParts {
14
+ title: string;
15
+ subtitle: string;
16
+ badge: RowField | null;
17
+ details: RowField[];
18
+ more: RowField[];
19
+ avatar: RowAvatar;
20
+ }
21
+ export interface ListParts {
22
+ title: string;
23
+ subtitle: Array<{
24
+ key: string;
25
+ text: string;
26
+ }>;
27
+ badge: RowField | null;
28
+ avatar: RowAvatar;
29
+ }
30
+ export declare function renderCell<T>(col: DataTableColumn<T>, row: T, index: number, labels: CellTextLabels): ReactNode;
31
+ export declare function rowParts<T>(row: T, index: number, fields: DataTableCardFields, byKey: Map<string, DataTableColumn<T>>, avatar: DataTableView<T>['avatar'], labels: CellTextLabels): RowParts;
32
+ export declare function listParts<T>(row: T, index: number, fields: DataTableListFields, byKey: Map<string, DataTableColumn<T>>, avatar: DataTableView<T>['avatar'], labels: CellTextLabels): ListParts;
@@ -0,0 +1,103 @@
1
+ import { type ColumnTextContext, type ContainerSize, type DataTableCardFields, type DataTableColumn, type DataTableDetailMode, type DataTableActiveFilter, type DataTableBulkAction, type DataTableCellFilterValue, type DataTableFilterGroup, type DataTableQuickFilter, type DataTableSavedFilter, type DataTableValueFilterKind, type DataTableLabels, type DataTableLayout, type DataTableListFields, type DataTableProps, type DataTableRowAction, type DataTableSelection, type DataTableSortEntry, type DataTableView, type TableFormat } from '@dcs-tech/core';
2
+ export interface PageRow<T> {
3
+ id: string;
4
+ row: T;
5
+ index: number;
6
+ }
7
+ export interface TableState<T> {
8
+ views: DataTableView<T>[];
9
+ view: DataTableView<T>;
10
+ setViewId: (id: string) => void;
11
+ columns: DataTableColumn<T>[];
12
+ byKey: Map<string, DataTableColumn<T>>;
13
+ cardFields: DataTableCardFields;
14
+ listFields: DataTableListFields;
15
+ L: DataTableLabels;
16
+ format: TableFormat;
17
+ ctx: ColumnTextContext;
18
+ size: ContainerSize;
19
+ searchOn: boolean;
20
+ search: string;
21
+ setSearch: (text: string) => void;
22
+ sortOn: boolean;
23
+ sorting: DataTableSortEntry[];
24
+ setSorting: (sorting: DataTableSortEntry[]) => void;
25
+ defaultSorting: DataTableSortEntry[];
26
+ sortIsDefault: boolean;
27
+ setSortingOrDefault: (sorting: DataTableSortEntry[]) => void;
28
+ filterOn: boolean;
29
+ filterGroup: DataTableFilterGroup;
30
+ setFilterGroup: (group: DataTableFilterGroup) => void;
31
+ activeFilters: DataTableActiveFilter[];
32
+ removeFilter: (conditionId: string) => void;
33
+ quickFilters: DataTableQuickFilter[];
34
+ quickFilterMode: 'single' | 'multi';
35
+ quickFilterLabel?: string;
36
+ quickFilterIds: string[];
37
+ setQuickFilters: (ids: string[]) => void;
38
+ savedFilters: DataTableSavedFilter[];
39
+ allSavedFilters: DataTableSavedFilter[];
40
+ canSaveFilters: boolean;
41
+ saveFilter: (preset: DataTableSavedFilter) => void;
42
+ deleteFilter: (id: string) => void;
43
+ filterByValue: (columnKey: string, value: DataTableCellFilterValue, kind: DataTableValueFilterKind) => void;
44
+ operators?: readonly string[];
45
+ clearAll: () => void;
46
+ filtersOpen: boolean;
47
+ setFiltersOpen: (open: boolean) => void;
48
+ filterOptionRows?: readonly T[];
49
+ rows: PageRow<T>[];
50
+ total: number;
51
+ serverMode: boolean;
52
+ pageOn: boolean;
53
+ pageIndex: number;
54
+ pageCount: number;
55
+ setPageIndex: (i: number) => void;
56
+ loading: boolean;
57
+ fetching: boolean;
58
+ error: unknown;
59
+ retry: () => void;
60
+ layouts: DataTableLayout[];
61
+ layout: DataTableLayout;
62
+ setLayout: (layout: DataTableLayout) => void;
63
+ detailMode: DataTableDetailMode;
64
+ opens: boolean;
65
+ openId: string | null;
66
+ open: (id: string | null) => void;
67
+ rowOf: (id: string) => T | null;
68
+ actionsOf: (row: T) => DataTableRowAction<T>[];
69
+ menuOn: boolean;
70
+ menuRow: PageRow<T> | null;
71
+ openMenu: (id: string | null) => void;
72
+ selectionOn: boolean;
73
+ selectionShow: 'onDemand' | 'always';
74
+ selecting: boolean;
75
+ checkboxes: boolean;
76
+ tapTicks: boolean;
77
+ isTicked: (id: string) => boolean;
78
+ canTick: (row: T) => boolean;
79
+ toggleTick: (id: string) => void;
80
+ ticks: Readonly<Record<string, boolean>>;
81
+ setTicks: (next: Readonly<Record<string, boolean>>) => void;
82
+ pressTicks: boolean;
83
+ multiple: boolean;
84
+ toggleSelecting: () => void;
85
+ clearSelection: () => void;
86
+ selectAll?: {
87
+ label: string;
88
+ run: () => void;
89
+ };
90
+ allMatching: boolean;
91
+ selection: DataTableSelection<T>;
92
+ selectedCount: number;
93
+ bulkActions: DataTableBulkAction<T>[];
94
+ swiped: {
95
+ id: string;
96
+ side: 'right' | 'left';
97
+ } | null;
98
+ setSwiped: (next: {
99
+ id: string;
100
+ side: 'right' | 'left';
101
+ } | null) => void;
102
+ }
103
+ export declare function useTableState<T>(props: DataTableProps<T>, width: number): TableState<T>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { CalendarView, IsoDay } from '@dcs-tech/core';
3
+ export interface CalendarProps {
4
+ view: CalendarView;
5
+ weekdayNames: string[];
6
+ dayLabel: (day: IsoDay) => string;
7
+ fontSize: number;
8
+ width: number;
9
+ onPick: (day: IsoDay) => void;
10
+ }
11
+ export declare function Calendar({ view, weekdayNames, dayLabel, fontSize, width, onPick }: CalendarProps): React.JSX.Element;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { ControlLayout, ControlSize, ControlVariant, DateDisplayFormat, DatePickerMode, DateRangeValue, DateTextOrder, FieldChangeEvent, FieldWidth, OpenReason } from '@dcs-tech/core';
4
+ import { Input } from '../Input/Input';
5
+ export declare const TYPING_SETTLE_MS = 250;
6
+ interface DatePickerCommonProps {
7
+ id?: string;
8
+ name?: string;
9
+ label?: React.ReactNode;
10
+ placeholder?: string;
11
+ hint?: React.ReactNode;
12
+ error?: React.ReactNode;
13
+ required?: boolean;
14
+ disabled?: boolean;
15
+ readOnly?: boolean;
16
+ size?: ControlSize;
17
+ variant?: ControlVariant;
18
+ layout?: ControlLayout;
19
+ width?: FieldWidth;
20
+ style?: StyleProp<ViewStyle>;
21
+ picker?: DatePickerMode;
22
+ min?: string;
23
+ max?: string;
24
+ yearRange?: {
25
+ back?: number;
26
+ ahead?: number;
27
+ };
28
+ displayFormat?: DateDisplayFormat;
29
+ textOrder?: DateTextOrder;
30
+ weekStart?: number;
31
+ presets?: boolean | string[];
32
+ fyStartMonth?: number;
33
+ monthNames?: string[];
34
+ weekdayNames?: string[];
35
+ clearLabel?: string;
36
+ applyLabel?: string;
37
+ showCalendarIcon?: boolean;
38
+ withTime?: boolean;
39
+ timeToggle?: boolean;
40
+ clearable?: boolean;
41
+ autoComplete?: React.ComponentProps<typeof Input>['autoComplete'];
42
+ open?: boolean;
43
+ defaultOpen?: boolean;
44
+ onOpenChange?: (open: boolean, reason: OpenReason) => void;
45
+ testID?: string;
46
+ 'aria-label'?: string;
47
+ }
48
+ export interface DatePickerSingleProps extends DatePickerCommonProps {
49
+ range?: false;
50
+ value?: string;
51
+ onChange?: (event: FieldChangeEvent<string>) => void;
52
+ onApply?: (value: string) => void;
53
+ }
54
+ export interface DatePickerRangeProps extends DatePickerCommonProps {
55
+ range: true;
56
+ value?: DateRangeValue;
57
+ onChange?: (event: FieldChangeEvent<DateRangeValue>) => void;
58
+ onApply?: (value: DateRangeValue) => void;
59
+ }
60
+ export type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
61
+ export declare function DatePicker({ picker, ...props }: DatePickerProps): React.JSX.Element;
62
+ export declare namespace DatePicker {
63
+ var displayName: string;
64
+ }
65
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { IsoPeriod, PeriodGridView } from '@dcs-tech/core';
3
+ export interface PeriodGridProps {
4
+ view: PeriodGridView;
5
+ cellText: (period: IsoPeriod) => string;
6
+ cellLabel: (period: IsoPeriod) => string;
7
+ fontSize: number;
8
+ width: number;
9
+ onPick: (period: IsoPeriod) => void;
10
+ }
11
+ export declare function PeriodGrid({ view, cellText, cellLabel, fontSize, width, onPick }: PeriodGridProps): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { PeriodMode } from '@dcs-tech/core';
3
+ import type { DatePickerProps } from './DatePicker';
4
+ export type PeriodPickerProps = DatePickerProps & {
5
+ mode: PeriodMode;
6
+ };
7
+ export declare function PeriodPicker(props: PeriodPickerProps): React.JSX.Element;
8
+ export declare namespace PeriodPicker {
9
+ var displayName: string;
10
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { ControlSize, ControlVariant } from '@dcs-tech/core';
3
+ export interface TimeFieldProps {
4
+ size?: ControlSize;
5
+ variant?: ControlVariant;
6
+ label: string;
7
+ value: string;
8
+ onChange: (next: string) => void;
9
+ hour12?: boolean;
10
+ minuteStep?: number;
11
+ disabled?: boolean;
12
+ fallback?: string;
13
+ fontSize: number;
14
+ }
15
+ export declare function TimeField({ size, variant, label, value, onChange, hour12, minuteStep, disabled, fallback, fontSize }: TimeFieldProps): React.JSX.Element;
@@ -0,0 +1,75 @@
1
+ import type { TextStyle, ViewStyle } from 'react-native';
2
+ import type { Tokens } from '@dcs-tech/tokens';
3
+ export declare function calendarSize(fontSize: number, width: number): {
4
+ row: number;
5
+ cell: number;
6
+ };
7
+ export interface DayState {
8
+ inMonth: boolean;
9
+ isToday: boolean;
10
+ filled: boolean;
11
+ band: boolean;
12
+ start: boolean;
13
+ end: boolean;
14
+ disabled: boolean;
15
+ pressed: boolean;
16
+ }
17
+ export interface DayLook {
18
+ cell: ViewStyle;
19
+ cap?: ViewStyle;
20
+ circle: ViewStyle;
21
+ tint: ViewStyle;
22
+ text: TextStyle;
23
+ dot?: ViewStyle;
24
+ }
25
+ export declare function dayLook(t: Tokens, fontSize: number, size: {
26
+ row: number;
27
+ cell: number;
28
+ }, s: DayState): DayLook;
29
+ export declare function panelLook(t: Tokens, fontSize: number): {
30
+ weekday: ViewStyle;
31
+ weekdayText: TextStyle;
32
+ head: ViewStyle;
33
+ nav: (pressed: boolean) => ViewStyle;
34
+ navIcon: number;
35
+ jumps: ViewStyle;
36
+ entryLabel: TextStyle;
37
+ entries: ViewStyle;
38
+ rail: ViewStyle;
39
+ preset: (active: boolean, pressed: boolean) => ViewStyle;
40
+ presetText: (active: boolean) => TextStyle;
41
+ foot: ViewStyle;
42
+ footRead: TextStyle;
43
+ footReadValue: TextStyle;
44
+ footAct: ViewStyle;
45
+ footBtn: (pressed: boolean) => ViewStyle;
46
+ footBtnText: TextStyle;
47
+ apply: (pressed: boolean) => ViewStyle;
48
+ applyText: TextStyle;
49
+ navOn: (pressed: boolean) => ViewStyle;
50
+ };
51
+ export declare function timeLook(t: Tokens, fontSize: number): {
52
+ viewport: number;
53
+ cols: ViewStyle;
54
+ col: ViewStyle;
55
+ opt: (lit: boolean) => ViewStyle;
56
+ optText: (lit: boolean, pressed: boolean) => TextStyle;
57
+ };
58
+ export interface PeriodState {
59
+ isCurrent: boolean;
60
+ filled: boolean;
61
+ band: boolean;
62
+ start: boolean;
63
+ end: boolean;
64
+ disabled: boolean;
65
+ pressed: boolean;
66
+ }
67
+ export declare function periodLook(t: Tokens, fontSize: number, width: number, s: PeriodState): {
68
+ cell: ViewStyle;
69
+ cap: ViewStyle | undefined;
70
+ pill: ViewStyle;
71
+ tint: ViewStyle;
72
+ text: TextStyle;
73
+ dot: ViewStyle | undefined;
74
+ title: TextStyle;
75
+ };
@@ -0,0 +1,4 @@
1
+ export { DatePicker, TYPING_SETTLE_MS } from './DatePicker';
2
+ export type { DatePickerProps, DatePickerSingleProps, DatePickerRangeProps } from './DatePicker';
3
+ export { Calendar } from './Calendar';
4
+ export type { CalendarProps } from './Calendar';
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import { type DialogPlacement, type DialogSize } from './dialogStyle';
4
+ export type { DialogPlacement, DialogSize } from './dialogStyle';
5
+ export interface DialogProps {
6
+ open: boolean;
7
+ onClose?: () => void;
8
+ onBeforeClose?: () => boolean;
9
+ onBackdropPress?: () => void;
10
+ onAnimationEnd?: () => void;
11
+ children?: React.ReactNode;
12
+ title?: React.ReactNode;
13
+ subtitle?: React.ReactNode;
14
+ footer?: React.ReactNode;
15
+ placement?: DialogPlacement;
16
+ size?: DialogSize;
17
+ closeOnBackdrop?: boolean;
18
+ closeOnEscape?: boolean;
19
+ showCloseButton?: boolean;
20
+ closeIcon?: React.ReactNode;
21
+ animationDuration?: number;
22
+ padded?: boolean;
23
+ style?: StyleProp<ViewStyle>;
24
+ testID?: string;
25
+ 'aria-label'?: string;
26
+ }
27
+ export declare function DialogOpenProvider({ children }: {
28
+ children?: React.ReactNode;
29
+ }): React.JSX.Element;
30
+ export declare const useDialogOpen: () => boolean;
31
+ export declare const useTopDialog: () => object | null;
32
+ export declare function Dialog({ open, onClose, onBeforeClose, onBackdropPress, onAnimationEnd, children, title, subtitle, footer, placement, size, closeOnBackdrop, closeOnEscape, showCloseButton, closeIcon: ownCloseIcon, animationDuration, padded, style, testID, 'aria-label': ariaLabel, }: DialogProps): React.JSX.Element;
33
+ export declare namespace Dialog {
34
+ var displayName: string;
35
+ }