@bitrise/bitkit 10.15.0 → 10.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
+
import Image from '../Image/Image';
|
|
3
|
+
import AspectRatio from './AspectRatio';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/AspectRatio',
|
|
7
|
+
component: AspectRatio,
|
|
8
|
+
} as ComponentMeta<typeof AspectRatio>;
|
|
9
|
+
|
|
10
|
+
const Template: ComponentStory<typeof AspectRatio> = (props) => <AspectRatio {...props} />;
|
|
11
|
+
|
|
12
|
+
export const WithImage = Template.bind({});
|
|
13
|
+
WithImage.args = {
|
|
14
|
+
children: <Image alt="Bitrise office" src="bitrise_office.jpg" />,
|
|
15
|
+
maxWidth: 800,
|
|
16
|
+
ratio: 1920 / 1280,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const WithVideo = Template.bind({});
|
|
20
|
+
WithVideo.args = {
|
|
21
|
+
children: <iframe title="Intro to Bitrise" src="https://www.youtube.com/embed/JrCn9xWQ7IM" allowFullScreen />,
|
|
22
|
+
maxWidth: 800,
|
|
23
|
+
ratio: 16 / 9,
|
|
24
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AspectRatio as ChakraAspectRatio, AspectRatioProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AspectRatio component is used to embed responsive videos and maps, etc.
|
|
5
|
+
*
|
|
6
|
+
* https://chakra-ui.com/docs/components/aspect-ratio/usage
|
|
7
|
+
*/
|
|
8
|
+
const AspectRatio = forwardRef<AspectRatioProps, 'div'>((props, ref) => {
|
|
9
|
+
return <ChakraAspectRatio {...props} ref={ref} />;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type { AspectRatioProps };
|
|
13
|
+
|
|
14
|
+
export default AspectRatio;
|
package/src/index.ts
CHANGED
|
@@ -163,6 +163,9 @@ export { default as AccordionItem } from './Components/Accordion/AccordionItem';
|
|
|
163
163
|
export type { LightBoxProps } from './Components/LightBox/LightBox';
|
|
164
164
|
export { default as LightBox } from './Components/LightBox/LightBox';
|
|
165
165
|
|
|
166
|
+
export type { AspectRatioProps } from './Components/AspectRatio/AspectRatio';
|
|
167
|
+
export { default as AspectRatio } from './Components/AspectRatio/AspectRatio';
|
|
168
|
+
|
|
166
169
|
export type { TableProps } from './Components/Table/Table';
|
|
167
170
|
export { default as Table } from './Components/Table/Table';
|
|
168
171
|
|