@ldelia/react-media 0.4.2 → 0.4.4

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.
Files changed (140) hide show
  1. package/dist/components/__tests__/timeline/timeline.test.d.ts +1 -0
  2. package/dist/components/reproduction-widget/ReproductionWidget.d.ts +17 -0
  3. package/dist/components/reproduction-widget/index.js +1 -0
  4. package/dist/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.d.ts +8 -0
  5. package/dist/components/reproduction-widget/inner-players/YouTubeInnerPlayer.d.ts +10 -0
  6. package/dist/components/reproduction-widget/models/Player/PlayAlongPlayer.d.ts +30 -0
  7. package/dist/components/reproduction-widget/models/Player/PlayerEvents.d.ts +4 -0
  8. package/dist/components/reproduction-widget/models/Player/YouTubePlayer.d.ts +30 -0
  9. package/dist/components/reproduction-widget/models/Reproduction.d.ts +66 -0
  10. package/dist/components/reproduction-widget/models/ReproductionBuilder.d.ts +16 -0
  11. package/dist/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.d.ts +8 -0
  12. package/dist/components/timeline/Timeline.d.ts +12 -0
  13. package/dist/components/timeline/TimelineCanvas/TickTime.d.ts +7 -0
  14. package/dist/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.d.ts +6 -0
  15. package/dist/components/timeline/TimelineCanvas/TimelineCanvas.d.ts +7 -0
  16. package/dist/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.d.ts +2 -0
  17. package/dist/components/timeline/TimelineValue/TimelineValue.d.ts +7 -0
  18. package/dist/components/timeline/ZoomContext/ZoomContext.d.ts +7 -0
  19. package/dist/components/timeline/constants.d.ts +1 -0
  20. package/dist/components/timeline/utils/utils.d.ts +7 -0
  21. package/dist/setupTests.d.ts +1 -0
  22. package/dist/stories/reproduction-widget.stories.d.ts +4 -0
  23. package/dist/stories/timeline.stories.d.ts +9 -0
  24. package/package.json +45 -35
  25. package/.bitmap +0 -48
  26. package/.eslintcache +0 -1
  27. package/.prettierignore +0 -3
  28. package/.prettierrc +0 -7
  29. package/.storybook/main.js +0 -38
  30. package/.storybook/preview.js +0 -4
  31. package/config/env.js +0 -104
  32. package/config/getHttpsConfig.js +0 -66
  33. package/config/jest/babelTransform.js +0 -29
  34. package/config/jest/cssTransform.js +0 -14
  35. package/config/jest/fileTransform.js +0 -40
  36. package/config/modules.js +0 -134
  37. package/config/paths.js +0 -77
  38. package/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
  39. package/config/webpack.config.js +0 -755
  40. package/config/webpackDevServer.config.js +0 -127
  41. package/scripts/build.js +0 -217
  42. package/scripts/start.js +0 -154
  43. package/scripts/test.js +0 -52
  44. package/src/components/__tests__/timeline/timeline.test.tsx +0 -26
  45. package/src/components/reproduction-widget/README.md +0 -27
  46. package/src/components/reproduction-widget/ReproductionWidget.tsx +0 -68
  47. package/src/components/reproduction-widget/index.tsx +0 -1
  48. package/src/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.tsx +0 -10
  49. package/src/components/reproduction-widget/inner-players/YouTubeInnerPlayer.tsx +0 -36
  50. package/src/components/reproduction-widget/models/Player/PlayAlongPlayer.ts +0 -129
  51. package/src/components/reproduction-widget/models/Player/PlayerEvents.ts +0 -4
  52. package/src/components/reproduction-widget/models/Player/YouTubePlayer.ts +0 -171
  53. package/src/components/reproduction-widget/models/Reproduction.ts +0 -272
  54. package/src/components/reproduction-widget/models/ReproductionBuilder.ts +0 -70
  55. package/src/components/timeline/README.md +0 -111
  56. package/src/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.tsx +0 -166
  57. package/src/components/timeline/Timeline.tsx +0 -139
  58. package/src/components/timeline/TimelineCanvas/TickTime.tsx +0 -45
  59. package/src/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.tsx +0 -42
  60. package/src/components/timeline/TimelineCanvas/TimelineCanvas.tsx +0 -79
  61. package/src/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.ts +0 -43
  62. package/src/components/timeline/TimelineValue/TimelineValue.tsx +0 -87
  63. package/src/components/timeline/ZoomContext/ZoomContext.ts +0 -10
  64. package/src/components/timeline/constants.ts +0 -13
  65. package/src/components/timeline/utils/utils.ts +0 -49
  66. package/src/modules.d.ts +0 -1
  67. package/src/react-app-env.d.ts +0 -71
  68. package/src/react-docgen-types.d.ts +0 -37
  69. package/src/setupTests.ts +0 -5
  70. package/src/stories/Configure.mdx +0 -364
  71. package/src/stories/reproduction-widget.stories.tsx +0 -23
  72. package/src/stories/timeline.stories.custom.css +0 -29
  73. package/src/stories/timeline.stories.tsx +0 -66
  74. package/storybook-static/favicon.svg +0 -1
  75. package/storybook-static/index.html +0 -173
  76. package/storybook-static/index.json +0 -1
  77. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  78. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  79. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  80. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  81. package/storybook-static/project.json +0 -1
  82. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
  83. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
  84. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +0 -12
  85. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
  86. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -412
  87. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -0
  88. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +0 -3
  89. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
  90. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +0 -3
  91. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
  92. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +0 -3
  93. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
  94. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +0 -3
  95. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
  96. package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
  97. package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
  98. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
  99. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  100. package/storybook-static/sb-common-assets/favicon.svg +0 -1
  101. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  102. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  103. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  104. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  105. package/storybook-static/sb-manager/globals-module-info.js +0 -995
  106. package/storybook-static/sb-manager/globals-runtime.js +0 -53527
  107. package/storybook-static/sb-manager/globals.js +0 -48
  108. package/storybook-static/sb-manager/runtime.js +0 -11885
  109. package/storybook-static/sb-preview/globals.js +0 -33
  110. package/storybook-static/sb-preview/runtime.js +0 -9483
  111. package/tsconfig.json +0 -14
  112. /package/{src → dist}/components/__tests__/timeline/timeline.test.js +0 -0
  113. /package/{src/components/index.js → dist/components/index.d.ts} +0 -0
  114. /package/{src/components/index.ts → dist/components/index.js} +0 -0
  115. /package/{src → dist}/components/reproduction-widget/ReproductionWidget.js +0 -0
  116. /package/{src/components/reproduction-widget/index.js → dist/components/reproduction-widget/index.d.ts} +0 -0
  117. /package/{src → dist}/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.js +0 -0
  118. /package/{src → dist}/components/reproduction-widget/inner-players/YouTubeInnerPlayer.js +0 -0
  119. /package/{src → dist}/components/reproduction-widget/models/Player/PlayAlongPlayer.js +0 -0
  120. /package/{src → dist}/components/reproduction-widget/models/Player/PlayerEvents.js +0 -0
  121. /package/{src → dist}/components/reproduction-widget/models/Player/YouTubePlayer.js +0 -0
  122. /package/{src → dist}/components/reproduction-widget/models/Reproduction.js +0 -0
  123. /package/{src → dist}/components/reproduction-widget/models/ReproductionBuilder.js +0 -0
  124. /package/{src → dist}/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.js +0 -0
  125. /package/{src → dist}/components/timeline/Timeline.js +0 -0
  126. /package/{src → dist}/components/timeline/TimelineCanvas/TickTime.js +0 -0
  127. /package/{src → dist}/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.js +0 -0
  128. /package/{src → dist}/components/timeline/TimelineCanvas/TimelineCanvas.js +0 -0
  129. /package/{src → dist}/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.js +0 -0
  130. /package/{src → dist}/components/timeline/TimelineValue/TimelineValue.js +0 -0
  131. /package/{src → dist}/components/timeline/ZoomContext/ZoomContext.js +0 -0
  132. /package/{src → dist}/components/timeline/constants.js +0 -0
  133. /package/{src/components/timeline/index.js → dist/components/timeline/index.d.ts} +0 -0
  134. /package/{src/components/timeline/index.tsx → dist/components/timeline/index.js} +0 -0
  135. /package/{src → dist}/components/timeline/utils/utils.js +0 -0
  136. /package/{src/index.js → dist/index.d.ts} +0 -0
  137. /package/{src/index.ts → dist/index.js} +0 -0
  138. /package/{src → dist}/setupTests.js +0 -0
  139. /package/{src → dist}/stories/reproduction-widget.stories.js +0 -0
  140. /package/{src → dist}/stories/timeline.stories.js +0 -0
