@demlanide/react-lucky-components 0.1.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/README.md +184 -0
- package/dist/Alert/Alert.d.ts +3 -0
- package/dist/Alert/Alert.d.ts.map +1 -0
- package/dist/Alert/Alert.js +7 -0
- package/dist/Alert/constants.d.ts +38 -0
- package/dist/Alert/constants.d.ts.map +1 -0
- package/dist/Alert/constants.js +34 -0
- package/dist/Alert/index.d.ts +3 -0
- package/dist/Alert/index.d.ts.map +1 -0
- package/dist/Alert/index.js +1 -0
- package/dist/Alert/styles.d.ts +11 -0
- package/dist/Alert/styles.d.ts.map +1 -0
- package/dist/Alert/styles.js +49 -0
- package/dist/Alert/types.d.ts +20 -0
- package/dist/Alert/types.d.ts.map +1 -0
- package/dist/Alert/types.js +1 -0
- package/dist/Avatar/Avatar.d.ts +3 -0
- package/dist/Avatar/Avatar.d.ts.map +1 -0
- package/dist/Avatar/Avatar.js +33 -0
- package/dist/Avatar/Shapes/.map.json +42 -0
- package/dist/Avatar/Shapes/romb.png +0 -0
- package/dist/Avatar/consts.d.ts +21 -0
- package/dist/Avatar/consts.d.ts.map +1 -0
- package/dist/Avatar/consts.js +20 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.d.ts.map +1 -0
- package/dist/Avatar/index.js +1 -0
- package/dist/Avatar/styles.d.ts +27 -0
- package/dist/Avatar/styles.d.ts.map +1 -0
- package/dist/Avatar/styles.js +83 -0
- package/dist/Avatar/types.d.ts +31 -0
- package/dist/Avatar/types.d.ts.map +1 -0
- package/dist/Avatar/types.js +1 -0
- package/dist/Avatar/utilities.d.ts +8 -0
- package/dist/Avatar/utilities.d.ts.map +1 -0
- package/dist/Avatar/utilities.js +66 -0
- package/dist/Badge/Badge.d.ts +3 -0
- package/dist/Badge/Badge.d.ts.map +1 -0
- package/dist/Badge/Badge.js +8 -0
- package/dist/Badge/constants.d.ts +20 -0
- package/dist/Badge/constants.d.ts.map +1 -0
- package/dist/Badge/constants.js +32 -0
- package/dist/Badge/index.d.ts +3 -0
- package/dist/Badge/index.d.ts.map +1 -0
- package/dist/Badge/index.js +1 -0
- package/dist/Badge/styles.d.ts +10 -0
- package/dist/Badge/styles.d.ts.map +1 -0
- package/dist/Badge/styles.js +28 -0
- package/dist/Badge/types.d.ts +18 -0
- package/dist/Badge/types.d.ts.map +1 -0
- package/dist/Badge/types.js +1 -0
- package/dist/BigInput/BigInput.d.ts +3 -0
- package/dist/BigInput/BigInput.d.ts.map +1 -0
- package/dist/BigInput/BigInput.js +46 -0
- package/dist/BigInput/constants.d.ts +32 -0
- package/dist/BigInput/constants.d.ts.map +1 -0
- package/dist/BigInput/constants.js +31 -0
- package/dist/BigInput/index.d.ts +3 -0
- package/dist/BigInput/index.d.ts.map +1 -0
- package/dist/BigInput/index.js +1 -0
- package/dist/BigInput/styles.d.ts +14 -0
- package/dist/BigInput/styles.d.ts.map +1 -0
- package/dist/BigInput/styles.js +80 -0
- package/dist/BigInput/types.d.ts +23 -0
- package/dist/BigInput/types.d.ts.map +1 -0
- package/dist/BigInput/types.js +1 -0
- package/dist/Button/Button.d.ts +3 -0
- package/dist/Button/Button.d.ts.map +1 -0
- package/dist/Button/Button.js +7 -0
- package/dist/Button/constants.d.ts +23 -0
- package/dist/Button/constants.d.ts.map +1 -0
- package/dist/Button/constants.js +28 -0
- package/dist/Button/index.d.ts +3 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/Button/index.js +1 -0
- package/dist/Button/styles.d.ts +13 -0
- package/dist/Button/styles.d.ts.map +1 -0
- package/dist/Button/styles.js +34 -0
- package/dist/Button/types.d.ts +20 -0
- package/dist/Button/types.d.ts.map +1 -0
- package/dist/Button/types.js +1 -0
- package/dist/CardStack/BehindCard.d.ts +12 -0
- package/dist/CardStack/BehindCard.d.ts.map +1 -0
- package/dist/CardStack/BehindCard.js +18 -0
- package/dist/CardStack/CardStack.d.ts +3 -0
- package/dist/CardStack/CardStack.d.ts.map +1 -0
- package/dist/CardStack/CardStack.js +77 -0
- package/dist/CardStack/CardStackDots.d.ts +3 -0
- package/dist/CardStack/CardStackDots.d.ts.map +1 -0
- package/dist/CardStack/CardStackDots.js +121 -0
- package/dist/CardStack/StackCard.d.ts +27 -0
- package/dist/CardStack/StackCard.d.ts.map +1 -0
- package/dist/CardStack/StackCard.js +45 -0
- package/dist/CardStack/constants.d.ts +32 -0
- package/dist/CardStack/constants.d.ts.map +1 -0
- package/dist/CardStack/constants.js +31 -0
- package/dist/CardStack/index.d.ts +4 -0
- package/dist/CardStack/index.d.ts.map +1 -0
- package/dist/CardStack/index.js +2 -0
- package/dist/CardStack/types.d.ts +39 -0
- package/dist/CardStack/types.d.ts.map +1 -0
- package/dist/CardStack/types.js +1 -0
- package/dist/CardStack/useSwipeGesture.d.ts +18 -0
- package/dist/CardStack/useSwipeGesture.d.ts.map +1 -0
- package/dist/CardStack/useSwipeGesture.js +70 -0
- package/dist/DatePicker/CalendarModal.d.ts +15 -0
- package/dist/DatePicker/CalendarModal.d.ts.map +1 -0
- package/dist/DatePicker/CalendarModal.js +129 -0
- package/dist/DatePicker/DatePicker.d.ts +3 -0
- package/dist/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/DatePicker/DatePicker.js +57 -0
- package/dist/DatePicker/DayCell.d.ts +14 -0
- package/dist/DatePicker/DayCell.d.ts.map +1 -0
- package/dist/DatePicker/DayCell.js +16 -0
- package/dist/DatePicker/constants.d.ts +46 -0
- package/dist/DatePicker/constants.d.ts.map +1 -0
- package/dist/DatePicker/constants.js +51 -0
- package/dist/DatePicker/icons.d.ts +4 -0
- package/dist/DatePicker/icons.d.ts.map +1 -0
- package/dist/DatePicker/icons.js +12 -0
- package/dist/DatePicker/index.d.ts +3 -0
- package/dist/DatePicker/index.d.ts.map +1 -0
- package/dist/DatePicker/index.js +1 -0
- package/dist/DatePicker/styles.d.ts +40 -0
- package/dist/DatePicker/styles.d.ts.map +1 -0
- package/dist/DatePicker/styles.js +134 -0
- package/dist/DatePicker/types.d.ts +39 -0
- package/dist/DatePicker/types.d.ts.map +1 -0
- package/dist/DatePicker/types.js +1 -0
- package/dist/DatePicker/utils.d.ts +15 -0
- package/dist/DatePicker/utils.d.ts.map +1 -0
- package/dist/DatePicker/utils.js +133 -0
- package/dist/DimmedScrollView/DimmedScrollView.d.ts +5 -0
- package/dist/DimmedScrollView/DimmedScrollView.d.ts.map +1 -0
- package/dist/DimmedScrollView/DimmedScrollView.js +18 -0
- package/dist/DimmedScrollView/index.d.ts +3 -0
- package/dist/DimmedScrollView/index.d.ts.map +1 -0
- package/dist/DimmedScrollView/index.js +1 -0
- package/dist/DimmedScrollView/styles.d.ts +15 -0
- package/dist/DimmedScrollView/styles.d.ts.map +1 -0
- package/dist/DimmedScrollView/styles.js +32 -0
- package/dist/DimmedScrollView/types.d.ts +20 -0
- package/dist/DimmedScrollView/types.d.ts.map +1 -0
- package/dist/DimmedScrollView/types.js +1 -0
- package/dist/FadingEdge/FadingEdge.d.ts +3 -0
- package/dist/FadingEdge/FadingEdge.d.ts.map +1 -0
- package/dist/FadingEdge/FadingEdge.js +30 -0
- package/dist/FadingEdge/index.d.ts +3 -0
- package/dist/FadingEdge/index.d.ts.map +1 -0
- package/dist/FadingEdge/index.js +1 -0
- package/dist/FadingEdge/types.d.ts +14 -0
- package/dist/FadingEdge/types.d.ts.map +1 -0
- package/dist/FadingEdge/types.js +1 -0
- package/dist/Icon/Icon.d.ts +6 -0
- package/dist/Icon/Icon.d.ts.map +1 -0
- package/dist/Icon/Icon.js +16 -0
- package/dist/Icon/defaults.d.ts +7 -0
- package/dist/Icon/defaults.d.ts.map +1 -0
- package/dist/Icon/defaults.js +80 -0
- package/dist/Icon/icons/navigation.d.ts +10 -0
- package/dist/Icon/icons/navigation.d.ts.map +1 -0
- package/dist/Icon/icons/navigation.js +10 -0
- package/dist/Icon/icons/system.d.ts +29 -0
- package/dist/Icon/icons/system.d.ts.map +1 -0
- package/dist/Icon/icons/system.js +29 -0
- package/dist/Icon/icons/tabs.d.ts +6 -0
- package/dist/Icon/icons/tabs.d.ts.map +1 -0
- package/dist/Icon/icons/tabs.js +6 -0
- package/dist/Icon/index.d.ts +3 -0
- package/dist/Icon/index.d.ts.map +1 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Icon/registry.d.ts +3 -0
- package/dist/Icon/registry.d.ts.map +1 -0
- package/dist/Icon/registry.js +43 -0
- package/dist/Icon/types.d.ts +20 -0
- package/dist/Icon/types.d.ts.map +1 -0
- package/dist/Icon/types.js +40 -0
- package/dist/Input/Input.d.ts +5 -0
- package/dist/Input/Input.d.ts.map +1 -0
- package/dist/Input/Input.js +64 -0
- package/dist/Input/constants.d.ts +56 -0
- package/dist/Input/constants.d.ts.map +1 -0
- package/dist/Input/constants.js +61 -0
- package/dist/Input/index.d.ts +3 -0
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/Input/index.js +1 -0
- package/dist/Input/styles.d.ts +23 -0
- package/dist/Input/styles.d.ts.map +1 -0
- package/dist/Input/styles.js +99 -0
- package/dist/Input/types.d.ts +21 -0
- package/dist/Input/types.d.ts.map +1 -0
- package/dist/Input/types.js +1 -0
- package/dist/ListCell/CheckMark.d.ts +10 -0
- package/dist/ListCell/CheckMark.d.ts.map +1 -0
- package/dist/ListCell/CheckMark.js +12 -0
- package/dist/ListCell/Chevron.d.ts +14 -0
- package/dist/ListCell/Chevron.d.ts.map +1 -0
- package/dist/ListCell/Chevron.js +22 -0
- package/dist/ListCell/ListCell.d.ts +3 -0
- package/dist/ListCell/ListCell.d.ts.map +1 -0
- package/dist/ListCell/ListCell.js +120 -0
- package/dist/ListCell/PickerModal.d.ts +13 -0
- package/dist/ListCell/PickerModal.d.ts.map +1 -0
- package/dist/ListCell/PickerModal.js +8 -0
- package/dist/ListCell/RadioButton.d.ts +10 -0
- package/dist/ListCell/RadioButton.d.ts.map +1 -0
- package/dist/ListCell/RadioButton.js +12 -0
- package/dist/ListCell/SwitchTrack.d.ts +19 -0
- package/dist/ListCell/SwitchTrack.d.ts.map +1 -0
- package/dist/ListCell/SwitchTrack.js +8 -0
- package/dist/ListCell/constants.d.ts +30 -0
- package/dist/ListCell/constants.d.ts.map +1 -0
- package/dist/ListCell/constants.js +35 -0
- package/dist/ListCell/index.d.ts +3 -0
- package/dist/ListCell/index.d.ts.map +1 -0
- package/dist/ListCell/index.js +1 -0
- package/dist/ListCell/styles.d.ts +28 -0
- package/dist/ListCell/styles.d.ts.map +1 -0
- package/dist/ListCell/styles.js +111 -0
- package/dist/ListCell/types.d.ts +68 -0
- package/dist/ListCell/types.d.ts.map +1 -0
- package/dist/ListCell/types.js +1 -0
- package/dist/ListCell/useSwitchAnimation.d.ts +12 -0
- package/dist/ListCell/useSwitchAnimation.d.ts.map +1 -0
- package/dist/ListCell/useSwitchAnimation.js +31 -0
- package/dist/ListCell/utilities.d.ts +24 -0
- package/dist/ListCell/utilities.d.ts.map +1 -0
- package/dist/ListCell/utilities.js +29 -0
- package/dist/Picker/Picker.d.ts +3 -0
- package/dist/Picker/Picker.d.ts.map +1 -0
- package/dist/Picker/Picker.js +76 -0
- package/dist/Picker/PickerHeader.d.ts +7 -0
- package/dist/Picker/PickerHeader.d.ts.map +1 -0
- package/dist/Picker/PickerHeader.js +6 -0
- package/dist/Picker/PickerRow.d.ts +9 -0
- package/dist/Picker/PickerRow.d.ts.map +1 -0
- package/dist/Picker/PickerRow.js +9 -0
- package/dist/Picker/SearchField.d.ts +8 -0
- package/dist/Picker/SearchField.d.ts.map +1 -0
- package/dist/Picker/SearchField.js +8 -0
- package/dist/Picker/constants.d.ts +24 -0
- package/dist/Picker/constants.d.ts.map +1 -0
- package/dist/Picker/constants.js +29 -0
- package/dist/Picker/icons.d.ts +3 -0
- package/dist/Picker/icons.d.ts.map +1 -0
- package/dist/Picker/icons.js +9 -0
- package/dist/Picker/index.d.ts +3 -0
- package/dist/Picker/index.d.ts.map +1 -0
- package/dist/Picker/index.js +1 -0
- package/dist/Picker/styles.d.ts +34 -0
- package/dist/Picker/styles.d.ts.map +1 -0
- package/dist/Picker/styles.js +192 -0
- package/dist/Picker/types.d.ts +40 -0
- package/dist/Picker/types.d.ts.map +1 -0
- package/dist/Picker/types.js +1 -0
- package/dist/Picker/useFilteredItems.d.ts +3 -0
- package/dist/Picker/useFilteredItems.d.ts.map +1 -0
- package/dist/Picker/useFilteredItems.js +18 -0
- package/dist/SegmentedTabs/SegmentedTabs.d.ts +3 -0
- package/dist/SegmentedTabs/SegmentedTabs.d.ts.map +1 -0
- package/dist/SegmentedTabs/SegmentedTabs.js +70 -0
- package/dist/SegmentedTabs/index.d.ts +3 -0
- package/dist/SegmentedTabs/index.d.ts.map +1 -0
- package/dist/SegmentedTabs/index.js +1 -0
- package/dist/SegmentedTabs/types.d.ts +10 -0
- package/dist/SegmentedTabs/types.d.ts.map +1 -0
- package/dist/SegmentedTabs/types.js +1 -0
- package/dist/Select/Select.d.ts +3 -0
- package/dist/Select/Select.d.ts.map +1 -0
- package/dist/Select/Select.js +60 -0
- package/dist/Select/index.d.ts +3 -0
- package/dist/Select/index.d.ts.map +1 -0
- package/dist/Select/index.js +1 -0
- package/dist/Select/styles.d.ts +8 -0
- package/dist/Select/styles.d.ts.map +1 -0
- package/dist/Select/styles.js +36 -0
- package/dist/Select/types.d.ts +37 -0
- package/dist/Select/types.d.ts.map +1 -0
- package/dist/Select/types.js +1 -0
- package/dist/Tabs/FloatingTabBar.d.ts +9 -0
- package/dist/Tabs/FloatingTabBar.d.ts.map +1 -0
- package/dist/Tabs/FloatingTabBar.js +55 -0
- package/dist/Tabs/Tabs.d.ts +21 -0
- package/dist/Tabs/Tabs.d.ts.map +1 -0
- package/dist/Tabs/Tabs.js +29 -0
- package/dist/Tabs/constants.d.ts +35 -0
- package/dist/Tabs/constants.d.ts.map +1 -0
- package/dist/Tabs/constants.js +36 -0
- package/dist/Tabs/icons.d.ts +16 -0
- package/dist/Tabs/icons.d.ts.map +1 -0
- package/dist/Tabs/icons.js +8 -0
- package/dist/Tabs/index.d.ts +6 -0
- package/dist/Tabs/index.d.ts.map +1 -0
- package/dist/Tabs/index.js +4 -0
- package/dist/Tabs/styles.d.ts +224 -0
- package/dist/Tabs/styles.d.ts.map +1 -0
- package/dist/Tabs/styles.js +121 -0
- package/dist/Tabs/types.d.ts +61 -0
- package/dist/Tabs/types.d.ts.map +1 -0
- package/dist/Tabs/types.js +4 -0
- package/dist/Tabs/useFloatingTabBarScrollPadding.d.ts +7 -0
- package/dist/Tabs/useFloatingTabBarScrollPadding.d.ts.map +1 -0
- package/dist/Tabs/useFloatingTabBarScrollPadding.js +11 -0
- package/dist/Tabs/utilities.d.ts +7 -0
- package/dist/Tabs/utilities.d.ts.map +1 -0
- package/dist/Tabs/utilities.js +18 -0
- package/dist/ToggleSection/ToggleSection.d.ts +3 -0
- package/dist/ToggleSection/ToggleSection.d.ts.map +1 -0
- package/dist/ToggleSection/ToggleSection.js +18 -0
- package/dist/ToggleSection/index.d.ts +3 -0
- package/dist/ToggleSection/index.d.ts.map +1 -0
- package/dist/ToggleSection/index.js +1 -0
- package/dist/ToggleSection/styles.d.ts +15 -0
- package/dist/ToggleSection/styles.d.ts.map +1 -0
- package/dist/ToggleSection/styles.js +49 -0
- package/dist/ToggleSection/types.d.ts +36 -0
- package/dist/ToggleSection/types.d.ts.map +1 -0
- package/dist/ToggleSection/types.js +1 -0
- package/dist/assets/fonts/.map.json +51 -0
- package/dist/assets/fonts/SB Sans Text.ttf +0 -0
- package/dist/assets/fonts/sf-pro-display/.map.json +114 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYBLACKITALIC.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYBOLD.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYHEAVYITALIC.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYLIGHTITALIC.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYMEDIUM.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYREGULAR.otf +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYSEMIBOLDITALIC.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYTHINITALIC.OTF +0 -0
- package/dist/assets/fonts/sf-pro-display/SFPRODISPLAYULTRALIGHTITALIC.OTF +0 -0
- package/dist/fonts.d.ts +6 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +8 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/theme.d.ts +19 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +18 -0
- package/package.json +76 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Svg, { Path, Rect } from 'react-native-svg';
|
|
3
|
+
import { SELECTION_ICON_SIZE } from './constants';
|
|
4
|
+
export function CheckMark({ selected = false, color = '#B2F549', inactiveColor = '#C7C7CC', size = SELECTION_ICON_SIZE, }) {
|
|
5
|
+
const inset = size * 0.0833;
|
|
6
|
+
const innerSize = size - inset * 2;
|
|
7
|
+
const borderRadius = 4;
|
|
8
|
+
if (selected) {
|
|
9
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [_jsx(Rect, { x: inset, y: inset, width: innerSize, height: innerSize, rx: borderRadius, fill: color }), _jsx(Path, { d: `M${size * 0.3} ${size * 0.5} L${size * 0.45} ${size * 0.65} L${size * 0.7} ${size * 0.35}`, stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" })] }));
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(Svg, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: _jsx(Rect, { x: inset, y: inset, width: innerSize, height: innerSize, rx: borderRadius, stroke: inactiveColor, strokeWidth: 1.5, fill: "none" }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
export interface ChevronProps {
|
|
3
|
+
/** Stroke colour. @default '#C7C7CC' */
|
|
4
|
+
color?: string;
|
|
5
|
+
/** Outer container size. @default 24 */
|
|
6
|
+
size?: number;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A simple right-pointing chevron (">") built with View borders.
|
|
11
|
+
* Matches the 24 × 24 icon container from the Figma design.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Chevron({ color, size, style, }: ChevronProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=Chevron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chevron.d.ts","sourceRoot":"","sources":["../../src/ListCell/Chevron.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAgBD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAqB,EACrB,IAA6B,EAC7B,KAAK,GACN,EAAE,YAAY,2CAMd"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components/native';
|
|
3
|
+
import { CHEVRON_COLOR, CHEVRON_CONTAINER_SIZE, CHEVRON_STROKE_WIDTH } from './constants';
|
|
4
|
+
const ChevronContainer = styled.View `
|
|
5
|
+
width: ${({ $size }) => `${$size}px`};
|
|
6
|
+
height: ${({ $size }) => `${$size}px`};
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
`;
|
|
10
|
+
const ChevronArrow = styled.View `
|
|
11
|
+
width: 8.5px;
|
|
12
|
+
height: 8.5px;
|
|
13
|
+
border-top-width: ${CHEVRON_STROKE_WIDTH}px;
|
|
14
|
+
border-right-width: ${CHEVRON_STROKE_WIDTH}px;
|
|
15
|
+
`;
|
|
16
|
+
/**
|
|
17
|
+
* A simple right-pointing chevron (">") built with View borders.
|
|
18
|
+
* Matches the 24 × 24 icon container from the Figma design.
|
|
19
|
+
*/
|
|
20
|
+
export function Chevron({ color = CHEVRON_COLOR, size = CHEVRON_CONTAINER_SIZE, style, }) {
|
|
21
|
+
return (_jsx(ChevronContainer, { "$size": size, style: style, children: _jsx(ChevronArrow, { style: { borderColor: color, transform: [{ rotate: '45deg' }] } }) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ListCellProps } from './types';
|
|
2
|
+
export declare function ListCell({ title, subtitle, leading, image, style, disabled, testID, trailing, value, onValueChange, activeTrackColor, inactiveTrackColor, thumbColor, detail, onPress, selected, items, selectedValue, onSelectValue, pickerTitle, pickerSearchPlaceholder, variant, }: ListCellProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=ListCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListCell.d.ts","sourceRoot":"","sources":["../../src/ListCell/ListCell.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAA0B,MAAM,SAAS,CAAC;AAqCrE,wBAAgB,QAAQ,CAAC,EAEvB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAgB,EAChB,MAAM,EAEN,QAAqC,EAErC,KAAa,EACb,aAAa,EACb,gBAA6C,EAC7C,kBAAiD,EACjD,UAAgC,EAEhC,MAAM,EACN,OAAO,EAEP,QAAgB,EAEhB,KAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,uBAAkC,EAClC,OAAO,GACR,EAAE,aAAa,2CAyKf"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { CheckMark } from './CheckMark';
|
|
4
|
+
import { RadioButton } from './RadioButton';
|
|
5
|
+
import { PickerModal } from './PickerModal';
|
|
6
|
+
import { CellPressable, DetailText, ImageWrapper, Leading, LeadingImage, SubtitleText, TitleGroup, TitleText, TrailingNavigation, TrailingSelection, TrailingText, } from './styles';
|
|
7
|
+
import { SwitchTrack } from './SwitchTrack';
|
|
8
|
+
import { useSwitchAnimation } from './useSwitchAnimation';
|
|
9
|
+
import { createListCellPressHandler, getListCellAccessibilityState, } from './utilities';
|
|
10
|
+
import { DEFAULT_ACTIVE_TRACK_COLOR, DEFAULT_INACTIVE_TRACK_COLOR, DEFAULT_LIST_CELL_TRAILING, DEFAULT_THUMB_COLOR, } from './constants';
|
|
11
|
+
import { colors } from '../theme';
|
|
12
|
+
import { Icon } from '../Icon';
|
|
13
|
+
const CLASSIC_VARIANT_STYLE = {
|
|
14
|
+
backgroundColor: colors.white,
|
|
15
|
+
borderRadius: 24,
|
|
16
|
+
padding: 16,
|
|
17
|
+
marginBottom: 8,
|
|
18
|
+
marginHorizontal: 16,
|
|
19
|
+
};
|
|
20
|
+
function isTrailingPreset(value) {
|
|
21
|
+
return (value === 'switch' ||
|
|
22
|
+
value === 'navigation' ||
|
|
23
|
+
value === 'selector' ||
|
|
24
|
+
value === 'text' ||
|
|
25
|
+
value === 'radio' ||
|
|
26
|
+
value === 'checkbox' ||
|
|
27
|
+
value === 'none');
|
|
28
|
+
}
|
|
29
|
+
/* ── Component ──────────────────────────────────────────────────────── */
|
|
30
|
+
export function ListCell({
|
|
31
|
+
// Common
|
|
32
|
+
title, subtitle, leading, image, style, disabled = false, testID,
|
|
33
|
+
// Trailing
|
|
34
|
+
trailing = DEFAULT_LIST_CELL_TRAILING,
|
|
35
|
+
// Switch
|
|
36
|
+
value = false, onValueChange, activeTrackColor = DEFAULT_ACTIVE_TRACK_COLOR, inactiveTrackColor = DEFAULT_INACTIVE_TRACK_COLOR, thumbColor = DEFAULT_THUMB_COLOR,
|
|
37
|
+
// Navigation / Text
|
|
38
|
+
detail, onPress,
|
|
39
|
+
// Radio / Checkbox
|
|
40
|
+
selected = false,
|
|
41
|
+
// Selector
|
|
42
|
+
items = [], selectedValue, onSelectValue, pickerTitle, pickerSearchPlaceholder = 'Search', variant, }) {
|
|
43
|
+
const { translateX, trackBg, indicatorOpacity, circleOpacity } = useSwitchAnimation(value, { activeTrackColor, inactiveTrackColor });
|
|
44
|
+
const switchToggle = (_jsx(SwitchTrack, { trackBg: trackBg, translateX: translateX, indicatorOpacity: indicatorOpacity, circleOpacity: circleOpacity, thumbColor: thumbColor, disabled: disabled }));
|
|
45
|
+
const cellStyle = variant === 'classic' ? [CLASSIC_VARIANT_STYLE, style] : style;
|
|
46
|
+
/* ── List cell ────────────────────────────────────────────────── */
|
|
47
|
+
const trailingPreset = isTrailingPreset(trailing) ? trailing : undefined;
|
|
48
|
+
const isSwitch = trailingPreset === 'switch';
|
|
49
|
+
const isSelector = trailingPreset === 'selector';
|
|
50
|
+
const isText = trailingPreset === 'text';
|
|
51
|
+
const isRadio = trailingPreset === 'radio';
|
|
52
|
+
const isCheckbox = trailingPreset === 'checkbox';
|
|
53
|
+
const [pickerVisible, setPickerVisible] = useState(false);
|
|
54
|
+
const [draftSelectedValue, setDraftSelectedValue] = useState(selectedValue);
|
|
55
|
+
const selectorDetail = useMemo(() => {
|
|
56
|
+
if (!isSelector || items.length === 0)
|
|
57
|
+
return undefined;
|
|
58
|
+
const found = items.find((i) => i.value === selectedValue);
|
|
59
|
+
return found?.label ?? 'Select…';
|
|
60
|
+
}, [isSelector, items, selectedValue]);
|
|
61
|
+
const displayDetail = isSelector ? detail ?? selectorDetail : detail;
|
|
62
|
+
const handleSelectorPress = useCallback(() => {
|
|
63
|
+
setDraftSelectedValue(selectedValue);
|
|
64
|
+
setPickerVisible(true);
|
|
65
|
+
}, [selectedValue]);
|
|
66
|
+
const handlePickerBack = useCallback(() => setPickerVisible(false), []);
|
|
67
|
+
const handlePickerValueChange = useCallback((v) => {
|
|
68
|
+
setDraftSelectedValue(v);
|
|
69
|
+
onSelectValue?.(v);
|
|
70
|
+
}, []);
|
|
71
|
+
const handlePickerSave = useCallback((v) => {
|
|
72
|
+
setPickerVisible(false);
|
|
73
|
+
onSelectValue?.(v);
|
|
74
|
+
}, [onSelectValue]);
|
|
75
|
+
const handlePress = createListCellPressHandler({
|
|
76
|
+
disabled,
|
|
77
|
+
isSwitchTrailing: isSwitch,
|
|
78
|
+
isSelectorTrailing: isSelector,
|
|
79
|
+
value,
|
|
80
|
+
onValueChange,
|
|
81
|
+
onPress,
|
|
82
|
+
onSelectorPress: handleSelectorPress,
|
|
83
|
+
});
|
|
84
|
+
const accessibilityState = getListCellAccessibilityState({
|
|
85
|
+
isSwitchTrailing: isSwitch,
|
|
86
|
+
isSelectionTrailing: isRadio || isCheckbox,
|
|
87
|
+
selected,
|
|
88
|
+
value,
|
|
89
|
+
disabled,
|
|
90
|
+
});
|
|
91
|
+
const hasTextSubtitle = typeof subtitle === 'string';
|
|
92
|
+
/* ── Trailing accessory ───────────────────────────────────────── */
|
|
93
|
+
const renderTrailing = () => {
|
|
94
|
+
if (trailing === 'none')
|
|
95
|
+
return null;
|
|
96
|
+
if (!trailingPreset)
|
|
97
|
+
return trailing;
|
|
98
|
+
if (isSwitch)
|
|
99
|
+
return switchToggle;
|
|
100
|
+
if (isText) {
|
|
101
|
+
return (_jsx(TrailingText, { children: displayDetail != null && (_jsx(DetailText, { numberOfLines: 1, children: displayDetail })) }));
|
|
102
|
+
}
|
|
103
|
+
if (isRadio) {
|
|
104
|
+
return (_jsx(TrailingSelection, { children: _jsx(RadioButton, { selected: selected }) }));
|
|
105
|
+
}
|
|
106
|
+
if (isCheckbox) {
|
|
107
|
+
return (_jsx(TrailingSelection, { children: _jsx(CheckMark, { selected: selected }) }));
|
|
108
|
+
}
|
|
109
|
+
return (_jsxs(TrailingNavigation, { children: [displayDetail != null && (_jsx(DetailText, { numberOfLines: 1, children: displayDetail })), _jsx(Icon, { name: "chevron-right", size: 24, color: colors.gray400 })] }));
|
|
110
|
+
};
|
|
111
|
+
const accessibilityRole = isSwitch
|
|
112
|
+
? 'switch'
|
|
113
|
+
: isRadio
|
|
114
|
+
? 'radio'
|
|
115
|
+
: isCheckbox
|
|
116
|
+
? 'checkbox'
|
|
117
|
+
: 'button';
|
|
118
|
+
return (_jsxs(CellPressable, { onPress: handlePress, disabled: disabled, testID: testID, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, "$dimmed": !isSwitch && disabled, style: cellStyle, children: [_jsxs(Leading, { "$withLeading": !!leading || !!image, children: [image && (_jsx(ImageWrapper, { children: _jsx(LeadingImage, { source: image }) })), leading && leading, _jsxs(TitleGroup, { "$hasTextSubtitle": hasTextSubtitle, children: [_jsx(TitleText, { numberOfLines: 1, children: title }), subtitle != null &&
|
|
119
|
+
(hasTextSubtitle ? (_jsx(SubtitleText, { numberOfLines: 2, children: subtitle })) : (subtitle))] })] }), renderTrailing(), isSelector && items.length > 0 && (_jsx(PickerModal, { visible: pickerVisible, items: items, selectedValue: draftSelectedValue, onValueChange: handlePickerValueChange, title: pickerTitle ?? title ?? 'Select', onBack: handlePickerBack, onSave: handlePickerSave, searchPlaceholder: pickerSearchPlaceholder }))] }));
|
|
120
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PickerItem } from '../Picker/types';
|
|
2
|
+
export interface PickerModalProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
items: PickerItem[];
|
|
5
|
+
selectedValue?: string;
|
|
6
|
+
onValueChange: (value: string) => void;
|
|
7
|
+
title: string;
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
onSave: (value: string) => void;
|
|
10
|
+
searchPlaceholder: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function PickerModal({ visible, items, selectedValue, onValueChange, title, onBack, onSave, searchPlaceholder, }: PickerModalProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=PickerModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerModal.d.ts","sourceRoot":"","sources":["../../src/ListCell/PickerModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,aAAa,EACb,KAAK,EACL,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,EAAE,gBAAgB,2CAuBlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal, View } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { Picker } from '../Picker';
|
|
5
|
+
export function PickerModal({ visible, items, selectedValue, onValueChange, title, onBack, onSave, searchPlaceholder, }) {
|
|
6
|
+
const insets = useSafeAreaInsets();
|
|
7
|
+
return (_jsx(Modal, { visible: visible, animationType: "slide", presentationStyle: "fullScreen", onRequestClose: onBack, children: _jsx(View, { style: { flex: 1, backgroundColor: '#FFF', paddingTop: insets.top }, children: _jsx(Picker, { items: items, selectedValue: selectedValue, onValueChange: onValueChange, title: title, onBack: onBack, onSave: onSave, searchPlaceholder: searchPlaceholder }) }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RadioButtonProps {
|
|
2
|
+
selected?: boolean;
|
|
3
|
+
/** Stroke / fill colour when selected. @default '#B2F549' */
|
|
4
|
+
color?: string;
|
|
5
|
+
/** Stroke colour when unselected. @default '#C7C7CC' */
|
|
6
|
+
inactiveColor?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function RadioButton({ selected, color, inactiveColor, size, }: RadioButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../src/ListCell/RadioButton.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAgB,EAChB,KAAiB,EACjB,aAAyB,EACzB,IAA0B,GAC3B,EAAE,gBAAgB,2CAiClB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Svg, { Circle } from 'react-native-svg';
|
|
3
|
+
import { SELECTION_ICON_SIZE } from './constants';
|
|
4
|
+
export function RadioButton({ selected = false, color = '#B2F549', inactiveColor = '#C7C7CC', size = SELECTION_ICON_SIZE, }) {
|
|
5
|
+
const strokeWidth = 1.5;
|
|
6
|
+
const outerRadius = size / 2 - strokeWidth;
|
|
7
|
+
const center = size / 2;
|
|
8
|
+
if (selected) {
|
|
9
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [_jsx(Circle, { cx: center, cy: center, r: outerRadius, stroke: color, strokeWidth: strokeWidth, fill: "none" }), _jsx(Circle, { cx: center, cy: center, r: size * 0.25, fill: color })] }));
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(Svg, { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: _jsx(Circle, { cx: center, cy: center, r: outerRadius, stroke: inactiveColor, strokeWidth: strokeWidth, fill: "none" }) }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
export interface SwitchTrackProps {
|
|
3
|
+
/** Animated track background (interpolated color) */
|
|
4
|
+
trackBg: Animated.AnimatedInterpolation<string | number>;
|
|
5
|
+
/** Animated knob translateX */
|
|
6
|
+
translateX: Animated.AnimatedInterpolation<number>;
|
|
7
|
+
/** Animated indicator opacity */
|
|
8
|
+
indicatorOpacity: Animated.AnimatedInterpolation<number>;
|
|
9
|
+
/** Animated circle opacity (off state) */
|
|
10
|
+
circleOpacity: Animated.AnimatedInterpolation<number>;
|
|
11
|
+
/** Knob and indicator colour */
|
|
12
|
+
thumbColor: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Presentational track + knob + indicator. No press handling or animation logic.
|
|
17
|
+
*/
|
|
18
|
+
export declare function SwitchTrack({ trackBg, translateX, indicatorOpacity, circleOpacity, thumbColor, disabled, }: SwitchTrackProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=SwitchTrack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwitchTrack.d.ts","sourceRoot":"","sources":["../../src/ListCell/SwitchTrack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,OAAO,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACzD,+BAA+B;IAC/B,UAAU,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACnD,iCAAiC;IACjC,gBAAgB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzD,0CAA0C;IAC1C,aAAa,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACtD,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,QAAgB,GACjB,EAAE,gBAAgB,2CAiBlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CircleOff, Indicator, Knob, Track } from './styles';
|
|
3
|
+
/**
|
|
4
|
+
* Presentational track + knob + indicator. No press handling or animation logic.
|
|
5
|
+
*/
|
|
6
|
+
export function SwitchTrack({ trackBg, translateX, indicatorOpacity, circleOpacity, thumbColor, disabled = false, }) {
|
|
7
|
+
return (_jsxs(Track, { "$disabled": disabled, style: { backgroundColor: trackBg }, children: [_jsx(Indicator, { style: { opacity: indicatorOpacity, backgroundColor: thumbColor } }), _jsx(CircleOff, { style: { opacity: circleOpacity, borderColor: thumbColor } }), _jsx(Knob, { style: { backgroundColor: thumbColor, transform: [{ translateX }] } })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListCell dimensions and design tokens (from Figma node 1:2991 / 27:776).
|
|
3
|
+
* List-cell typography uses Figma design variables.
|
|
4
|
+
*/
|
|
5
|
+
import type { ListCellTrailingPreset } from './types';
|
|
6
|
+
export declare const TRACK_WIDTH = 64;
|
|
7
|
+
export declare const TRACK_HEIGHT = 28;
|
|
8
|
+
export declare const TRACK_PADDING = 2;
|
|
9
|
+
export declare const KNOB_WIDTH = 39;
|
|
10
|
+
export declare const KNOB_HEIGHT = 24;
|
|
11
|
+
export declare const TRAVEL: number;
|
|
12
|
+
export declare const INDICATOR_HEIGHT = 10;
|
|
13
|
+
export declare const INDICATOR_LEFT: number;
|
|
14
|
+
export declare const CIRCLE_SIZE = 10;
|
|
15
|
+
export declare const CIRCLE_OFF_LEFT: number;
|
|
16
|
+
export declare const TEXT_PRIMARY = "#2C2C2C";
|
|
17
|
+
export declare const TEXT_SECONDARY = "#738295";
|
|
18
|
+
export declare const IMG_SIZE = 44;
|
|
19
|
+
export declare const CHEVRON_CONTAINER_SIZE = 24;
|
|
20
|
+
export declare const CHEVRON_STROKE_WIDTH = 2;
|
|
21
|
+
export declare const CHEVRON_COLOR = "#C7C7CC";
|
|
22
|
+
export declare const SELECTION_ICON_SIZE = 24;
|
|
23
|
+
export declare const RADIO_INNER_SIZE = 21;
|
|
24
|
+
export declare const CHECKBOX_INNER_SIZE = 20;
|
|
25
|
+
export declare const BRAND_GREEN = "#B2F549";
|
|
26
|
+
export declare const DEFAULT_LIST_CELL_TRAILING: ListCellTrailingPreset;
|
|
27
|
+
export declare const DEFAULT_ACTIVE_TRACK_COLOR = "#B2F549";
|
|
28
|
+
export declare const DEFAULT_INACTIVE_TRACK_COLOR = "#738295";
|
|
29
|
+
export declare const DEFAULT_THUMB_COLOR = "#FFFFFF";
|
|
30
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/ListCell/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,UAAU,KAAK,CAAC;AAC7B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,MAAM,QAA+C,CAAC;AAGnE,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,cAAc,QAAmC,CAAC;AAG/D,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,eAAe,QAC6B,CAAC;AAG1D,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,cAAc,YAAY,CAAC;AAGxC,eAAO,MAAM,QAAQ,KAAK,CAAC;AAG3B,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,aAAa,YAAY,CAAC;AAGvC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AACtC,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,eAAO,MAAM,0BAA0B,EAAE,sBAAiC,CAAC;AAC3E,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,eAAO,MAAM,4BAA4B,YAAY,CAAC;AACtD,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListCell dimensions and design tokens (from Figma node 1:2991 / 27:776).
|
|
3
|
+
* List-cell typography uses Figma design variables.
|
|
4
|
+
*/
|
|
5
|
+
/* ── Toggle dimensions ─────────────────────────────────────────────── */
|
|
6
|
+
export const TRACK_WIDTH = 64;
|
|
7
|
+
export const TRACK_HEIGHT = 28;
|
|
8
|
+
export const TRACK_PADDING = 2;
|
|
9
|
+
export const KNOB_WIDTH = 39;
|
|
10
|
+
export const KNOB_HEIGHT = 24;
|
|
11
|
+
export const TRAVEL = TRACK_WIDTH - TRACK_PADDING * 2 - KNOB_WIDTH; // 21 px
|
|
12
|
+
/* "I" indicator — centred in the non-knob area when the switch is ON */
|
|
13
|
+
export const INDICATOR_HEIGHT = 10;
|
|
14
|
+
export const INDICATOR_LEFT = TRACK_PADDING + (TRAVEL - 1) / 2;
|
|
15
|
+
/* Hollow circle — centred in the non-knob area when the switch is OFF */
|
|
16
|
+
export const CIRCLE_SIZE = 10;
|
|
17
|
+
export const CIRCLE_OFF_LEFT = TRACK_PADDING + KNOB_WIDTH + (TRAVEL - CIRCLE_SIZE) / 2;
|
|
18
|
+
/* ── List-cell typography (Figma design variables) ────────────────── */
|
|
19
|
+
export const TEXT_PRIMARY = '#2C2C2C'; // Text/Primary
|
|
20
|
+
export const TEXT_SECONDARY = '#738295'; // Text/Secondary
|
|
21
|
+
/* ── List-cell image ───────────────────────────────────────────────── */
|
|
22
|
+
export const IMG_SIZE = 44;
|
|
23
|
+
/* ── Chevron (navigation trailing) ─────────────────────────────────── */
|
|
24
|
+
export const CHEVRON_CONTAINER_SIZE = 24;
|
|
25
|
+
export const CHEVRON_STROKE_WIDTH = 2;
|
|
26
|
+
export const CHEVRON_COLOR = '#C7C7CC';
|
|
27
|
+
/* ── Radio / Checkbox (selection trailing) ─────────────────────────── */
|
|
28
|
+
export const SELECTION_ICON_SIZE = 24;
|
|
29
|
+
export const RADIO_INNER_SIZE = 21; // 87.5% of 24
|
|
30
|
+
export const CHECKBOX_INNER_SIZE = 20; // ~83.3% of 24
|
|
31
|
+
export const BRAND_GREEN = '#B2F549';
|
|
32
|
+
export const DEFAULT_LIST_CELL_TRAILING = 'switch';
|
|
33
|
+
export const DEFAULT_ACTIVE_TRACK_COLOR = '#B2F549';
|
|
34
|
+
export const DEFAULT_INACTIVE_TRACK_COLOR = '#738295';
|
|
35
|
+
export const DEFAULT_THUMB_COLOR = '#FFFFFF';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ListCell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListCell } from './ListCell';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
export declare const Track: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, {
|
|
4
|
+
$disabled?: boolean | undefined;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const Knob: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, never>>;
|
|
7
|
+
export declare const Indicator: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, never>>;
|
|
8
|
+
export declare const CircleOff: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>>, never>>;
|
|
9
|
+
export declare const CellPressable: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<Omit<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>, "ref"> & {
|
|
10
|
+
ref?: ((instance: import("react-native").View | null) => void) | import("react").RefObject<import("react-native").View> | null | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
$dimmed?: boolean | undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
export declare const Leading: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps, {
|
|
15
|
+
$withLeading?: boolean | undefined;
|
|
16
|
+
}>>;
|
|
17
|
+
export declare const ImageWrapper: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").ViewProps, never>>;
|
|
18
|
+
export declare const LeadingImage: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").ImageProps, never>>;
|
|
19
|
+
export declare const TitleGroup: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").Substitute<import("react-native").ViewProps, {
|
|
20
|
+
$hasTextSubtitle?: boolean | undefined;
|
|
21
|
+
}>>;
|
|
22
|
+
export declare const TitleText: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").TextProps, never>>;
|
|
23
|
+
export declare const SubtitleText: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").TextProps, never>>;
|
|
24
|
+
export declare const TrailingNavigation: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").ViewProps, never>>;
|
|
25
|
+
export declare const DetailText: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").TextProps, never>>;
|
|
26
|
+
export declare const TrailingText: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").ViewProps, never>>;
|
|
27
|
+
export declare const TrailingSelection: import("styled-components/native/dist/types").IStyledComponentBase<"native", import("styled-components/native/dist/types").FastOmit<import("react-native").ViewProps, never>>;
|
|
28
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ListCell/styles.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AAmBnD,eAAO,MAAM,KAAK;;GAMjB,CAAC;AAEF,eAAO,MAAM,IAAI,oQAOhB,CAAC;AAEF,eAAO,MAAM,SAAS,oQAOrB,CAAC;AAEF,eAAO,MAAM,SAAS,oQASrB,CAAC;AAIF,eAAO,MAAM,aAAa;;;;GAMzB,CAAC;AAEF,eAAO,MAAM,OAAO;;GAMnB,CAAC;AAEF,eAAO,MAAM,YAAY,+KASxB,CAAC;AAEF,eAAO,MAAM,YAAY,gLAKxB,CAAC;AAEF,eAAO,MAAM,UAAU;;GAItB,CAAC;AAEF,eAAO,MAAM,SAAS,+KAMrB,CAAC;AAEF,eAAO,MAAM,YAAY,+KAOxB,CAAC;AAIF,eAAO,MAAM,kBAAkB,+KAI9B,CAAC;AAEF,eAAO,MAAM,UAAU,+KAMtB,CAAC;AAIF,eAAO,MAAM,YAAY,+KAGxB,CAAC;AAIF,eAAO,MAAM,iBAAiB,+KAG7B,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Animated, Pressable } from 'react-native';
|
|
2
|
+
import styled from 'styled-components/native';
|
|
3
|
+
import { TRACK_HEIGHT, TRACK_WIDTH, TRACK_PADDING, KNOB_HEIGHT, KNOB_WIDTH, INDICATOR_HEIGHT, INDICATOR_LEFT, CIRCLE_SIZE, CIRCLE_OFF_LEFT, TEXT_PRIMARY, TEXT_SECONDARY, IMG_SIZE, } from './constants';
|
|
4
|
+
/* ── Toggle ────────────────────────────────────────────────────────── */
|
|
5
|
+
export const Track = styled(Animated.View) `
|
|
6
|
+
width: ${TRACK_WIDTH}px;
|
|
7
|
+
height: ${TRACK_HEIGHT}px;
|
|
8
|
+
border-radius: ${TRACK_HEIGHT / 2}px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
opacity: ${({ $disabled }) => ($disabled ? 0.5 : 1)};
|
|
11
|
+
`;
|
|
12
|
+
export const Knob = styled(Animated.View) `
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: ${TRACK_PADDING}px;
|
|
15
|
+
left: ${TRACK_PADDING}px;
|
|
16
|
+
width: ${KNOB_WIDTH}px;
|
|
17
|
+
height: ${KNOB_HEIGHT}px;
|
|
18
|
+
border-radius: ${KNOB_HEIGHT / 2}px;
|
|
19
|
+
`;
|
|
20
|
+
export const Indicator = styled(Animated.View) `
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: ${INDICATOR_LEFT}px;
|
|
23
|
+
top: ${(TRACK_HEIGHT - INDICATOR_HEIGHT) / 2}px;
|
|
24
|
+
width: 1px;
|
|
25
|
+
height: ${INDICATOR_HEIGHT}px;
|
|
26
|
+
border-radius: 0.5px;
|
|
27
|
+
`;
|
|
28
|
+
export const CircleOff = styled(Animated.View) `
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: ${CIRCLE_OFF_LEFT}px;
|
|
31
|
+
top: ${(TRACK_HEIGHT - CIRCLE_SIZE) / 2}px;
|
|
32
|
+
width: ${CIRCLE_SIZE}px;
|
|
33
|
+
height: ${CIRCLE_SIZE}px;
|
|
34
|
+
border-radius: ${CIRCLE_SIZE / 2}px;
|
|
35
|
+
border-width: 1.5px;
|
|
36
|
+
background-color: transparent;
|
|
37
|
+
`;
|
|
38
|
+
/* ── List-cell layout ──────────────────────────────────────────────── */
|
|
39
|
+
export const CellPressable = styled(Pressable) `
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
align-items: center;
|
|
42
|
+
padding: 16px;
|
|
43
|
+
gap: 8px;
|
|
44
|
+
opacity: ${({ $dimmed }) => ($dimmed ? 0.5 : 1)};
|
|
45
|
+
`;
|
|
46
|
+
export const Leading = styled.View `
|
|
47
|
+
flex: 1;
|
|
48
|
+
height: ${IMG_SIZE}px;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: ${({ $withLeading }) => ($withLeading ? 8 : 0)}px;
|
|
52
|
+
`;
|
|
53
|
+
export const ImageWrapper = styled.View `
|
|
54
|
+
width: ${IMG_SIZE}px;
|
|
55
|
+
height: ${IMG_SIZE}px;
|
|
56
|
+
border-radius: 6px;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
border-width: 0.5px;
|
|
59
|
+
border-color: rgba(0, 0, 0, 0.06);
|
|
60
|
+
background-color: #F2F2F2;
|
|
61
|
+
padding: 4px;
|
|
62
|
+
`;
|
|
63
|
+
export const LeadingImage = styled.Image `
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
resize-mode: contain;
|
|
68
|
+
`;
|
|
69
|
+
export const TitleGroup = styled.View `
|
|
70
|
+
flex-shrink: 1;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
padding-bottom: ${({ $hasTextSubtitle }) => ($hasTextSubtitle ? 2 : 0)}px;
|
|
73
|
+
`;
|
|
74
|
+
export const TitleText = styled.Text `
|
|
75
|
+
font-size: 17px;
|
|
76
|
+
font-weight: 400;
|
|
77
|
+
line-height: 22px;
|
|
78
|
+
letter-spacing: -0.43px;
|
|
79
|
+
color: ${TEXT_PRIMARY};
|
|
80
|
+
`;
|
|
81
|
+
export const SubtitleText = styled.Text `
|
|
82
|
+
font-size: 13px;
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
line-height: 18px;
|
|
85
|
+
letter-spacing: -0.08px;
|
|
86
|
+
color: ${TEXT_SECONDARY};
|
|
87
|
+
margin-top: 4px;
|
|
88
|
+
`;
|
|
89
|
+
/* ── Navigation trailing (detail text + chevron) ─────────────────── */
|
|
90
|
+
export const TrailingNavigation = styled.View `
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
`;
|
|
95
|
+
export const DetailText = styled.Text `
|
|
96
|
+
font-size: 17px;
|
|
97
|
+
font-weight: 400;
|
|
98
|
+
line-height: 22px;
|
|
99
|
+
letter-spacing: -0.43px;
|
|
100
|
+
color: ${TEXT_PRIMARY};
|
|
101
|
+
`;
|
|
102
|
+
/* ── Text-only trailing (detail text, no chevron) ────────────────── */
|
|
103
|
+
export const TrailingText = styled.View `
|
|
104
|
+
flex-direction: row;
|
|
105
|
+
align-items: center;
|
|
106
|
+
`;
|
|
107
|
+
/* ── Selection trailing (radio / checkbox) ────────────────────────── */
|
|
108
|
+
export const TrailingSelection = styled.View `
|
|
109
|
+
flex-direction: row;
|
|
110
|
+
align-items: center;
|
|
111
|
+
`;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ImageSourcePropType, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { PickerItem } from '../Picker/types';
|
|
4
|
+
export type ListCellTrailingPreset = 'switch' | 'navigation' | 'selector' | 'text' | 'radio' | 'checkbox';
|
|
5
|
+
export type ListCellTrailing = ListCellTrailingPreset | ReactNode;
|
|
6
|
+
export interface ListCellProps {
|
|
7
|
+
/** Primary label. When provided the component renders as a full list-cell row. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Secondary label shown below the title. Pass a string for text or a ReactNode (e.g. Badge). */
|
|
10
|
+
subtitle?: ReactNode;
|
|
11
|
+
/** Leading content. Can be a ReactNode or an ImageSourcePropType. */
|
|
12
|
+
leading?: ReactNode | ImageSourcePropType;
|
|
13
|
+
/** Leading image (44 x 44, rounded 6 px) */
|
|
14
|
+
image?: ImageSourcePropType;
|
|
15
|
+
/** Style applied to the outer container in list-cell mode */
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
/** Disables interaction and lowers opacity */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Forwarded to the root Pressable */
|
|
20
|
+
testID?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Determines the trailing (right-side) accessory of the list cell.
|
|
23
|
+
*
|
|
24
|
+
* - `'switch'` - animated toggle switch (default)
|
|
25
|
+
* - `'navigation'` - optional detail text + chevron arrow
|
|
26
|
+
* - `'selector'` - selected item label + chevron; opens Picker in modal when pressed
|
|
27
|
+
* - `'text'` - detail text only (no chevron)
|
|
28
|
+
* - `'radio'` - radio button
|
|
29
|
+
* - `'checkbox'` - checkbox
|
|
30
|
+
* - `ReactNode` - custom trailing element rendered as-is
|
|
31
|
+
*
|
|
32
|
+
* When no `title` is provided the component always renders as a
|
|
33
|
+
* standalone toggle regardless of this prop.
|
|
34
|
+
*
|
|
35
|
+
* @default 'switch'
|
|
36
|
+
*/
|
|
37
|
+
trailing?: ListCellTrailing;
|
|
38
|
+
/** Whether the switch is on */
|
|
39
|
+
value?: boolean;
|
|
40
|
+
/** Called with the new value when the switch is toggled */
|
|
41
|
+
onValueChange?: (value: boolean) => void;
|
|
42
|
+
/** Track colour when on. @default '#B2F549' (brand green) */
|
|
43
|
+
activeTrackColor?: string;
|
|
44
|
+
/** Track colour when off. @default colors.gray300 */
|
|
45
|
+
inactiveTrackColor?: string;
|
|
46
|
+
/** Knob colour. @default colors.white */
|
|
47
|
+
thumbColor?: string;
|
|
48
|
+
/** Detail text shown before the chevron (trailing='navigation' | 'text') */
|
|
49
|
+
detail?: string;
|
|
50
|
+
/** Called when the cell is pressed (all non-switch/non-selector trailing modes, including custom trailing nodes) */
|
|
51
|
+
onPress?: () => void;
|
|
52
|
+
/** Whether the radio/checkbox is selected (trailing='radio' | 'checkbox') */
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
/** Options for the Picker (trailing='selector'); required when trailing is 'selector' */
|
|
55
|
+
items?: PickerItem[];
|
|
56
|
+
/** Currently selected value (trailing='selector') */
|
|
57
|
+
selectedValue?: string;
|
|
58
|
+
/** Called when the user selects and saves in the Picker (trailing='selector') */
|
|
59
|
+
onSelectValue?: (value: string) => void;
|
|
60
|
+
/** Header title for the Picker modal. @default title or 'Select' */
|
|
61
|
+
pickerTitle?: string;
|
|
62
|
+
/** Placeholder for the search field in the Picker modal. @default 'Search' */
|
|
63
|
+
pickerSearchPlaceholder?: string;
|
|
64
|
+
variant?: 'classic';
|
|
65
|
+
}
|
|
66
|
+
/** @deprecated Use `ListCellProps` instead. */
|
|
67
|
+
export type SwitchProps = ListCellProps;
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ListCell/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,mBAAmB,EACnB,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,sBAAsB,GAC9B,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,MAAM,GACN,OAAO,GACP,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,SAAS,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iGAAiG;IACjG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAC1C,4CAA4C;IAC5C,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oHAAoH;IACpH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,yFAAyF;IACzF,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
export interface SwitchAnimationColors {
|
|
3
|
+
activeTrackColor: string;
|
|
4
|
+
inactiveTrackColor: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function useSwitchAnimation(value: boolean, { activeTrackColor, inactiveTrackColor }: SwitchAnimationColors): {
|
|
7
|
+
translateX: Animated.AnimatedInterpolation<string | number>;
|
|
8
|
+
trackBg: Animated.AnimatedInterpolation<string | number>;
|
|
9
|
+
indicatorOpacity: Animated.AnimatedInterpolation<string | number>;
|
|
10
|
+
circleOpacity: Animated.AnimatedInterpolation<string | number>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useSwitchAnimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSwitchAnimation.d.ts","sourceRoot":"","sources":["../../src/ListCell/useSwitchAnimation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,EAAE,qBAAqB;;;;;EAkChE"}
|