├── demos
├── build
│ └── .gitkeep
├── demo-react-ts
│ ├── .prettierrc.json
│ ├── .eslintignore
│ ├── .prettierignore
│ ├── src
│ │ ├── visitor-ui-component-library
│ │ │ ├── button
│ │ │ │ ├── constants
│ │ │ │ │ ├── IconButtonShapes.ts
│ │ │ │ │ ├── ButtonUses.ts
│ │ │ │ │ ├── IconButtonUses.ts
│ │ │ │ │ ├── IconButtonSizeToIconSize.ts
│ │ │ │ │ ├── ButtonSizes.ts
│ │ │ │ │ └── LoadingButtonUses.ts
│ │ │ │ ├── theme
│ │ │ │ │ ├── closeButtonThemeOperators.js
│ │ │ │ │ ├── iconButtonThemeOperators.ts
│ │ │ │ │ ├── buttonTheme.ts
│ │ │ │ │ └── iconButtonTheme.ts
│ │ │ │ ├── VizExFileButton.js
│ │ │ │ ├── VizExIconButton.tsx
│ │ │ │ ├── VizExButton.tsx
│ │ │ │ ├── VizExCloseButton.js
│ │ │ │ ├── VizExLoadingButton.js
│ │ │ │ └── VizExButton.stories.tsx
│ │ │ ├── input
│ │ │ │ ├── constants
│ │ │ │ │ ├── InputVariations.ts
│ │ │ │ │ └── ExpandingInputVariations.ts
│ │ │ │ ├── theme
│ │ │ │ │ ├── checkboxThemeOperators.js
│ │ │ │ │ ├── inputThemeOperators.js
│ │ │ │ │ └── expandingInputThemeOperators.js
│ │ │ │ ├── VizExCheckbox.js
│ │ │ │ └── VizExInput.js
│ │ │ ├── typography
│ │ │ │ ├── constants
│ │ │ │ │ └── SmallVariations.ts
│ │ │ │ ├── utils
│ │ │ │ │ ├── getSmallStyles.js
│ │ │ │ │ ├── getBodyTypographyStyles.js
│ │ │ │ │ └── getHeadingStyles.js
│ │ │ │ └── VizExSmall.js
│ │ │ ├── constants
│ │ │ │ ├── keyCodes.ts
│ │ │ │ └── sizes.ts
│ │ │ ├── link
│ │ │ │ ├── constants
│ │ │ │ │ └── LinkVariations.ts
│ │ │ │ ├── theme
│ │ │ │ │ ├── linkThemeOperators.ts
│ │ │ │ │ └── linkTheme.ts
│ │ │ │ ├── VizExLink.tsx
│ │ │ │ └── VizExExternalLink.tsx
│ │ │ ├── utils
│ │ │ │ ├── callIfValid.ts
│ │ │ │ ├── themePropType.ts
│ │ │ │ ├── pipe.ts
│ │ │ │ ├── mixins.ts
│ │ │ │ ├── stripHTML.js
│ │ │ │ ├── get.ts
│ │ │ │ ├── browserTest.js
│ │ │ │ ├── hexToRgba.ts
│ │ │ │ ├── curryable.ts
│ │ │ │ ├── hexToRGB.ts
│ │ │ │ ├── types.ts
│ │ │ │ ├── isUnsafeUrl.ts
│ │ │ │ ├── adjustLuminance.ts
│ │ │ │ ├── SyntheticEvent.ts
│ │ │ │ ├── getTextColorFromBgColor.ts
│ │ │ │ ├── getContrastRatio.ts
│ │ │ │ ├── mergeDeep.ts
│ │ │ │ └── aria-live
│ │ │ │ │ ├── AriaLiveContext.stories.tsx
│ │ │ │ │ ├── AriaLiveContext.tsx
│ │ │ │ │ └── AriaLiveAnnouncer.ts
│ │ │ ├── ratings
│ │ │ │ ├── constants
│ │ │ │ │ └── RatingSizes.ts
│ │ │ │ ├── theme
│ │ │ │ │ └── VizExCsatRatingThemeOperator.ts
│ │ │ │ └── VizExCsatRating.js
│ │ │ ├── list
│ │ │ │ ├── theme
│ │ │ │ │ ├── listTheme.ts
│ │ │ │ │ └── listItemButtonTheme.ts
│ │ │ │ ├── VizExList.tsx
│ │ │ │ ├── VizExListItemButton.tsx
│ │ │ │ └── VizExList.stories.tsx
│ │ │ ├── card
│ │ │ │ └── VizExCard.js
│ │ │ ├── tooltip
│ │ │ │ ├── utils
│ │ │ │ │ ├── getPlacement.js
│ │ │ │ │ ├── getArrowSpacing.js
│ │ │ │ │ └── getBodySpacing.js
│ │ │ │ ├── theme
│ │ │ │ │ └── tooltipThemeOperators.ts
│ │ │ │ ├── constants
│ │ │ │ │ └── PlacementConstants.ts
│ │ │ │ ├── VizExTooltipArrow.js
│ │ │ │ ├── VizExTooltipBody.js
│ │ │ │ └── VizExTooltip.js
│ │ │ └── theme
│ │ │ │ ├── VizExThemeProvider.tsx
│ │ │ │ ├── ColorConstants.ts
│ │ │ │ ├── styled.d.ts
│ │ │ │ ├── defaultTheme.ts
│ │ │ │ ├── createTheme.ts
│ │ │ │ ├── defaultThemeOperators.ts
│ │ │ │ └── createThemeV2.ts
│ │ ├── icons
│ │ │ ├── statusDot.svg
│ │ │ ├── caretDown.svg
│ │ │ ├── recordVinyl.svg
│ │ │ ├── phone.svg
│ │ │ ├── microphone.svg
│ │ │ ├── deleteLeft.svg
│ │ │ ├── checkmark.svg
│ │ │ ├── mobileRetro.svg
│ │ │ ├── microphoneSlash.svg
│ │ │ ├── externalLink.svg
│ │ │ └── sprocket.svg
│ │ ├── types
│ │ │ ├── index.d.ts
│ │ │ └── ScreenTypes.ts
│ │ ├── hooks
│ │ │ ├── useAutoFocus.ts
│ │ │ └── useTimer.ts
│ │ ├── index.tsx
│ │ ├── constants
│ │ │ └── buttonIds.ts
│ │ ├── utils
│ │ │ ├── millisecondsToFormattedDuration.ts
│ │ │ ├── phoneNumberUtils.ts
│ │ │ └── colors.ts
│ │ ├── components
│ │ │ ├── Alert.tsx
│ │ │ ├── screens
│ │ │ │ ├── DialingScreen.tsx
│ │ │ │ ├── LoginScreen.tsx
│ │ │ │ ├── CallEndedScreen.tsx
│ │ │ │ ├── IncomingScreen.tsx
│ │ │ │ └── CallingScreen.tsx
│ │ │ ├── Keypad.tsx
│ │ │ ├── FromNumbersDropdown.tsx
│ │ │ └── Icons.tsx
│ │ └── index.html
│ ├── babel.config.js
│ ├── test
│ │ ├── support
│ │ │ └── jasmine-browser.json
│ │ ├── spec
│ │ │ ├── run-test.ts
│ │ │ └── components
│ │ │ │ ├── screens
│ │ │ │ ├── CallingScreen-test.tsx
│ │ │ │ ├── DialingScreen-test.tsx
│ │ │ │ ├── LoginScreen-test.tsx
│ │ │ │ ├── IncomingScreen-test.tsx
│ │ │ │ └── CallEndedScreen-test.tsx
│ │ │ │ ├── FromNumbersDropdown-test.tsx
│ │ │ │ └── App-test.tsx
│ │ └── render.tsx
│ ├── README.md
│ ├── tsconfig.json
│ ├── webpack-test.config.js
│ ├── .eslintrc
│ ├── webpack.config.js
│ └── package.json
├── demo-minimal-js
│ ├── README.md
│ ├── webpack.config.js
│ └── package.json
├── src
│ └── index.html
├── package-lock.json
└── package.json
├── .eslintignore
├── .npmrc
├── .prettierignore
├── .prettierrc.json
├── test
├── .eslintrc
├── support
│ └── jasmine-browser.json
└── spec
│ ├── IFrameManager-test.ts
│ └── CallingExtensions-test.ts
├── .npmignore
├── webpack.common.js
├── docs
└── images
│ ├── InitializeCallWidgetIFrame.png
│ └── OutboundCallSequenceDiagram.png
├── .gitignore
├── index.ts
├── .github
├── CODEOWNERS
├── workflows
│ ├── deploy.yml
│ └── preview.yml
├── ISSUE_TEMPLATE
│ ├── feature-request.md
│ └── bug-report.md
└── PULL_REQUEST_TEMPLATE.md
├── tsconfig.cjs.json
├── tsconfig.esm.json
├── webpack.config.js
├── webpack-test.config.js
├── webpack.cjs.config.js
├── webpack.esm.config.js
├── LICENSE
├── .eslintrc
├── README.md
├── SHIP_WITH_CARE.md
├── package.json
└── src
└── Constants.ts
/demos/build/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | demo/build
3 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry = https://registry.npmjs.org/
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | dist-test
3 | node_modules
4 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | { "arrowParens": "avoid", "trailingComma": "all" }
2 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 | visitor-ui-component-library
3 |
--------------------------------------------------------------------------------
/test/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../.eslintrc",
3 | "env": {
4 | "jasmine": true
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore artifacts:
2 | dist
3 | node_modules
4 | visitor-ui-component-library
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | *.pem
2 | .eslintignore
3 | .eslintrc
4 | node_modules
5 | circle.yml
6 | webpack.config.js
7 | coverage
8 |
--------------------------------------------------------------------------------
/webpack.common.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | entry: "./index.ts",
3 | resolve: {
4 | extensions: [".ts", ".tsx", ".js"],
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/docs/images/InitializeCallWidgetIFrame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HubSpot/calling-extensions-sdk/master/docs/images/InitializeCallWidgetIFrame.png
--------------------------------------------------------------------------------
/docs/images/OutboundCallSequenceDiagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HubSpot/calling-extensions-sdk/master/docs/images/OutboundCallSequenceDiagram.png
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/button/constants/IconButtonShapes.ts:
--------------------------------------------------------------------------------
1 | export const CIRCLE = 'circle';
2 | export const DEFAULT = 'default';
3 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/input/constants/InputVariations.ts:
--------------------------------------------------------------------------------
1 | export const DEFAULT = "default";
2 | export const ON_DARK = "on-dark";
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | npm-debug.log
3 | dist
4 | bin
5 | *.pem
6 | coverage
7 | .DS_STORE
8 | lib
9 | demos/build/*
10 | !demos/build/.gitkeep
11 | dist-test
12 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/input/constants/ExpandingInputVariations.ts:
--------------------------------------------------------------------------------
1 | export const UNSTYLED = "unstyled";
2 | export const DEFAULT = "default";
3 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/icons/statusDot.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/typography/constants/SmallVariations.ts:
--------------------------------------------------------------------------------
1 | export const HELP = "help";
2 | export const DEFAULT = "default";
3 | export const ERROR = "error";
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/constants/keyCodes.ts:
--------------------------------------------------------------------------------
1 | export const UP_ARROW = 38;
2 | export const DOWN_ARROW = 40;
3 | export const ENTER = 13;
4 | export const SPACE_BAR = 32;
5 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/link/constants/LinkVariations.ts:
--------------------------------------------------------------------------------
1 | export const ON_BRIGHT = 'on-bright';
2 | export const DEFAULT = 'default';
3 | export const ERROR = 'error';
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/callIfValid.ts:
--------------------------------------------------------------------------------
1 | export const callIfValid = (func: Function, ...args: any[]) => {
2 | if (typeof func === 'function') func(...args);
3 | };
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/themePropType.ts:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | const themePropType = PropTypes.object;
4 |
5 | export default themePropType;
6 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/pipe.ts:
--------------------------------------------------------------------------------
1 | export function pipe(...functions: Array<(arg: T) => T>) {
2 | return (data: T) => functions.reduce((acc, func) => func(acc), data);
3 | }
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/types/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module "*.svg" {
2 | import React = require("react");
3 | const ReactComponent: React.FC>;
4 | export default ReactComponent;
5 | }
6 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/mixins.ts:
--------------------------------------------------------------------------------
1 | import { css } from 'styled-components';
2 |
3 | export const focusRing = css`
4 | outline-offset: 1px;
5 | outline: 2px solid #00a4bd;
6 | `;
7 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/button/constants/ButtonUses.ts:
--------------------------------------------------------------------------------
1 | export const PRIMARY = 'primary';
2 | export const SECONDARY = 'secondary';
3 | export const TRANSPARENT_ON_PRIMARY = 'transparent-on-primary';
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: ["babel-plugin-styled-components"],
3 | presets: [
4 | "@babel/preset-typescript",
5 | "@babel/preset-react",
6 | "@babel/preset-env",
7 | ],
8 | };
9 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/stripHTML.js:
--------------------------------------------------------------------------------
1 | 'use es6';
2 |
3 | export const stripHTML = html => {
4 | const doc = new DOMParser().parseFromString(html, 'text/html');
5 | return doc.body.textContent || '';
6 | };
7 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/get.ts:
--------------------------------------------------------------------------------
1 | import { curryable } from './curryable';
2 |
3 | type dataObject = {
4 | [key: string]: string;
5 | };
6 | export const get = curryable((key: string, data: dataObject) => data[key]);
7 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/test/support/jasmine-browser.json:
--------------------------------------------------------------------------------
1 | {
2 | "srcDir": "src",
3 | "srcFiles": [],
4 | "specDir": "dist-test",
5 | "specFiles": ["test.js"],
6 | "helpers": [],
7 | "browser": {
8 | "name": "chrome"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/button/constants/IconButtonUses.ts:
--------------------------------------------------------------------------------
1 | export const PRIMARY = 'primary';
2 | export const TRANSPARENT_ON_BACKGROUND = 'transparent-on-background';
3 | export const TRANSPARENT_ON_PRIMARY = 'transparent-on-primary';
4 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/browserTest.js:
--------------------------------------------------------------------------------
1 | 'use es6';
2 |
3 | const lowercasedUserAgent = window.navigator
4 | ? navigator.userAgent.toLowerCase()
5 | : '';
6 |
7 | export const isIE11 = () => lowercasedUserAgent.includes('trident/');
8 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/constants/sizes.ts:
--------------------------------------------------------------------------------
1 | export const MEDIUM = "md";
2 | export const EXTRA_SMALL = "xs";
3 | export const SMALL = "sm";
4 | export const EXTRA_EXTRA_SMALL = "xxs";
5 | export const LARGE = "lg";
6 | export const EXTRA_LARGE = "xl";
7 |
--------------------------------------------------------------------------------
/demos/demo-react-ts/src/visitor-ui-component-library/utils/hexToRgba.ts:
--------------------------------------------------------------------------------
1 | import { hexToRGB } from './hexToRGB';
2 | export const hexToRgba = (hexColor: string, opacity = 1) => {
3 | const { r, g, b } = hexToRGB(hexColor);
4 | return `rgba(${r}, ${g}, ${b}, ${opacity})`;
5 | };
6 |
--------------------------------------------------------------------------------
/test/support/jasmine-browser.json:
--------------------------------------------------------------------------------
1 | {
2 | "srcDir": "src",
3 | "srcFiles": [],
4 | "specDir": "dist-test",
5 | "specFiles": ["test.js"],
6 | "helpers": [],
7 | "env": {
8 | "random": true
9 | },
10 | "browser": {
11 | "name": "chrome"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/index.ts:
--------------------------------------------------------------------------------
1 | import CallingExtensions from "./src/CallingExtensions";
2 | import * as Constants from "./src/Constants";
3 | import IFrameManager from "./src/IFrameManager";
4 |
5 | export default CallingExtensions;
6 | export { Constants, IFrameManager };
7 | export * from "./src/types";
8 |
--------------------------------------------------------------------------------
/demos/demo-minimal-js/README.md:
--------------------------------------------------------------------------------
1 | # Demo Widget - Minimal JS
2 |
3 | Features a minimal implementation of the Calling Extensions SDK using JavaScript, HTML, and CSS.
4 |
5 | Please note: this demo app isn't a fully functional calling app and uses mock data to provide a more realistic experience.
6 |
--------------------------------------------------------------------------------
/demos/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Index Page
4 |
5 |
6 |
7 | Demo App Minimal JS
8 |
9 | Demo App React TS
10 |
11 |