Skip to content

Commit b30f32b

Browse files
BenjaminGolyacipak
authored andcommitted
fix(Momentum): remove Momentum ui and create ListSeparator
1 parent b782fb9 commit b30f32b

17 files changed

+52
-136
lines changed

.storybook/preview.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import mockData from '../src/data';
33
import {WebexJSONAdapter} from '../src/adapters';
44
import {WebexDataProvider} from '../src/components';
5-
import '@momentum-ui/core/css/momentum-ui.min.css';
65
import '../src/styles/index.scss';
76

87
export const decorators = [

README.md

-55
Original file line numberDiff line numberDiff line change
@@ -70,51 +70,6 @@ To learn more on the Webex Widgets head to its Github repository at
7070
https://github.com/webex/widgets.
7171

7272
## Usage
73-
74-
### Styles
75-
76-
In order to properly style Webex Components, we need to import all the fonts, icons, images and core _CSS_ manually.
77-
You will need to add [Momentum UI](https://momentum.design) styles in addition to the components' styles.
78-
[Momentum UI](https://momentum.design) is Webex design system.
79-
80-
#### Momentum UI Styles
81-
82-
Momentum UI should be installed in your application as a peer dependency of the Webex Components. If you followed the command in the [install section](#install) it should already be your dependencies. There are two ways to include Momentum UI in your application:
83-
84-
##### CSS
85-
86-
1. Copy `@momentum-ui/core/fonts` directory to the fonts or assets directory of your app.
87-
If you don't have a directory, create a public directory from which the fonts to be served
88-
2. Copy `@momentum-ui/core/css/momentum-ui.min.css` to the styles or assets directory of your app
89-
3. In the `<head>` of your HTML, reference the location of your `momentum-ui.min.css`
90-
91-
```HTML
92-
<link rel="stylesheet" type="text/css" href="<path to>/momentum-ui.min.css">
93-
```
94-
95-
##### Sass
96-
97-
1. Copy `@momentum-ui/icons/fonts` directory to the fonts or assets directory of your app
98-
2. Add `$brand-font-folder`, `$icon-font-path`, and `$images-path` variables to your app's "variables.scss" file
99-
100-
```JS
101-
$brand-font-folder: '<path to fonts directory>';
102-
$icon-font-path: '<path to fonts directory>';
103-
$images-path: '<path to images directory>';
104-
```
105-
106-
3. Import `@momentum-ui/core/scss/momentum-ui-components.scss` into your main entry Sass file _after_ the variables
107-
108-
```CSS
109-
...
110-
111-
@import '@momentum-ui/core/scss/momentum-ui-components';
112-
```
113-
114-
4. Compile your Sass using your static compiler or bundler
115-
116-
For more on Momentum UI, you can visit [Momentum UI's repository](https://github.com/momentum-design/momentum-ui/tree/master/core)
117-
11873
#### Webex Components Styles
11974

12075
There are two ways to do this:
@@ -129,27 +84,17 @@ import '@webex/components/dist/css/webex-components.css';
12984
...
13085
```
13186

132-
> *Important:* Import Momentum UI styles before importing the Webex Component ones.
133-
> Webex Components may override certain Momentum UI styles
134-
13587
##### HTML
13688

13789
In the `<head>` of your `index.html`, add the following imports:
13890

13991
```html
14092
<head>
14193
...
142-
143-
<!-- If you added Momentum UI via standard CSS -->
144-
<link rel="stylesheet" type="text/css" href="<path to>/@momentum-ui/core/css/momentum-ui.min.css" />
145-
14694
<link rel="stylesheet" type="text/css" href="node_modules/@webex/components/dist/css/webex-components.css" />
14795
</head>
14896
```
14997

150-
> *Important:* Import Momentum UI styles before importing the Webex Component ones.
151-
> Webex Components may override certain Momentum UI styles
152-
15398
### Adapters
15499

155100
Webex Components are self-updating, meaning, they know how to fetch the data they need.

dependencies.md

-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This guide describes the dependencies of this repository and their purpose.
1010
- [date-fns](#date-fns)
1111
- [Resize Observer](#resize-observer)
1212
- [Peer Dependencies](#peer-dependencies)
13-
- [Momentum UI](#momentum-ui)
1413
- [React](#react)
1514
- [RxJS](#rxjs)
1615
- [Development Dependencies](#development-dependencies)
@@ -70,15 +69,6 @@ Usually peer dependencies are packages that would-be users would already have or
7069
as part of their own applications, and hence, no need to include them as part of
7170
the library code.
7271

73-
### Momentum UI
74-
75-
[Momentum UI](https://momentum.design) is Webex design system.
76-
77-
#### Momentum UI Packages
78-
79-
- [@momentum-ui/react](https://www.npmjs.com/package/@momentum-ui/react):
80-
Momentum UI's [React](https://reactjs.org)'s component library
81-
8272
### React
8373

8474
[React](https://reactjs.org) is a library for building component-based user interfaces.

docs/bundle-analysis-esm.html

+1-1
Large diffs are not rendered by default.

docs/bundle-analysis-umd.html

+1-1
Large diffs are not rendered by default.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
],
3434
"peerDependencies": {
3535
"@babel/runtime": "^7.11.2",
36-
"@momentum-ui/react": "^23.17.4",
3736
"prop-types": "^15.7.2",
3837
"react": "^17.0.2",
3938
"react-dom": "^17.0.2",

rollup.config.js

-7
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ const plugins = [
4040
}),
4141
copy({
4242
targets: [
43-
// Copying Momentum's core CSS since there is no hosted version
44-
{
45-
src: 'node_modules/@momentum-ui/core/css/momentum-ui.min.css',
46-
dest: 'dist/css',
47-
},
4843
{
4944
src: ['src/themes/dark', 'src/themes/light'],
5045
dest: 'dist/themes',
@@ -59,15 +54,13 @@ const plugins = [
5954

6055
// Peer dependencies to exclude from bundle
6156
const external = [
62-
/^@momentum-ui/,
6357
/^prop-types/,
6458
/^react/,
6559
/^rxjs/,
6660
];
6761

6862
// UMD global/window names for peer dependencies
6963
const globals = {
70-
'@momentum-ui/react': 'momentum-ui-react',
7164
'prop-types': 'PropTypes',
7265
react: 'React',
7366
'react-dom': 'ReactDOM',

src/components/WebexActivityStream/TimeRuler.jsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import {ListSeparator} from '@momentum-ui/react';
43
import {
54
format,
65
isSameWeek,
@@ -55,7 +54,9 @@ export default function TimeRuler({className, date, style}) {
5554
const cssClasses = webexComponentClasses('time-ruler', className);
5655

5756
return (
58-
<ListSeparator className={cssClasses} style={style} role="listitem" text={text} />
57+
<div className={cssClasses} style={style}>
58+
<span className="md-list-separator__text">{text}</span>
59+
</div>
5960
);
6061
}
6162

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
.#{$WEBEX_COMPONENTS_CLASS_PREFIX}-time-ruler {
2+
display: inline-flex;
3+
justify-content: center;
4+
align-items: center;
5+
overflow: hidden;
6+
color: $wxc-gray-20;
7+
width: 100%;
28
padding: 0 3rem;
9+
margin: 0.5rem 0;
10+
font-family: "CiscoSansTT Regular","Helvetica Neue",Helvetica,Arial,sans-serif;
11+
12+
&::after, &::before {
13+
border-top: 0.06rem solid currentColor;
14+
content: '';
15+
flex: 1 1 auto;
16+
}
317
}

src/components/WebexActivityStream/WebexActivityStream.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
height: 10px;
1414
margin: 1rem auto;
1515
border-radius: 5px;
16-
background-color: $md-gray-30;
17-
color: $md-gray-30;
16+
background-color: $wxc-black-alpha-20;
17+
color: $wxc-black-alpha-20;
1818
animation: dotFlashing 1s infinite linear alternate;
1919
animation-delay: .5s;
2020
}
@@ -31,8 +31,8 @@
3131
width: 10px;
3232
height: 10px;
3333
border-radius: 5px;
34-
background-color: $md-gray-30;
35-
color: $md-gray-30;
34+
background-color: $wxc-black-alpha-20;
35+
color: $wxc-black-alpha-20;
3636
animation: dotFlashing 1s infinite alternate;
3737
animation-delay: 0s;
3838
}
@@ -42,19 +42,19 @@
4242
width: 10px;
4343
height: 10px;
4444
border-radius: 5px;
45-
background-color: $md-gray-30;
46-
color: $md-gray-30;
45+
background-color: $wxc-black-alpha-20;
46+
color: $wxc-black-alpha-20;
4747
animation: dotFlashing 1s infinite alternate;
4848
animation-delay: 1s;
4949
}
5050

5151
@keyframes dotFlashing {
5252
0% {
53-
background-color: $md-gray-30;
53+
background-color: $wxc-black-alpha-20;
5454
}
5555
50%,
5656
100% {
57-
background-color: $md-gray-10;
57+
background-color: $wxc-gray-10;
5858
}
5959
}
6060
}

src/components/WebexActivityStream/__snapshots__/WebexActivityStream.stories.storyshot

+6-18
Original file line numberDiff line numberDiff line change
@@ -538,18 +538,12 @@ Array [
538538
</div>
539539
</div>
540540
<div
541-
className="md-list-separator wxc-time-ruler"
542-
role="listitem"
541+
className="wxc-time-ruler"
543542
>
544543
<span
545-
className="md-list-separator__container"
544+
className="md-list-separator__text"
546545
>
547-
<span
548-
className="md-list-separator__text"
549-
style={Object {}}
550-
>
551-
Yesterday
552-
</span>
546+
Yesterday
553547
</span>
554548
</div>
555549
<div
@@ -603,18 +597,12 @@ Array [
603597
</div>
604598
</div>
605599
<div
606-
className="md-list-separator wxc-time-ruler"
607-
role="listitem"
600+
className="wxc-time-ruler"
608601
>
609602
<span
610-
className="md-list-separator__container"
603+
className="md-list-separator__text"
611604
>
612-
<span
613-
className="md-list-separator__text"
614-
style={Object {}}
615-
>
616-
Today
617-
</span>
605+
Today
618606
</span>
619607
</div>
620608
<div

src/components/WebexMeetingControl/WebexMeetingControl.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function renderButton(action, display, style, showText, asItem) {
3939
if (asItem) {
4040
output = (
4141
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */
42-
<div onClick={action} title={tooltip} role="button" tabIndex="0">
42+
<div onClick={action} title={tooltip} role="button" tabIndex="0" style={style}>
4343
{icon && <Icon name={icon} size={14} className="item-button-icon" />}
4444
<span className="item-button-text">{text}</span>
4545
</div>

src/components/WebexMember/WebexMember.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
margin-top: 0.063rem;
2525

2626
.guest {
27-
color: $md-gray-70;
27+
color: $wxc-gray-70;
2828
}
2929
}
3030

src/components/generic/_generic.scss

+16
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,19 @@
66
@import 'Title/Title';
77
@import 'OptionsList/OptionsList';
88
@import 'Select/Select';
9+
10+
html, body {
11+
height: 100%;
12+
}
13+
14+
body {
15+
@include body-fonts;
16+
position: relative;
17+
padding: 0;
18+
margin: 0;
19+
cursor: auto;
20+
}
21+
22+
img {
23+
width: 100%;
24+
}

src/storyshots.test.js

-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ jest.mock('./components/hooks/useActivityScroll');
99
// useElementDimensions uses Resize Observer API which expects a real Element
1010
jest.mock('./components/hooks/useElementDimensions');
1111

12-
// Mock react-uid to maintain a fixed ID for Momentum UI buttons
13-
jest.mock('react-uid', () => ({
14-
__esModule: true,
15-
UIDConsumer: ({children}) => children('md-button-0', 'md-button-0'),
16-
}));
17-
1812
/**
1913
* Returns a mock DOM ref object for use of snapshot tests.
2014
*

src/styles/_variables.scss

-23
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,6 @@ $WEBEX_MEETING_MIN_HEIGHT: 25rem;
55
$WEBEX_MEETING_MIN_WIDTH: 17rem; // Standard small phone width is 20rem, leaving some padding
66
$brand-font-folder: '../assets/fonts';
77

8-
// Momentum UI Colors
9-
// See https://momentum.design/tokens/color
10-
$md-white: #FFFFFF !default;
11-
12-
$md-gray-05: #F7F7F7 !default;
13-
$md-gray-10: #EDEDED !default;
14-
$md-gray-20: #DEDEDE !default;
15-
$md-gray-30: #CCCCCC !default;
16-
$md-gray-40: #B2B2B2 !default;
17-
$md-gray-50: #949494 !default;
18-
$md-gray-60: #707070 !default;
19-
$md-gray-70: #545454 !default;
20-
$md-gray-80: #3B3B3B !default;
21-
$md-gray-90: #292929 !default;
22-
$md-gray-95: #1C1C1C !default;
23-
$md-gray-100: #121212 !default;
24-
$md-yellow-40: #FC9D03 !default;
25-
26-
$md-red-60: #D4371C !default;
27-
28-
$md-black-100: #000000;
29-
30-
// Momentum UI Fonts
318
$font-family-sans-serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
329
$font-family-serif: Georgia, Cambria, 'Times New Roman', Times, serif;
3310
$font-family-monospace: Consolas, 'Liberation Mono', Courier, monospace;

src/themes/dark.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
--wxc-button--default--disabled--color: #{$wxc-white-alpha-40};
7474

7575
--wxc-button--ghost--normal--border: none;
76-
--wxc-button--ghost--normal--color: #{$md-white};
76+
--wxc-button--ghost--normal--color: #{$wxc-white-alpha-100};
7777

7878
--wxc-button--ghost--hover--background: #{$wxc-white-alpha-07};
7979

0 commit comments

Comments
 (0)