@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.
- package/CHANGELOG.md +125 -0
- package/README.md +178 -2
- package/dist/components/Button/Button.js +61 -0
- package/dist/components/Button/buttonStyle.js +100 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Checkbox/Checkbox.js +60 -0
- package/dist/components/Checkbox/checkboxStyle.js +44 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/DataTable/BulkRun.js +85 -0
- package/dist/components/DataTable/CardList.js +70 -0
- package/dist/components/DataTable/DataTable.js +53 -0
- package/dist/components/DataTable/DataTableScrollView.js +33 -0
- package/dist/components/DataTable/DragSelect.js +153 -0
- package/dist/components/DataTable/LayoutSwitcher.js +48 -0
- package/dist/components/DataTable/Pager.js +15 -0
- package/dist/components/DataTable/RowActions.js +28 -0
- package/dist/components/DataTable/RowDetail.js +80 -0
- package/dist/components/DataTable/RowMenuSheet.js +72 -0
- package/dist/components/DataTable/SortSheet.js +25 -0
- package/dist/components/DataTable/SplitList.js +30 -0
- package/dist/components/DataTable/StatusRow.js +48 -0
- package/dist/components/DataTable/SwipeRow.js +125 -0
- package/dist/components/DataTable/ToolButton.js +9 -0
- package/dist/components/DataTable/Toolbar.js +53 -0
- package/dist/components/DataTable/cells.js +21 -0
- package/dist/components/DataTable/dataTableStyle.js +218 -0
- package/dist/components/DataTable/filters/FilterConditionRow.js +48 -0
- package/dist/components/DataTable/filters/FilterGroupEditor.js +21 -0
- package/dist/components/DataTable/filters/FilterSheet.js +67 -0
- package/dist/components/DataTable/filters/SavedFilterBar.js +39 -0
- package/dist/components/DataTable/filters/filterStyle.js +82 -0
- package/dist/components/DataTable/index.js +3 -0
- package/dist/components/DataTable/persistence/adapters.js +78 -0
- package/dist/components/DataTable/persistence/useViewPrefs.js +76 -0
- package/dist/components/DataTable/rowParts.js +47 -0
- package/dist/components/DataTable/useTableState.js +328 -0
- package/dist/components/DatePicker/Calendar.js +28 -0
- package/dist/components/DatePicker/DatePicker.js +296 -0
- package/dist/components/DatePicker/PeriodGrid.js +17 -0
- package/dist/components/DatePicker/PeriodPicker.js +213 -0
- package/dist/components/DatePicker/TimeField.js +50 -0
- package/dist/components/DatePicker/datePickerStyle.js +157 -0
- package/dist/components/DatePicker/index.js +2 -0
- package/dist/components/Dialog/Dialog.js +104 -0
- package/dist/components/Dialog/DialogHost.js +71 -0
- package/dist/components/Dialog/dialogStyle.js +72 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/FieldContext/FieldContext.js +50 -0
- package/dist/components/FieldContext/index.js +1 -0
- package/dist/components/FieldWrapper/FieldWrapper.js +23 -0
- package/dist/components/FieldWrapper/fieldWrapperStyle.js +64 -0
- package/dist/components/FieldWrapper/index.js +1 -0
- package/dist/components/Icon/Icon.js +124 -0
- package/dist/components/Icon/IconContext.js +12 -0
- package/dist/components/Icon/iconStyle.js +59 -0
- package/dist/components/Icon/icons.js +239 -0
- package/dist/components/Icon/index.js +4 -0
- package/dist/components/Icon/useIconDone.js +19 -0
- package/dist/components/Input/Input.js +71 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/Input/inputStyle.js +47 -0
- package/dist/components/Press/Ripple.js +92 -0
- package/dist/components/Press/index.js +1 -0
- package/dist/components/Press/measure.js +3 -0
- package/dist/components/Radio/Radio.js +54 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/Radio/radioStyle.js +45 -0
- package/dist/components/Select/Select.js +83 -0
- package/dist/components/Select/SelectSheet.js +85 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Suggest/Suggest.js +101 -0
- package/dist/components/Suggest/index.js +1 -0
- package/dist/components/Switch/Switch.js +71 -0
- package/dist/components/Switch/index.js +1 -0
- package/dist/components/Switch/switchStyle.js +59 -0
- package/dist/components/Toast/ToastHost.js +76 -0
- package/dist/components/Toast/ToastItem.js +115 -0
- package/dist/components/Toast/ToastLayer.js +21 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/toast.types.js +1 -0
- package/dist/components/Toast/toastStyle.js +73 -0
- package/dist/components/Toggle/ToggleField.js +20 -0
- package/dist/components/Toggle/ToggleGroupFrame.js +10 -0
- package/dist/components/UIProvider/UIProvider.js +14 -0
- package/dist/components/UIProvider/context.js +57 -0
- package/dist/components/UIProvider/index.js +1 -0
- package/dist/components/styles/color.js +35 -0
- package/dist/components/styles/fieldControl.js +102 -0
- package/dist/components/styles/popupList.js +102 -0
- package/dist/components/styles/toggle.js +64 -0
- package/dist/components/styles/webValues.js +147 -0
- package/dist/index.js +15 -0
- package/dist/locales/hi.js +1 -0
- package/dist/locales/ta.js +1 -0
- package/dist/types/components/Button/Button.d.ts +31 -0
- package/dist/types/components/Button/buttonStyle.d.ts +46 -0
- package/dist/types/components/Button/index.d.ts +3 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +60 -0
- package/dist/types/components/Checkbox/checkboxStyle.d.ts +16 -0
- package/dist/types/components/Checkbox/index.d.ts +3 -0
- package/dist/types/components/DataTable/BulkRun.d.ts +11 -0
- package/dist/types/components/DataTable/CardList.d.ts +18 -0
- package/dist/types/components/DataTable/DataTable.d.ts +11 -0
- package/dist/types/components/DataTable/DataTableScrollView.d.ts +10 -0
- package/dist/types/components/DataTable/DragSelect.d.ts +12 -0
- package/dist/types/components/DataTable/LayoutSwitcher.d.ts +23 -0
- package/dist/types/components/DataTable/Pager.d.ts +5 -0
- package/dist/types/components/DataTable/RowActions.d.ts +13 -0
- package/dist/types/components/DataTable/RowDetail.d.ts +15 -0
- package/dist/types/components/DataTable/RowMenuSheet.d.ts +5 -0
- package/dist/types/components/DataTable/SortSheet.d.ts +8 -0
- package/dist/types/components/DataTable/SplitList.d.ts +9 -0
- package/dist/types/components/DataTable/StatusRow.d.ts +7 -0
- package/dist/types/components/DataTable/SwipeRow.d.ts +25 -0
- package/dist/types/components/DataTable/ToolButton.d.ts +13 -0
- package/dist/types/components/DataTable/Toolbar.d.ts +8 -0
- package/dist/types/components/DataTable/cells.d.ts +13 -0
- package/dist/types/components/DataTable/dataTableStyle.d.ts +139 -0
- package/dist/types/components/DataTable/filters/FilterConditionRow.d.ts +12 -0
- package/dist/types/components/DataTable/filters/FilterGroupEditor.d.ts +13 -0
- package/dist/types/components/DataTable/filters/FilterSheet.d.ts +5 -0
- package/dist/types/components/DataTable/filters/SavedFilterBar.d.ts +20 -0
- package/dist/types/components/DataTable/filters/filterStyle.d.ts +46 -0
- package/dist/types/components/DataTable/index.d.ts +5 -0
- package/dist/types/components/DataTable/persistence/adapters.d.ts +12 -0
- package/dist/types/components/DataTable/persistence/useViewPrefs.d.ts +20 -0
- package/dist/types/components/DataTable/rowParts.d.ts +32 -0
- package/dist/types/components/DataTable/useTableState.d.ts +103 -0
- package/dist/types/components/DatePicker/Calendar.d.ts +11 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +65 -0
- package/dist/types/components/DatePicker/PeriodGrid.d.ts +11 -0
- package/dist/types/components/DatePicker/PeriodPicker.d.ts +10 -0
- package/dist/types/components/DatePicker/TimeField.d.ts +15 -0
- package/dist/types/components/DatePicker/datePickerStyle.d.ts +75 -0
- package/dist/types/components/DatePicker/index.d.ts +4 -0
- package/dist/types/components/Dialog/Dialog.d.ts +35 -0
- package/dist/types/components/Dialog/DialogHost.d.ts +45 -0
- package/dist/types/components/Dialog/dialogStyle.d.ts +23 -0
- package/dist/types/components/Dialog/index.d.ts +4 -0
- package/dist/types/components/FieldContext/FieldContext.d.ts +43 -0
- package/dist/types/components/FieldContext/index.d.ts +3 -0
- package/dist/types/components/FieldWrapper/FieldWrapper.d.ts +23 -0
- package/dist/types/components/FieldWrapper/fieldWrapperStyle.d.ts +24 -0
- package/dist/types/components/FieldWrapper/index.d.ts +3 -0
- package/dist/types/components/Icon/Icon.d.ts +37 -0
- package/dist/types/components/Icon/IconContext.d.ts +12 -0
- package/dist/types/components/Icon/iconStyle.d.ts +10 -0
- package/dist/types/components/Icon/icons.d.ts +237 -0
- package/dist/types/components/Icon/index.d.ts +7 -0
- package/dist/types/components/Icon/useIconDone.d.ts +4 -0
- package/dist/types/components/Input/Input.d.ts +53 -0
- package/dist/types/components/Input/index.d.ts +3 -0
- package/dist/types/components/Input/inputStyle.d.ts +11 -0
- package/dist/types/components/Press/Ripple.d.ts +20 -0
- package/dist/types/components/Press/index.d.ts +2 -0
- package/dist/types/components/Press/measure.d.ts +8 -0
- package/dist/types/components/Radio/Radio.d.ts +58 -0
- package/dist/types/components/Radio/index.d.ts +3 -0
- package/dist/types/components/Radio/radioStyle.d.ts +17 -0
- package/dist/types/components/Select/Select.d.ts +49 -0
- package/dist/types/components/Select/SelectSheet.d.ts +34 -0
- package/dist/types/components/Select/index.d.ts +3 -0
- package/dist/types/components/Suggest/Suggest.d.ts +44 -0
- package/dist/types/components/Suggest/index.d.ts +3 -0
- package/dist/types/components/Switch/Switch.d.ts +42 -0
- package/dist/types/components/Switch/index.d.ts +3 -0
- package/dist/types/components/Switch/switchStyle.d.ts +29 -0
- package/dist/types/components/Toast/ToastHost.d.ts +12 -0
- package/dist/types/components/Toast/ToastItem.d.ts +17 -0
- package/dist/types/components/Toast/ToastLayer.d.ts +11 -0
- package/dist/types/components/Toast/index.d.ts +5 -0
- package/dist/types/components/Toast/toast.types.d.ts +37 -0
- package/dist/types/components/Toast/toastStyle.d.ts +22 -0
- package/dist/types/components/Toggle/ToggleField.d.ts +31 -0
- package/dist/types/components/Toggle/ToggleGroupFrame.d.ts +14 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +16 -0
- package/dist/types/components/UIProvider/context.d.ts +20 -0
- package/dist/types/components/UIProvider/index.d.ts +2 -0
- package/dist/types/components/styles/color.d.ts +2 -0
- package/dist/types/components/styles/fieldControl.d.ts +26 -0
- package/dist/types/components/styles/popupList.d.ts +48 -0
- package/dist/types/components/styles/toggle.d.ts +26 -0
- package/dist/types/components/styles/webValues.d.ts +157 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/locales/hi.d.ts +1 -0
- package/dist/types/locales/ta.d.ts +1 -0
- package/package.json +85 -4
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { withAlpha } from '../Button/buttonStyle';
|
|
2
|
+
import { DISABLED_OPACITY } from './webValues';
|
|
3
|
+
export function toggleSize(t, size) {
|
|
4
|
+
switch (size) {
|
|
5
|
+
case 'xxs': return { box: t.controlSizeXxs, font: t.fontSizeXxs };
|
|
6
|
+
case 'xs': return { box: t.controlSizeXs, font: t.fontSizeXs };
|
|
7
|
+
case 'small': return { box: t.controlSizeSm, font: t.fontSizeSm };
|
|
8
|
+
case 'medium': return { box: t.controlSizeMd, font: t.fontSizeMd };
|
|
9
|
+
case 'large': return { box: t.controlSizeLg, font: t.fontSizeLg };
|
|
10
|
+
case 'xl': return { box: t.controlSizeXl, font: t.fontSizeXl };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function toggleColor(t, color) {
|
|
14
|
+
switch (color) {
|
|
15
|
+
case 'primary': return { solid: t.accentPrimary, light: t.accentPrimaryLight, on: t.onPrimary };
|
|
16
|
+
case 'secondary': return { solid: t.accentSecondary, light: t.accentSecondaryLight, on: t.onSecondary };
|
|
17
|
+
case 'success': return { solid: t.success, light: t.successLight, on: t.onSuccess };
|
|
18
|
+
case 'error': return { solid: t.error, light: t.errorLight, on: t.onError };
|
|
19
|
+
case 'warning': return { solid: t.warning, light: t.warningLight, on: t.onWarning };
|
|
20
|
+
case 'info': return { solid: t.info, light: t.infoLight, on: t.onInfo };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function toggleRowStyle(s) {
|
|
24
|
+
const direction = { end: 'row', start: 'row-reverse', top: 'column-reverse', bottom: 'column' };
|
|
25
|
+
return {
|
|
26
|
+
flexDirection: direction[s.labelPosition],
|
|
27
|
+
alignItems: 'flex-start',
|
|
28
|
+
alignSelf: s.fullWidth ? 'stretch' : 'flex-start',
|
|
29
|
+
...(s.fullWidth && (s.labelPosition === 'end' || s.labelPosition === 'start') ? { justifyContent: 'space-between' } : {}),
|
|
30
|
+
...(s.disabled ? { opacity: DISABLED_OPACITY } : {}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function toggleLabelStyle(t, size, s, rowLine) {
|
|
34
|
+
const { font } = toggleSize(t, size);
|
|
35
|
+
let color = t.textPrimary;
|
|
36
|
+
if (s.disabled)
|
|
37
|
+
color = t.textTertiary;
|
|
38
|
+
if (s.error)
|
|
39
|
+
color = t.errorText;
|
|
40
|
+
const gap = {
|
|
41
|
+
end: { marginLeft: t.spacingMd },
|
|
42
|
+
start: { marginRight: t.spacingMd },
|
|
43
|
+
top: { marginBottom: t.spacingXs },
|
|
44
|
+
bottom: { marginTop: t.spacingXs },
|
|
45
|
+
}[s.labelPosition];
|
|
46
|
+
return {
|
|
47
|
+
box: { minHeight: rowLine, justifyContent: 'center', flexShrink: 1, ...gap },
|
|
48
|
+
text: { fontSize: font, lineHeight: Math.round(font * t.lineHeightNormal), color },
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export const toggleRequiredStyle = (t) => ({ color: t.errorText, fontWeight: String(t.fontWeightSemibold) });
|
|
52
|
+
export const toggleLine = (t, size) => Math.round(toggleSize(t, size).font * t.lineHeightNormal);
|
|
53
|
+
export function toggleHaloStyle(t, box, color, on, pressed, disabled) {
|
|
54
|
+
const size = box * t.controlHaloSize;
|
|
55
|
+
const show = pressed && !disabled;
|
|
56
|
+
return {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
width: size,
|
|
59
|
+
height: size,
|
|
60
|
+
borderRadius: size / 2,
|
|
61
|
+
overflow: 'hidden',
|
|
62
|
+
backgroundColor: show ? (on ? withAlpha(color, t.controlHaloTintHover) : t.controlHaloHover) : 'transparent',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export const DISABLED_OPACITY = 0.5;
|
|
2
|
+
export const TOGGLE_PRESSED_SCALE = 0.95;
|
|
3
|
+
export const SWITCH_TEXT_INSET = 6;
|
|
4
|
+
export const STATE_LABEL_OPACITY = 0.6;
|
|
5
|
+
export const STATE_LABEL_DISABLED_OPACITY = 0.4;
|
|
6
|
+
export const CAPS_LETTER_SPACING = 0.5;
|
|
7
|
+
export const POPUP_DISABLED_ROW_OPACITY = 0.6;
|
|
8
|
+
export const SUGGEST_SECONDARY_LINE_HEIGHT = 1.3;
|
|
9
|
+
export const POPUP_LIST_MAX_HEIGHT = 300;
|
|
10
|
+
export const DIALOG_WIDTHS = { sm: 420, md: 560, lg: 720, xl: 960 };
|
|
11
|
+
export const DIALOG_NARROW_BELOW = 600;
|
|
12
|
+
export const DIALOG_TITLE_LINE_HEIGHT = 1.3;
|
|
13
|
+
export const DIALOG_POP_SCALE = 0.97;
|
|
14
|
+
export const DIALOG_ANIMATION_MS = 200;
|
|
15
|
+
export const DT_LINE_SOFT_MIX = 65;
|
|
16
|
+
export const DT_ROW_HOVER_MIX = 4;
|
|
17
|
+
export const DT_ACCENT_SOFT_MIX = 10;
|
|
18
|
+
export const DT_AVATAR_LIGHTNESS = 0.52;
|
|
19
|
+
export const DT_AVATAR_CHROMA = 0.09;
|
|
20
|
+
export const DT_AVATAR_TEXT_SCALE = 0.34;
|
|
21
|
+
export const DT_AVATAR_LETTER_SPACING_EM = 0.02;
|
|
22
|
+
export const DT_AVATAR_CARD = 44;
|
|
23
|
+
export const DT_AVATAR_CARD_PHONE = 40;
|
|
24
|
+
export const DT_AVATAR_SPLIT = 32;
|
|
25
|
+
export const DT_CARD_PAD = 14;
|
|
26
|
+
export const DT_CARD_HEAD_PAD_BOTTOM = 10;
|
|
27
|
+
export const DT_CARD_TITLE_LINE_HEIGHT = 1.3;
|
|
28
|
+
export const DT_FIELD_NAME_LETTER_SPACING_EM = 0.04;
|
|
29
|
+
export const DT_CARD_FOOT_MIN_HEIGHT = 40;
|
|
30
|
+
export const DT_CARD_EXPAND = 36;
|
|
31
|
+
export const DT_CARD_EXPAND_PHONE = 44;
|
|
32
|
+
export const DT_CARDS_GAP_PHONE = 10;
|
|
33
|
+
export const DT_CARD_MIN_WIDTH = 300;
|
|
34
|
+
export const DT_SPLIT_ITEM_PAD_Y = 10;
|
|
35
|
+
export const DT_SPLIT_ITEM_PHONE_MIN_HEIGHT = 60;
|
|
36
|
+
export const DT_SPLIT_SIDE = 360;
|
|
37
|
+
export const DT_SPLIT_SIDE_NARROW = 300;
|
|
38
|
+
export const DT_SPLIT_SIDE_MAX = '40%';
|
|
39
|
+
export const DT_SPLIT_OPEN_BAR = 3;
|
|
40
|
+
export const DT_LOADING_OPACITY = 0.55;
|
|
41
|
+
export const DT_EMPTY_PAD_Y = 40;
|
|
42
|
+
export const DT_PAGER_MIN_HEIGHT = 44;
|
|
43
|
+
export const DT_PAGER_BUTTON = 40;
|
|
44
|
+
export const DT_DETAIL_BAR_MIN_HEIGHT = 48;
|
|
45
|
+
export const DT_DETAIL_NAV_BUTTON = 36;
|
|
46
|
+
export const DT_DETAIL_NAV_RADIUS = 9;
|
|
47
|
+
export const DT_DETAIL_NAV_DISABLED_OPACITY = 0.35;
|
|
48
|
+
export const DT_DETAIL_LABEL_MIN_WIDTH = 120;
|
|
49
|
+
export const DT_DETAIL_EMPTY_MIN_HEIGHT = 240;
|
|
50
|
+
export const DT_VIEW_TAB_HEIGHT = 48;
|
|
51
|
+
export const DT_VIEW_TAB_HEIGHT_PHONE = 32;
|
|
52
|
+
export const DT_VIEW_TAB_BAR = 3;
|
|
53
|
+
export const DT_TOOLBAR_MIN_HEIGHT = 52;
|
|
54
|
+
export const DT_TOOLBAR_MIN_HEIGHT_PHONE = 48;
|
|
55
|
+
export const DT_TOOLBAR_PAD_Y = 10;
|
|
56
|
+
export const DT_TOOLBAR_BUTTON = 32;
|
|
57
|
+
export const DT_TOOLBAR_BUTTON_PHONE = 36;
|
|
58
|
+
export const DT_SEARCH_BASIS = 220;
|
|
59
|
+
export const DT_SEARCH_MIN = 140;
|
|
60
|
+
export const DT_SEARCH_MAX = 280;
|
|
61
|
+
export const DT_ACTIVE_EDGE_MIX = 30;
|
|
62
|
+
export const MENU_RAIL_ITEM_MIN_WIDTH = 64;
|
|
63
|
+
export const MENU_RAIL_DISABLED_OPACITY = 0.4;
|
|
64
|
+
export const DT_SPLIT_ACTIONS_TUCK = 6;
|
|
65
|
+
export const TOAST_WIDTH = 340;
|
|
66
|
+
export const TOAST_NARROW_BELOW = 600;
|
|
67
|
+
export const TOAST_RAIL_WIDTH = 3;
|
|
68
|
+
export const TOAST_LINE_HEIGHT = 1.45;
|
|
69
|
+
export const TOAST_PROGRESS_HEIGHT = 2;
|
|
70
|
+
export const TOAST_PROGRESS_OPACITY = 0.55;
|
|
71
|
+
export const TOAST_ENTER_OFFSET = 8;
|
|
72
|
+
export const TOAST_MOTION_SCALE = 0.98;
|
|
73
|
+
export const CSS_EASE = { x1: 0.25, y1: 0.1, x2: 0.25, y2: 1 };
|
|
74
|
+
export const TOAST_EXIT_MS = 200;
|
|
75
|
+
export const TOAST_SWIPE_DISMISS = 110;
|
|
76
|
+
export const TOAST_SWIPE_FADE = 220;
|
|
77
|
+
export const TOAST_ICON_NUDGE = 1;
|
|
78
|
+
export const DT_CARD_CHECK_BOX = 32;
|
|
79
|
+
export const DT_CARD_CHECK_TOP = 12;
|
|
80
|
+
export const DT_CARD_CHECK_LEFT = 8;
|
|
81
|
+
export const DT_CARD_CHECK_HEAD_PAD = 48;
|
|
82
|
+
export const DT_SPLIT_CHECK_WIDTH = 20;
|
|
83
|
+
export const DT_SPLIT_CHECK_HEIGHT = 32;
|
|
84
|
+
export const DT_STATUS_ROW_HEIGHT = 40;
|
|
85
|
+
export const DT_STATUS_ROW_HEIGHT_PHONE = 36;
|
|
86
|
+
export const DT_STATUS_SELECTING_MIX = 5;
|
|
87
|
+
export const DT_STATUS_IDLE_MIX = 35;
|
|
88
|
+
export const DT_STATUS_CHIP_HEIGHT = 26;
|
|
89
|
+
export const DT_STATUS_CHIP_PAD_START = 10;
|
|
90
|
+
export const DT_STATUS_CHIP_PAD_END = 3;
|
|
91
|
+
export const DT_STATUS_CHIP_REMOVE = 20;
|
|
92
|
+
export const DT_STATUS_LINK_PAD = 10;
|
|
93
|
+
export const DT_STATUS_LINK_RADIUS = 7;
|
|
94
|
+
export const DT_BULK_BUTTON_HEIGHT = 28;
|
|
95
|
+
export const DT_BULK_EDGE_MIX = 35;
|
|
96
|
+
export const DT_BULK_TEXT_MIX = 85;
|
|
97
|
+
export const DT_STATUS_DIVIDER_HEIGHT = 22;
|
|
98
|
+
export const DT_STATUS_DIVIDER_SOFT_HEIGHT = 18;
|
|
99
|
+
export const DT_STATUS_DIVIDER_MIX = 25;
|
|
100
|
+
export const DT_STATUS_SPACER_MIN = 8;
|
|
101
|
+
export const DT_RESULT_TOAST_MS = 4000;
|
|
102
|
+
export const DT_UNDO_TOAST_MS = 6000;
|
|
103
|
+
export const DT_BULK_DISABLED_OPACITY = 0.45;
|
|
104
|
+
export const DT_BULK_BUSY_OPACITY = 0.8;
|
|
105
|
+
export const DT_POP_MIN_WIDTH = 200;
|
|
106
|
+
export const DT_POP_OFFSET = 6;
|
|
107
|
+
export const DT_POP_EDGE = 8;
|
|
108
|
+
export const DT_LAYOUT_ITEM_MIN_HEIGHT = 36;
|
|
109
|
+
export const DT_LAYOUT_ITEM_PAD = 10;
|
|
110
|
+
export const DT_CHIP_OPERATOR_OPACITY = 0.75;
|
|
111
|
+
export const DT_CHIP_VALUE_MAX = 220;
|
|
112
|
+
export const DT_QUICK_BASIS = 160;
|
|
113
|
+
export const DT_QUICK_MIN = 120;
|
|
114
|
+
export const DT_QUICK_MAX = 180;
|
|
115
|
+
export const DT_MENU_BACK_HEIGHT = 36;
|
|
116
|
+
export const DT_MENU_FILTER_ENTRY_HEIGHT = 44;
|
|
117
|
+
export const DT_MENU_CHIP_HEIGHT = 30;
|
|
118
|
+
export const DP_ROW_EM = 2.25;
|
|
119
|
+
export const DP_CELL_EM = 2.7;
|
|
120
|
+
export const DP_WEEKDAY_HEIGHT_EM = 2;
|
|
121
|
+
export const DP_WEEKDAY_FONT_EM = 0.75;
|
|
122
|
+
export const DP_WEEKDAY_LETTER_SPACING_EM = 0.04;
|
|
123
|
+
export const DP_DAY_FONT_EM = 0.95;
|
|
124
|
+
export const DP_TODAY_DOT = 4;
|
|
125
|
+
export const DP_TODAY_DOT_BOTTOM_EM = 0.1;
|
|
126
|
+
export const DP_SMALL_TEXT_EM = 0.92;
|
|
127
|
+
export const DP_NAV_ICON_RATIO = 1.7;
|
|
128
|
+
export const DP_ENTRY_LABEL_EM = 0.75;
|
|
129
|
+
export const DP_ENTRY_LABEL_LETTER_SPACING_EM = 0.06;
|
|
130
|
+
export const DP_TIME_COLS_HEIGHT_EM = 7;
|
|
131
|
+
export const DP_TIME_OPT_RADIUS = 3;
|
|
132
|
+
export const DP_PERIOD_ROW_EM = 2.75;
|
|
133
|
+
export const DP_PERIOD_DOT_BOTTOM_EM = 0.2;
|
|
134
|
+
export const DT_FM_ICON_TILE = 36;
|
|
135
|
+
export const DT_FM_ICON_TILE_RADIUS = 10;
|
|
136
|
+
export const DT_FM_BADGE = 18;
|
|
137
|
+
export const DT_FM_BADGE_PAD = 5;
|
|
138
|
+
export const DT_FM_GROUP_EDGE = 4;
|
|
139
|
+
export const DT_FM_GROUP_GAP = 10;
|
|
140
|
+
export const DT_FM_TAB_PAD_X = 14;
|
|
141
|
+
export const DT_FM_TAB_RADIUS = 6;
|
|
142
|
+
export const DT_FM_CONDITION_RADIUS = 10;
|
|
143
|
+
export const DT_FM_CONDITION_PAD_Y = 10;
|
|
144
|
+
export const DT_FM_CONDITION_OFF_OPACITY = 0.45;
|
|
145
|
+
export const DT_FM_JSON_RADIUS = 10;
|
|
146
|
+
export const DT_FM_JSON_MAX = 240;
|
|
147
|
+
export const DT_FM_HEAD_TRACKING = 0.5;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './components/UIProvider';
|
|
2
|
+
export * from './components/Icon';
|
|
3
|
+
export * from './components/Button';
|
|
4
|
+
export * from './components/FieldContext';
|
|
5
|
+
export * from './components/FieldWrapper';
|
|
6
|
+
export * from './components/Input';
|
|
7
|
+
export * from './components/Checkbox';
|
|
8
|
+
export * from './components/Radio';
|
|
9
|
+
export * from './components/Switch';
|
|
10
|
+
export * from './components/Select';
|
|
11
|
+
export * from './components/DatePicker';
|
|
12
|
+
export * from './components/Suggest';
|
|
13
|
+
export * from './components/Dialog';
|
|
14
|
+
export * from './components/Toast';
|
|
15
|
+
export * from './components/DataTable';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@dcs-tech/core/locales/hi';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@dcs-tech/core/locales/ta';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type GestureResponderEvent, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ButtonColor, ButtonShape, ButtonSize, ButtonVariant, LoadingPosition } from '@dcs-tech/core';
|
|
4
|
+
import type { ViewRef } from '../Icon/Icon';
|
|
5
|
+
export interface ButtonProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
startIcon?: React.ReactNode;
|
|
9
|
+
endIcon?: React.ReactNode;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
12
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
loadingPosition?: LoadingPosition;
|
|
16
|
+
loadingIndicator?: React.ReactNode;
|
|
17
|
+
variant?: ButtonVariant;
|
|
18
|
+
size?: ButtonSize;
|
|
19
|
+
color?: ButtonColor;
|
|
20
|
+
shape?: ButtonShape;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
disableTextTransform?: boolean;
|
|
23
|
+
disableElevation?: boolean;
|
|
24
|
+
feedback?: 'ripple' | 'press' | 'none';
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
testID?: string;
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
'aria-expanded'?: boolean;
|
|
29
|
+
accessibilityHint?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<ViewRef>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Shadow, Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ButtonColor, ButtonShape, ButtonSize, ButtonVariant } from '@dcs-tech/core';
|
|
4
|
+
interface ColorSet {
|
|
5
|
+
text: string;
|
|
6
|
+
solid: string;
|
|
7
|
+
strong: string;
|
|
8
|
+
light: string;
|
|
9
|
+
on?: string;
|
|
10
|
+
outline?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function buttonColors(t: Tokens, color: ButtonColor): ColorSet;
|
|
13
|
+
interface SizeSet {
|
|
14
|
+
padY: number;
|
|
15
|
+
padX: number;
|
|
16
|
+
fontSize: number;
|
|
17
|
+
height: number;
|
|
18
|
+
gap: number;
|
|
19
|
+
iconPad: number;
|
|
20
|
+
iconStep: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function buttonSize(t: Tokens, size: ButtonSize): SizeSet;
|
|
23
|
+
export declare const boxShadow: (shadow: readonly Shadow[]) => ViewStyle["boxShadow"];
|
|
24
|
+
export declare function withAlpha(color: string, alpha: number): string;
|
|
25
|
+
export interface ButtonLookOptions {
|
|
26
|
+
variant: ButtonVariant;
|
|
27
|
+
size: ButtonSize;
|
|
28
|
+
color: ButtonColor;
|
|
29
|
+
shape: ButtonShape;
|
|
30
|
+
iconOnly: boolean;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
fullWidth: boolean;
|
|
33
|
+
disableTextTransform: boolean;
|
|
34
|
+
disableElevation: boolean;
|
|
35
|
+
pressed: boolean;
|
|
36
|
+
pressDown: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface ButtonLook {
|
|
39
|
+
container: ViewStyle;
|
|
40
|
+
text: TextStyle;
|
|
41
|
+
fg: string;
|
|
42
|
+
iconSize: number;
|
|
43
|
+
gap: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function buttonLook(t: Tokens, o: ButtonLookOptions): ButtonLook;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ControlLabelPosition, ControlSize, FieldChangeEvent, FieldColor, ToggleVariant } from '@dcs-tech/core';
|
|
4
|
+
type Value = string | number;
|
|
5
|
+
export interface CheckboxProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
value?: Value;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
defaultChecked?: boolean;
|
|
11
|
+
indeterminate?: boolean;
|
|
12
|
+
onChange?: (event: FieldChangeEvent<Value | undefined>) => void;
|
|
13
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
hint?: React.ReactNode;
|
|
16
|
+
error?: React.ReactNode;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
labelPosition?: ControlLabelPosition;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
size?: ControlSize;
|
|
22
|
+
variant?: ToggleVariant;
|
|
23
|
+
color?: FieldColor;
|
|
24
|
+
fullWidth?: boolean;
|
|
25
|
+
checkedIcon?: React.ReactNode;
|
|
26
|
+
uncheckedIcon?: React.ReactNode;
|
|
27
|
+
indeterminateIcon?: React.ReactNode;
|
|
28
|
+
ripple?: boolean;
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
testID?: string;
|
|
31
|
+
'aria-label'?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CheckboxGroupProps {
|
|
34
|
+
name?: string;
|
|
35
|
+
value?: Value[];
|
|
36
|
+
defaultValue?: Value[];
|
|
37
|
+
onChange?: (values: Value[]) => void;
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
helperText?: React.ReactNode;
|
|
40
|
+
error?: React.ReactNode;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
readOnly?: boolean;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
orientation?: 'horizontal' | 'vertical';
|
|
45
|
+
size?: ControlSize;
|
|
46
|
+
variant?: ToggleVariant;
|
|
47
|
+
color?: FieldColor;
|
|
48
|
+
style?: StyleProp<ViewStyle>;
|
|
49
|
+
'aria-label'?: string;
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
export declare function CheckboxGroup({ name, value, defaultValue, onChange, label, helperText, error, disabled, readOnly, required, orientation, size, variant, color, style, 'aria-label': ariaLabel, children }: CheckboxGroupProps): React.JSX.Element;
|
|
53
|
+
export declare namespace CheckboxGroup {
|
|
54
|
+
var displayName: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function Checkbox({ name, value, checked, defaultChecked, indeterminate, onChange, onCheckedChange, label, hint, error, required, labelPosition, disabled, readOnly, size, variant, color, fullWidth, checkedIcon, uncheckedIcon, indeterminateIcon, ripple, style, testID, 'aria-label': ariaLabel, }: CheckboxProps): React.JSX.Element;
|
|
57
|
+
export declare namespace Checkbox {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ControlSize, FieldColor, ToggleVariant } from '@dcs-tech/core';
|
|
4
|
+
export interface CheckboxBoxState {
|
|
5
|
+
size: ControlSize;
|
|
6
|
+
variant: ToggleVariant;
|
|
7
|
+
color: FieldColor;
|
|
8
|
+
on: boolean;
|
|
9
|
+
error: boolean;
|
|
10
|
+
pressed: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function checkboxBoxLook(t: Tokens, s: CheckboxBoxState): {
|
|
13
|
+
box: ViewStyle;
|
|
14
|
+
iconColor: string;
|
|
15
|
+
size: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DataTableBulkAction } from '@dcs-tech/core';
|
|
3
|
+
import type { TableState } from './useTableState';
|
|
4
|
+
export interface BulkRunner<T> {
|
|
5
|
+
busyId: string | null;
|
|
6
|
+
run: (action: DataTableBulkAction<T>) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useBulkRun<T>(state: TableState<T>): {
|
|
9
|
+
runner: BulkRunner<T>;
|
|
10
|
+
dialog: React.ReactNode;
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type GestureResponderEvent } from 'react-native';
|
|
3
|
+
import type { TableState } from './useTableState';
|
|
4
|
+
import { type DragTick } from './DragSelect';
|
|
5
|
+
interface CardListProps<T> {
|
|
6
|
+
state: TableState<T>;
|
|
7
|
+
}
|
|
8
|
+
export declare function CardList<T>({ state }: CardListProps<T>): React.JSX.Element;
|
|
9
|
+
export declare function pairsOf<F>(list: readonly F[]): Array<[F, F | null]>;
|
|
10
|
+
export declare function pressOf<T>(state: TableState<T>, id: string): (() => void) | undefined;
|
|
11
|
+
export declare function longPressOf<T>(state: TableState<T>, id: string, drag?: DragTick): ((e: GestureResponderEvent) => void) | undefined;
|
|
12
|
+
export declare function RowCheck<T>({ state, id, row, title }: {
|
|
13
|
+
state: TableState<T>;
|
|
14
|
+
id: string;
|
|
15
|
+
row: T;
|
|
16
|
+
title: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { DataTableProps as CoreDataTableProps } from '@dcs-tech/core';
|
|
4
|
+
export interface DataTableProps<TData = any> extends CoreDataTableProps<TData> {
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
testID?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function DataTable<TData = any>(props: DataTableProps<TData>): React.JSX.Element;
|
|
9
|
+
export declare namespace DataTable {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ScrollViewProps } from 'react-native';
|
|
3
|
+
export interface TableScroll {
|
|
4
|
+
hold: (on: boolean) => void;
|
|
5
|
+
offset: () => number;
|
|
6
|
+
scrollTo: (y: number) => void;
|
|
7
|
+
view: () => unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTableScroll: () => TableScroll | null;
|
|
10
|
+
export declare const DataTableScrollView: React.ForwardRefExoticComponent<ScrollViewProps & React.RefAttributes<import("react-native").ScrollViewInstance>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type GestureResponderEvent, type GestureResponderHandlers, type LayoutChangeEvent } from 'react-native';
|
|
3
|
+
import type { ViewRef } from '../Icon/Icon';
|
|
4
|
+
import type { TableState } from './useTableState';
|
|
5
|
+
export interface DragTick {
|
|
6
|
+
start: (id: string, event?: GestureResponderEvent) => void;
|
|
7
|
+
release: () => void;
|
|
8
|
+
onRowLayout: (id: string) => (e: LayoutChangeEvent) => void;
|
|
9
|
+
listRef: React.RefObject<ViewRef | null>;
|
|
10
|
+
handlers: GestureResponderHandlers;
|
|
11
|
+
}
|
|
12
|
+
export declare function useDragTick<T>(state: TableState<T>): DragTick;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
4
|
+
import type { DataTableLabels, DataTableLayout } from '@dcs-tech/core';
|
|
5
|
+
import { type IconComponent } from '../Icon';
|
|
6
|
+
export declare const LAYOUT_ICONS: Record<DataTableLayout, IconComponent>;
|
|
7
|
+
export declare function popMenuLook(t: Tokens): {
|
|
8
|
+
box: ViewStyle;
|
|
9
|
+
item: ViewStyle;
|
|
10
|
+
itemPressed: ViewStyle;
|
|
11
|
+
label: TextStyle;
|
|
12
|
+
labelOn: TextStyle;
|
|
13
|
+
};
|
|
14
|
+
interface LayoutSwitcherProps {
|
|
15
|
+
layouts: DataTableLayout[];
|
|
16
|
+
layout: DataTableLayout;
|
|
17
|
+
onChange: (layout: DataTableLayout) => void;
|
|
18
|
+
L: DataTableLabels;
|
|
19
|
+
size: number;
|
|
20
|
+
compact: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function LayoutSwitcher({ layouts, layout, onChange, L, size, compact }: LayoutSwitcherProps): React.JSX.Element | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DataTableRowAction } from '@dcs-tech/core';
|
|
3
|
+
import type { PageRow, TableState } from './useTableState';
|
|
4
|
+
interface RowActionsProps<T> {
|
|
5
|
+
state: TableState<T>;
|
|
6
|
+
item: PageRow<T>;
|
|
7
|
+
surface: 'card' | 'list';
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function rowButtonsOf<T>(state: TableState<T>, item: PageRow<T>, surface: 'card' | 'list'): DataTableRowAction<T>[];
|
|
11
|
+
export declare const hasRowActions: <T>(state: TableState<T>, item: PageRow<T>, surface: "card" | "list") => boolean;
|
|
12
|
+
export declare function RowActions<T>({ state, item, surface, title }: RowActionsProps<T>): React.JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type DataTableDetailContext } from '@dcs-tech/core';
|
|
3
|
+
import type { TableState } from './useTableState';
|
|
4
|
+
export declare function BuiltInDetail<T>({ row, state, close }: {
|
|
5
|
+
row: T;
|
|
6
|
+
state: TableState<T>;
|
|
7
|
+
close: () => void;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export interface RowDetailProps<T> {
|
|
10
|
+
state: TableState<T>;
|
|
11
|
+
renderDetail?: (row: T | null, ctx: DataTableDetailContext) => ReactNode;
|
|
12
|
+
bar: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function DetailPane<T>({ state, renderDetail, bar }: RowDetailProps<T>): React.JSX.Element;
|
|
15
|
+
export declare function DetailSheet<T>({ state, renderDetail, bar }: RowDetailProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TableState } from './useTableState';
|
|
3
|
+
export declare function sortableColumns<T>(state: TableState<T>): import("@dcs-tech/core").DataTableColumn<T>[];
|
|
4
|
+
export declare function SortSheet<T>({ state, open, onClose }: {
|
|
5
|
+
state: TableState<T>;
|
|
6
|
+
open: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TableState } from './useTableState';
|
|
3
|
+
interface SplitListProps<T> {
|
|
4
|
+
state: TableState<T>;
|
|
5
|
+
pane: React.ReactNode | null;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function SplitList<T>({ state, pane, height }: SplitListProps<T>): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type LayoutChangeEvent, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
4
|
+
import { type DataTableActionVariant, type DataTableSwipeEntry } from '@dcs-tech/core';
|
|
5
|
+
import type { PageRow, TableState } from './useTableState';
|
|
6
|
+
export type SwipeSide = 'right' | 'left';
|
|
7
|
+
export declare function swipeActionLook(t: Tokens, tone: DataTableActionVariant | undefined): {
|
|
8
|
+
box: ViewStyle;
|
|
9
|
+
text: TextStyle;
|
|
10
|
+
ink: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function swipeOf<T>(state: TableState<T>, item: PageRow<T>): Omit<SwipeRowProps, 'children'> | null;
|
|
13
|
+
export interface SwipeRowProps {
|
|
14
|
+
right: DataTableSwipeEntry[];
|
|
15
|
+
left: DataTableSwipeEntry[];
|
|
16
|
+
fullSwipe: boolean;
|
|
17
|
+
open: SwipeSide | null;
|
|
18
|
+
onOpen: (side: SwipeSide | null) => void;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
radius?: number;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
onLayout?: (e: LayoutChangeEvent) => void;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function SwipeRow({ right, left, fullSwipe, open, onOpen, enabled, radius, style, onLayout, children }: SwipeRowProps): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IconComponent } from '../Icon/Icon';
|
|
3
|
+
interface ToolButtonProps {
|
|
4
|
+
icon: IconComponent;
|
|
5
|
+
label: string;
|
|
6
|
+
onPress: () => void;
|
|
7
|
+
size: number;
|
|
8
|
+
active?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
badge?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function ToolButton({ icon: Icon, label, onPress, size, active, disabled, badge }: ToolButtonProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TableState } from './useTableState';
|
|
3
|
+
export declare function ViewTabs<T>({ state }: {
|
|
4
|
+
state: TableState<T>;
|
|
5
|
+
}): React.JSX.Element | null;
|
|
6
|
+
export declare function Toolbar<T>({ state }: {
|
|
7
|
+
state: TableState<T>;
|
|
8
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type TextStyle } from 'react-native';
|
|
3
|
+
import { type AvatarPlace } from './dataTableStyle';
|
|
4
|
+
import type { RowAvatar } from './rowParts';
|
|
5
|
+
export declare function CellNode({ node, style, lines }: {
|
|
6
|
+
node: ReactNode;
|
|
7
|
+
style: StyleProp<TextStyle>;
|
|
8
|
+
lines?: number;
|
|
9
|
+
}): React.JSX.Element | null;
|
|
10
|
+
export declare function RowAvatarView({ avatar, place }: {
|
|
11
|
+
avatar: RowAvatar;
|
|
12
|
+
place: AvatarPlace;
|
|
13
|
+
}): React.JSX.Element | null;
|