related-ui-components 2.6.0 → 2.6.2
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/lib/commonjs/app.d.ts +4 -0
- package/lib/commonjs/app.d.ts.map +1 -0
- package/lib/commonjs/components/Badges/Badge.d.ts +14 -0
- package/lib/commonjs/components/Badges/Badge.d.ts.map +1 -0
- package/lib/commonjs/components/Badges/index.d.ts +3 -0
- package/lib/commonjs/components/Badges/index.d.ts.map +1 -0
- package/lib/commonjs/components/Banner/Banner.d.ts +24 -0
- package/lib/commonjs/components/Banner/Banner.d.ts.map +1 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.d.ts +16 -0
- package/lib/commonjs/components/Banner/BannerWithDetails.d.ts.map +1 -0
- package/lib/commonjs/components/Banner/index.d.ts +4 -0
- package/lib/commonjs/components/Banner/index.d.ts.map +1 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.d.ts +18 -0
- package/lib/commonjs/components/BrandIcon/BrandIcon.d.ts.map +1 -0
- package/lib/commonjs/components/BrandIcon/index.d.ts +3 -0
- package/lib/commonjs/components/BrandIcon/index.d.ts.map +1 -0
- package/lib/commonjs/components/Button/Button.d.ts +17 -0
- package/lib/commonjs/components/Button/Button.d.ts.map +1 -0
- package/lib/commonjs/components/Button/index.d.ts +3 -0
- package/lib/commonjs/components/Button/index.d.ts.map +1 -0
- package/lib/commonjs/components/Card/Card.d.ts +17 -0
- package/lib/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/commonjs/components/Card/CardContent.d.ts +8 -0
- package/lib/commonjs/components/Card/CardContent.d.ts.map +1 -0
- package/lib/commonjs/components/Card/CardFooter.d.ts +9 -0
- package/lib/commonjs/components/Card/CardFooter.d.ts.map +1 -0
- package/lib/commonjs/components/Card/CardHeader.d.ts +14 -0
- package/lib/commonjs/components/Card/CardHeader.d.ts.map +1 -0
- package/lib/commonjs/components/Card/CardImage.d.ts +12 -0
- package/lib/commonjs/components/Card/CardImage.d.ts.map +1 -0
- package/lib/commonjs/components/Card/index.d.ts +10 -0
- package/lib/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCard.d.ts +30 -0
- package/lib/commonjs/components/Card/templates/DealCard.d.ts.map +1 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts +37 -0
- package/lib/commonjs/components/Card/templates/DealCardWithBackgroundImage.d.ts.map +1 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.d.ts +12 -0
- package/lib/commonjs/components/Card/templates/SimpleTrendingCard.d.ts.map +1 -0
- package/lib/commonjs/components/Card/types.d.ts +2 -0
- package/lib/commonjs/components/Card/types.d.ts.map +1 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.d.ts +14 -0
- package/lib/commonjs/components/CloseIcon/CloseIcon.d.ts.map +1 -0
- package/lib/commonjs/components/CloseIcon/index.d.ts +3 -0
- package/lib/commonjs/components/CloseIcon/index.d.ts.map +1 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.d.ts +20 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/commonjs/components/DateRangePicker/index.d.ts +2 -0
- package/lib/commonjs/components/DateRangePicker/index.d.ts.map +1 -0
- package/lib/commonjs/components/Filters/Filters.d.ts +56 -0
- package/lib/commonjs/components/Filters/Filters.d.ts.map +1 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.d.ts +27 -0
- package/lib/commonjs/components/Filters/PointsRangeSelector.d.ts.map +1 -0
- package/lib/commonjs/components/Filters/index.d.ts +4 -0
- package/lib/commonjs/components/Filters/index.d.ts.map +1 -0
- package/lib/commonjs/components/Input/Input.d.ts +4 -0
- package/lib/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/commonjs/components/Input/index.d.ts +3 -0
- package/lib/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.d.ts +15 -0
- package/lib/commonjs/components/LockOverlay/LockOverlay.d.ts.map +1 -0
- package/lib/commonjs/components/LockOverlay/index.d.ts +3 -0
- package/lib/commonjs/components/LockOverlay/index.d.ts.map +1 -0
- package/lib/commonjs/components/Marquee/Marquee.d.ts +14 -0
- package/lib/commonjs/components/Marquee/Marquee.d.ts.map +1 -0
- package/lib/commonjs/components/Marquee/index.d.ts +3 -0
- package/lib/commonjs/components/Marquee/index.d.ts.map +1 -0
- package/lib/commonjs/components/NumericStepper/NumericStepper.d.ts +16 -0
- package/lib/commonjs/components/NumericStepper/NumericStepper.d.ts.map +1 -0
- package/lib/commonjs/components/NumericStepper/index.d.ts +3 -0
- package/lib/commonjs/components/NumericStepper/index.d.ts.map +1 -0
- package/lib/commonjs/components/Popup/Popup.d.ts +39 -0
- package/lib/commonjs/components/Popup/Popup.d.ts.map +1 -0
- package/lib/commonjs/components/Popup/index.d.ts +3 -0
- package/lib/commonjs/components/Popup/index.d.ts.map +1 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.d.ts +22 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.d.ts.map +1 -0
- package/lib/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/commonjs/components/ProgressBar/index.d.ts.map +1 -0
- package/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts +4 -0
- package/lib/commonjs/components/RedeemedVoucher/RedeemedVoucherSheet.d.ts.map +1 -0
- package/lib/commonjs/components/RedeemedVoucher/index.d.ts +3 -0
- package/lib/commonjs/components/RedeemedVoucher/index.d.ts.map +1 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.d.ts +23 -0
- package/lib/commonjs/components/RedemptionOption/RedemptionOption.d.ts.map +1 -0
- package/lib/commonjs/components/RedemptionOption/index.d.ts +3 -0
- package/lib/commonjs/components/RedemptionOption/index.d.ts.map +1 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.d.ts +19 -0
- package/lib/commonjs/components/ScratchCard/ScratchCard.d.ts.map +1 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.d.ts +7 -0
- package/lib/commonjs/components/ScratchCard/ScratchCardContent.d.ts.map +1 -0
- package/lib/commonjs/components/ScratchCard/index.d.ts +4 -0
- package/lib/commonjs/components/ScratchCard/index.d.ts.map +1 -0
- package/lib/commonjs/components/SelectAmount/SelectAmount.d.ts +29 -0
- package/lib/commonjs/components/SelectAmount/SelectAmount.d.ts.map +1 -0
- package/lib/commonjs/components/SelectAmount/index.d.ts +2 -0
- package/lib/commonjs/components/SelectAmount/index.d.ts.map +1 -0
- package/lib/commonjs/components/Skeleton/Shimmer.d.ts +11 -0
- package/lib/commonjs/components/Skeleton/Shimmer.d.ts.map +1 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.d.ts +10 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.d.ts.map +1 -0
- package/lib/commonjs/components/Skeleton/index.d.ts +4 -0
- package/lib/commonjs/components/Skeleton/index.d.ts.map +1 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.d.ts +12 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.d.ts +52 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.d.ts +47 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.d.ts +32 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.d.ts +45 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.d.ts +36 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.d.ts +12 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.d.ts +15 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.d.ts +47 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/index.d.ts +2 -0
- package/lib/commonjs/components/TravelBooking/index.d.ts.map +1 -0
- package/lib/commonjs/components/TravelBooking/types.d.ts +3 -0
- package/lib/commonjs/components/TravelBooking/types.d.ts.map +1 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.d.ts +23 -0
- package/lib/commonjs/components/UnlockRewards/RewardItem.d.ts.map +1 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.d.ts +41 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.d.ts.map +1 -0
- package/lib/commonjs/components/UnlockRewards/index.d.ts +4 -0
- package/lib/commonjs/components/UnlockRewards/index.d.ts.map +1 -0
- package/lib/commonjs/components/Wheel/Wheel.d.ts +25 -0
- package/lib/commonjs/components/Wheel/Wheel.d.ts.map +1 -0
- package/lib/commonjs/components/Wheel/index.d.ts +3 -0
- package/lib/commonjs/components/Wheel/index.d.ts.map +1 -0
- package/lib/commonjs/components/index.d.ts +2 -0
- package/lib/commonjs/components/index.d.ts.map +1 -0
- package/lib/commonjs/constants/BRANDS.d.ts +14 -0
- package/lib/commonjs/constants/BRANDS.d.ts.map +1 -0
- package/lib/commonjs/index.d.ts +2 -0
- package/lib/commonjs/index.d.ts.map +1 -0
- package/lib/commonjs/theme/Colors.d.ts +110 -0
- package/lib/commonjs/theme/Colors.d.ts.map +1 -0
- package/lib/commonjs/theme/ThemeContext.d.ts +11 -0
- package/lib/commonjs/theme/ThemeContext.d.ts.map +1 -0
- package/lib/commonjs/theme/index.d.ts +2 -0
- package/lib/commonjs/theme/index.d.ts.map +1 -0
- package/lib/module/app.js +8 -8
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/RangeSlider/RangeSlider.js +170 -0
- package/lib/module/components/RangeSlider/RangeSlider.js.map +1 -0
- package/lib/module/components/RangeSlider/SliderLabel.js +95 -0
- package/lib/module/components/RangeSlider/SliderLabel.js.map +1 -0
- package/lib/module/components/RangeSlider/index.js +5 -0
- package/lib/module/components/RangeSlider/index.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/src/app.d.ts.map +1 -1
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts +18 -0
- package/lib/typescript/src/components/RangeSlider/RangeSlider.d.ts.map +1 -0
- package/lib/typescript/src/components/RangeSlider/SliderLabel.d.ts +15 -0
- package/lib/typescript/src/components/RangeSlider/SliderLabel.d.ts.map +1 -0
- package/lib/typescript/src/components/RangeSlider/index.d.ts +3 -0
- package/lib/typescript/src/components/RangeSlider/index.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +3 -1
- package/src/components/RangeSlider/RangeSlider.tsx +196 -0
- package/src/components/RangeSlider/SliderLabel.tsx +123 -0
- package/src/components/RangeSlider/index.ts +2 -0
- package/src/components/index.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAe,mBAAU;AACzB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,oBAAW;AACzB,cAAc,kBAAS;AACvB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,6BAAoB;AAClC,cAAc,wBAAe;AAC7B,cAAc,0BAAiB;AAC/B,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,oBAAW;AACzB,cAAc,4BAAmB;AACjC,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,uBAAc;AAC5B,cAAc,8BAAqB;AACnC,cAAc,0BAAiB;AAC/B,cAAc,4BAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,iBAAQ;AACtB,cAAc,wBAAe;AAC7B,cAAe,mBAAU;AACzB,cAAc,mBAAU;AACxB,cAAc,sBAAa;AAC3B,cAAc,oBAAW;AACzB,cAAc,kBAAS;AACvB,cAAc,wBAAe;AAC7B,cAAc,kBAAS;AACvB,cAAc,6BAAoB;AAClC,cAAc,wBAAe;AAC7B,cAAc,0BAAiB;AAC/B,cAAc,kBAAS;AACvB,cAAc,sBAAa;AAC3B,cAAc,oBAAW;AACzB,cAAc,4BAAmB;AACjC,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,uBAAc;AAC5B,cAAc,8BAAqB;AACnC,cAAc,0BAAiB;AAC/B,cAAc,4BAAmB;AACjC,cAAc,wBAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAsDxC,QAAA,MAAM,GAAG,yBA8ER,CAAC;AAUF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ThemeType } from "../../theme";
|
|
3
|
+
interface RangeSliderProps {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
sliderWidth: number;
|
|
8
|
+
initialMinValue: number;
|
|
9
|
+
initialMaxValue: number;
|
|
10
|
+
onValueChange: (values: {
|
|
11
|
+
min: number;
|
|
12
|
+
max: number;
|
|
13
|
+
}) => void;
|
|
14
|
+
theme?: ThemeType;
|
|
15
|
+
}
|
|
16
|
+
declare const RangeSlider: React.FC<RangeSliderProps>;
|
|
17
|
+
export default RangeSlider;
|
|
18
|
+
//# sourceMappingURL=RangeSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeSlider.d.ts","sourceRoot":"","sources":["../../../../../src/components/RangeSlider/RangeSlider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAE,SAAS,EAAY,MAAM,aAAa,CAAC;AAMlD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAE9D,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgI3C,CAAC;AAwCF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SharedValue } from "react-native-reanimated";
|
|
3
|
+
import { ThemeType } from "../../theme";
|
|
4
|
+
interface SliderLabelsProps {
|
|
5
|
+
leftValue: string;
|
|
6
|
+
rightValue: string;
|
|
7
|
+
leftPosition: SharedValue<number>;
|
|
8
|
+
rightPosition: SharedValue<number>;
|
|
9
|
+
sliderWidth: number;
|
|
10
|
+
thumbSize: number;
|
|
11
|
+
theme?: ThemeType;
|
|
12
|
+
}
|
|
13
|
+
export declare const SliderLabels: React.FC<SliderLabelsProps>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=SliderLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderLabel.d.ts","sourceRoot":"","sources":["../../../../../src/components/RangeSlider/SliderLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAiB,EACf,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAY,MAAM,aAAa,CAAC;AAIlD,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAgDD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+BpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/RangeSlider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAe,UAAU,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAe,UAAU,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
HotelForm,
|
|
11
11
|
HotelSummary,
|
|
12
12
|
Filters,
|
|
13
|
+
RangeSlider,
|
|
13
14
|
} from "./components";
|
|
14
15
|
import { lightTheme, RelatedProvider, useTheme } from "./theme";
|
|
15
16
|
import CircularProgressBar from "./components/ProgressBar/CircularProgressBar";
|
|
@@ -119,7 +120,8 @@ const App = () => {
|
|
|
119
120
|
{/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
120
121
|
{/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
121
122
|
{/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
122
|
-
<CircularProgressBar variant="steps" totalSteps={4} currentStep={4} size={43} strokeWidth={2} progressColor="#9CA0A3"></CircularProgressBar>
|
|
123
|
+
{/* <CircularProgressBar variant="steps" totalSteps={4} currentStep={4} size={43} strokeWidth={2} progressColor="#9CA0A3"></CircularProgressBar> */}
|
|
124
|
+
<RangeSlider initialMinValue={0} initialMaxValue={100} min={0} max={500} sliderWidth={100} onValueChange={console.log}></RangeSlider>
|
|
123
125
|
{/* <PhoneInput value="" onChangeText={() => {}} inputContainerStyle={{height: 55}}></PhoneInput> */}
|
|
124
126
|
</SafeAreaView>
|
|
125
127
|
</BottomSheetStackProvider>
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import React, { useCallback, useState } from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
4
|
+
import Animated, {
|
|
5
|
+
runOnJS,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
useSharedValue,
|
|
8
|
+
} from "react-native-reanimated";
|
|
9
|
+
import { SliderLabels } from "./SliderLabel";
|
|
10
|
+
import { ThemeType, useTheme } from "../../theme";
|
|
11
|
+
|
|
12
|
+
const THUMB_SIZE = 28;
|
|
13
|
+
const RAIL_HEIGHT = 6;
|
|
14
|
+
const LABEL_HEIGHT = 26;
|
|
15
|
+
|
|
16
|
+
interface RangeSliderProps {
|
|
17
|
+
min: number;
|
|
18
|
+
max: number;
|
|
19
|
+
step?: number;
|
|
20
|
+
sliderWidth: number;
|
|
21
|
+
initialMinValue: number;
|
|
22
|
+
initialMaxValue: number;
|
|
23
|
+
onValueChange: (values: { min: number; max: number }) => void;
|
|
24
|
+
|
|
25
|
+
theme?: ThemeType
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const RangeSlider: React.FC<RangeSliderProps> = ({
|
|
29
|
+
min,
|
|
30
|
+
max,
|
|
31
|
+
step = 1,
|
|
32
|
+
sliderWidth,
|
|
33
|
+
initialMinValue,
|
|
34
|
+
initialMaxValue,
|
|
35
|
+
onValueChange,
|
|
36
|
+
theme
|
|
37
|
+
}) => {
|
|
38
|
+
const { theme: defaultTheme} = useTheme();
|
|
39
|
+
|
|
40
|
+
const currTheme = theme || defaultTheme;
|
|
41
|
+
|
|
42
|
+
const styles = getStyles(currTheme);
|
|
43
|
+
|
|
44
|
+
// State for label text values, passed down to the SliderLabels component
|
|
45
|
+
const [leftLabel, setLeftLabel] = useState(initialMinValue.toLocaleString());
|
|
46
|
+
const [rightLabel, setRightLabel] = useState(
|
|
47
|
+
initialMaxValue.toLocaleString()
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const valueToPosition = useCallback(
|
|
51
|
+
(value: number) => {
|
|
52
|
+
"worklet";
|
|
53
|
+
return ((value - min) / (max - min)) * sliderWidth;
|
|
54
|
+
},
|
|
55
|
+
[min, max, sliderWidth]
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const positionToValue = useCallback(
|
|
59
|
+
(position: number) => {
|
|
60
|
+
"worklet";
|
|
61
|
+
const rawValue = (position / sliderWidth) * (max - min) + min;
|
|
62
|
+
return Math.round(rawValue / step) * step;
|
|
63
|
+
},
|
|
64
|
+
[min, max, step, sliderWidth]
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const leftPosition = useSharedValue(valueToPosition(initialMinValue));
|
|
68
|
+
const rightPosition = useSharedValue(valueToPosition(initialMaxValue));
|
|
69
|
+
const context = useSharedValue({ x: 0 });
|
|
70
|
+
const activeThumb = useSharedValue<"left" | "right" | null>(null);
|
|
71
|
+
|
|
72
|
+
const panGesture = Gesture.Pan()
|
|
73
|
+
.onBegin((e) => {
|
|
74
|
+
const distToLeft = Math.abs(e.x - leftPosition.value);
|
|
75
|
+
const distToRight = Math.abs(e.x - rightPosition.value);
|
|
76
|
+
if (distToLeft <= distToRight) {
|
|
77
|
+
activeThumb.value = "left";
|
|
78
|
+
context.value = { x: leftPosition.value };
|
|
79
|
+
} else {
|
|
80
|
+
activeThumb.value = "right";
|
|
81
|
+
context.value = { x: rightPosition.value };
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
.onUpdate((e) => {
|
|
85
|
+
if (activeThumb.value === null) return;
|
|
86
|
+
const newPos = context.value.x + e.translationX;
|
|
87
|
+
|
|
88
|
+
if (activeThumb.value === "left") {
|
|
89
|
+
const clampedPos = Math.max(
|
|
90
|
+
0,
|
|
91
|
+
Math.min(newPos, rightPosition.value - THUMB_SIZE)
|
|
92
|
+
);
|
|
93
|
+
leftPosition.value = clampedPos;
|
|
94
|
+
runOnJS(setLeftLabel)(positionToValue(clampedPos).toLocaleString());
|
|
95
|
+
} else {
|
|
96
|
+
const clampedPos = Math.min(
|
|
97
|
+
sliderWidth,
|
|
98
|
+
Math.max(newPos, leftPosition.value + THUMB_SIZE)
|
|
99
|
+
);
|
|
100
|
+
rightPosition.value = clampedPos;
|
|
101
|
+
runOnJS(setRightLabel)(positionToValue(clampedPos).toLocaleString());
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
.onEnd(() => {
|
|
105
|
+
if (activeThumb.value === null) return;
|
|
106
|
+
const finalLeftValue = positionToValue(leftPosition.value);
|
|
107
|
+
const finalRightValue = positionToValue(rightPosition.value);
|
|
108
|
+
runOnJS(onValueChange)({ min: finalLeftValue, max: finalRightValue });
|
|
109
|
+
activeThumb.value = null;
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const animatedLeftThumbStyle = useAnimatedStyle(() => ({
|
|
113
|
+
transform: [{ translateX: leftPosition.value }],
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
const animatedRightThumbStyle = useAnimatedStyle(() => ({
|
|
117
|
+
transform: [{ translateX: rightPosition.value - THUMB_SIZE }],
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
const animatedActiveRailStyle = useAnimatedStyle(() => ({
|
|
121
|
+
left: leftPosition.value,
|
|
122
|
+
right: sliderWidth - rightPosition.value,
|
|
123
|
+
}));
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<View style={[styles.container, { width: sliderWidth }]}>
|
|
127
|
+
<SliderLabels
|
|
128
|
+
leftValue={leftLabel}
|
|
129
|
+
rightValue={rightLabel}
|
|
130
|
+
leftPosition={leftPosition}
|
|
131
|
+
rightPosition={rightPosition}
|
|
132
|
+
sliderWidth={sliderWidth}
|
|
133
|
+
thumbSize={THUMB_SIZE}
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<GestureDetector gesture={panGesture}>
|
|
137
|
+
<View style={styles.railContainer}>
|
|
138
|
+
<View style={styles.rail} />
|
|
139
|
+
<Animated.View style={[styles.activeRail, animatedActiveRailStyle]} />
|
|
140
|
+
|
|
141
|
+
<Animated.View
|
|
142
|
+
style={[styles.thumbContainer, animatedLeftThumbStyle]}
|
|
143
|
+
>
|
|
144
|
+
<View style={styles.thumb} />
|
|
145
|
+
</Animated.View>
|
|
146
|
+
|
|
147
|
+
<Animated.View
|
|
148
|
+
style={[styles.thumbContainer, animatedRightThumbStyle]}
|
|
149
|
+
>
|
|
150
|
+
<View style={styles.thumb} />
|
|
151
|
+
</Animated.View>
|
|
152
|
+
</View>
|
|
153
|
+
</GestureDetector>
|
|
154
|
+
</View>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const getStyles = (theme: ThemeType) =>
|
|
159
|
+
StyleSheet.create({
|
|
160
|
+
container: {
|
|
161
|
+
height: LABEL_HEIGHT + THUMB_SIZE,
|
|
162
|
+
justifyContent: "center",
|
|
163
|
+
marginTop: LABEL_HEIGHT, // Add margin to prevent label cutoff
|
|
164
|
+
},
|
|
165
|
+
railContainer: {
|
|
166
|
+
justifyContent: "center",
|
|
167
|
+
height: THUMB_SIZE,
|
|
168
|
+
},
|
|
169
|
+
rail: {
|
|
170
|
+
height: RAIL_HEIGHT,
|
|
171
|
+
borderRadius: RAIL_HEIGHT / 2,
|
|
172
|
+
backgroundColor: theme.surface,
|
|
173
|
+
},
|
|
174
|
+
activeRail: {
|
|
175
|
+
height: RAIL_HEIGHT,
|
|
176
|
+
backgroundColor: theme.primary,
|
|
177
|
+
position: "absolute",
|
|
178
|
+
},
|
|
179
|
+
thumbContainer: {
|
|
180
|
+
position: "absolute",
|
|
181
|
+
width: THUMB_SIZE,
|
|
182
|
+
height: THUMB_SIZE,
|
|
183
|
+
justifyContent: "center",
|
|
184
|
+
alignItems: "center",
|
|
185
|
+
},
|
|
186
|
+
thumb: {
|
|
187
|
+
width: THUMB_SIZE,
|
|
188
|
+
height: THUMB_SIZE,
|
|
189
|
+
borderRadius: THUMB_SIZE / 2,
|
|
190
|
+
backgroundColor: theme.background,
|
|
191
|
+
borderColor: theme.primary,
|
|
192
|
+
borderWidth: 5,
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
export default RangeSlider;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
3
|
+
import Animated, {
|
|
4
|
+
SharedValue,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
useDerivedValue,
|
|
7
|
+
useSharedValue,
|
|
8
|
+
} from "react-native-reanimated";
|
|
9
|
+
import { ThemeType, useTheme } from "../../theme";
|
|
10
|
+
|
|
11
|
+
const LABEL_HEIGHT = 26;
|
|
12
|
+
|
|
13
|
+
interface SliderLabelsProps {
|
|
14
|
+
leftValue: string;
|
|
15
|
+
rightValue: string;
|
|
16
|
+
leftPosition: SharedValue<number>;
|
|
17
|
+
rightPosition: SharedValue<number>;
|
|
18
|
+
sliderWidth: number;
|
|
19
|
+
thumbSize: number;
|
|
20
|
+
theme?: ThemeType
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface CenteredLabelProps {
|
|
24
|
+
value: string;
|
|
25
|
+
position: SharedValue<number>;
|
|
26
|
+
sliderWidth: number;
|
|
27
|
+
thumbSize: number;
|
|
28
|
+
theme?: ThemeType
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const CenteredLabel: React.FC<CenteredLabelProps> = ({
|
|
33
|
+
value,
|
|
34
|
+
position,
|
|
35
|
+
sliderWidth,
|
|
36
|
+
thumbSize,
|
|
37
|
+
theme
|
|
38
|
+
}) => {
|
|
39
|
+
const labelWidth = useSharedValue(0);
|
|
40
|
+
const {theme: defaultTheme} = useTheme();
|
|
41
|
+
const currTheme = theme || defaultTheme;
|
|
42
|
+
const styles = getStyles(currTheme);
|
|
43
|
+
|
|
44
|
+
const animatedLabelStyle = useAnimatedStyle(() => {
|
|
45
|
+
const rawCenter = position.value + thumbSize / 2;
|
|
46
|
+
const shifted = rawCenter - labelWidth.value / 2;
|
|
47
|
+
|
|
48
|
+
const left = Math.min(Math.max(shifted, 0), sliderWidth - labelWidth.value);
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
left: left,
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Animated.View
|
|
57
|
+
style={[styles.labelContainer, animatedLabelStyle]}
|
|
58
|
+
onLayout={(e) => {
|
|
59
|
+
labelWidth.value = e.nativeEvent.layout.width;
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
<Text style={styles.labelText}>
|
|
63
|
+
{value}
|
|
64
|
+
</Text>
|
|
65
|
+
</Animated.View>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const SliderLabels: React.FC<SliderLabelsProps> = ({
|
|
70
|
+
leftValue,
|
|
71
|
+
rightValue,
|
|
72
|
+
leftPosition,
|
|
73
|
+
rightPosition,
|
|
74
|
+
sliderWidth,
|
|
75
|
+
thumbSize,
|
|
76
|
+
theme
|
|
77
|
+
}) => {
|
|
78
|
+
const {theme: defaultTheme} = useTheme();
|
|
79
|
+
const currTheme = theme || defaultTheme;
|
|
80
|
+
const styles = getStyles(currTheme);
|
|
81
|
+
const rightThumbLeftPosition = useDerivedValue(() => {
|
|
82
|
+
return rightPosition.value - thumbSize;
|
|
83
|
+
});
|
|
84
|
+
return (
|
|
85
|
+
<View style={styles.wrapper} pointerEvents="none">
|
|
86
|
+
<CenteredLabel
|
|
87
|
+
value={leftValue}
|
|
88
|
+
thumbSize={thumbSize}
|
|
89
|
+
position={leftPosition}
|
|
90
|
+
sliderWidth={sliderWidth}
|
|
91
|
+
/>
|
|
92
|
+
<CenteredLabel
|
|
93
|
+
value={rightValue}
|
|
94
|
+
thumbSize={thumbSize}
|
|
95
|
+
position={rightThumbLeftPosition}
|
|
96
|
+
sliderWidth={sliderWidth}
|
|
97
|
+
/>
|
|
98
|
+
</View>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const getStyles = (theme: ThemeType) =>
|
|
103
|
+
StyleSheet.create({
|
|
104
|
+
wrapper: {
|
|
105
|
+
position: "absolute",
|
|
106
|
+
width: "100%",
|
|
107
|
+
height: "100%",
|
|
108
|
+
},
|
|
109
|
+
labelContainer: {
|
|
110
|
+
position: "absolute",
|
|
111
|
+
top: -LABEL_HEIGHT + 4,
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
},
|
|
114
|
+
labelText: {
|
|
115
|
+
backgroundColor: theme.surface,
|
|
116
|
+
paddingHorizontal: 8,
|
|
117
|
+
paddingVertical: 4,
|
|
118
|
+
borderRadius: 4,
|
|
119
|
+
color: theme.onSurface,
|
|
120
|
+
fontSize: 14,
|
|
121
|
+
fontFamily: "DinBold",
|
|
122
|
+
},
|
|
123
|
+
});
|
package/src/components/index.ts
CHANGED