@@ -1,87 +0,0 @@
1
- import React, { useCallback, useContext, useEffect, useRef } from 'react';
2
- import styled from 'styled-components';
3
- import {
4
- getComputedElementWidth,
5
- numberToPxString,
6
- secondsToPixel,
7
- } from '../utils/utils';
8
- import { ZoomContext, ZoomContextType } from '../ZoomContext/ZoomContext';
9
-
10
- const PreValueLine = styled.span`
11
- position: absolute;
12
- left: 0;
13
- height: 100%;
14
- `;
15
-
16
- const ValueLine = styled.span`
17
- position: absolute;
18
- width: 1px;
19
- height: 100%;
20
- background-color: #575757;
21
- `;
22
-
23
- const PostValueLine = styled.span`
24
- position: absolute;
25
- height: 100%;
26
- `;
27
-
28
- interface Props {
29
- canvasRef: React.RefObject<HTMLCanvasElement>;
30
- value: number;
31
- }
32
-
33
- export const TimelineValue: React.FC<Props> = ({ canvasRef, value }) => {
34
- const preValueLineRef = useRef(null);
35
- const valueLineRef = useRef(null);
36
- const postValueLineRef = useRef(null);
37
-
38
- const zoomContextValue: ZoomContextType = useContext(ZoomContext);
39
-
40
- const showValueLine = useCallback(() => {
41
- const canvas: HTMLCanvasElement = canvasRef.current!;
42
-
43
- const preValueLineElement: HTMLElement = preValueLineRef.current!;
44
- const valueLineElement: HTMLElement = valueLineRef.current!;
45
- const postValueLineElement: HTMLElement = postValueLineRef.current!;
46
-
47
- const valueLineWidth: number = getComputedElementWidth(valueLineElement);
48
- const linePosition: number = secondsToPixel(zoomContextValue, value);
49
- const valueLinePositionBeginningConsideringWidth: number =
50
- linePosition - valueLineWidth / 2;
51
-
52
- // configure preValueLineElement
53
- preValueLineElement.style.width = numberToPxString(
54
- valueLinePositionBeginningConsideringWidth,
55
- );
56
-
57
- // configure valueLineElement
58
- valueLineElement.style.left = numberToPxString(
59
- valueLinePositionBeginningConsideringWidth,
60
- );
61
-
62
- // configure postValueLineElement
63
- const postValueLinePosition =
64
- valueLinePositionBeginningConsideringWidth + valueLineWidth;
65
- const postValueLineWidth = canvas.width - postValueLinePosition;
66
- postValueLineElement.style.left = numberToPxString(postValueLinePosition);
67
- postValueLineElement.style.width = numberToPxString(postValueLineWidth);
68
- }, [canvasRef, value, zoomContextValue]);
69
-
70
- useEffect(() => {
71
- showValueLine();
72
- }, [showValueLine]);
73
-
74
- return (
75
- <>
76
- <PreValueLine
77
- ref={preValueLineRef}
78
- className={'media-timeline-pre-value-line'}
79
- />
80
- <ValueLine ref={valueLineRef} className={'media-timeline-value-line'} />
81
- <PostValueLine
82
- ref={postValueLineRef}
83
- className={'media-timeline-post-value-line'}
84
- />
85
- </>
86
- );
87
- };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
-
3
- export type ZoomContextType = {
4
- blockOffset: number;
5
- pixelsInSecond: number;
6
- timelineWrapperWidth: number;
7
- };
8
- export const ZoomContext = React.createContext<ZoomContextType>(
9
- null as unknown as ZoomContextType,
10
- );
@@ -1,13 +0,0 @@
1
- //[blockOffset, pixelsInSecond] when zoomLevel === 0, each block has an offset of 20 seconds, and each second has a width of 7px.
2
- export const zoomLevelConfigurations: number[][] = [
3
- [20, 7],
4
- [10, 10],
5
- [10, 15],
6
- [5, 20],
7
- [5, 25],
8
- [2, 35],
9
- [2, 50],
10
- [1, 60],
11
- [1, 75],
12
- [1, 90],
13
- ];
@@ -1,49 +0,0 @@
1
- import { ZoomContextType } from '../ZoomContext/ZoomContext';
2
-
3
- export const secondsToPixel = (
4
- zoomContextValue: ZoomContextType,
5
- seconds: number,
6
- ) => {
7
- return zoomContextValue.pixelsInSecond * seconds;
8
- };
9
-
10
- export const pixelToSeconds = (
11
- zoomContextValue: ZoomContextType,
12
- pixel: number,
13
- ) => {
14
- const seconds = pixel / zoomContextValue.pixelsInSecond;
15
- return Math.round((seconds + Number.EPSILON) * 100) / 100;
16
- };
17
-
18
- export const getComputedElementWidth = (element: HTMLElement): number => {
19
- const elementWidthCSSProperty: string = window
20
- .getComputedStyle(element)
21
- .getPropertyValue('width')
22
- .replace(/[^-\d]/g, '');
23
- return parseInt(elementWidthCSSProperty);
24
- };
25
-
26
- export const numberToPxString = (number: number): string => {
27
- return `${number}px`;
28
- };
29
-
30
- export const getTimelineWrapperWidth = (
31
- timeLineContainerWidth: number,
32
- zoomLevel: number,
33
- ): number => {
34
- return timeLineContainerWidth * Math.pow(1.25, zoomLevel) - 2; //-2px to account for the border
35
- };
36
-
37
- export function getBlockOffsetForZoomLevel(
38
- zoomLevel: number,
39
- duration: number,
40
- timelineWrapperWidth: number,
41
- ): number {
42
- const offsets = [10, 5, 5, 5, 2, 2, 2, 2, 2, 1];
43
-
44
- let optimalOffset = offsets[zoomLevel];
45
- while ((duration / optimalOffset) * 40 > timelineWrapperWidth) {
46
- optimalOffset = optimalOffset * 1.25;
47
- }
48
- return Math.ceil(optimalOffset);
49
- }
package/src/modules.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module '*.md';
@@ -1,71 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="react" />
3
- /// <reference types="react-dom" />
4
-
5
- declare namespace NodeJS {
6
- interface ProcessEnv {
7
- readonly NODE_ENV: 'development' | 'production' | 'test';
8
- readonly PUBLIC_URL: string;
9
- }
10
- }
11
-
12
- declare module '*.avif' {
13
- const src: string;
14
- export default src;
15
- }
16
-
17
- declare module '*.bmp' {
18
- const src: string;
19
- export default src;
20
- }
21
-
22
- declare module '*.gif' {
23
- const src: string;
24
- export default src;
25
- }
26
-
27
- declare module '*.jpg' {
28
- const src: string;
29
- export default src;
30
- }
31
-
32
- declare module '*.jpeg' {
33
- const src: string;
34
- export default src;
35
- }
36
-
37
- declare module '*.png' {
38
- const src: string;
39
- export default src;
40
- }
41
-
42
- declare module '*.webp' {
43
- const src: string;
44
- export default src;
45
- }
46
-
47
- declare module '*.svg' {
48
- import * as React from 'react';
49
-
50
- export const ReactComponent: React.FunctionComponent<React.SVGProps<
51
- SVGSVGElement
52
- > & { title?: string }>;
53
-
54
- const src: string;
55
- export default src;
56
- }
57
-
58
- declare module '*.module.css' {
59
- const classes: { readonly [key: string]: string };
60
- export default classes;
61
- }
62
-
63
- declare module '*.module.scss' {
64
- const classes: { readonly [key: string]: string };
65
- export default classes;
66
- }
67
-
68
- declare module '*.module.sass' {
69
- const classes: { readonly [key: string]: string };
70
- export default classes;
71
- }
@@ -1,37 +0,0 @@
1
- import 'react';
2
-
3
- declare module 'react' {
4
- interface FunctionComponent<P = {}> {
5
- __docgenInfo?: {
6
- description?: string;
7
- displayName?: string;
8
- props?: {
9
- [key: string]: {
10
- description?: string;
11
- required?: boolean;
12
- tsType?: {
13
- name: string;
14
- elements?: { name: string }[]; // Handle array types
15
- raw?: string;
16
- type?: string; // Handle various types
17
- };
18
- defaultValue?: {
19
- value: string;
20
- computed: boolean;
21
- };
22
- };
23
- };
24
- methods?: {
25
- name: string;
26
- type?: string; // Handle method types
27
- signature?: {
28
- arguments: {
29
- type: { name: string };
30
- name: string;
31
- }[];
32
- return: { name: string };
33
- }; // Handle method signatures
34
- }[];
35
- };
36
- }
37
- }
package/src/setupTests.ts DELETED
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';
@@ -1,364 +0,0 @@
1
- import { Meta } from "@storybook/blocks";
2
-
3
- import Github from "./assets/github.svg";
4
- import Discord from "./assets/discord.svg";
5
- import Youtube from "./assets/youtube.svg";
6
- import Tutorials from "./assets/tutorials.svg";
7
- import Styling from "./assets/styling.png";
8
- import Context from "./assets/context.png";
9
- import Assets from "./assets/assets.png";
10
- import Docs from "./assets/docs.png";
11
- import Share from "./assets/share.png";
12
- import FigmaPlugin from "./assets/figma-plugin.png";
13
- import Testing from "./assets/testing.png";
14
- import Accessibility from "./assets/accessibility.png";
15
- import Theming from "./assets/theming.png";
16
- import AddonLibrary from "./assets/addon-library.png";
17
-
18
- export const RightArrow = () => <svg
19
- viewBox="0 0 14 14"
20
- width="8px"
21
- height="14px"
22
- style={{
23
- marginLeft: '4px',
24
- display: 'inline-block',
25
- shapeRendering: 'inherit',
26
- verticalAlign: 'middle',
27
- fill: 'currentColor',
28
- 'path fill': 'currentColor'
29
- }}
30
- >
31
- <path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
32
- </svg>
33
-
34
- <Meta title="Configure your project" />
35
-
36
- <div className="sb-container">
37
- <div className='sb-section-title'>
38
- # Configure your project
39
-
40
- Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
41
- </div>
42
- <div className="sb-section">
43
- <div className="sb-section-item">
44
- <img
45
- src={Styling}
46
- alt="A wall of logos representing different styling technologies"
47
- />
48
- <h4 className="sb-section-item-heading">Add styling and CSS</h4>
49
- <p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
50
- <a
51
- href="https://storybook.js.org/docs/react/configure/styling-and-css"
52
- target="_blank"
53
- >Learn more<RightArrow /></a>
54
- </div>
55
- <div className="sb-section-item">
56
- <img
57
- src={Context}
58
- alt="An abstraction representing the composition of data for a component"
59
- />
60
- <h4 className="sb-section-item-heading">Provide context and mocking</h4>
61
- <p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
62
- <a
63
- href="https://storybook.js.org/docs/react/writing-stories/decorators#context-for-mocking"
64
- target="_blank"
65
- >Learn more<RightArrow /></a>
66
- </div>
67
- <div className="sb-section-item">
68
- <img src={Assets} alt="A representation of typography and image assets" />
69
- <div>
70
- <h4 className="sb-section-item-heading">Load assets and resources</h4>
71
- <p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
72
- `staticDirs` configuration option to specify folders to load when
73
- starting Storybook.</p>
74
- <a
75
- href="https://storybook.js.org/docs/react/configure/images-and-assets"
76
- target="_blank"
77
- >Learn more<RightArrow /></a>
78
- </div>
79
- </div>
80
- </div>
81
- </div>
82
- <div className="sb-container">
83
- <div className='sb-section-title'>
84
- # Do more with Storybook
85
-
86
- Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
87
- </div>
88
-
89
- <div className="sb-section">
90
- <div className="sb-features-grid">
91
- <div className="sb-grid-item">
92
- <img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
93
- <h4 className="sb-section-item-heading">Autodocs</h4>
94
- <p className="sb-section-item-paragraph">Auto-generate living,
95
- interactive reference documentation from your components and stories.</p>
96
- <a
97
- href="https://storybook.js.org/docs/react/writing-docs/autodocs"
98
- target="_blank"
99
- >Learn more<RightArrow /></a>
100
- </div>
101
- <div className="sb-grid-item">
102
- <img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
103
- <h4 className="sb-section-item-heading">Publish to Chromatic</h4>
104
- <p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
105
- <a
106
- href="https://storybook.js.org/docs/react/sharing/publish-storybook#publish-storybook-with-chromatic"
107
- target="_blank"
108
- >Learn more<RightArrow /></a>
109
- </div>
110
- <div className="sb-grid-item">
111
- <img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
112
- <h4 className="sb-section-item-heading">Figma Plugin</h4>
113
- <p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
114
- implementation in one place.</p>
115
- <a
116
- href="https://storybook.js.org/docs/react/sharing/design-integrations#embed-storybook-in-figma-with-the-plugin"
117
- target="_blank"
118
- >Learn more<RightArrow /></a>
119
- </div>
120
- <div className="sb-grid-item">
121
- <img src={Testing} alt="Screenshot of tests passing and failing" />
122
- <h4 className="sb-section-item-heading">Testing</h4>
123
- <p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
124
- complex.</p>
125
- <a
126
- href="https://storybook.js.org/docs/react/writing-tests"
127
- target="_blank"
128
- >Learn more<RightArrow /></a>
129
- </div>
130
- <div className="sb-grid-item">
131
- <img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
132
- <h4 className="sb-section-item-heading">Accessibility</h4>
133
- <p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
134
- <a
135
- href="https://storybook.js.org/docs/react/writing-tests/accessibility-testing"
136
- target="_blank"
137
- >Learn more<RightArrow /></a>
138
- </div>
139
- <div className="sb-grid-item">
140
- <img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
141
- <h4 className="sb-section-item-heading">Theming</h4>
142
- <p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
143
- <a
144
- href="https://storybook.js.org/docs/react/configure/theming"
145
- target="_blank"
146
- >Learn more<RightArrow /></a>
147
- </div>
148
- </div>
149
- </div>
150
- </div>
151
- <div className='sb-addon'>
152
- <div className='sb-addon-text'>
153
- <h4>Addons</h4>
154
- <p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
155
- <a
156
- href="https://storybook.js.org/integrations/"
157
- target="_blank"
158
- >Discover all addons<RightArrow /></a>
159
- </div>
160
- <div className='sb-addon-img'>
161
- <img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
162
- </div>
163
- </div>
164
-
165
- <div className="sb-section sb-socials">
166
- <div className="sb-section-item">
167
- <img src={Github} alt="Github logo" className="sb-explore-image"/>
168
- Join our contributors building the future of UI development.
169
-
170
- <a
171
- href="https://github.com/storybookjs/storybook"
172
- target="_blank"
173
- >Star on GitHub<RightArrow /></a>
174
- </div>
175
- <div className="sb-section-item">
176
- <img src={Discord} alt="Discord logo" className="sb-explore-image"/>
177
- <div>
178
- Get support and chat with frontend developers.
179
-
180
- <a
181
- href="https://discord.gg/storybook"
182
- target="_blank"
183
- >Join Discord server<RightArrow /></a>
184
- </div>
185
- </div>
186
- <div className="sb-section-item">
187
- <img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
188
- <div>
189
- Watch tutorials, feature previews and interviews.
190
-
191
- <a
192
- href="https://www.youtube.com/@chromaticui"
193
- target="_blank"
194
- >Watch on YouTube<RightArrow /></a>
195
- </div>
196
- </div>
197
- <div className="sb-section-item">
198
- <img src={Tutorials} alt="A book" className="sb-explore-image"/>
199
- <p>Follow guided walkthroughs on for key workflows.</p>
200
-
201
- <a
202
- href="https://storybook.js.org/tutorials/"
203
- target="_blank"
204
- >Discover tutorials<RightArrow /></a>
205
- </div>
206
- </div>
207
-
208
- <style>
209
- {`
210
- .sb-container {
211
- margin-bottom: 48px;
212
- }
213
-
214
- .sb-section {
215
- width: 100%;
216
- display: flex;
217
- flex-direction: row;
218
- gap: 20px;
219
- }
220
-
221
- img {
222
- object-fit: cover;
223
- }
224
-
225
- .sb-section-title {
226
- margin-bottom: 32px;
227
- }
228
-
229
- .sb-section a:not(h1 a, h2 a, h3 a) {
230
- font-size: 14px;
231
- }
232
-
233
- .sb-section-item, .sb-grid-item {
234
- flex: 1;
235
- display: flex;
236
- flex-direction: column;
237
- }
238
-
239
- .sb-section-item-heading {
240
- padding-top: 20px !important;
241
- padding-bottom: 5px !important;
242
- margin: 0 !important;
243
- }
244
- .sb-section-item-paragraph {
245
- margin: 0;
246
- padding-bottom: 10px;
247
- }
248
-
249
- .sb-chevron {
250
- margin-left: 5px;
251
- }
252
-
253
- .sb-features-grid {
254
- display: grid;
255
- grid-template-columns: repeat(2, 1fr);
256
- grid-gap: 32px 20px;
257
- }
258
-
259
- .sb-socials {
260
- display: grid;
261
- grid-template-columns: repeat(4, 1fr);
262
- }
263
-
264
- .sb-socials p {
265
- margin-bottom: 10px;
266
- }
267
-
268
- .sb-explore-image {
269
- max-height: 32px;
270
- align-self: flex-start;
271
- }
272
-
273
- .sb-addon {
274
- width: 100%;
275
- display: flex;
276
- align-items: center;
277
- position: relative;
278
- background-color: #EEF3F8;
279
- border-radius: 5px;
280
- border: 1px solid rgba(0, 0, 0, 0.05);
281
- background: #EEF3F8;
282
- height: 180px;
283
- margin-bottom: 48px;
284
- overflow: hidden;
285
- }
286
-
287
- .sb-addon-text {
288
- padding-left: 48px;
289
- max-width: 240px;
290
- }
291
-
292
- .sb-addon-text h4 {
293
- padding-top: 0px;
294
- }
295
-
296
- .sb-addon-img {
297
- position: absolute;
298
- left: 345px;
299
- top: 0;
300
- height: 100%;
301
- width: 200%;
302
- overflow: hidden;
303
- }
304
-
305
- .sb-addon-img img {
306
- width: 650px;
307
- transform: rotate(-15deg);
308
- margin-left: 40px;
309
- margin-top: -72px;
310
- box-shadow: 0 0 1px rgba(255, 255, 255, 0);
311
- backface-visibility: hidden;
312
- }
313
-
314
- @media screen and (max-width: 800px) {
315
- .sb-addon-img {
316
- left: 300px;
317
- }
318
- }
319
-
320
- @media screen and (max-width: 600px) {
321
- .sb-section {
322
- flex-direction: column;
323
- }
324
-
325
- .sb-features-grid {
326
- grid-template-columns: repeat(1, 1fr);
327
- }
328
-
329
- .sb-socials {
330
- grid-template-columns: repeat(2, 1fr);
331
- }
332
-
333
- .sb-addon {
334
- height: 280px;
335
- align-items: flex-start;
336
- padding-top: 32px;
337
- overflow: hidden;
338
- }
339
-
340
- .sb-addon-text {
341
- padding-left: 24px;
342
- }
343
-
344
- .sb-addon-img {
345
- right: 0;
346
- left: 0;
347
- top: 130px;
348
- bottom: 0;
349
- overflow: hidden;
350
- height: auto;
351
- width: 124%;
352
- }
353
-
354
- .sb-addon-img img {
355
- width: 1200px;
356
- transform: rotate(-12deg);
357
- margin-left: 0;
358
- margin-top: 48px;
359
- margin-bottom: -40px;
360
- margin-left: -24px;
361
- }
362
- }
363
- `}
364
- </style>
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Meta, StoryFn } from '@storybook/react';
3
- import { ReproductionWidget, ReproductionWidgetProps } from '../components/reproduction-widget';
4
-
5
- export default {
6
- title: 'ReproductionWidget',
7
- component: ReproductionWidget,
8
- argTypes: {
9
- onInit: { action: 'initiated' },
10
- },
11
- } as Meta;
12
-
13
- const Template: StoryFn<ReproductionWidgetProps> = (args: ReproductionWidgetProps) => (
14
- <ReproductionWidget
15
- {...args}
16
- />
17
- );
18
- export const Default = Template.bind({});
19
- Default.args = {
20
- trainingMode: true,
21
- videoId: 'jFI-RBqXzhU',
22
- onInit: (reproduction) => { reproduction.start() }
23
- };
@@ -1,29 +0,0 @@
1
- #storybook-root .this-class-redefines-styles {
2
- background-color: transparent;
3
- }
4
-
5
- #storybook-root .minimalist {
6
- background-color: transparent;
7
- border: 0;
8
- }
9
-
10
- #storybook-root .minimalist > canvas {
11
- color: transparent;
12
- }
13
-
14
- #storybook-root .minimalist > div > .media-timeline-pre-value-line {
15
- height: 4px;
16
- background-color: greenyellow;
17
- }
18
-
19
- #storybook-root .minimalist > div > .media-timeline-value-line {
20
- height: 10px;
21
- width: 10px;
22
- background-color: greenyellow;
23
- border-radius: 10px;
24
- }
25
-
26
- #storybook-root .minimalist > div > .media-timeline-post-value-line {
27
- height: 4px;
28
- background-color: rgba(10, 10, 10, 0.24);
29
- }