Skip to content

Commit

Permalink
Merge pull request #399 from kronostechnologies/dev/DS-259
Browse files Browse the repository at this point in the history
refactor(ApplicationMenu)!: rename to GlobalHeader
  • Loading branch information
meriouma authored Jan 7, 2022
2 parents 20d1f73 + 8fb6251 commit 4b6d0ee
Show file tree
Hide file tree
Showing 73 changed files with 636 additions and 688 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/avatar/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactElement, useMemo } from 'react';
import styled, { css, FlattenInterpolation, ThemeProps } from 'styled-components';
import { useTranslation } from '../../i18n/use-translation';
import { Theme } from '../../themes';
import { getInitialsFromUsername } from '../../utils/user';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import { useTranslation } from '../../i18n/use-translation';
import { Icon } from '../icon/icon';

export type AvatarSize = 'xsmall' | 'small' | 'medium' | 'large'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ exports[`BentoMenuButton Matches Snapshot (tag="nav") 1`] = `
color: #FFFFFF;
}
.c4 {
background-color: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-shadow: 0 10px 20px 0 rgba(0,0,0,0.19);
color: #000000;
list-style-type: none;
position: absolute;
width: 100%;
}
.c0 {
position: relative;
}
.c6 {
max-width: 350px;
min-width: 200px;
right: 0;
width: initial;
}
.c18 {
-webkit-align-items: center;
-webkit-box-align: center;
Expand Down Expand Up @@ -443,28 +465,6 @@ exports[`BentoMenuButton Matches Snapshot (tag="nav") 1`] = `
pointer-events: none;
}
.c4 {
background-color: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-shadow: 0 10px 20px 0 rgba(0,0,0,0.19);
color: #000000;
list-style-type: none;
position: absolute;
width: 100%;
}
.c0 {
position: relative;
}
.c6 {
max-width: 350px;
min-width: 200px;
right: 0;
width: initial;
}
.c1 .c5 {
border-radius: var(--border-radius-2x);
box-sizing: border-box;
Expand Down Expand Up @@ -853,6 +853,28 @@ exports[`BentoMenuButton Matches Snapshot 1`] = `
color: #FFFFFF;
}
.c4 {
background-color: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-shadow: 0 10px 20px 0 rgba(0,0,0,0.19);
color: #000000;
list-style-type: none;
position: absolute;
width: 100%;
}
.c0 {
position: relative;
}
.c6 {
max-width: 350px;
min-width: 200px;
right: 0;
width: initial;
}
.c18 {
-webkit-align-items: center;
-webkit-box-align: center;
Expand Down Expand Up @@ -1202,28 +1224,6 @@ exports[`BentoMenuButton Matches Snapshot 1`] = `
pointer-events: none;
}
.c4 {
background-color: #FFFFFF;
border: 1px solid #60666E;
border-radius: var(--border-radius);
box-shadow: 0 10px 20px 0 rgba(0,0,0,0.19);
color: #000000;
list-style-type: none;
position: absolute;
width: 100%;
}
.c0 {
position: relative;
}
.c6 {
max-width: 350px;
min-width: 200px;
right: 0;
width: initial;
}
.c1 .c5 {
border-radius: var(--border-radius-2x);
box-sizing: border-box;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable react/jsx-props-no-spreading */
import { FunctionComponent, useRef } from 'react';
import styled from 'styled-components';
import { useTranslation } from '../../i18n/use-translation';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import { DropdownMenuButton, StyledDropdownMenu } from '../dropdown-menu-button/dropdown-menu-button';
import { ExternalItem, ExternalItemProps, GroupItem, NavItem, NavItemProps } from '../dropdown-menu/list-items';
import { HtmlLink, StyledNavItem } from '../dropdown-menu/list-items/nav-item';
import { StyledExternalLink } from '../dropdown-menu/list-items/external-item';
import { DropdownMenuButton, StyledDropdownMenu } from '../dropdown-menu-button/dropdown-menu-button';
import { Icon } from '../icon/icon';
import { useTranslation } from '../../i18n/use-translation';
import { StyledHeading } from '../dropdown-menu/list-items/group-item';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import { HtmlLink, StyledNavItem } from '../dropdown-menu/list-items/nav-item';
import { Icon } from '../icon/icon';

const StyledDropdownMenuButton = styled(DropdownMenuButton)`
${StyledDropdownMenu} {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme';
import { mountWithProviders } from '../../test-utils/renderer';
import { findByTestId, getByTestId } from '../../test-utils/enzyme-selectors';
import { mountWithProviders } from '../../test-utils/renderer';
import { Breadcrumb } from './breadcrumb';

const defaultHistory = [
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/breadcrumb/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ReactElement, KeyboardEvent, useState, useRef, useCallback, useEffect } from 'react';
import { KeyboardEvent, ReactElement, useCallback, useEffect, useRef, useState } from 'react';
import { Link } from 'react-router-dom';
import styled from 'styled-components';
import { eventIsInside } from '../../utils/events';
import { IconButton } from '../buttons/icon-button';
import { NavMenu } from '../nav-menu/nav-menu';
import { NavMenuOption } from '../nav-menu/nav-menu-option';
import { RouteLink } from '../route-link/route-link';
import { NavMenu } from '../nav-menu/nav-menu';

export type BreadcrumbElement = NavMenuOption;

Expand Down
9 changes: 1 addition & 8 deletions packages/react/src/components/buttons/abstract-button.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
ButtonHTMLAttributes,
EventHandler,
forwardRef,
MouseEvent,
Ref,
useCallback,
} from 'react';
import { ButtonHTMLAttributes, EventHandler, forwardRef, MouseEvent, Ref, useCallback } from 'react';
import styled, { css, FlattenInterpolation, ThemeProps } from 'styled-components';
import { Theme } from '../../themes';
import { focus } from '../../utils/css-state';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/buttons/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, MouseEvent, KeyboardEvent, ReactElement, ReactNode, Ref } from 'react';
import { forwardRef, KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from 'react';
import styled from 'styled-components';
import { Theme } from '../../themes';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/buttons/icon-button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { forwardRef, KeyboardEvent, MouseEvent, ReactElement, Ref } from 'react';
import styled from 'styled-components';
import { AvatarProps } from '../avatar/avatar';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import { Icon, IconName, IconProps } from '../icon/icon';
import { AbstractButton, getButtonTypeStyles } from './abstract-button';
import { AvatarProps } from '../avatar/avatar';

type ButtonType = 'primary' | 'secondary' | 'tertiary' | 'destructive';

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/card-link/card-link.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ReactElement } from 'react';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
import { Icon } from '../icon/icon';
import styled from 'styled-components';
import { focus } from '../../utils/css-state';
import { Icon } from '../icon/icon';

const StyledIcon = styled(Icon)`
color: ${({ theme }) => theme.greys['dark-grey']};
Expand Down
10 changes: 1 addition & 9 deletions packages/react/src/components/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
ChangeEvent,
forwardRef,
FunctionComponent,
Ref,
useEffect,
useImperativeHandle,
useRef,
} from 'react';
import { ChangeEvent, forwardRef, FunctionComponent, Ref, useEffect, useImperativeHandle, useRef } from 'react';
import styled, { css } from 'styled-components';
import { focus } from '../../utils/css-state';
import { Icon } from '../icon/icon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme';
import { getByTestId } from '../../test-utils/enzyme-selectors';
import { renderWithProviders, mountWithTheme } from '../../test-utils/renderer';
import { mountWithTheme, renderWithProviders } from '../../test-utils/renderer';
import { ChooserCard } from './chooser-card';

