@100mslive/roomkit-react 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/dist/Accordion/Accordion.d.ts +964 -0
- package/dist/Accordion/index.d.ts +979 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js +39 -0
- package/dist/ActiveSpeakerView-H3VYXANB.js.map +7 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css +11 -0
- package/dist/ActiveSpeakerView-REZLWPPI.css.map +7 -0
- package/dist/AudioLevel/AudioLevel.d.ts +8 -0
- package/dist/AudioLevel/index.d.ts +1 -0
- package/dist/Avatar/Avatar.d.ts +487 -0
- package/dist/Avatar/getAvatarBg.d.ts +7 -0
- package/dist/Avatar/index.d.ts +1 -0
- package/dist/Button/Button.d.ts +488 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Checkbox/Checkbox.d.ts +958 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Collapsible/Collapsible.d.ts +1434 -0
- package/dist/Collapsible/index.d.ts +1 -0
- package/dist/Divider/Divider.d.ts +958 -0
- package/dist/Divider/index.d.ts +1 -0
- package/dist/Dropdown/Dropdown.d.ts +5728 -0
- package/dist/Dropdown/index.d.ts +1 -0
- package/dist/Fieldset/Fieldset.d.ts +477 -0
- package/dist/Fieldset/index.d.ts +1 -0
- package/dist/Footer/Footer.d.ts +3834 -0
- package/dist/Footer/index.d.ts +1 -0
- package/dist/HLSView-3RDXRV7Y.js +689 -0
- package/dist/HLSView-3RDXRV7Y.js.map +7 -0
- package/dist/HLSView-6BVBCQM7.css +11 -0
- package/dist/HLSView-6BVBCQM7.css.map +7 -0
- package/dist/IconButton/IconButton.d.ts +479 -0
- package/dist/IconButton/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +2917 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Label/Label.d.ts +479 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/Layout/Box.d.ts +477 -0
- package/dist/Layout/Flex.d.ts +482 -0
- package/dist/Layout/index.d.ts +2 -0
- package/dist/Link/Link.d.ts +489 -0
- package/dist/Link/index.d.ts +2 -0
- package/dist/Loading/Loading.d.ts +14 -0
- package/dist/Loading/index.d.ts +1 -0
- package/dist/Modal/Dialog.d.ts +3826 -0
- package/dist/Modal/DialogContent.d.ts +3343 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Pagination/StyledPagination.d.ts +1918 -0
- package/dist/Pagination/index.d.ts +1 -0
- package/dist/PinnedTrackView-453PELNU.js +70 -0
- package/dist/PinnedTrackView-453PELNU.js.map +7 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css +11 -0
- package/dist/PinnedTrackView-QQ5FDXJX.css.map +7 -0
- package/dist/Popover/index.d.ts +1436 -0
- package/dist/Progress/index.d.ts +957 -0
- package/dist/QRCode/QRCode.d.ts +3 -0
- package/dist/QRCode/index.d.ts +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +1435 -0
- package/dist/RadioGroup/index.d.ts +1 -0
- package/dist/ReactSelect/ReactSelect.d.ts +4778 -0
- package/dist/ReactSelect/index.d.ts +1 -0
- package/dist/Select/Select.d.ts +1437 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Slider/Slider.d.ts +488 -0
- package/dist/Slider/index.d.ts +1 -0
- package/dist/Stats/Stats.d.ts +19 -0
- package/dist/Stats/StyledStats.d.ts +2872 -0
- package/dist/Stats/formatBytes.d.ts +1 -0
- package/dist/Stats/index.d.ts +1 -0
- package/dist/Switch/Switch.d.ts +482 -0
- package/dist/Switch/index.d.ts +1 -0
- package/dist/Tabs/Tabs.d.ts +1912 -0
- package/dist/Tabs/index.d.ts +1 -0
- package/dist/Text/Text.d.ts +605 -0
- package/dist/Text/index.d.ts +1 -0
- package/dist/Theme/ThemeProvider.d.ts +397 -0
- package/dist/Theme/base.config.d.ts +417 -0
- package/dist/Theme/index.d.ts +3 -0
- package/dist/Theme/stitches.config.d.ts +4702 -0
- package/dist/Theme/themes.d.ts +64 -0
- package/dist/Theme/useSSR.d.ts +6 -0
- package/dist/TileMenu/StyledMenuTile.d.ts +3351 -0
- package/dist/TileMenu/TileMenu.d.ts +6 -0
- package/dist/TileMenu/index.d.ts +1 -0
- package/dist/Toast/Toast.d.ts +2881 -0
- package/dist/Toast/index.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts +14 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Video/Video.d.ts +499 -0
- package/dist/Video/index.d.ts +1 -0
- package/dist/VideoList/StyledVideoList.d.ts +1438 -0
- package/dist/VideoList/index.d.ts +2 -0
- package/dist/VideoList/videoListUtils.d.ts +1 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +4309 -0
- package/dist/VideoTile/index.d.ts +1 -0
- package/dist/VirtualBackground-LHYBWUT5.js +158 -0
- package/dist/VirtualBackground-LHYBWUT5.js.map +7 -0
- package/dist/chunk-7YUYZ64D.js +6843 -0
- package/dist/chunk-7YUYZ64D.js.map +7 -0
- package/dist/chunk-HCAGFNXW.js +8270 -0
- package/dist/chunk-HCAGFNXW.js.map +7 -0
- package/dist/chunk-KYYP6ZVK.js +907 -0
- package/dist/chunk-KYYP6ZVK.js.map +7 -0
- package/dist/chunk-ULXGBUSC.js +65 -0
- package/dist/chunk-ULXGBUSC.js.map +7 -0
- package/dist/chunk-XRJXE6UO.js +243 -0
- package/dist/chunk-XRJXE6UO.js.map +7 -0
- package/dist/conference-IDNRO4WK.js +3812 -0
- package/dist/conference-IDNRO4WK.js.map +7 -0
- package/dist/conference-KN6OKGDU.css +11 -0
- package/dist/conference-KN6OKGDU.css.map +7 -0
- package/dist/fixtures/chats.d.ts +4 -0
- package/dist/fixtures/peers.d.ts +3 -0
- package/dist/fixtures/tracks.d.ts +2 -0
- package/dist/index.cjs.css +11 -0
- package/dist/index.cjs.css.map +7 -0
- package/dist/index.cjs.js +22987 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.css +11 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +133 -0
- package/dist/index.js.map +7 -0
- package/dist/meta.cjs.json +13085 -0
- package/dist/meta.esbuild.json +13693 -0
- package/dist/transcription-BTSB7FZH.js +356 -0
- package/dist/transcription-BTSB7FZH.js.map +7 -0
- package/dist/utils/animations.d.ts +92 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/styles.d.ts +21 -0
- package/package.json +116 -0
- package/src/Accordion/Accordion.stories.tsx +50 -0
- package/src/Accordion/Accordion.tsx +88 -0
- package/src/Accordion/index.ts +8 -0
- package/src/AudioLevel/AudioLevel.tsx +34 -0
- package/src/AudioLevel/index.ts +1 -0
- package/src/Avatar/Avatar.stories.tsx +33 -0
- package/src/Avatar/Avatar.tsx +55 -0
- package/src/Avatar/getAvatarBg.ts +46 -0
- package/src/Avatar/index.ts +1 -0
- package/src/Button/Button.mdx +43 -0
- package/src/Button/Button.stories.tsx +52 -0
- package/src/Button/Button.tsx +144 -0
- package/src/Button/index.tsx +1 -0
- package/src/Chat/Chat.mdx +39 -0
- package/src/Chat/Chat.stories.tsx +39 -0
- package/src/Checkbox/Checkbox.stories.tsx +61 -0
- package/src/Checkbox/Checkbox.tsx +33 -0
- package/src/Checkbox/index.tsx +1 -0
- package/src/Collapsible/Collapsible.tsx +34 -0
- package/src/Collapsible/index.tsx +1 -0
- package/src/Divider/Divider.tsx +45 -0
- package/src/Divider/HorizontalDivider.stories.tsx +34 -0
- package/src/Divider/VerticalDivider.stories.tsx +40 -0
- package/src/Divider/index.ts +1 -0
- package/src/Dropdown/Dropdown.stories.tsx +94 -0
- package/src/Dropdown/Dropdown.tsx +142 -0
- package/src/Dropdown/index.tsx +1 -0
- package/src/Fieldset/Fieldset.stories.tsx +29 -0
- package/src/Fieldset/Fieldset.tsx +11 -0
- package/src/Fieldset/index.tsx +1 -0
- package/src/Footer/Footer.stories.tsx +61 -0
- package/src/Footer/Footer.tsx +47 -0
- package/src/Footer/index.tsx +1 -0
- package/src/IconButton/IconButton.tsx +45 -0
- package/src/IconButton/index.tsx +1 -0
- package/src/Icons/Icons.stories.mdx +10 -0
- package/src/Icons/IconsList.jsx +17 -0
- package/src/Input/Input.stories.tsx +25 -0
- package/src/Input/Input.tsx +105 -0
- package/src/Input/PasswordInput.stories.tsx +53 -0
- package/src/Input/index.tsx +1 -0
- package/src/Introduction/Integrating.stories.mdx +100 -0
- package/src/Introduction/Introduction.stories.mdx +9 -0
- package/src/Label/Label.tsx +8 -0
- package/src/Label/index.ts +1 -0
- package/src/Layout/Box.tsx +3 -0
- package/src/Layout/Flex.tsx +76 -0
- package/src/Layout/index.tsx +2 -0
- package/src/Link/Link.stories.tsx +18 -0
- package/src/Link/Link.tsx +54 -0
- package/src/Link/index.tsx +2 -0
- package/src/Loading/Loading.mdx +15 -0
- package/src/Loading/Loading.stories.tsx +37 -0
- package/src/Loading/Loading.tsx +33 -0
- package/src/Loading/index.ts +1 -0
- package/src/Modal/Dialog.mdx +19 -0
- package/src/Modal/Dialog.stories.tsx +68 -0
- package/src/Modal/Dialog.tsx +26 -0
- package/src/Modal/DialogContent.tsx +63 -0
- package/src/Modal/index.ts +1 -0
- package/src/Pagination/StyledPagination.stories.tsx +80 -0
- package/src/Pagination/StyledPagination.tsx +68 -0
- package/src/Pagination/index.tsx +1 -0
- package/src/Popover/Popover.mdx +9 -0
- package/src/Popover/Popover.stories.tsx +95 -0
- package/src/Popover/index.tsx +26 -0
- package/src/Prebuilt/App.jsx +273 -0
- package/src/Prebuilt/AppContext.jsx +21 -0
- package/src/Prebuilt/IconButton.jsx +19 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +20 -0
- package/src/Prebuilt/common/PeersSorter.js +89 -0
- package/src/Prebuilt/common/constants.js +208 -0
- package/src/Prebuilt/common/hooks.js +47 -0
- package/src/Prebuilt/common/roles.js +4 -0
- package/src/Prebuilt/common/useSortedPeers.js +28 -0
- package/src/Prebuilt/common/utils.js +91 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +189 -0
- package/src/Prebuilt/components/AppData/useAppConfig.js +7 -0
- package/src/Prebuilt/components/AppData/useAppLayout.js +6 -0
- package/src/Prebuilt/components/AppData/useChatState.js +18 -0
- package/src/Prebuilt/components/AppData/useSidepane.js +49 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +164 -0
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +16 -0
- package/src/Prebuilt/components/AudioVideoToggle.jsx +67 -0
- package/src/Prebuilt/components/AuthToken.jsx +133 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +96 -0
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +46 -0
- package/src/Prebuilt/components/Chat/Chat.jsx +155 -0
- package/src/Prebuilt/components/Chat/ChatBody.jsx +370 -0
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +150 -0
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +67 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +162 -0
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +30 -0
- package/src/Prebuilt/components/Chat/useUnreadCount.js +17 -0
- package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +80 -0
- package/src/Prebuilt/components/Connection/TileConnection.jsx +40 -0
- package/src/Prebuilt/components/Connection/connectionQualityUtils.js +39 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +138 -0
- package/src/Prebuilt/components/ErrorBoundary.jsx +105 -0
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +50 -0
- package/src/Prebuilt/components/Footer/ChatToggle.jsx +27 -0
- package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +104 -0
- package/src/Prebuilt/components/Footer/StreamingFooter.jsx +71 -0
- package/src/Prebuilt/components/Footer.jsx +8 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +11 -0
- package/src/Prebuilt/components/GoLiveButton.jsx +45 -0
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +21 -0
- package/src/Prebuilt/components/HMSVideo/FullscreenButton.jsx +18 -0
- package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.jsx +35 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +82 -0
- package/src/Prebuilt/components/HMSVideo/HMSVIdeoUtils.js +27 -0
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +11 -0
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +13 -0
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +77 -0
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +31 -0
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +39 -0
- package/src/Prebuilt/components/HMSVideo/index.js +19 -0
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +217 -0
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +88 -0
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +29 -0
- package/src/Prebuilt/components/Header/Header.jsx +8 -0
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +41 -0
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +91 -0
- package/src/Prebuilt/components/Header/ParticipantList.jsx +337 -0
- package/src/Prebuilt/components/Header/StreamActions.jsx +225 -0
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +55 -0
- package/src/Prebuilt/components/Header/index.jsx +1 -0
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +101 -0
- package/src/Prebuilt/components/Image.jsx +7 -0
- package/src/Prebuilt/components/Input/KeyboardInputManager.js +107 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +202 -0
- package/src/Prebuilt/components/MetaActions.jsx +45 -0
- package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +139 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +92 -0
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +67 -0
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +106 -0
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +29 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +225 -0
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +90 -0
- package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx +38 -0
- package/src/Prebuilt/components/Notifications/InitErrorModal.jsx +39 -0
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +25 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +151 -0
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +45 -0
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +67 -0
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +69 -0
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx +51 -0
- package/src/Prebuilt/components/Notifications/TrackNotifications.jsx +19 -0
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx +49 -0
- package/src/Prebuilt/components/Notifications/index.jsx +1 -0
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +82 -0
- package/src/Prebuilt/components/PIP/PIPManager.js +296 -0
- package/src/Prebuilt/components/PIP/SetupMediaSession.js +60 -0
- package/src/Prebuilt/components/PIP/index.jsx +11 -0
- package/src/Prebuilt/components/PIP/pip.test.js +72 -0
- package/src/Prebuilt/components/PIP/pipUtils.js +183 -0
- package/src/Prebuilt/components/Pagination.jsx +29 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +129 -0
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +172 -0
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +51 -0
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +95 -0
- package/src/Prebuilt/components/PostLeave.jsx +76 -0
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +51 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +196 -0
- package/src/Prebuilt/components/Preview/PreviewName.jsx +37 -0
- package/src/Prebuilt/components/RoleChangeModal.jsx +185 -0
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +26 -0
- package/src/Prebuilt/components/ScreenShare.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +45 -0
- package/src/Prebuilt/components/ScreenshareHintModal.jsx +37 -0
- package/src/Prebuilt/components/ScreenshareTile.jsx +91 -0
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +220 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +91 -0
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +61 -0
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +171 -0
- package/src/Prebuilt/components/Settings/StartRecording.jsx +130 -0
- package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +40 -0
- package/src/Prebuilt/components/Settings/common.js +15 -0
- package/src/Prebuilt/components/ShareMenuIcon.jsx +26 -0
- package/src/Prebuilt/components/StatsForNerds.jsx +250 -0
- package/src/Prebuilt/components/Streaming/Common.jsx +132 -0
- package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +226 -0
- package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +24 -0
- package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +336 -0
- package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +88 -0
- package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +76 -0
- package/src/Prebuilt/components/TileMenu.jsx +275 -0
- package/src/Prebuilt/components/Toast/Toast.jsx +17 -0
- package/src/Prebuilt/components/Toast/ToastBatcher.js +57 -0
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +134 -0
- package/src/Prebuilt/components/Toast/ToastContainer.jsx +30 -0
- package/src/Prebuilt/components/Toast/ToastManager.js +44 -0
- package/src/Prebuilt/components/VideoList.jsx +101 -0
- package/src/Prebuilt/components/VideoTile.jsx +177 -0
- package/src/Prebuilt/components/conference.jsx +164 -0
- package/src/Prebuilt/components/gridView.jsx +85 -0
- package/src/Prebuilt/components/hooks/useDropdownList.jsx +23 -0
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +6 -0
- package/src/Prebuilt/components/hooks/useFeatures.js +22 -0
- package/src/Prebuilt/components/hooks/useFullscreen.js +43 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +52 -0
- package/src/Prebuilt/components/hooks/useNavigation.js +19 -0
- package/src/Prebuilt/components/hooks/usePlaylist.js +25 -0
- package/src/Prebuilt/components/hooks/usePlaylistMusic.js +35 -0
- package/src/Prebuilt/components/hooks/useScreenshareAudio.js +28 -0
- package/src/Prebuilt/components/hooks/useSetPinnedMessage.js +38 -0
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +20 -0
- package/src/Prebuilt/components/hooks/useUserPreferences.jsx +25 -0
- package/src/Prebuilt/components/init/Init.jsx +58 -0
- package/src/Prebuilt/components/init/initUtils.js +90 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +29 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +108 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +31 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +32 -0
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +233 -0
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +89 -0
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +85 -0
- package/src/Prebuilt/components/peerTileUtils.jsx +27 -0
- package/src/Prebuilt/hms.js +7 -0
- package/src/Prebuilt/images/first_person.png +0 -0
- package/src/Prebuilt/index.d.ts +15 -0
- package/src/Prebuilt/index.js +2 -0
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +34 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +141 -0
- package/src/Prebuilt/layouts/HLSView.jsx +290 -0
- package/src/Prebuilt/layouts/InsetView.jsx +222 -0
- package/src/Prebuilt/layouts/NonPublisherView.jsx +51 -0
- package/src/Prebuilt/layouts/PDFView.jsx +122 -0
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +59 -0
- package/src/Prebuilt/layouts/SidePane.jsx +51 -0
- package/src/Prebuilt/layouts/WaitingView.jsx +51 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +66 -0
- package/src/Prebuilt/layouts/mainGridView.jsx +98 -0
- package/src/Prebuilt/layouts/mainView.jsx +113 -0
- package/src/Prebuilt/layouts/screenShareView.jsx +185 -0
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +132 -0
- package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +18 -0
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +90 -0
- package/src/Prebuilt/plugins/VirtualBackground/vbutils.js +66 -0
- package/src/Prebuilt/plugins/confetti.jsx +60 -0
- package/src/Prebuilt/plugins/transcription/Transcriber.js +216 -0
- package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +138 -0
- package/src/Prebuilt/plugins/transcription/index.jsx +1 -0
- package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +110 -0
- package/src/Prebuilt/plugins/whiteboard/README.md +29 -0
- package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +43 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +12 -0
- package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +11 -0
- package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +8 -0
- package/src/Prebuilt/plugins/whiteboard/index.js +3 -0
- package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +212 -0
- package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +47 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +280 -0
- package/src/Prebuilt/primitives/DropdownTrigger.jsx +46 -0
- package/src/Prebuilt/services/FeatureFlags.jsx +47 -0
- package/src/Prebuilt/services/tokenService.js +49 -0
- package/src/Progress/index.tsx +17 -0
- package/src/QRCode/QRCode.mdx +9 -0
- package/src/QRCode/QRCode.stories.tsx +29 -0
- package/src/QRCode/QRCode.tsx +6 -0
- package/src/QRCode/index.tsx +1 -0
- package/src/RadioGroup/RadioGroup.stories.tsx +32 -0
- package/src/RadioGroup/RadioGroup.tsx +33 -0
- package/src/RadioGroup/index.tsx +1 -0
- package/src/ReactSelect/ReactSelect.stories.tsx +83 -0
- package/src/ReactSelect/ReactSelect.tsx +97 -0
- package/src/ReactSelect/index.ts +1 -0
- package/src/Select/Select.stories.tsx +33 -0
- package/src/Select/Select.tsx +63 -0
- package/src/Select/index.ts +1 -0
- package/src/Slider/Slider.stories.tsx +21 -0
- package/src/Slider/Slider.tsx +70 -0
- package/src/Slider/index.ts +1 -0
- package/src/Stats/Stats.tsx +211 -0
- package/src/Stats/StyledStats.tsx +57 -0
- package/src/Stats/formatBytes.ts +19 -0
- package/src/Stats/index.tsx +1 -0
- package/src/Switch/Switch.mdx +11 -0
- package/src/Switch/Switch.stories.tsx +46 -0
- package/src/Switch/Switch.tsx +52 -0
- package/src/Switch/index.ts +1 -0
- package/src/Tabs/Tabs.stories.tsx +77 -0
- package/src/Tabs/Tabs.tsx +41 -0
- package/src/Tabs/index.tsx +1 -0
- package/src/Text/Text.stories.tsx +21 -0
- package/src/Text/Text.tsx +149 -0
- package/src/Text/index.tsx +1 -0
- package/src/Theme/Theme.stories.mdx +8 -0
- package/src/Theme/ThemeProvider.tsx +104 -0
- package/src/Theme/ThemeStory.jsx +58 -0
- package/src/Theme/base.config.ts +264 -0
- package/src/Theme/index.tsx +3 -0
- package/src/Theme/stitches.config.ts +100 -0
- package/src/Theme/themes.ts +70 -0
- package/src/Theme/useSSR.tsx +24 -0
- package/src/TileMenu/StyledMenuTile.tsx +101 -0
- package/src/TileMenu/TileMenu.tsx +96 -0
- package/src/TileMenu/index.tsx +1 -0
- package/src/Toast/AppToast.stories.tsx +56 -0
- package/src/Toast/Toast.mdx +19 -0
- package/src/Toast/Toast.stories.tsx +57 -0
- package/src/Toast/Toast.tsx +168 -0
- package/src/Toast/index.tsx +1 -0
- package/src/Tooltip/Tooltip.stories.tsx +62 -0
- package/src/Tooltip/Tooltip.tsx +79 -0
- package/src/Tooltip/index.ts +1 -0
- package/src/Video/UseVideo.mdx +22 -0
- package/src/Video/UseVideo.stories.tsx +26 -0
- package/src/Video/Video.mdx +24 -0
- package/src/Video/Video.stories.tsx +27 -0
- package/src/Video/Video.tsx +61 -0
- package/src/Video/index.tsx +1 -0
- package/src/VideoList/StyledVideoList.tsx +39 -0
- package/src/VideoList/VideoList.stories.tsx +92 -0
- package/src/VideoList/index.tsx +2 -0
- package/src/VideoList/videoListUtils.tsx +20 -0
- package/src/VideoTile/StyledVideoTile.tsx +148 -0
- package/src/VideoTile/VideoTile.mdx +28 -0
- package/src/VideoTile/VideoTile.stories.tsx +32 -0
- package/src/VideoTile/index.tsx +1 -0
- package/src/fixtures/chats.ts +25 -0
- package/src/fixtures/peers.ts +24 -0
- package/src/fixtures/tracks.ts +11 -0
- package/src/index.ts +38 -0
- package/src/store/SetupFakeStore.ts +33 -0
- package/src/store/StorybookSDK.ts +229 -0
- package/src/utils/animations.ts +90 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/styles.ts +22 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
import React, { ComponentProps, PropsWithChildren, PropsWithRef } from 'react';
|
2
|
+
import { CSS } from '@stitches/react';
|
3
|
+
import { CopyIcon, EyeCloseIcon, EyeOpenIcon } from '@100mslive/react-icons';
|
4
|
+
import { Flex } from '../Layout';
|
5
|
+
import { styled } from '../Theme';
|
6
|
+
|
7
|
+
export const Input = styled('input', {
|
8
|
+
fontFamily: '$sans',
|
9
|
+
lineHeight: 'inherit',
|
10
|
+
backgroundColor: '$surfaceLight',
|
11
|
+
borderRadius: '8px',
|
12
|
+
outline: 'none',
|
13
|
+
border: '1px solid $borderLight',
|
14
|
+
padding: '0.5rem 0.75rem',
|
15
|
+
color: '$textPrimary',
|
16
|
+
fontSize: '$md',
|
17
|
+
'&:focus': {
|
18
|
+
boxShadow: '0 0 0 1px $colors$borderAccent',
|
19
|
+
border: '1px solid transparent',
|
20
|
+
},
|
21
|
+
'&::placeholder': {
|
22
|
+
color: '$textDisabled',
|
23
|
+
},
|
24
|
+
variants: {
|
25
|
+
error: {
|
26
|
+
true: {
|
27
|
+
'&:focus': {
|
28
|
+
boxShadow: '0 0 0 3px $colors$error',
|
29
|
+
},
|
30
|
+
},
|
31
|
+
},
|
32
|
+
},
|
33
|
+
});
|
34
|
+
|
35
|
+
const PasswordRoot = styled('div', {
|
36
|
+
w: '100%',
|
37
|
+
position: 'relative',
|
38
|
+
display: 'flex',
|
39
|
+
});
|
40
|
+
|
41
|
+
const PasswordShowIcon: React.FC<ComponentProps<typeof Flex> & { showPassword?: boolean; css?: CSS }> = ({
|
42
|
+
showPassword,
|
43
|
+
css,
|
44
|
+
...props
|
45
|
+
}) => {
|
46
|
+
return (
|
47
|
+
<Flex css={{ ...css }} {...props}>
|
48
|
+
{showPassword ? <EyeOpenIcon /> : <EyeCloseIcon />}
|
49
|
+
</Flex>
|
50
|
+
);
|
51
|
+
};
|
52
|
+
|
53
|
+
const PasswordCopyIcon: React.FC<ComponentProps<typeof Flex & { css?: CSS }>> = ({ css, ...props }) => {
|
54
|
+
return (
|
55
|
+
<Flex css={{ ...css }} {...props}>
|
56
|
+
<CopyIcon />
|
57
|
+
</Flex>
|
58
|
+
);
|
59
|
+
};
|
60
|
+
|
61
|
+
const PasswordIcons = React.forwardRef<HTMLDivElement, PropsWithChildren<ComponentProps<typeof Flex & { css?: CSS }>>>(
|
62
|
+
({ css, ...props }, ref) => {
|
63
|
+
return (
|
64
|
+
<Flex
|
65
|
+
css={{
|
66
|
+
position: 'absolute',
|
67
|
+
top: 0,
|
68
|
+
height: '100%',
|
69
|
+
zIndex: 10,
|
70
|
+
right: '$4',
|
71
|
+
bg: '$surfaceLight',
|
72
|
+
alignItems: 'center',
|
73
|
+
...css,
|
74
|
+
}}
|
75
|
+
ref={ref}
|
76
|
+
{...props}
|
77
|
+
>
|
78
|
+
{props.children}
|
79
|
+
</Flex>
|
80
|
+
);
|
81
|
+
},
|
82
|
+
);
|
83
|
+
|
84
|
+
const ReactInput: React.FC<PropsWithRef<ComponentProps<typeof Input> & { showPassword?: boolean; css?: CSS }>> =
|
85
|
+
React.forwardRef<
|
86
|
+
HTMLInputElement,
|
87
|
+
PropsWithRef<ComponentProps<typeof Input> & { showPassword?: boolean; css?: CSS }>
|
88
|
+
>(({ showPassword = false, css, ...props }, ref) => {
|
89
|
+
return (
|
90
|
+
<Input
|
91
|
+
css={{ flexGrow: 1, width: '100%', ...css }}
|
92
|
+
type={showPassword ? 'text' : 'password'}
|
93
|
+
{...props}
|
94
|
+
ref={ref}
|
95
|
+
/>
|
96
|
+
);
|
97
|
+
});
|
98
|
+
|
99
|
+
export const PasswordInput = {
|
100
|
+
Root: PasswordRoot,
|
101
|
+
Icons: PasswordIcons,
|
102
|
+
Input: ReactInput,
|
103
|
+
ShowIcon: PasswordShowIcon,
|
104
|
+
CopyIcon: PasswordCopyIcon,
|
105
|
+
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useMeasure } from 'react-use';
|
3
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
4
|
+
import { Box } from '../Layout';
|
5
|
+
import { PasswordInput } from './Input';
|
6
|
+
|
7
|
+
export default {
|
8
|
+
title: 'UI Components/PasswordInput',
|
9
|
+
component: PasswordInput.Root,
|
10
|
+
argTypes: {
|
11
|
+
css: { control: 'object' },
|
12
|
+
},
|
13
|
+
} as ComponentMeta<typeof PasswordInput.Root>;
|
14
|
+
|
15
|
+
//👇 We create a “template” of how args map to rendering
|
16
|
+
const Template: ComponentStory<typeof PasswordInput.Root> = args => {
|
17
|
+
const [text, setText] = React.useState('');
|
18
|
+
const [showPassword, setShowPassword] = React.useState(false);
|
19
|
+
const [ref, { width }] = useMeasure<HTMLDivElement>();
|
20
|
+
return (
|
21
|
+
<Box css={{ w: '240px' }}>
|
22
|
+
<PasswordInput.Root {...args}>
|
23
|
+
<PasswordInput.Input
|
24
|
+
css={{ pr: width + 8 }}
|
25
|
+
showPassword={showPassword}
|
26
|
+
onChange={e => setText(e.target.value)}
|
27
|
+
/>
|
28
|
+
<PasswordInput.Icons ref={ref} css={{ bg: '$transparent' }}>
|
29
|
+
<PasswordInput.ShowIcon
|
30
|
+
showPassword={showPassword}
|
31
|
+
onClick={() => {
|
32
|
+
setShowPassword(!showPassword);
|
33
|
+
}}
|
34
|
+
css={{
|
35
|
+
color: '$textPrimary',
|
36
|
+
}}
|
37
|
+
/>
|
38
|
+
<PasswordInput.CopyIcon
|
39
|
+
onClick={() => {
|
40
|
+
navigator.clipboard.writeText(text);
|
41
|
+
}}
|
42
|
+
css={{
|
43
|
+
color: '$textPrimary',
|
44
|
+
}}
|
45
|
+
/>
|
46
|
+
</PasswordInput.Icons>
|
47
|
+
</PasswordInput.Root>
|
48
|
+
</Box>
|
49
|
+
);
|
50
|
+
};
|
51
|
+
|
52
|
+
export const Example = Template.bind({});
|
53
|
+
Example.storyName = 'PasswordInput';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Input';
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Introduction/Integrating The SDK" />
|
4
|
+
|
5
|
+
## Installing our libraries
|
6
|
+
|
7
|
+
You can use either npm or yarn to install the dependencies. Please install the respective libraries depending on whether
|
8
|
+
you're planning to use with react or other framework/plain JavaScript.
|
9
|
+
|
10
|
+
```bash
|
11
|
+
npm install --save @100mslive/hms-video @100mslive/hms-video-store
|
12
|
+
```
|
13
|
+
|
14
|
+
```bash
|
15
|
+
## npm
|
16
|
+
npm install --save @100mslive/react-sdk@latest
|
17
|
+
## yarn
|
18
|
+
yarn add @100mslive/react-sdk@latest
|
19
|
+
```
|
20
|
+
|
21
|
+
Via CDN:
|
22
|
+
|
23
|
+
```
|
24
|
+
https://cdn.skypack.dev/@100mslive/hms-video
|
25
|
+
https://cdn.skypack.dev/@100mslive/hms-video-store
|
26
|
+
```
|
27
|
+
|
28
|
+
## Setting up the sdk
|
29
|
+
|
30
|
+
Our core SDK can be used with plain JavaScript or any UI framework. We also provide a convenient hooks based interface
|
31
|
+
in case you're planning to integrate our SDK in a React app. Please follow the appropriate section below.
|
32
|
+
|
33
|
+
### JavaScript
|
34
|
+
|
35
|
+
There are three entities which we need to be familiar of -
|
36
|
+
|
37
|
+
- `hmsStore` - this contains the complete state of the room at any given time. This includes for example, participant details,
|
38
|
+
messages and track states.
|
39
|
+
- `hmsActions` - this is used to perform any action such as joining, muting and sending a message.
|
40
|
+
- `hmsNotifications` - this can be used to get notified on peer join/leave and new messages in order to show toast notifications to
|
41
|
+
the user.
|
42
|
+
|
43
|
+
Let's create a `hms.js` file where we initialize and export the above entities, so they can be used as required. We'll assume that
|
44
|
+
this setup is in place in other sections of the documentation.
|
45
|
+
|
46
|
+
```js
|
47
|
+
import { HMSReactiveStore } from '@100mslive/hms-video-store';
|
48
|
+
|
49
|
+
const hms = new HMSReactiveStore();
|
50
|
+
|
51
|
+
// by default subscriber is notified about store changes post subscription only, this can be
|
52
|
+
// changed to call it right after subscribing too using this function.
|
53
|
+
hms.triggerOnSubscribe(); // optional, recommended
|
54
|
+
|
55
|
+
const hmsActions = hms.getHMSActions();
|
56
|
+
const hmsStore = hms.getStore();
|
57
|
+
const hmsNotifications = hms.getNotifications();
|
58
|
+
|
59
|
+
export { hmsActions, hmsStore, hmsNotifications };
|
60
|
+
```
|
61
|
+
|
62
|
+
```js:some_other_file.js
|
63
|
+
import { hmsActions, hmsStore, hmsNotifications } from './hms';
|
64
|
+
```
|
65
|
+
|
66
|
+
### React Hooks
|
67
|
+
|
68
|
+
If you're planning to use our SDK with React, we provide three friendly hooks as a wrapper over our plain JavaScript interface.
|
69
|
+
You can wrap your UI in `HMSRoomProvider` and these hooks will become available to all the UI components. We'll learn more about these hooks,
|
70
|
+
and their use as we navigate through further sections.
|
71
|
+
|
72
|
+
```jsx
|
73
|
+
// app.jsx
|
74
|
+
import { HMSRoomProvider } from '@100mslive/react-sdk';
|
75
|
+
|
76
|
+
export function App() {
|
77
|
+
return (
|
78
|
+
<HMSRoomProvider>
|
79
|
+
<MyApp />
|
80
|
+
</HMSRoomProvider>
|
81
|
+
);
|
82
|
+
}
|
83
|
+
```
|
84
|
+
|
85
|
+
```jsx
|
86
|
+
// component.jsx
|
87
|
+
import {
|
88
|
+
useHMSStore,
|
89
|
+
useHMSActions,
|
90
|
+
useHMSNotifications
|
91
|
+
} from '@100mslive/react-sdk';
|
92
|
+
|
93
|
+
export function MyComponent() {
|
94
|
+
const hmsStore = useHMSStore();
|
95
|
+
const hmsActions = useHMSActions();
|
96
|
+
const hmsNotifications = useHMSNotifications();
|
97
|
+
|
98
|
+
return </>;
|
99
|
+
}
|
100
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
<Meta title="Introduction/Getting Started" />
|
4
|
+
|
5
|
+
# Getting Started
|
6
|
+
|
7
|
+
- [Basic Concepts](https://www.100ms.live/docs/javascript/v2/foundation/basics)
|
8
|
+
- [Template and Roles](https://www.100ms.live/docs/javascript/v2/foundation/templates-and-roles)
|
9
|
+
- [Authentication and Tokens](https://www.100ms.live/docs/javascript/v2/foundation/security-and-tokens)
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Label';
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { styled } from '../Theme';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @see https://tailwindcss.com/docs/space
|
5
|
+
*/
|
6
|
+
const gapStyles = (value: number) => {
|
7
|
+
return {
|
8
|
+
'& > * + *': {
|
9
|
+
marginRight: '0',
|
10
|
+
marginLeft: `${0.25 * value}rem`,
|
11
|
+
},
|
12
|
+
};
|
13
|
+
};
|
14
|
+
|
15
|
+
export const Flex = styled('div', {
|
16
|
+
display: 'flex',
|
17
|
+
variants: {
|
18
|
+
justify: {
|
19
|
+
start: {
|
20
|
+
justifyContent: 'flex-start',
|
21
|
+
},
|
22
|
+
end: {
|
23
|
+
justifyContent: 'flex-end',
|
24
|
+
},
|
25
|
+
center: {
|
26
|
+
justifyContent: 'center',
|
27
|
+
},
|
28
|
+
between: {
|
29
|
+
justifyContent: 'space-between',
|
30
|
+
},
|
31
|
+
around: {
|
32
|
+
justifyContent: 'space-around',
|
33
|
+
},
|
34
|
+
evenly: {
|
35
|
+
justifyContent: 'space-evenly',
|
36
|
+
},
|
37
|
+
},
|
38
|
+
align: {
|
39
|
+
start: {
|
40
|
+
alignItems: 'flex-start',
|
41
|
+
},
|
42
|
+
end: {
|
43
|
+
alignItems: 'flex-end',
|
44
|
+
},
|
45
|
+
center: {
|
46
|
+
alignItems: 'center',
|
47
|
+
},
|
48
|
+
baseline: {
|
49
|
+
alignItems: 'baseline',
|
50
|
+
},
|
51
|
+
strech: {
|
52
|
+
alignItems: 'stretch',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
direction: {
|
56
|
+
row: {
|
57
|
+
flexDirection: 'row',
|
58
|
+
},
|
59
|
+
column: {
|
60
|
+
flexDirection: 'column',
|
61
|
+
},
|
62
|
+
rowReverse: {
|
63
|
+
flexDirection: 'row-reverse',
|
64
|
+
},
|
65
|
+
columnReverse: {
|
66
|
+
flexDirection: 'column-reverse',
|
67
|
+
},
|
68
|
+
},
|
69
|
+
gap: {
|
70
|
+
1: gapStyles(1),
|
71
|
+
2: gapStyles(2),
|
72
|
+
3: gapStyles(3),
|
73
|
+
4: gapStyles(4),
|
74
|
+
},
|
75
|
+
},
|
76
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
|
+
import { Link } from '.';
|
4
|
+
|
5
|
+
export default {
|
6
|
+
title: 'UI Components/Link',
|
7
|
+
component: Link,
|
8
|
+
} as ComponentMeta<typeof Link>;
|
9
|
+
|
10
|
+
const Template: ComponentStory<typeof Link> = props => {
|
11
|
+
return (
|
12
|
+
<Link icon={props.icon} iconSide={props.iconSide} color={props.color} href="#">
|
13
|
+
Link Text
|
14
|
+
</Link>
|
15
|
+
);
|
16
|
+
};
|
17
|
+
|
18
|
+
export const Multiple = Template.bind({});
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as icons from '@100mslive/react-icons';
|
3
|
+
import { Flex } from '../Layout';
|
4
|
+
import { Text } from '../Text';
|
5
|
+
import { styled } from '../Theme';
|
6
|
+
|
7
|
+
const LinkComponent = styled('a', {
|
8
|
+
textDecoration: 'none',
|
9
|
+
display: 'flex',
|
10
|
+
alignItems: 'center',
|
11
|
+
gap: '$5',
|
12
|
+
variants: {
|
13
|
+
color: {
|
14
|
+
highEmp: {
|
15
|
+
color: '$textHighEmp',
|
16
|
+
'&:hover': {
|
17
|
+
color: '$textMedEmp',
|
18
|
+
},
|
19
|
+
},
|
20
|
+
primary: {
|
21
|
+
color: '$primaryLight',
|
22
|
+
'&:hover': {
|
23
|
+
color: '$primaryDefault',
|
24
|
+
},
|
25
|
+
},
|
26
|
+
},
|
27
|
+
},
|
28
|
+
});
|
29
|
+
|
30
|
+
export interface LinkProps extends React.ComponentProps<typeof LinkComponent> {
|
31
|
+
as?: React.ElementType;
|
32
|
+
iconSide?: 'left' | 'right' | 'none';
|
33
|
+
icon?: keyof typeof icons;
|
34
|
+
color?: 'highEmp' | 'primary';
|
35
|
+
}
|
36
|
+
|
37
|
+
export const Link = ({ iconSide = 'left', icon, color = 'primary', children, ...rest }: LinkProps) => {
|
38
|
+
const Icon = icon ? icons[icon] : React.Fragment;
|
39
|
+
const renderedIcon = icon ? (
|
40
|
+
<Flex as="span">
|
41
|
+
<Icon height={13.33} width={13.33} />{' '}
|
42
|
+
</Flex>
|
43
|
+
) : null;
|
44
|
+
|
45
|
+
return (
|
46
|
+
<LinkComponent {...rest} color={color}>
|
47
|
+
{iconSide === 'left' && renderedIcon}
|
48
|
+
<Text as="span" variant="body2" css={{ color: 'inherit' }}>
|
49
|
+
{children}
|
50
|
+
</Text>
|
51
|
+
{iconSide === 'right' && renderedIcon}
|
52
|
+
</LinkComponent>
|
53
|
+
);
|
54
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Story, Preview, Props } from '@storybook/addon-docs';
|
2
|
+
|
3
|
+
import { Loading } from '.';
|
4
|
+
|
5
|
+
# Loading
|
6
|
+
|
7
|
+
## Overview
|
8
|
+
|
9
|
+
This is some random overview text of the item.
|
10
|
+
|
11
|
+
<Preview>
|
12
|
+
<Story id="ui-components-loading--example" />
|
13
|
+
</Preview>
|
14
|
+
|
15
|
+
<Props />
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
|
+
import { Flex } from '../Layout';
|
4
|
+
import mdx from './Loading.mdx';
|
5
|
+
import { Loading } from '.';
|
6
|
+
|
7
|
+
export default {
|
8
|
+
title: 'UI Components/Loading',
|
9
|
+
component: Loading,
|
10
|
+
parameters: {
|
11
|
+
docs: {
|
12
|
+
page: mdx,
|
13
|
+
},
|
14
|
+
},
|
15
|
+
} as ComponentMeta<typeof Loading>;
|
16
|
+
|
17
|
+
const Template: ComponentStory<typeof Loading> = ({ color }) => {
|
18
|
+
return (
|
19
|
+
<Flex gap={4}>
|
20
|
+
<Loading size={24} color={color} />
|
21
|
+
<Loading size={48} color={color} />
|
22
|
+
<Loading size={64} color={color} />
|
23
|
+
</Flex>
|
24
|
+
);
|
25
|
+
};
|
26
|
+
|
27
|
+
export const Multiple = Template.bind({});
|
28
|
+
Multiple.args = {
|
29
|
+
color: 'red',
|
30
|
+
};
|
31
|
+
|
32
|
+
export const Playground: ComponentStory<typeof Loading> = args => <Loading {...args} />;
|
33
|
+
Playground.storyName = 'Loading';
|
34
|
+
Playground.argTypes = {
|
35
|
+
size: { control: { type: 'number' }, defaultValue: 24 },
|
36
|
+
color: { defaultValue: 'blue' },
|
37
|
+
};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
type Props = {
|
4
|
+
/**
|
5
|
+
* Adjusts width and height
|
6
|
+
*/
|
7
|
+
size?: number | string;
|
8
|
+
/**
|
9
|
+
* Color of Loader
|
10
|
+
*/
|
11
|
+
color?: string;
|
12
|
+
};
|
13
|
+
|
14
|
+
type LoadingProps = Props & React.SVGProps<SVGSVGElement>;
|
15
|
+
|
16
|
+
export const Loading = ({ size = 24, color = 'white', ...props }: LoadingProps) => (
|
17
|
+
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
18
|
+
<path
|
19
|
+
d="M19.8852 12C20.5009 12 21.0071 12.501 20.9311 13.1119C20.7585 14.498 20.2649 15.8303 19.4832 17.0001C18.4943 18.4802 17.0887 19.6337 15.4442 20.3149C13.7996 20.9961 11.99 21.1743 10.2442 20.8271C8.49836 20.4798 6.89471 19.6226 5.63604 18.364C4.37737 17.1053 3.5202 15.5016 3.17293 13.7558C2.82567 12.01 3.0039 10.2004 3.68508 8.55585C4.36627 6.91131 5.51983 5.50571 6.99987 4.51677C8.16971 3.73511 9.50199 3.24152 10.8881 3.06895C11.499 2.99288 12 3.4991 12 4.11476C12 4.73042 11.4976 5.22017 10.8903 5.32108C9.94601 5.47798 9.04141 5.83408 8.23852 6.37055C7.12512 7.1145 6.25733 8.17191 5.74489 9.40905C5.23245 10.6462 5.09837 12.0075 5.35961 13.3209C5.62085 14.6342 6.26568 15.8406 7.21255 16.7875C8.15942 17.7343 9.3658 18.3791 10.6791 18.6404C11.9925 18.9016 13.3538 18.7675 14.591 18.2551C15.8281 17.7427 16.8855 16.8749 17.6294 15.7615C18.1659 14.9586 18.522 14.054 18.6789 13.1097C18.7798 12.5024 19.2696 12 19.8852 12Z"
|
20
|
+
fill={color}
|
21
|
+
>
|
22
|
+
<animateTransform
|
23
|
+
attributeType="XML"
|
24
|
+
attributeName="transform"
|
25
|
+
type="rotate"
|
26
|
+
from="0 12 12"
|
27
|
+
to="360 12 12"
|
28
|
+
dur="0.75s"
|
29
|
+
repeatCount="indefinite"
|
30
|
+
/>
|
31
|
+
</path>
|
32
|
+
</svg>
|
33
|
+
);
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Loading } from './Loading';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Replacing DocsPage with custom `MDX` content
|
2
|
+
|
3
|
+
This file is a documentation-only `MDX`file to customize Storybook's [DocsPage](https://storybook.js.org/docs/react/writing-docs/docs-page#replacing-docspage).
|
4
|
+
|
5
|
+
It can be further expanded with your own code snippets and include specific information related to your stories.
|
6
|
+
|
7
|
+
For example:
|
8
|
+
|
9
|
+
import { Story } from '@storybook/addon-docs';
|
10
|
+
|
11
|
+
## Dialog
|
12
|
+
|
13
|
+
Dialog is an hover component used to have a focus-mode like UI for users.
|
14
|
+
|
15
|
+
- [Example](#example)
|
16
|
+
|
17
|
+
### Example
|
18
|
+
|
19
|
+
<Story id="dialog--example" />
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
3
|
+
import { CrossIcon, InfoIcon } from '@100mslive/react-icons';
|
4
|
+
import { Button } from '../Button';
|
5
|
+
import { Fieldset } from '../Fieldset';
|
6
|
+
import { Input } from '../Input';
|
7
|
+
import { Label } from '../Label';
|
8
|
+
import { Flex } from '../Layout';
|
9
|
+
import { Text } from '../Text';
|
10
|
+
import { Dialog } from './Dialog';
|
11
|
+
import DialogDocs from './Dialog.mdx';
|
12
|
+
|
13
|
+
export default {
|
14
|
+
title: 'UI Components/Dialog',
|
15
|
+
component: Dialog.Root,
|
16
|
+
argTypes: { onClick: { action: 'clicked' } },
|
17
|
+
parameters: {
|
18
|
+
docs: {
|
19
|
+
page: DialogDocs,
|
20
|
+
},
|
21
|
+
},
|
22
|
+
} as ComponentMeta<typeof Dialog.Root>;
|
23
|
+
|
24
|
+
//👇 We create a “template” of how args map to rendering
|
25
|
+
const Template: ComponentStory<typeof Dialog.Root> = () => (
|
26
|
+
<Dialog.Root css={{ position: 'relative' }}>
|
27
|
+
<Dialog.Trigger asChild>
|
28
|
+
<Button variant="standard">Open Dialog</Button>
|
29
|
+
</Dialog.Trigger>
|
30
|
+
<Dialog.Portal>
|
31
|
+
<Dialog.Overlay />
|
32
|
+
<Dialog.Content>
|
33
|
+
<Dialog.Title css={{ c: '$textHighEmp', position: 'relative' }}>
|
34
|
+
<Flex direction="row" justify="between" css={{ w: '100%' }}>
|
35
|
+
<Flex justify="start" align="center" gap="3">
|
36
|
+
<InfoIcon />
|
37
|
+
<Text variant="h5">Dialog Heading</Text>
|
38
|
+
</Flex>
|
39
|
+
<Dialog.DefaultClose css={{ position: 'absolute', top: '-1rem', right: '-1rem' }}>
|
40
|
+
<CrossIcon />
|
41
|
+
</Dialog.DefaultClose>
|
42
|
+
</Flex>
|
43
|
+
</Dialog.Title>
|
44
|
+
<Text variant="body1" css={{ c: '$textMedEmp' }}>
|
45
|
+
Body 2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
46
|
+
dolore magna aliqua. Ut enim ad minim veniam,im venitetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
47
|
+
labore et dolore magna aliqua. Ut enim ad minim veniam,im veni
|
48
|
+
</Text>
|
49
|
+
<Fieldset css={{ mt: '$4' }}>
|
50
|
+
<Label htmlFor="name">Name</Label>
|
51
|
+
<Input id="name" defaultValue="Hardik" css={{ w: '50%' }} />
|
52
|
+
</Fieldset>
|
53
|
+
<Fieldset>
|
54
|
+
<Label htmlFor="username">Username</Label>
|
55
|
+
<Input id="username" defaultValue="@hdz666" css={{ w: '50%' }} />
|
56
|
+
</Fieldset>
|
57
|
+
<Flex css={{ marginTop: 25, justifyContent: 'flex-end' }}>
|
58
|
+
<Dialog.Close asChild>
|
59
|
+
<Button variant="primary">Save changes</Button>
|
60
|
+
</Dialog.Close>
|
61
|
+
</Flex>
|
62
|
+
</Dialog.Content>
|
63
|
+
</Dialog.Portal>
|
64
|
+
</Dialog.Root>
|
65
|
+
);
|
66
|
+
|
67
|
+
export const Example = Template.bind({});
|
68
|
+
Example.storyName = 'Dialog';
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Root } from '@radix-ui/react-dialog';
|
2
|
+
import { styled } from '@stitches/react';
|
3
|
+
import {
|
4
|
+
DialogClose,
|
5
|
+
DialogDefaultCloseIcon,
|
6
|
+
DialogDescription,
|
7
|
+
DialogTitle,
|
8
|
+
StyledDialogContent,
|
9
|
+
StyledDialogOverlay,
|
10
|
+
StyledDialogPortal,
|
11
|
+
StyledDialogTrigger,
|
12
|
+
} from './DialogContent';
|
13
|
+
|
14
|
+
const StyledDialog = styled(Root, {});
|
15
|
+
|
16
|
+
export const Dialog = {
|
17
|
+
Root: StyledDialog,
|
18
|
+
Trigger: StyledDialogTrigger,
|
19
|
+
Overlay: StyledDialogOverlay,
|
20
|
+
Content: StyledDialogContent,
|
21
|
+
Title: DialogTitle,
|
22
|
+
Description: DialogDescription,
|
23
|
+
Close: DialogClose,
|
24
|
+
DefaultClose: DialogDefaultCloseIcon,
|
25
|
+
Portal: StyledDialogPortal,
|
26
|
+
};
|