@dcs-tech/ui-native 0.0.0-stage → 0.16.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 +186 -0
- package/README.md +179 -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 +49 -0
- package/dist/components/DataTable/filters/FilterGroupEditor.js +21 -0
- package/dist/components/DataTable/filters/FilterSheet.js +69 -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 +345 -0
- package/dist/components/DatePicker/Calendar.js +28 -0
- package/dist/components/DatePicker/DatePicker.js +300 -0
- package/dist/components/DatePicker/PeriodGrid.js +17 -0
- package/dist/components/DatePicker/PeriodPicker.js +216 -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 +252 -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 +58 -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 +250 -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 +17 -0
- package/dist/types/components/UIProvider/context.d.ts +22 -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,58 @@
|
|
|
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 RadioGroupProps {
|
|
6
|
+
name: string;
|
|
7
|
+
value?: Value;
|
|
8
|
+
defaultValue?: Value;
|
|
9
|
+
onChange?: (value: Value) => void;
|
|
10
|
+
onChangeEvent?: (event: FieldChangeEvent<Value>) => void;
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
helperText?: React.ReactNode;
|
|
13
|
+
error?: React.ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
orientation?: 'horizontal' | 'vertical';
|
|
18
|
+
size?: ControlSize;
|
|
19
|
+
variant?: ToggleVariant;
|
|
20
|
+
color?: FieldColor;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
'aria-label'?: string;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function RadioGroup({ name, value, defaultValue, onChange, onChangeEvent, label, helperText, error, disabled, readOnly, required, orientation, size, variant, color, style, 'aria-label': ariaLabel, children }: RadioGroupProps): React.JSX.Element;
|
|
26
|
+
export declare namespace RadioGroup {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
export interface RadioProps {
|
|
30
|
+
id?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
value: Value;
|
|
33
|
+
checked?: boolean;
|
|
34
|
+
defaultChecked?: boolean;
|
|
35
|
+
onChange?: (event: FieldChangeEvent<Value>) => void;
|
|
36
|
+
label?: React.ReactNode;
|
|
37
|
+
hint?: React.ReactNode;
|
|
38
|
+
error?: React.ReactNode;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
labelPosition?: ControlLabelPosition;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
readOnly?: boolean;
|
|
43
|
+
size?: ControlSize;
|
|
44
|
+
variant?: ToggleVariant;
|
|
45
|
+
color?: FieldColor;
|
|
46
|
+
fullWidth?: boolean;
|
|
47
|
+
checkedIcon?: React.ReactNode;
|
|
48
|
+
uncheckedIcon?: React.ReactNode;
|
|
49
|
+
ripple?: boolean;
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
testID?: string;
|
|
52
|
+
'aria-label'?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare function Radio({ name, value, checked, defaultChecked, onChange, label, hint, error, required, labelPosition, disabled, readOnly, size, variant, color, fullWidth, checkedIcon, uncheckedIcon, ripple, style, testID, 'aria-label': ariaLabel, }: RadioProps): React.JSX.Element;
|
|
55
|
+
export declare namespace Radio {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
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 RadioCircleState {
|
|
5
|
+
size: ControlSize;
|
|
6
|
+
variant: ToggleVariant;
|
|
7
|
+
color: FieldColor;
|
|
8
|
+
checked: boolean;
|
|
9
|
+
error: boolean;
|
|
10
|
+
pressed: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function radioCircleLook(t: Tokens, s: RadioCircleState): {
|
|
13
|
+
circle: ViewStyle;
|
|
14
|
+
dot: ViewStyle;
|
|
15
|
+
markColor: string;
|
|
16
|
+
size: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ControlLayout, ControlSize, ControlVariant, EmptyStateConfig, FieldWidth, GroupConfig, LoadingConfig, MultiSelectConfig, OpenReason, SearchConfig, SelectEvent, SelectOption, SortConfig } from '@dcs-tech/core';
|
|
4
|
+
export interface SelectProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
options: (string | number | SelectOption)[];
|
|
8
|
+
value?: unknown;
|
|
9
|
+
defaultValue?: unknown;
|
|
10
|
+
onChange?: (event: SelectEvent) => void;
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
hint?: React.ReactNode;
|
|
13
|
+
error?: React.ReactNode;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
defaultText?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
size?: ControlSize;
|
|
20
|
+
variant?: ControlVariant;
|
|
21
|
+
layout?: ControlLayout;
|
|
22
|
+
width?: FieldWidth;
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
clearable?: boolean;
|
|
25
|
+
multiSelect?: boolean | MultiSelectConfig;
|
|
26
|
+
search?: boolean | SearchConfig;
|
|
27
|
+
autoFocusSearch?: boolean;
|
|
28
|
+
sort?: boolean | SortConfig;
|
|
29
|
+
group?: boolean | GroupConfig;
|
|
30
|
+
emptyState?: EmptyStateConfig;
|
|
31
|
+
loading?: LoadingConfig;
|
|
32
|
+
renderOption?: (option: SelectOption, isSelected: boolean, isHighlighted: boolean) => React.ReactNode;
|
|
33
|
+
renderSelectedValue?: (value: unknown, options: SelectOption[]) => React.ReactNode;
|
|
34
|
+
open?: boolean;
|
|
35
|
+
defaultOpen?: boolean;
|
|
36
|
+
onOpenChange?: (open: boolean, reason: OpenReason) => void;
|
|
37
|
+
onOpen?: () => void;
|
|
38
|
+
onClose?: () => void;
|
|
39
|
+
onSearch?: (term: string) => void;
|
|
40
|
+
onSelect?: (value: unknown) => void;
|
|
41
|
+
onDeselect?: (value: unknown) => void;
|
|
42
|
+
onClear?: () => void;
|
|
43
|
+
testID?: string;
|
|
44
|
+
'aria-label'?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function Select({ name, options, value, defaultValue, onChange, label, hint, error, required, defaultText, placeholder, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, clearable, multiSelect, search, autoFocusSearch, sort, group, emptyState, loading, renderOption, renderSelectedValue, open: openProp, defaultOpen, onOpenChange, onOpen, onClose, onSearch, onSelect, onDeselect, onClear, testID, 'aria-label': ariaLabel, }: SelectProps): React.JSX.Element;
|
|
47
|
+
export declare namespace Select {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ControlSize, GroupConfig, SearchConfig, SelectOption } from '@dcs-tech/core';
|
|
3
|
+
export type SheetCloseReason = 'select' | 'blur' | 'click' | 'escape';
|
|
4
|
+
export interface SelectSheetProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
size: ControlSize;
|
|
8
|
+
options: SelectOption[];
|
|
9
|
+
multi: boolean;
|
|
10
|
+
isSelected: (option: SelectOption) => boolean;
|
|
11
|
+
isBlocked: (option: SelectOption) => boolean;
|
|
12
|
+
onPick: (option: SelectOption) => void;
|
|
13
|
+
onClose: (reason: SheetCloseReason) => void;
|
|
14
|
+
search: SearchConfig;
|
|
15
|
+
autoFocusSearch: boolean;
|
|
16
|
+
onSearch?: (term: string) => void;
|
|
17
|
+
group?: GroupConfig;
|
|
18
|
+
selectAll?: {
|
|
19
|
+
all: boolean;
|
|
20
|
+
onPress: (shown: SelectOption[]) => void;
|
|
21
|
+
};
|
|
22
|
+
loading?: {
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
loadingText?: string;
|
|
25
|
+
renderLoadingState?: () => React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
emptyState?: {
|
|
28
|
+
noOptionsText?: string;
|
|
29
|
+
noResultsText?: string;
|
|
30
|
+
renderEmptyState?: (term: string) => React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
renderOption?: (option: SelectOption, isSelected: boolean, isHighlighted: boolean) => React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export declare function SelectSheet(p: SelectSheetProps): React.JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Select } from './Select';
|
|
2
|
+
export type { SelectProps } from './Select';
|
|
3
|
+
export type { SelectOption, SelectEvent, SelectSize, SelectVariant, SelectLayout, MultiSelectConfig, SearchConfig, SortConfig, GroupConfig, EmptyStateConfig, LoadingConfig } from '@dcs-tech/core';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type TextInputProps, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ControlLayout, ControlSize, ControlVariant, FieldChangeEvent, FieldWidth, SuggestionConfig } from '@dcs-tech/core';
|
|
4
|
+
export interface SuggestProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
data: unknown[];
|
|
8
|
+
config: SuggestionConfig;
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?: (event: FieldChangeEvent<string>) => void;
|
|
12
|
+
onChangeText?: (text: string) => void;
|
|
13
|
+
onSelect?: (item: any, name?: string) => void;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
hint?: React.ReactNode;
|
|
17
|
+
error?: React.ReactNode;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
size?: ControlSize;
|
|
22
|
+
variant?: ControlVariant;
|
|
23
|
+
layout?: ControlLayout;
|
|
24
|
+
width?: FieldWidth;
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
minSearchLength?: number;
|
|
27
|
+
debounceMs?: number;
|
|
28
|
+
showAllOnFocus?: boolean;
|
|
29
|
+
openOnFocus?: boolean;
|
|
30
|
+
clearOnSelect?: boolean;
|
|
31
|
+
closeOnSelect?: boolean;
|
|
32
|
+
renderItem?: (item: any, isHighlighted: boolean, searchValue: string) => React.ReactNode;
|
|
33
|
+
renderGroup?: (groupName: string, items: any[]) => React.ReactNode;
|
|
34
|
+
inputMode?: TextInputProps['inputMode'];
|
|
35
|
+
returnKeyType?: TextInputProps['returnKeyType'];
|
|
36
|
+
onFocus?: () => void;
|
|
37
|
+
onBlur?: () => void;
|
|
38
|
+
testID?: string;
|
|
39
|
+
'aria-label'?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare function Suggest({ name, data, config, value, defaultValue, onChange, onChangeText, onSelect, label, placeholder, hint, error, required, disabled: disabledProp, readOnly: readOnlyProp, size: sizeProp, variant: variantProp, layout: layoutProp, width, style, minSearchLength, debounceMs, showAllOnFocus, openOnFocus, clearOnSelect, closeOnSelect, renderItem, renderGroup, inputMode, returnKeyType, onFocus, onBlur, testID, 'aria-label': ariaLabel, }: SuggestProps): React.JSX.Element;
|
|
42
|
+
export declare namespace Suggest {
|
|
43
|
+
var displayName: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ControlLabelPosition, ControlSize, FieldChangeEvent, FieldColor } from '@dcs-tech/core';
|
|
4
|
+
type Value = string | number;
|
|
5
|
+
export interface SwitchProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
value?: Value;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
defaultChecked?: boolean;
|
|
11
|
+
onChange?: (event: FieldChangeEvent<Value | undefined>) => void;
|
|
12
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
hint?: React.ReactNode;
|
|
15
|
+
error?: React.ReactNode;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
labelPosition?: ControlLabelPosition;
|
|
18
|
+
onText?: string;
|
|
19
|
+
offText?: string;
|
|
20
|
+
onIcon?: React.ReactNode;
|
|
21
|
+
offIcon?: React.ReactNode;
|
|
22
|
+
labelOn?: React.ReactNode;
|
|
23
|
+
labelOff?: React.ReactNode;
|
|
24
|
+
stateLabelMode?: 'sides' | 'replace';
|
|
25
|
+
justSwitch?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
loadingIndicator?: React.ReactNode;
|
|
30
|
+
size?: ControlSize;
|
|
31
|
+
color?: FieldColor;
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
animated?: boolean;
|
|
34
|
+
style?: StyleProp<ViewStyle>;
|
|
35
|
+
testID?: string;
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function Switch({ name, value, checked, defaultChecked, onChange, onCheckedChange, label, hint, error, required, labelPosition, onText, offText, onIcon, offIcon, labelOn, labelOff, stateLabelMode, justSwitch, disabled, readOnly, loading, loadingIndicator, size, color, fullWidth, animated, style, testID, 'aria-label': ariaLabel, }: SwitchProps): React.JSX.Element;
|
|
39
|
+
export declare namespace Switch {
|
|
40
|
+
var displayName: string;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ControlSize, FieldColor } from '@dcs-tech/core';
|
|
4
|
+
export interface SwitchState {
|
|
5
|
+
size: ControlSize;
|
|
6
|
+
color: FieldColor;
|
|
7
|
+
checked: boolean;
|
|
8
|
+
pressed: boolean;
|
|
9
|
+
error: boolean;
|
|
10
|
+
choiceMode: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SwitchLook {
|
|
13
|
+
pad: number;
|
|
14
|
+
box: number;
|
|
15
|
+
track: ViewStyle;
|
|
16
|
+
thumb: ViewStyle;
|
|
17
|
+
travel: number;
|
|
18
|
+
rowLine: number;
|
|
19
|
+
onText: TextStyle;
|
|
20
|
+
offText: TextStyle;
|
|
21
|
+
thumbIconSize: number;
|
|
22
|
+
thumbIconColor: string;
|
|
23
|
+
accent: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function switchLook(t: Tokens, s: SwitchState): SwitchLook;
|
|
26
|
+
export declare function switchStateLabelStyle(t: Tokens, size: ControlSize, active: boolean, disabled: boolean, rowLine: number): {
|
|
27
|
+
box: ViewStyle;
|
|
28
|
+
text: TextStyle;
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToastApi, ToastDefaults } from './toast.types';
|
|
3
|
+
export declare const useToast: () => ToastApi;
|
|
4
|
+
export declare const useOptionalToast: () => ToastApi | null;
|
|
5
|
+
export interface ToastHostProps {
|
|
6
|
+
defaults?: ToastDefaults;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function ToastHost({ defaults, children }: ToastHostProps): React.JSX.Element;
|
|
10
|
+
export declare namespace ToastHost {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToastRecord } from './toast.types';
|
|
3
|
+
export interface ToastMemory {
|
|
4
|
+
left: number;
|
|
5
|
+
since: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface ToastItemProps {
|
|
8
|
+
toast: ToastRecord;
|
|
9
|
+
active: boolean;
|
|
10
|
+
onDismiss: (id: string) => void;
|
|
11
|
+
narrow: boolean;
|
|
12
|
+
memory?: Map<string, ToastMemory>;
|
|
13
|
+
}
|
|
14
|
+
export declare function ToastItem({ toast, active, onDismiss, narrow, memory }: ToastItemProps): React.JSX.Element;
|
|
15
|
+
export declare namespace ToastItem {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ToastMemory } from './ToastItem';
|
|
3
|
+
import type { ToastPosition, ToastRecord } from './toast.types';
|
|
4
|
+
export interface ToastLayerValue {
|
|
5
|
+
regions: ReadonlyArray<readonly [ToastPosition, ToastRecord[]]>;
|
|
6
|
+
active: boolean;
|
|
7
|
+
dismiss: (id: string) => void;
|
|
8
|
+
memory: Map<string, ToastMemory>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ToastLayerContext: React.Context<ToastLayerValue | null>;
|
|
11
|
+
export declare function ToastLayer(): React.JSX.Element | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ToastHost, useToast } from './ToastHost';
|
|
2
|
+
export type { ToastHostProps } from './ToastHost';
|
|
3
|
+
export { ToastItem } from './ToastItem';
|
|
4
|
+
export type { ToastItemProps } from './ToastItem';
|
|
5
|
+
export type { ToastApi, ToastDefaults, ToastOptions, ToastPosition, ToastRecord, ToastType, } from './toast.types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type ToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
4
|
+
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
5
|
+
export interface ToastOptions {
|
|
6
|
+
type?: ToastType;
|
|
7
|
+
autoClose?: number | false;
|
|
8
|
+
position?: ToastPosition;
|
|
9
|
+
hideProgressBar?: boolean;
|
|
10
|
+
closeOnClick?: boolean;
|
|
11
|
+
pauseOnFocusLoss?: boolean;
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
closeButton?: boolean | React.ReactNode;
|
|
14
|
+
icon?: React.ReactNode | false;
|
|
15
|
+
id?: string;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ToastRecord extends ToastOptions {
|
|
21
|
+
id: string;
|
|
22
|
+
message: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export interface ToastDefaults extends Omit<ToastOptions, 'id' | 'onClose' | 'testID'> {
|
|
25
|
+
newestOnTop?: boolean;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface ToastApi {
|
|
29
|
+
toast: (message: React.ReactNode, opts?: ToastOptions) => string;
|
|
30
|
+
success: (message: React.ReactNode, opts?: ToastOptions) => string;
|
|
31
|
+
error: (message: React.ReactNode, opts?: ToastOptions) => string;
|
|
32
|
+
warning: (message: React.ReactNode, opts?: ToastOptions) => string;
|
|
33
|
+
info: (message: React.ReactNode, opts?: ToastOptions) => string;
|
|
34
|
+
update: (id: string, message: React.ReactNode, opts?: ToastOptions) => void;
|
|
35
|
+
dismiss: (id?: string) => void;
|
|
36
|
+
isActive: (id: string) => boolean;
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { EdgeInsets } from '../Dialog/dialogStyle';
|
|
4
|
+
import type { ToastPosition, ToastType } from './toast.types';
|
|
5
|
+
export declare function toastAccent(t: Tokens, type: ToastType): string;
|
|
6
|
+
export interface ToastLook {
|
|
7
|
+
toast: ViewStyle;
|
|
8
|
+
rail: ViewStyle;
|
|
9
|
+
icon: ViewStyle;
|
|
10
|
+
iconSize: number;
|
|
11
|
+
accent: string;
|
|
12
|
+
body: ViewStyle;
|
|
13
|
+
text: TextStyle;
|
|
14
|
+
close: ViewStyle;
|
|
15
|
+
closePressed: ViewStyle;
|
|
16
|
+
closeIconSize: number;
|
|
17
|
+
closeColor: string;
|
|
18
|
+
closePressedColor: string;
|
|
19
|
+
progress: ViewStyle;
|
|
20
|
+
}
|
|
21
|
+
export declare function toastLook(t: Tokens, type: ToastType, narrow: boolean): ToastLook;
|
|
22
|
+
export declare function toastRegionLook(t: Tokens, position: ToastPosition, narrow: boolean, insets: EdgeInsets): ViewStyle;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { ControlLabelPosition, ControlSize } from '@dcs-tech/core';
|
|
4
|
+
import { type Ripple } from '../Press';
|
|
5
|
+
export interface ToggleFieldProps {
|
|
6
|
+
role: 'checkbox' | 'radio' | 'switch';
|
|
7
|
+
checked: boolean | 'mixed';
|
|
8
|
+
onToggle: () => void;
|
|
9
|
+
size: ControlSize;
|
|
10
|
+
layout: 'inline' | 'cell';
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
readOnly: boolean;
|
|
13
|
+
busy?: boolean;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
labelPosition: ControlLabelPosition;
|
|
17
|
+
error?: React.ReactNode;
|
|
18
|
+
hint?: React.ReactNode;
|
|
19
|
+
fullWidth?: boolean;
|
|
20
|
+
rowLine: number;
|
|
21
|
+
renderControl: (pressed: boolean) => React.ReactNode;
|
|
22
|
+
ripple?: Ripple;
|
|
23
|
+
renderLabels?: (labelBox: {
|
|
24
|
+
box: ViewStyle;
|
|
25
|
+
text: object;
|
|
26
|
+
}) => React.ReactNode;
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
testID?: string;
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function ToggleField(p: ToggleFieldProps): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export declare function ToggleGroupFrame({ role, label, required, helper, error, disabled, orientation, style, 'aria-label': ariaLabel, children }: {
|
|
4
|
+
role: 'group' | 'radiogroup';
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
required: boolean;
|
|
7
|
+
helper?: React.ReactNode;
|
|
8
|
+
error?: React.ReactNode;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
orientation: 'horizontal' | 'vertical';
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DateDisplayFormat, IconDefaults, UILocalePack } from '@dcs-tech/core';
|
|
3
|
+
import type { ToastDefaults } from '../Toast/toast.types';
|
|
4
|
+
import { type UILabelsInput, type UITheme } from './context';
|
|
5
|
+
export { useTokens, useUIDateFormat, useUILabels, useUILocale } from './context';
|
|
6
|
+
export type { UITheme, UILabels, UILabelsInput } from './context';
|
|
7
|
+
export interface UIProviderProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
theme?: UITheme;
|
|
10
|
+
icons?: IconDefaults;
|
|
11
|
+
labels?: UILabelsInput;
|
|
12
|
+
messages?: readonly UILocalePack[];
|
|
13
|
+
locale?: string;
|
|
14
|
+
dateFormat?: DateDisplayFormat;
|
|
15
|
+
toast?: ToastDefaults;
|
|
16
|
+
}
|
|
17
|
+
export declare const UIProvider: React.FC<UIProviderProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { DataTableLabels, DateDisplayFormat, PartialLabels, UILabelDictionary, UILocalePack } from '@dcs-tech/core';
|
|
4
|
+
export type UITheme = 'light' | 'dark' | 'system';
|
|
5
|
+
export type UILabels = UILabelDictionary & {
|
|
6
|
+
table?: Partial<DataTableLabels>;
|
|
7
|
+
};
|
|
8
|
+
export type UILabelsInput = PartialLabels<UILabels>;
|
|
9
|
+
export interface LabelsState {
|
|
10
|
+
value: UILabels;
|
|
11
|
+
labels: UILabelsInput | undefined;
|
|
12
|
+
packs: readonly UILocalePack[];
|
|
13
|
+
locale: string | undefined;
|
|
14
|
+
dateFormat?: DateDisplayFormat;
|
|
15
|
+
}
|
|
16
|
+
export declare const ThemeContext: React.Context<UITheme>;
|
|
17
|
+
export declare const LabelsContext: React.Context<LabelsState>;
|
|
18
|
+
export declare function resolveLabelsState(parent: LabelsState, labels: UILabelsInput | undefined, messages: readonly UILocalePack[] | undefined, locale: string | undefined, dateFormat?: DateDisplayFormat): LabelsState;
|
|
19
|
+
export declare const useUILabels: () => UILabels;
|
|
20
|
+
export declare const useUILocale: () => string | undefined;
|
|
21
|
+
export declare const useUIDateFormat: () => DateDisplayFormat | undefined;
|
|
22
|
+
export declare function useTokens(): Tokens;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ControlSize, ControlVariant } from '@dcs-tech/core';
|
|
4
|
+
export interface FieldSizeSet {
|
|
5
|
+
height: number;
|
|
6
|
+
padY: number;
|
|
7
|
+
padX: number;
|
|
8
|
+
fontSize: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function fieldSize(t: Tokens, size: ControlSize): FieldSizeSet;
|
|
11
|
+
export interface FieldControlState {
|
|
12
|
+
size: ControlSize;
|
|
13
|
+
variant: ControlVariant;
|
|
14
|
+
error: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
readOnly: boolean;
|
|
17
|
+
focused: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface FieldControlLook {
|
|
20
|
+
box: ViewStyle;
|
|
21
|
+
text: TextStyle;
|
|
22
|
+
placeholderColor: string;
|
|
23
|
+
color: string;
|
|
24
|
+
fontSize: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function fieldControlLook(t: Tokens, s: FieldControlState): FieldControlLook;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ControlSize } from '@dcs-tech/core';
|
|
4
|
+
export declare function popupSize(t: Tokens, size: ControlSize): {
|
|
5
|
+
padY: number;
|
|
6
|
+
padX: number;
|
|
7
|
+
primary: number;
|
|
8
|
+
secondary: number;
|
|
9
|
+
tertiary: number;
|
|
10
|
+
};
|
|
11
|
+
export interface PopupRowState {
|
|
12
|
+
size: ControlSize;
|
|
13
|
+
selected: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
pressed: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function popupRowLook(t: Tokens, s: PopupRowState): {
|
|
18
|
+
row: ViewStyle;
|
|
19
|
+
text: TextStyle;
|
|
20
|
+
tickColor: string;
|
|
21
|
+
tickSize: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function popupMarkStyle(t: Tokens, selected: boolean): TextStyle;
|
|
24
|
+
export declare function popupGroupHeaderStyle(t: Tokens, size: ControlSize): {
|
|
25
|
+
box: ViewStyle;
|
|
26
|
+
text: TextStyle;
|
|
27
|
+
};
|
|
28
|
+
export declare function popupMessageStyle(t: Tokens, size: ControlSize, empty: boolean): {
|
|
29
|
+
box: ViewStyle;
|
|
30
|
+
text: TextStyle;
|
|
31
|
+
};
|
|
32
|
+
export declare function suggestLineStyles(t: Tokens, size: ControlSize): {
|
|
33
|
+
primary: {
|
|
34
|
+
line: ViewStyle;
|
|
35
|
+
text: TextStyle;
|
|
36
|
+
};
|
|
37
|
+
secondary: {
|
|
38
|
+
line: ViewStyle;
|
|
39
|
+
text: TextStyle;
|
|
40
|
+
};
|
|
41
|
+
tertiary: {
|
|
42
|
+
line: ViewStyle;
|
|
43
|
+
chip: ViewStyle;
|
|
44
|
+
text: TextStyle;
|
|
45
|
+
};
|
|
46
|
+
label: TextStyle;
|
|
47
|
+
};
|
|
48
|
+
export declare function suggestPopupStyle(t: Tokens, maxHeight: number): ViewStyle;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import type { Tokens } from '@dcs-tech/tokens';
|
|
3
|
+
import type { ControlLabelPosition, ControlSize, FieldColor } from '@dcs-tech/core';
|
|
4
|
+
export declare function toggleSize(t: Tokens, size: ControlSize): {
|
|
5
|
+
box: number;
|
|
6
|
+
font: number;
|
|
7
|
+
};
|
|
8
|
+
export declare function toggleColor(t: Tokens, color: FieldColor): {
|
|
9
|
+
solid: string;
|
|
10
|
+
light: string;
|
|
11
|
+
on: string;
|
|
12
|
+
};
|
|
13
|
+
export interface ToggleRowState {
|
|
14
|
+
labelPosition: ControlLabelPosition;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
error: boolean;
|
|
17
|
+
fullWidth: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function toggleRowStyle(s: ToggleRowState): ViewStyle;
|
|
20
|
+
export declare function toggleLabelStyle(t: Tokens, size: ControlSize, s: ToggleRowState, rowLine: number): {
|
|
21
|
+
box: ViewStyle;
|
|
22
|
+
text: TextStyle;
|
|
23
|
+
};
|
|
24
|
+
export declare const toggleRequiredStyle: (t: Tokens) => TextStyle;
|
|
25
|
+
export declare const toggleLine: (t: Tokens, size: ControlSize) => number;
|
|
26
|
+
export declare function toggleHaloStyle(t: Tokens, box: number, color: string, on: boolean, pressed: boolean, disabled: boolean): ViewStyle;
|