Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Stop building the project as a CommonJS library #248

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@bufferapp/ui-template",
"version": "5.48.2",
"version": "5.48.2-beta.df91dcb",
"sideEffects": false,
"engines": {
"node": ">=4.0.0"
},
Expand Down Expand Up @@ -148,9 +149,9 @@
"predeploy:docs": "npm run gen:docs && npm run build:docs",
"deploy:docs": "gh-pages -d build",
"prebuild:lib": "rimraf lib",
"build:lib": "npm-run-all --parallel build:commonjs build:copy-files",
"build:lib": "npm-run-all --parallel build:esm build:copy-files",
"build:copy-files": "node scripts/copyBuildFiles.js",
"build:commonjs": "cross-env NODE_ENV=production babel ./src/components --out-dir ./lib --ignore index.js",
"build:esm": "cross-env NODE_ENV=production babel ./src/components --out-dir ./lib --ignore index.js",
"publish": "./scripts/publish.sh",
"beta:publish": "node ./scripts/betaPublish.js",
"component:new": "node ./scripts/newComponent.js",
Expand Down Expand Up @@ -187,12 +188,18 @@
},
"babel": {
"plugins": [
"@babel/plugin-transform-modules-commonjs",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from"
],
"presets": [
"@babel/preset-env",
[
"@babel/preset-env",
{
"targets": {
"esmodules": true
}
}
],
"@babel/react"
]
},
Expand Down
7 changes: 6 additions & 1 deletion src/components/Avatar/Avatar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import styled from 'styled-components';
import * as Styles from './style';
// import { socialNetworks } from '../constants';
import { facebook, googleplus, instagram, linkedin, pinterest, twitter } from '../style/colors';
import { Instagram, Facebook, Twitter, LinkedIn, Pinterest, GooglePlus } from '../Icon';
import Instagram from '../Icon/Icons/Instagram'
import Facebook from '../Icon/Icons/Facebook'
import Twitter from '../Icon/Icons/Twitter'
import LinkedIn from '../Icon/Icons/LinkedIn'
import Pinterest from '../Icon/Icons/Pinterest'
import GooglePlus from '../Icon/Icons/GooglePlus'

