Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/slider #1942

Open
wants to merge 14 commits into
base: patch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion example/storybook/.ondevice/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const getStories = () => {
require('../src/styled/api/MultipleTheme/MultipleTheme.stories.tsx'),
// require('../src/ui/components/DataDisplay/Badge/Badge.stories.tsx'),
require('../src/ui/components/DataDisplay/Card/Card.stories.tsx'),
require('../src/ui/components/Forms/RangeSlider/RangeSlider.stories.tsx'),

// require('../src/ui/components/Forms/Button/ButtonGroup.stories.tsx'),
// require('../src/ui/components/Forms/Checkbox/Checkbox.stories.tsx'),
// require('../src/ui/components/DataDisplay/Divider/Divider.stories.tsx'),
Expand All @@ -76,7 +78,7 @@ const getStories = () => {
// require('../src/ui/components/Feedback/Progress/Progress.stories.tsx'),
// require('../src/ui/components/Forms/Radio/Radio.stories.tsx'),
// require('../src/ui/components/Forms/Select/Select.stories.tsx'),
// require('../src/ui/components/Forms/Slider/Slider.stories.tsx'),
require('../src/ui/components/Forms/Slider/Slider.stories.tsx'),
// require('../src/ui/components/Feedback/Spinner/Spinner.stories.tsx'),
// require('../src/ui/components/Forms/Switch/Switch.stories.tsx'),
// require('../src/ui/components/Forms/Textarea/Textarea.stories.tsx'),
Expand Down
1 change: 1 addition & 0 deletions example/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const parameters = {
'Radio',
'Select',
'Slider',
'Range Slider',
'Switch',
'Tabs',
'Textarea',
Expand Down
4 changes: 4 additions & 0 deletions example/storybook/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ module.exports = function (api) {
__dirname,
'../../packages/themed/src'
),
'@gluestack-ui/range-slider': path.join(
__dirname,
'../../packages/unstyled/range-slider/src'
),
'@gluestack-ui/config': path.join(
__dirname,
'../../packages/config/src/gluestack-ui.config'
Expand Down
2 changes: 1 addition & 1 deletion example/storybook/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ config.transformer.getTransformOptions = async () => ({

config.watchFolders = [...config.watchFolders];

module.exports = config;
module.exports = config;
2 changes: 1 addition & 1 deletion example/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"react": "^18.2.0",
"react-aria": "^3.30.0",
"react-dom": "^18.2.0",
"react-native": "0.72.4",
"react-native": "^0.73.2",
"react-native-gesture-handler": "^2.12.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-svg": "13.4.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ComponentMeta } from '@storybook/react-native';
import RangeSlide from './RangeSlider';

const SliderMeta: ComponentMeta<typeof RangeSlide> = {
title: 'stories/FORMS/Range Slider',
component: RangeSlide,
};

export default SliderMeta;

export { RangeSlide };
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from 'react';
import {
Center,
RangeSlider,
RangeSliderTrack,
RangeSliderFilledTrack,
RangeSliderLeftThumb,
RangeSliderRightThumb,
Text,
VStack,
HStack,
Box,
Icon,
Heading,
Tooltip,
TooltipContent,
Button,
} from '@gluestack-ui/themed';

const RangeSliderBasic = ({ ...props }: any) => {
const [sliderValue, setSliderValue] = React.useState([20, 49]);

return (
<Center alignItems="center" w={200}>
<RangeSlider
sliderTrackHeight={4}
{...props}
mt="$4"
size="lg"
value={sliderValue}
onChange={setSliderValue}
label="RangeSlider"
>
<RangeSliderTrack>
<RangeSliderFilledTrack />
</RangeSliderTrack>
<RangeSliderLeftThumb />
<RangeSliderRightThumb />
</RangeSlider>
</Center>
);
};

RangeSliderBasic.description =
'This is a basic RangeSlider component example. RangeSlider are used to select a value from a range of values.';

export default RangeSliderBasic;

export {
Center,
RangeSlider,
RangeSliderTrack,
RangeSliderFilledTrack,
RangeSliderLeftThumb,
RangeSliderRightThumb,
Text,
VStack,
HStack,
Box,
Icon,
Heading,
Tooltip,
TooltipContent,
Button,
};
export { Volume, Volume2Icon, LightbulbIcon } from 'lucide-react-native';
Loading