Skip to content

Commit

Permalink
docs: update doc links and label recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyman committed Oct 29, 2023
1 parent ddbce01 commit 64d263b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/storybook/content/01-api.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {

<Description of={ReactCompareSlider} />

[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/src/ReactCompareSlider.tsx)
[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/lib/src/ReactCompareSlider.tsx)

### Props

Expand All @@ -29,7 +29,7 @@ import {

<Description of={ReactCompareSliderHandle} />

[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/src/ReactCompareSliderHandle.tsx)
[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/lib/src/ReactCompareSliderHandle.tsx)

### Props

Expand All @@ -40,7 +40,7 @@ import {

<Description of={ReactCompareSliderImage} />

[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/src/ReactCompareSliderImage.tsx)
[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/lib/src/ReactCompareSliderImage.tsx)

### Props

Expand All @@ -51,7 +51,7 @@ import {

<Description of={styleFitContainer} />

[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/src/utils.ts#L16)
[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/lib/src/utils.ts#L16)

The `styleFitContainer` utility makes any [replaced element](https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element)
fill its parent while maintaining the correct aspect ratio.
Expand Down Expand Up @@ -82,7 +82,7 @@ import { styleFitContainer } from 'react-compare-slider';

<Description of={useReactCompareSliderRef} />

[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/src/useReactCompareSliderRef.ts)
[🔗 Source](https://github.com/nerdyman/react-compare-slider/blob/main/lib/src/useReactCompareSliderRef.ts)

The `useReactCompareSliderRef` hook provides a ref to the root element of the slider and exposes the internal
function used to control the position of the slider. It offers performant programmatic control of the slider.
Expand Down
8 changes: 4 additions & 4 deletions docs/storybook/content/05-only-handle-draggable.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const isTouchDevice = window.matchMedia('(pointer: coarse)').matches;
</Canvas>

<Canvas>
<Story id="recipes-googlemaps--google-maps" />
<Story id="recipes-google-maps--google-maps" />
</Canvas>

<ArgTypes of={ReactCompareSlider} />

Also checkout the
[Only Handle Draggable](/story/docs--only-handle-draggable) and
[Detect Touch Devices](/story/recipes-detecttouchdevices--detect-touch-devices) and
[Google Maps](/story/recipes-googlemaps--google-maps) demos.
[Only Handle Draggable](/story/demos--only-handle-draggable) and
[Detect Touch Devices](/story/recipes--detect-touch-devices) and
[Google Maps](/story/recipes-google-maps--google-maps) demos.
18 changes: 15 additions & 3 deletions docs/storybook/content/stories/01-recipes/00-index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export const ItemLabels: StoryFn<ReactCompareSliderDetailedProps> = (props) => {
onPointerUp={() => setLabelOpacity(1)}
itemOne={
<div
style={{ display: 'flex', alignItems: 'center', height: '100%', justifyContent: 'start' }}
style={{
display: 'flex',
alignItems: 'center',
width: '100%',
height: '100%',
justifyContent: 'start',
}}
>
<div style={labelStyle}>Left</div>
<ReactCompareSliderImage
Expand All @@ -52,7 +58,13 @@ export const ItemLabels: StoryFn<ReactCompareSliderDetailedProps> = (props) => {
}
itemTwo={
<div
style={{ display: 'flex', alignItems: 'center', height: '100%', justifyContent: 'end' }}
style={{
display: 'flex',
alignItems: 'center',
width: '100%',
height: '100%',
justifyContent: 'end',
}}
>
<div style={labelStyle}>Right</div>
<ReactCompareSliderImage
Expand Down Expand Up @@ -107,7 +119,7 @@ export const HandleLabels: StoryFn<ReactCompareSliderDetailedProps> = (props) =>
/>
}
handle={
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', height: '100%' }}>
<ReactCompareSliderHandle />
<div style={{ ...labelStyle, translate: '-100% 0', left: 0 }}>Label 1</div>
<div style={{ ...labelStyle, translate: '100% 0', right: 0 }}>Label 2</div>
Expand Down

1 comment on commit 64d263b

@vercel
Copy link

@vercel vercel bot commented on 64d263b Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.