const Wrapper = styled.div`
${props => Styles.wrapper[props.size]}
Expand Down
2 changes: 1 addition & 1 deletion src/components/DropdownMenu/ButtonItem/ButtonItem.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ButtonItemStyled, ButtonLabel } from '../style';
import { Checkmark as CheckmarkIcon } from '../../Icon';
import CheckmarkIcon from '../../Icon/Icons/Checkmark'
import { green } from '../../style/colors';
import { keyCode } from '../keyCode';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Input/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import PropTypes from 'prop-types';
import * as Styles from './style';
import { Warning } from '../Icon';
import Warning from '../Icon/Icons/Warning';
import Text from '../Text';

export default class Input extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import * as Styles from './style';
import Button from '../Button';
import { Cross } from '../Icon';
import Cross from '../Icon/Icons/Cross';

function setCookie(cookie, cookieKey, days, value) {
const expiresInDays = days * 24 * 60 * 60;
Expand Down
22 changes: 10 additions & 12 deletions src/components/NavBar/NavBar.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import {
Cross,
Info as InfoIcon,
ArrowLeft,
Person as PersonIcon,
Instagram as InstagramIcon,
Twitter as TwitterIcon,
Facebook as FacebookIcon,
Pinterest as PinterestIcon,
LinkedIn as LinkedInIcon,
} from '../Icon';
import Cross from '../Icon/Icons/Cross'
import InfoIcon from '../Icon/Icons/Info'
import ArrowLeft from '../Icon/Icons/ArrowLeft'
import PersonIcon from '../Icon/Icons/Person'
import InstagramIcon from '../Icon/Icons/Instagram'
import TwitterIcon from '../Icon/Icons/Twitter'
import FacebookIcon from '../Icon/Icons/Facebook'
import PinterestIcon from '../Icon/Icons/Pinterest'
import LinkedInIcon from '../Icon/Icons/LinkedIn'

import {
gray,
Expand Down Expand Up @@ -195,7 +193,7 @@ export function appendOrgSwitcher(orgSwitcher) {
if (!item.subItems || item.subItems.length === 0) {
item.defaultTooltipMessage = 'No social accounts connected yet.';
}

return item;
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavBar/NavBarMenu/NavBarMenu.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ChevronDown } from '../../Icon';
import ChevronDown from '../../Icon/Icons/ChevronDown';
import {
NavBarStyled,
NavBarEmail,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Select/SelectItem/SelectItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Checkmark } from '../../Icon';
import Checkmark from '../../Icon/Icons/Checkmark'
import {
SelectItemStyled,
SelectItemLabel,
Expand Down
6 changes: 5 additions & 1 deletion src/components/SocialButton/SocialButton.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Twitter, Instagram, Facebook, Pinterest, LinkedIn } from '../Icon';
import Instagram from '../Icon/Icons/Instagram'
import Facebook from '../Icon/Icons/Facebook'
import Twitter from '../Icon/Icons/Twitter'
import LinkedIn from '../Icon/Icons/LinkedIn'
import Pinterest from '../Icon/Icons/Pinterest'
import Text from '../Text/Text';

import {
Expand Down
28 changes: 14 additions & 14 deletions src/components/TextArea/TextArea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import React from 'react';
import PropTypes from 'prop-types';
import Text from '../Text';
import {HelpTextWrapper, HelpText} from '../Input/style';
import { Warning } from '../Icon';
import Warning from '../Icon/Icons/Warning';
import {Container, StyledTextArea} from './style';

export default class TextArea extends React.Component {
render() {
const {
value,
label,
hasError,
help,
disabled,
rows,
onChange,
id,
value,
label,
hasError,
help,
disabled,
rows,
onChange,
id,
fullHeight,
forwardRef,
...props
forwardRef,
...props
} = this.props;
return (
<Container>
Expand Down Expand Up @@ -69,12 +69,12 @@ TextArea.propTypes = {
id: PropTypes.string.isRequired,
/** If the textarea should take the height of the parent div */
fullHeight: PropTypes.bool,
/**
/**
* this consumed by the default export that is wrapping the component into a ForwardRef
* @ignore
*/
forwardRef: PropTypes.oneOfType([
PropTypes.func,
PropTypes.func,
PropTypes.shape({ current: PropTypes.instanceOf(Element) })
]),
};
Expand All @@ -86,4 +86,4 @@ TextArea.defaultProps = {
rows: 4,
fullHeight: false,
forwardRef: undefined,
}
}
3 changes: 2 additions & 1 deletion src/documentation/app/layout/sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { ChevronDown, ChevronUp } from '@bufferapp/ui/Icon';
import ChevronDown from '@bufferapp/ui/Icon/Icons/ChevronDown';
import ChevronUp from '@bufferapp/ui/Icon/Icons/ChevronUp';
import helper from 'immutability-helper';

const SidebarWrapper = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/AppShell/AppShell.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import AppShell from '@bufferapp/ui/AppShell';
import { Gear } from '@bufferapp/ui/Icon';
import Gear from '@bufferapp/ui/Icon/Icons/Gear';

import { gray } from '@bufferapp/ui/style/colors';

Expand Down
4 changes: 1 addition & 3 deletions src/documentation/examples/AppShell/WithEngageEnabled.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import AppShell from '@bufferapp/ui/AppShell';
import {
Gear,
} from '@bufferapp/ui/Icon';
import Gear from '@bufferapp/ui/Icon/Icons/Gear';

import { gray } from '@bufferapp/ui/style/colors';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react';
import AppShell from '@bufferapp/ui/AppShell';
import {
Gear,
} from '@bufferapp/ui/Icon';
import Gear from '@bufferapp/ui/Icon/Icons/Gear';

import { gray } from '@bufferapp/ui/style/colors';

Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/AppShell/WithOrgSwitcher.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import AppShell from '@bufferapp/ui/AppShell';
import { Gear } from '@bufferapp/ui/Icon';
import Gear from '@bufferapp/ui/Icon/Icons/Gear';

import { gray } from '@bufferapp/ui/style/colors';

Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/Button/Type/TypeIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from '@bufferapp/ui/Button';
import { Folder } from '@bufferapp/ui/Icon';
import Folder from '@bufferapp/ui/Icon/Icons/Folder';

/** Secondary Icon */
export default function ExampleButton() {
Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/Button/Type/TypeIconEnd.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from '@bufferapp/ui/Button';
import { Folder } from '@bufferapp/ui/Icon';
import Folder from '@bufferapp/ui/Icon/Icons/Folder';

/** Secondary with Icon at End */
export default function ExampleButton() {
Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/Button/Type/TypePrimaryIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from '@bufferapp/ui/Button';
import { Message } from '@bufferapp/ui/Icon';
import Message from '@bufferapp/ui/Icon/Icons/Message';

/** Primary with Icon */
export default function ExampleButton() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from '@bufferapp/ui/Button';
import { Message } from '@bufferapp/ui/Icon';
import Message from '@bufferapp/ui/Icon/Icons/Message';

/** Primary with Icon */
export default function ExampleButton() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Button from '@bufferapp/ui/Button';
import { Folder } from '@bufferapp/ui/Icon';
import Folder from '@bufferapp/ui/Icon/Icons/Folder';

/** Secondary with Icon */
export default function ExampleButton() {
Expand Down
3 changes: 1 addition & 2 deletions src/documentation/examples/Select/SelectWithIcon.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import Select from '@bufferapp/ui/Select';
import { Person } from '@bufferapp/ui/Icon';

import Person from '@bufferapp/ui/Icon/Icons/Person';

/** With Icon */
export default function ExampleSelect() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Select from '@bufferapp/ui/Select';
import Search from '@bufferapp/ui/Search';
import { Search as SearchIcon } from '@bufferapp/ui/Icon';
import SearchIcon from '@bufferapp/ui/Icon/Icons/Search';

const searchBarWrapperStyle = {
width: '100%',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react';
import Select from '@bufferapp/ui/Select';
import { Person, People, Gear, ArrowLeft } from '@bufferapp/ui/Icon';
import Person from '@bufferapp/ui/Icon/Icons/Person'
import People from '@bufferapp/ui/Icon/Icons/People'
import Gear from '@bufferapp/ui/Icon/Icons/Gear'
import ArrowLeft from '@bufferapp/ui/Icon/Icons/ArrowLeft'
import { NavBarMenu } from '@bufferapp/ui/NavBar';

/** With Custom Component and Custom Items */
Expand Down
2 changes: 1 addition & 1 deletion src/documentation/examples/Select/SelectWithSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Select from '@bufferapp/ui/Select';
import { Flag } from '@bufferapp/ui/Icon';
import Flag from '@bufferapp/ui/Icon/Icons/Flag';

/** With Search */
export default function ExampleSelectWithSearch() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import SidebarListItem from '@bufferapp/ui/SidebarListItem';
import { Person } from '@bufferapp/ui/Icon';
import Person from '@bufferapp/ui/Icon/Icons/Person';

/** SidebarListItem Example */
export default function ExampleSidebarListItem() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import SidebarListItem from '@bufferapp/ui/SidebarListItem';
import { Person } from '@bufferapp/ui/Icon';
import Person from '@bufferapp/ui/Icon/Icons/Person';

/** SidebarListItem Selected Example */
export default function ExampleSidebarListItem() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import SidebarListItem from '@bufferapp/ui/SidebarListItem';
import { Warning } from '@bufferapp/ui/Icon';
import Warning from '@bufferapp/ui/Icon/Icons/Warning'

/** SidebarListItem With Badge Icon Example */
export default function ExampleSidebarListItem() {
Expand Down