jest.mock('../../utils/uuid');
Expand Down
13 changes: 2 additions & 11 deletions packages/react/src/components/chooser-card/chooser-card.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import {
ChangeEvent,
ReactElement,
ReactNode,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
import { ChangeEvent, ReactElement, ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { eventIsInside } from '../../utils/events';
import { v4 as uuid } from '../../utils/uuid';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import * as S from './styled-components';
import { eventIsInside } from '../../utils/events';

interface ChooserCardProps {
checked?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/datepicker/datepicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Button } from '../buttons/button';
import { useDeviceContext } from '../device-context-provider/device-context-provider';
import { FieldContainer } from '../field-container/field-container';
import { Icon } from '../icon/icon';
import { TooltipProps } from '../tooltip/tooltip';
import { CalendarHeader } from './calendar-header';
import {
DayOfWeek,
Expand All @@ -34,7 +35,6 @@ import {
setLocaleFirstDayOfWeek,
SupportedLocale,
} from './utils/datepicker-utils';
import { TooltipProps } from '../tooltip/tooltip';

interface StyledDatePickerProps extends ReactDatePickerProps {
isMobile: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { shallow } from 'enzyme';
import { ReactElement } from 'react';
import { getByTestId } from '../../test-utils/enzyme-selectors';
import { mountWithProviders, renderWithProviders } from '../../test-utils/renderer';
import { DropdownMenuButton } from './dropdown-menu-button';
import { ExternalItem, GroupItem, GroupItemProps, NavItem } from '../dropdown-menu/list-items';
import { DropdownMenuButton } from './dropdown-menu-button';

jest.mock('../../utils/uuid');

Expand Down
Loading

0 comments on commit 4b6d0ee

Please sign in to comment.