pl-fe: Exports cleanup
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -4,7 +4,7 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import AutosuggestAccountInput from 'pl-fe/components/autosuggest-account-input';
|
||||
|
||||
import SvgIcon from './ui/icon/svg-icon';
|
||||
import SvgIcon from './ui/svg-icon';
|
||||
|
||||
const messages = defineMessages({
|
||||
placeholder: { id: 'account_search.placeholder', defaultMessage: 'Search for an account' },
|
||||
|
||||
@ -7,7 +7,7 @@ import AutosuggestInput, { AutoSuggestion } from 'pl-fe/components/autosuggest-i
|
||||
import { useAppDispatch } from 'pl-fe/hooks';
|
||||
|
||||
import type { Menu } from 'pl-fe/components/dropdown-menu';
|
||||
import type { InputThemes } from 'pl-fe/components/ui/input/input';
|
||||
import type { InputThemes } from 'pl-fe/components/ui/input';
|
||||
|
||||
const noOp = () => { };
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import AutosuggestAccount from 'pl-fe/features/compose/components/autosuggest-ac
|
||||
import { textAtCursorMatchesToken } from 'pl-fe/utils/suggestions';
|
||||
|
||||
import type { Menu, MenuItem } from 'pl-fe/components/dropdown-menu';
|
||||
import type { InputThemes } from 'pl-fe/components/ui/input/input';
|
||||
import type { InputThemes } from 'pl-fe/components/ui/input';
|
||||
import type { Emoji } from 'pl-fe/features/emoji';
|
||||
|
||||
type AutoSuggestion = string | Emoji;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import Text, { IText } from './ui/text/text';
|
||||
import Text, { IText } from './ui/text';
|
||||
|
||||
interface IMarkup extends IText {
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { injectIntl, defineMessages, IntlShape, FormatDateOptions } from 'react-intl';
|
||||
|
||||
import Text, { IText } from './ui/text/text';
|
||||
import Text, { IText } from './ui/text';
|
||||
|
||||
const messages = defineMessages({
|
||||
just_now: { id: 'relative_time.just_now', defaultMessage: 'now' },
|
||||
|
||||
@ -14,7 +14,7 @@ import Markup from './markup';
|
||||
import { ParsedContent } from './parsed-content';
|
||||
import Poll from './polls/poll';
|
||||
|
||||
import type { Sizes } from 'pl-fe/components/ui/text/text';
|
||||
import type { Sizes } from 'pl-fe/components/ui/text';
|
||||
import type { MinifiedStatus } from 'pl-fe/reducers/statuses';
|
||||
|
||||
const BIG_EMOJI_LIMIT = 10;
|
||||
|
||||
@ -4,9 +4,9 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import DropdownMenu from 'pl-fe/components/dropdown-menu';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import Icon from '../icon/icon';
|
||||
import Text from '../text/text';
|
||||
import HStack from './hstack';
|
||||
import Icon from './icon';
|
||||
import Text from './text';
|
||||
|
||||
import type { Menu } from 'pl-fe/components/dropdown-menu';
|
||||
|
||||
@ -4,7 +4,7 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import StillImage, { IStillImage } from 'pl-fe/components/still-image';
|
||||
|
||||
import Icon from '../icon/icon';
|
||||
import Icon from './icon';
|
||||
|
||||
const AVATAR_SIZE = 42;
|
||||
|
||||
@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { fireEvent, render, screen } from 'pl-fe/jest/test-helpers';
|
||||
|
||||
import Button from './button';
|
||||
import Button from '.';
|
||||
|
||||
describe('<Button />', () => {
|
||||
it('renders the given text', () => {
|
||||
@ -2,7 +2,7 @@ import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import Icon from '../icon/icon';
|
||||
import Icon from '../icon';
|
||||
|
||||
import { useButtonStyles } from './useButtonStyles';
|
||||
|
||||
@ -3,10 +3,10 @@ import React from 'react';
|
||||
import { defineMessages, useIntl } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import SvgIcon from 'pl-fe/components/ui/icon/svg-icon';
|
||||
import SvgIcon from 'pl-fe/components/ui/svg-icon';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import Text from '../text/text';
|
||||
import HStack from './hstack';
|
||||
import Text from './text';
|
||||
|
||||
const sizes = {
|
||||
md: 'p-4 sm:rounded-xl',
|
||||
@ -2,8 +2,8 @@ import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { useDimensions } from 'pl-fe/hooks';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import Icon from '../icon/icon';
|
||||
import HStack from './hstack';
|
||||
import Icon from './icon';
|
||||
|
||||
interface ICarousel {
|
||||
children: any;
|
||||
@ -6,7 +6,7 @@ import { useHistory } from 'react-router-dom';
|
||||
import Helmet from 'pl-fe/components/helmet';
|
||||
import { usePlFeConfig } from 'pl-fe/hooks';
|
||||
|
||||
import { Card, CardBody, CardHeader, CardTitle, type CardSizes } from '../card/card';
|
||||
import { Card, CardBody, CardHeader, CardTitle, type CardSizes } from './card';
|
||||
|
||||
type IColumnHeader = Pick<IColumn, 'label' | 'backHref' | 'className' | 'action'>;
|
||||
|
||||
@ -1,99 +0,0 @@
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
||||
import { queryAllByRole, render, screen } from 'pl-fe/jest/test-helpers';
|
||||
|
||||
import Datepicker from './datepicker';
|
||||
|
||||
describe('<Datepicker />', () => {
|
||||
it('defaults to the current date', () => {
|
||||
const handler = vi.fn();
|
||||
render(<Datepicker onChange={handler} />);
|
||||
const today = new Date();
|
||||
|
||||
expect(screen.getByTestId('datepicker-month')).toHaveValue(String(today.getMonth()));
|
||||
expect(screen.getByTestId('datepicker-day')).toHaveValue(String(today.getDate()));
|
||||
expect(screen.getByTestId('datepicker-year')).toHaveValue(String(today.getFullYear()));
|
||||
});
|
||||
|
||||
it('changes number of days based on selected month and year', async() => {
|
||||
const handler = vi.fn();
|
||||
render(<Datepicker onChange={handler} />);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-month'),
|
||||
screen.getByRole('option', { name: 'February' }),
|
||||
);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-year'),
|
||||
screen.getByRole('option', { name: '2020' }),
|
||||
);
|
||||
|
||||
let daySelect: HTMLElement;
|
||||
daySelect = document.querySelector('[data-testid="datepicker-day"]') as HTMLElement;
|
||||
expect(queryAllByRole(daySelect, 'option')).toHaveLength(29);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-year'),
|
||||
screen.getByRole('option', { name: '2021' }),
|
||||
);
|
||||
|
||||
daySelect = document.querySelector('[data-testid="datepicker-day"]') as HTMLElement;
|
||||
expect(queryAllByRole(daySelect, 'option')).toHaveLength(28);
|
||||
});
|
||||
|
||||
it('ranges from the current year to 120 years ago', () => {
|
||||
const handler = vi.fn();
|
||||
render(<Datepicker onChange={handler} />);
|
||||
const today = new Date();
|
||||
|
||||
const yearSelect = document.querySelector('[data-testid="datepicker-year"]') as HTMLElement;
|
||||
expect(queryAllByRole(yearSelect, 'option')).toHaveLength(121);
|
||||
expect(queryAllByRole(yearSelect, 'option')[0]).toHaveValue(String(today.getFullYear()));
|
||||
expect(queryAllByRole(yearSelect, 'option')[120]).toHaveValue(String(today.getFullYear() - 120));
|
||||
});
|
||||
|
||||
it('calls the onChange function when the inputs change', async() => {
|
||||
const handler = vi.fn();
|
||||
render(<Datepicker onChange={handler} />);
|
||||
const today = new Date();
|
||||
|
||||
/**
|
||||
* A date with a different day, month, and year than today
|
||||
* so this test will always pass!
|
||||
*/
|
||||
const notToday = new Date(
|
||||
today.getFullYear() - 1, // last year
|
||||
(today.getMonth() + 2) % 11, // two months from now (mod 11 because it's 0-indexed)
|
||||
(today.getDate() + 2) % 28, // 2 days from now (for timezone stuff)
|
||||
);
|
||||
|
||||
const month = notToday.toLocaleString('en-us', { month: 'long' });
|
||||
const year = String(notToday.getFullYear());
|
||||
const day = String(notToday.getDate());
|
||||
|
||||
expect(handler.mock.calls.length).toEqual(1);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-month'),
|
||||
screen.getByRole('option', { name: month }),
|
||||
);
|
||||
|
||||
expect(handler.mock.calls.length).toEqual(2);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-year'),
|
||||
screen.getByRole('option', { name: year }),
|
||||
);
|
||||
|
||||
expect(handler.mock.calls.length).toEqual(3);
|
||||
|
||||
await userEvent.selectOptions(
|
||||
screen.getByTestId('datepicker-day'),
|
||||
screen.getByRole('option', { name: day }),
|
||||
);
|
||||
|
||||
expect(handler.mock.calls.length).toEqual(4);
|
||||
});
|
||||
});
|
||||
@ -1,92 +0,0 @@
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import { FormattedMessage, useIntl } from 'react-intl';
|
||||
|
||||
import Select from '../select/select';
|
||||
import Stack from '../stack/stack';
|
||||
import Text from '../text/text';
|
||||
|
||||
const getDaysInMonth = (month: number, year: number) => new Date(year, month + 1, 0).getDate();
|
||||
const currentYear = new Date().getFullYear();
|
||||
|
||||
interface IDatepicker {
|
||||
onChange(date: Date): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Datepicker that allows a user to select month, day, and year.
|
||||
*/
|
||||
const Datepicker = ({ onChange }: IDatepicker) => {
|
||||
const intl = useIntl();
|
||||
|
||||
const [month, setMonth] = useState<number>(new Date().getMonth());
|
||||
const [day, setDay] = useState<number>(new Date().getDate());
|
||||
const [year, setYear] = useState<number>(new Date().getFullYear());
|
||||
|
||||
const numberOfDays = useMemo(() => getDaysInMonth(month, year), [month, year]);
|
||||
|
||||
useEffect(() => {
|
||||
onChange(new Date(year, month, day));
|
||||
}, [month, day, year]);
|
||||
|
||||
return (
|
||||
<div className='grid grid-cols-1 gap-2 sm:grid-cols-3'>
|
||||
<div className='sm:col-span-1'>
|
||||
<Stack>
|
||||
<Text size='sm' weight='medium' theme='muted'>
|
||||
<FormattedMessage id='datepicker.month' defaultMessage='Month' />
|
||||
</Text>
|
||||
|
||||
<Select
|
||||
value={month}
|
||||
onChange={(event) => setMonth(Number(event.target.value))}
|
||||
data-testid='datepicker-month'
|
||||
>
|
||||
{[...Array(12)].map((_, idx) => (
|
||||
<option key={idx} value={idx}>
|
||||
{intl.formatDate(new Date(year, idx, 1), { month: 'long' })}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</Stack>
|
||||
</div>
|
||||
|
||||
<div className='sm:col-span-1'>
|
||||
<Stack>
|
||||
<Text size='sm' weight='medium' theme='muted'>
|
||||
<FormattedMessage id='datepicker.day' defaultMessage='Day' />
|
||||
</Text>
|
||||
|
||||
<Select
|
||||
value={day}
|
||||
onChange={(event) => setDay(Number(event.target.value))}
|
||||
data-testid='datepicker-day'
|
||||
>
|
||||
{[...Array(numberOfDays)].map((_, idx) => (
|
||||
<option key={idx} value={idx + 1}>{idx + 1}</option>
|
||||
))}
|
||||
</Select>
|
||||
</Stack>
|
||||
</div>
|
||||
|
||||
<div className='sm:col-span-1'>
|
||||
<Stack>
|
||||
<Text size='sm' weight='medium' theme='muted'>
|
||||
<FormattedMessage id='datepicker.year' defaultMessage='Year' />
|
||||
</Text>
|
||||
|
||||
<Select
|
||||
value={year}
|
||||
onChange={(event) => setYear(Number(event.target.value))}
|
||||
data-testid='datepicker-year'
|
||||
>
|
||||
{[...Array(121)].map((_, idx) => (
|
||||
<option key={idx} value={currentYear - idx}>{currentYear - idx}</option>
|
||||
))}
|
||||
</Select>
|
||||
</Stack>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { Datepicker as default };
|
||||
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import Text from '../text/text';
|
||||
import Text from './text';
|
||||
|
||||
import type { Sizes as TextSizes } from '../text/text';
|
||||
import type { Sizes as TextSizes } from './text';
|
||||
|
||||
interface IDivider {
|
||||
text?: string;
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import HStack from './hstack';
|
||||
|
||||
interface IFormActions {
|
||||
children: React.ReactNode;
|
||||
@ -1,8 +1,8 @@
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import Checkbox from '../checkbox/checkbox';
|
||||
import HStack from '../hstack/hstack';
|
||||
import Stack from '../stack/stack';
|
||||
import Checkbox from './checkbox';
|
||||
import HStack from './hstack';
|
||||
import Stack from './stack';
|
||||
|
||||
interface IFormGroup {
|
||||
/** Input label message. */
|
||||
@ -1,8 +1,8 @@
|
||||
import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
|
||||
import SvgIcon from '../icon/svg-icon';
|
||||
import Text from '../text/text';
|
||||
import SvgIcon from './svg-icon';
|
||||
import Text from './text';
|
||||
|
||||
interface IIconButton extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
/** Class name for the <svg> icon. */
|
||||
@ -1,8 +1,7 @@
|
||||
import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
|
||||
import Counter from '../counter/counter';
|
||||
|
||||
import Counter from './counter';
|
||||
import SvgIcon from './svg-icon';
|
||||
|
||||
interface IIcon extends Pick<React.SVGAttributes<SVGAElement>, 'strokeWidth'> {
|
||||
@ -1,11 +1,11 @@
|
||||
export { default as Accordion } from './accordion/accordion';
|
||||
export { default as Avatar } from './avatar/avatar';
|
||||
export { default as Banner } from './banner/banner';
|
||||
export { default as Button } from './button/button';
|
||||
export { default as Carousel } from './carousel/carousel';
|
||||
export { Card, CardBody, CardHeader, CardTitle } from './card/card';
|
||||
export { default as Checkbox } from './checkbox/checkbox';
|
||||
export { Column, ColumnHeader } from './column/column';
|
||||
export { default as Accordion } from './accordion';
|
||||
export { default as Avatar } from './avatar';
|
||||
export { default as Banner } from './banner';
|
||||
export { default as Button } from './button';
|
||||
export { default as Carousel } from './carousel';
|
||||
export { Card, CardBody, CardHeader, CardTitle } from './card';
|
||||
export { default as Checkbox } from './checkbox';
|
||||
export { Column, ColumnHeader } from './column';
|
||||
export {
|
||||
Combobox,
|
||||
ComboboxInput,
|
||||
@ -13,35 +13,34 @@ export {
|
||||
ComboboxList,
|
||||
ComboboxOption,
|
||||
ComboboxOptionText,
|
||||
} from './combobox/combobox';
|
||||
export { default as Counter } from './counter/counter';
|
||||
export { default as Datepicker } from './datepicker/datepicker';
|
||||
export { default as Divider } from './divider/divider';
|
||||
export { default as Emoji } from './emoji/emoji';
|
||||
export { default as FileInput } from './file-input/file-input';
|
||||
export { default as Form } from './form/form';
|
||||
export { default as FormActions } from './form-actions/form-actions';
|
||||
export { default as FormGroup } from './form-group/form-group';
|
||||
export { default as HStack } from './hstack/hstack';
|
||||
export { default as Icon } from './icon/icon';
|
||||
export { default as IconButton } from './icon-button/icon-button';
|
||||
export { default as Input } from './input/input';
|
||||
export { default as Layout } from './layout/layout';
|
||||
export { default as Modal } from './modal/modal';
|
||||
export { default as Popover } from './popover/popover';
|
||||
export { default as Portal } from './portal/portal';
|
||||
export { default as ProgressBar } from './progress-bar/progress-bar';
|
||||
export { default as RadioButton } from './radio-button/radio-button';
|
||||
export { default as Select } from './select/select';
|
||||
export { default as Slider } from './slider/slider';
|
||||
export { default as Spinner } from './spinner/spinner';
|
||||
export { default as Stack } from './stack/stack';
|
||||
export { default as Streamfield } from './streamfield/streamfield';
|
||||
export { default as Tabs } from './tabs/tabs';
|
||||
export { default as TagInput } from './tag-input/tag-input';
|
||||
export { default as Text } from './text/text';
|
||||
export { default as Textarea } from './textarea/textarea';
|
||||
export { default as Toast } from './toast/toast';
|
||||
export { default as Toggle } from './toggle/toggle';
|
||||
export { default as Tooltip } from './tooltip/tooltip';
|
||||
export { default as Widget } from './widget/widget';
|
||||
} from './combobox';
|
||||
export { default as Counter } from './counter';
|
||||
export { default as Divider } from './divider';
|
||||
export { default as Emoji } from './emoji';
|
||||
export { default as FileInput } from './file-input';
|
||||
export { default as Form } from './form';
|
||||
export { default as FormActions } from './form-actions';
|
||||
export { default as FormGroup } from './form-group';
|
||||
export { default as HStack } from './hstack';
|
||||
export { default as Icon } from './icon';
|
||||
export { default as IconButton } from './icon-button';
|
||||
export { default as Input } from './input';
|
||||
export { default as Layout } from './layout';
|
||||
export { default as Modal } from './modal';
|
||||
export { default as Popover } from './popover';
|
||||
export { default as Portal } from './portal';
|
||||
export { default as ProgressBar } from './progress-bar';
|
||||
export { default as RadioButton } from './radio-button';
|
||||
export { default as Select } from './select';
|
||||
export { default as Slider } from './slider';
|
||||
export { default as Spinner } from './spinner';
|
||||
export { default as Stack } from './stack';
|
||||
export { default as Streamfield } from './streamfield';
|
||||
export { default as Tabs } from './tabs';
|
||||
export { default as TagInput } from './tag-input';
|
||||
export { default as Text } from './text';
|
||||
export { default as Textarea } from './textarea';
|
||||
export { default as Toast } from './toast';
|
||||
export { default as Toggle } from './toggle';
|
||||
export { default as Tooltip } from './tooltip';
|
||||
export { default as Widget } from './widget';
|
||||
|
||||
@ -5,9 +5,9 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||
import { useLocale } from 'pl-fe/hooks';
|
||||
import { getTextDirection } from 'pl-fe/utils/rtl';
|
||||
|
||||
import Icon from '../icon/icon';
|
||||
import SvgIcon from '../icon/svg-icon';
|
||||
import Tooltip from '../tooltip/tooltip';
|
||||
import Icon from './icon';
|
||||
import SvgIcon from './svg-icon';
|
||||
import Tooltip from './tooltip';
|
||||
|
||||
const messages = defineMessages({
|
||||
showPassword: { id: 'input.password.show_password', defaultMessage: 'Show password' },
|
||||
@ -2,10 +2,10 @@ import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import Button from '../button/button';
|
||||
import { ButtonThemes } from '../button/useButtonStyles';
|
||||
import HStack from '../hstack/hstack';
|
||||
import IconButton from '../icon-button/icon-button';
|
||||
import Button from './button';
|
||||
import { ButtonThemes } from './button/useButtonStyles';
|
||||
import HStack from './hstack';
|
||||
import IconButton from './icon-button';
|
||||
|
||||
const messages = defineMessages({
|
||||
back: { id: 'card.back.label', defaultMessage: 'Back' },
|
||||
@ -16,7 +16,7 @@ import {
|
||||
import clsx from 'clsx';
|
||||
import React, { useRef, useState } from 'react';
|
||||
|
||||
import Portal from '../portal/portal';
|
||||
import Portal from './portal';
|
||||
|
||||
interface IPopover {
|
||||
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
@ -1,6 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import HStack from './hstack';
|
||||
|
||||
interface IRadioButton {
|
||||
value: string;
|
||||
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import Stack from '../stack/stack';
|
||||
import Text from '../text/text';
|
||||
import Stack from './stack';
|
||||
import Text from './text';
|
||||
|
||||
import './spinner.css';
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { useIntl, defineMessages } from 'react-intl';
|
||||
|
||||
import Button from '../button/button';
|
||||
import HStack from '../hstack/hstack';
|
||||
import IconButton from '../icon-button/icon-button';
|
||||
import Stack from '../stack/stack';
|
||||
import Text from '../text/text';
|
||||
import Button from './button';
|
||||
import HStack from './hstack';
|
||||
import IconButton from './icon-button';
|
||||
import Stack from './stack';
|
||||
import Text from './text';
|
||||
|
||||
const messages = defineMessages({
|
||||
add: { id: 'streamfield.add', defaultMessage: 'Add' },
|
||||
@ -9,7 +9,7 @@ import clsx from 'clsx';
|
||||
import React from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import Counter from '../counter/counter';
|
||||
import Counter from './counter';
|
||||
|
||||
import './tabs.css';
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
|
||||
import HStack from './hstack';
|
||||
import Tag from './tag';
|
||||
|
||||
interface ITagInput {
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import IconButton from '../icon-button/icon-button';
|
||||
import Text from '../text/text';
|
||||
import IconButton from './icon-button';
|
||||
import Text from './text';
|
||||
|
||||
interface ITag {
|
||||
/** Name of the tag. */
|
||||
@ -5,8 +5,8 @@ import { FormattedMessage } from 'react-intl';
|
||||
import { useLocale } from 'pl-fe/hooks';
|
||||
import { getTextDirection } from 'pl-fe/utils/rtl';
|
||||
|
||||
import Stack from '../stack/stack';
|
||||
import Text from '../text/text';
|
||||
import Stack from './stack';
|
||||
import Text from './text';
|
||||
|
||||
interface ITextarea extends Pick<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'id' | 'maxLength' | 'onChange' | 'onClick' | 'onKeyDown' | 'onPaste' | 'required' | 'disabled' | 'rows' | 'readOnly'> {
|
||||
/** Put the cursor into the input on mount. */
|
||||
@ -6,10 +6,10 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import { ToastText, ToastType } from 'pl-fe/toast';
|
||||
|
||||
import HStack from '../hstack/hstack';
|
||||
import Icon from '../icon/icon';
|
||||
import Stack from '../stack/stack';
|
||||
import Text from '../text/text';
|
||||
import HStack from './hstack';
|
||||
import Icon from './icon';
|
||||
import Stack from './stack';
|
||||
import Text from './text';
|
||||
|
||||
const renderText = (text: ToastText) => {
|
||||
if (typeof text === 'string') {
|
||||
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
import HStack from 'pl-fe/components/ui/hstack/hstack';
|
||||
import IconButton from 'pl-fe/components/ui/icon-button/icon-button';
|
||||
import Stack from 'pl-fe/components/ui/stack/stack';
|
||||
import Text from 'pl-fe/components/ui/text/text';
|
||||
import HStack from 'pl-fe/components/ui/hstack';
|
||||
import IconButton from 'pl-fe/components/ui/icon-button';
|
||||
import Stack from 'pl-fe/components/ui/stack';
|
||||
import Text from 'pl-fe/components/ui/text';
|
||||
|
||||
interface IWidgetTitle {
|
||||
/** Title text for the widget. */
|
||||
@ -4,7 +4,7 @@ import { Link, useHistory } from 'react-router-dom';
|
||||
|
||||
import { changeSetting } from 'pl-fe/actions/settings';
|
||||
import { Column, Text } from 'pl-fe/components/ui';
|
||||
import SvgIcon from 'pl-fe/components/ui/icon/svg-icon';
|
||||
import SvgIcon from 'pl-fe/components/ui/svg-icon';
|
||||
import { useAppDispatch } from 'pl-fe/hooks';
|
||||
import toast from 'pl-fe/toast';
|
||||
import sourceCode from 'pl-fe/utils/code';
|
||||
|
||||
@ -27,7 +27,7 @@ import { isDefaultAvatar, isDefaultHeader } from 'pl-fe/utils/accounts';
|
||||
import AvatarPicker from './components/avatar-picker';
|
||||
import HeaderPicker from './components/header-picker';
|
||||
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield/streamfield';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield';
|
||||
import type { Account } from 'pl-fe/normalizers';
|
||||
|
||||
const nonDefaultAvatar = (url: string | undefined) => url && isDefaultAvatar(url) ? undefined : url;
|
||||
|
||||
@ -12,7 +12,7 @@ import toast from 'pl-fe/toast';
|
||||
import { SelectDropdown } from '../forms';
|
||||
|
||||
import type { FilterContext } from 'pl-api';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield/streamfield';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield';
|
||||
|
||||
interface IFilterField {
|
||||
id?: string;
|
||||
|
||||
@ -4,7 +4,7 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
||||
import { useInteractionPolicies } from 'pl-fe/api/hooks';
|
||||
import List, { ListItem } from 'pl-fe/components/list';
|
||||
import { Button, CardTitle, Column, Form, FormActions, Tabs } from 'pl-fe/components/ui';
|
||||
import { InlineMultiselect } from 'pl-fe/components/ui/inline-multiselect/inline-multiselect';
|
||||
import { InlineMultiselect } from 'pl-fe/components/ui/inline-multiselect';
|
||||
import toast from 'pl-fe/toast';
|
||||
|
||||
import Warning from '../compose/components/warning';
|
||||
|
||||
@ -5,7 +5,7 @@ import { type FilterType, setFilter } from 'pl-fe/actions/notifications';
|
||||
import { Icon, Tabs } from 'pl-fe/components/ui';
|
||||
import { useAppDispatch, useFeatures, useSettings } from 'pl-fe/hooks';
|
||||
|
||||
import type { Item } from 'pl-fe/components/ui/tabs/tabs';
|
||||
import type { Item } from 'pl-fe/components/ui/tabs';
|
||||
|
||||
const messages = defineMessages({
|
||||
all: { id: 'notifications.filter.all', defaultMessage: 'All' },
|
||||
|
||||
@ -3,7 +3,7 @@ import { useIntl, defineMessages } from 'react-intl';
|
||||
|
||||
import { HStack, Input } from 'pl-fe/components/ui';
|
||||
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield/streamfield';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield';
|
||||
import type { CryptoAddress } from 'pl-fe/types/pl-fe';
|
||||
|
||||
const messages = defineMessages({
|
||||
|
||||
@ -3,7 +3,7 @@ import { useIntl, defineMessages } from 'react-intl';
|
||||
|
||||
import { HStack, Input } from 'pl-fe/components/ui';
|
||||
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield/streamfield';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield';
|
||||
import type { FooterItem } from 'pl-fe/types/pl-fe';
|
||||
|
||||
const messages = defineMessages({
|
||||
|
||||
@ -5,7 +5,7 @@ import { HStack, Input } from 'pl-fe/components/ui';
|
||||
|
||||
import IconPicker from './icon-picker';
|
||||
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield/streamfield';
|
||||
import type { StreamfieldComponent } from 'pl-fe/components/ui/streamfield';
|
||||
import type { PromoPanelItem } from 'pl-fe/types/pl-fe';
|
||||
|
||||
const messages = defineMessages({
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
} from 'pl-fe/actions/search';
|
||||
import AutosuggestAccountInput from 'pl-fe/components/autosuggest-account-input';
|
||||
import { Input } from 'pl-fe/components/ui';
|
||||
import SvgIcon from 'pl-fe/components/ui/icon/svg-icon';
|
||||
import SvgIcon from 'pl-fe/components/ui/svg-icon';
|
||||
import { useAppDispatch, useAppSelector } from 'pl-fe/hooks';
|
||||
import { selectAccount } from 'pl-fe/selectors';
|
||||
import { AppDispatch, RootState } from 'pl-fe/store';
|
||||
|
||||
@ -10,7 +10,7 @@ import AccountContainer from 'pl-fe/containers/account-container';
|
||||
import { useAppDispatch, useAppSelector } from 'pl-fe/hooks';
|
||||
|
||||
import type { BaseModalProps } from '../modal-root';
|
||||
import type { Item } from 'pl-fe/components/ui/tabs/tabs';
|
||||
import type { Item } from 'pl-fe/components/ui/tabs';
|
||||
|
||||
const messages = defineMessages({
|
||||
all: { id: 'reactions.all', defaultMessage: 'All' },
|
||||
|
||||
Reference in New Issue
Block a user