@inceptionbg/iui 2.0.34 → 2.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -6
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/package.json +25 -22
- package/idea/GridTable/GridTable.tsx +0 -119
- package/idea/GridTable/gridTable.scss +0 -42
- package/idea/Menu/Menu.tsx +0 -121
- package/idea/Menu/MenuItem.tsx +0 -75
- package/idea/Menu/hooks/useMenuControl.ts +0 -13
- package/idea/Menu.tsx +0 -133
- package/idea/NoAccessInfo.tsx +0 -193
- package/idea/Table/Components/Edit/ItemActionsMenu.tsx +0 -85
- package/idea/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -31
- package/idea/Table/Components/Edit/TableEditRow.tsx +0 -57
- package/idea/Table/Components/FilterItem.tsx +0 -20
- package/idea/Table/Components/Header/TableHeader.tsx +0 -46
- package/idea/Table/Components/Header/TableHeaderRow.tsx +0 -37
- package/idea/Table/Components/Print/CustomTablePrint.tsx +0 -115
- package/idea/Table/Components/SetSortList.tsx +0 -30
- package/idea/Table/Components/SetTableFilter.tsx +0 -91
- package/idea/Table/Components/TableFooter.tsx +0 -137
- package/idea/Table/Components/TableOptions.tsx +0 -227
- package/idea/Table/Components/Templates/TemplateCreate.tsx +0 -80
- package/idea/Table/Components/Templates/TemplateCreateDefault.tsx +0 -45
- package/idea/Table/Components/Templates/TemplateList.tsx +0 -167
- package/idea/Table/Components/Templates/repo/TemplateRepo.ts +0 -53
- package/idea/Table/Table.tsx +0 -528
- package/idea/Table/hooks/useDefaultTemplate.ts +0 -20
- package/idea/Table/hooks/useTableKeyboard.ts +0 -137
- package/idea/Table/hooks/useTableSelect.ts +0 -11
- package/rollup.config.js +0 -52
- package/src/assets/icons/duotone/faBell.ts +0 -17
- package/src/assets/icons/duotone/faCircleUser.ts +0 -17
- package/src/assets/icons/regular/faArrowLeft.ts +0 -15
- package/src/assets/icons/regular/faArrowRightArrowLeft.ts +0 -15
- package/src/assets/icons/regular/faCircleCheck.ts +0 -15
- package/src/assets/icons/regular/faCircleExclamation.ts +0 -15
- package/src/assets/icons/regular/faCircleInfo.ts +0 -15
- package/src/assets/icons/regular/faFileArrowDown.ts +0 -15
- package/src/assets/icons/regular/faFilterCircleXmark.ts +0 -15
- package/src/assets/icons/regular/faTriangleExclamation.ts +0 -15
- package/src/assets/icons/solid/faAngleLeft.ts +0 -15
- package/src/assets/icons/solid/faAngleRight.ts +0 -15
- package/src/assets/icons/solid/faArrowDownWideShort.ts +0 -15
- package/src/assets/icons/solid/faCaretDown.ts +0 -15
- package/src/assets/icons/solid/faCheck.ts +0 -15
- package/src/assets/icons/solid/faEllipsisVertical.ts +0 -15
- package/src/assets/icons/solid/faEnvelopeDot.ts +0 -15
- package/src/assets/icons/solid/faFilter.ts +0 -15
- package/src/assets/icons/solid/faFloppyDisk.ts +0 -15
- package/src/assets/icons/solid/faGripDotsVertical.ts +0 -15
- package/src/assets/icons/solid/faListUl.ts +0 -15
- package/src/assets/icons/solid/faMinus.ts +0 -15
- package/src/assets/icons/solid/faPlus.ts +0 -15
- package/src/assets/icons/solid/faPrint.ts +0 -15
- package/src/assets/icons/solid/faRotateRight.ts +0 -15
- package/src/assets/icons/solid/faXmark.ts +0 -15
- package/src/assets/images/logo/inception.svg +0 -22
- package/src/assets/images/logo/mts.svg +0 -5703
- package/src/assets/images/logo/paperless.svg +0 -21
- package/src/assets/images/logo/pismonosa.png +0 -0
- package/src/assets/images/not-found.svg +0 -19
- package/src/components/Accordions/Accordions.tsx +0 -74
- package/src/components/Alert/Alert.tsx +0 -31
- package/src/components/Badge/DotBadge.tsx +0 -16
- package/src/components/Badge/NotificationBadge.tsx +0 -29
- package/src/components/Badge/PillBadge.tsx +0 -13
- package/src/components/Button/Button.tsx +0 -56
- package/src/components/Button/IconButton.tsx +0 -51
- package/src/components/Button/SplitButton.tsx +0 -91
- package/src/components/Dashboard/Dashboard.tsx +0 -9
- package/src/components/Dashboard/DashboardWidget.tsx +0 -44
- package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +0 -36
- package/src/components/Dialog/Dialog.tsx +0 -178
- package/src/components/Dialog/components/DialogFooter.tsx +0 -100
- package/src/components/Header/Components/EnvBadge.tsx +0 -17
- package/src/components/Header/Components/ModuleSelect.tsx +0 -68
- package/src/components/Header/Components/Notifications.tsx +0 -204
- package/src/components/Header/Components/UserMenu.tsx +0 -52
- package/src/components/Header/Header.tsx +0 -45
- package/src/components/Helper/Collapse.tsx +0 -53
- package/src/components/Inputs/Checkbox.tsx +0 -53
- package/src/components/Inputs/CurrencyInput.tsx +0 -124
- package/src/components/Inputs/DateInput/DateInput.tsx +0 -184
- package/src/components/Inputs/DateInput/components/DatePartInput.tsx +0 -159
- package/src/components/Inputs/InputWrapper.tsx +0 -95
- package/src/components/Inputs/NumberInput.tsx +0 -86
- package/src/components/Inputs/PasswordInput.tsx +0 -39
- package/src/components/Inputs/PhoneInput/PhoneInput.tsx +0 -108
- package/src/components/Inputs/PhoneInput/utils/countryCode.ts +0 -20
- package/src/components/Inputs/Radio.tsx +0 -59
- package/src/components/Inputs/RadioGroup.tsx +0 -48
- package/src/components/Inputs/RadioLarge.tsx +0 -39
- package/src/components/Inputs/SearchInput.tsx +0 -46
- package/src/components/Inputs/Selects/Select.tsx +0 -17
- package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +0 -19
- package/src/components/Inputs/Selects/components/SelectWrapper.tsx +0 -118
- package/src/components/Inputs/Selects/utils/selectStyles.ts +0 -101
- package/src/components/Inputs/TextAreaInput.tsx +0 -68
- package/src/components/Inputs/TextInput.tsx +0 -100
- package/src/components/Inputs/TimeInput/TimeInput.tsx +0 -81
- package/src/components/List/List.tsx +0 -21
- package/src/components/List/ListItem.tsx +0 -70
- package/src/components/Loader/Loader.tsx +0 -66
- package/src/components/Loader/ProgressBar.tsx +0 -41
- package/src/components/Menu/Menu.tsx +0 -81
- package/src/components/Menu/MenuItem.tsx +0 -46
- package/src/components/Menu/NewMenu.tsx +0 -63
- package/src/components/Menu/hooks/useMenuPosition.tsx +0 -116
- package/src/components/PageComponents/ScrollableContent.tsx +0 -11
- package/src/components/Pullover/Pullover.tsx +0 -197
- package/src/components/Router/Router.tsx +0 -52
- package/src/components/Sidebar/AddButton.tsx +0 -22
- package/src/components/Sidebar/Sidebar.tsx +0 -85
- package/src/components/Sidebar/SidebarItem.tsx +0 -84
- package/src/components/Sidebar/types/ISidebar.ts +0 -28
- package/src/components/Table/Table.tsx +0 -258
- package/src/components/Table/components/columns/ColumnsList.tsx +0 -60
- package/src/components/Table/components/columns/TableColumnsEdit.tsx +0 -114
- package/src/components/Table/components/edit/TableEditRow.tsx +0 -78
- package/src/components/Table/components/filters/FilterItem.tsx +0 -15
- package/src/components/Table/components/filters/TableFilters.tsx +0 -126
- package/src/components/Table/components/footer/TableFooter.tsx +0 -126
- package/src/components/Table/components/header/TableHeader.tsx +0 -40
- package/src/components/Table/components/header/TableHeaderRow.tsx +0 -57
- package/src/components/Table/components/items/TableItemActions.tsx +0 -78
- package/src/components/Table/components/print/TablePrint.tsx +0 -200
- package/src/components/Table/components/select/TableSelect.tsx +0 -50
- package/src/components/Table/components/sort/TableSort.tsx +0 -75
- package/src/components/Table/components/templates/CreateTemplateDialog.tsx +0 -58
- package/src/components/Table/components/templates/TableTemplates.tsx +0 -65
- package/src/components/Table/components/templates/TemplatesPullover.tsx +0 -88
- package/src/components/Table/contexts/TableContext.tsx +0 -117
- package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +0 -70
- package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +0 -82
- package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +0 -175
- package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +0 -12
- package/src/components/Table/hooks/useTableColumns.ts +0 -34
- package/src/components/Table/hooks/useTableEdit.tsx +0 -140
- package/src/components/Table/hooks/useTableFilterFields.tsx +0 -150
- package/src/components/Table/hooks/useTablePagination.ts +0 -19
- package/src/components/Table/hooks/useTablePrint.ts +0 -83
- package/src/components/Table/hooks/useTableSearch.ts +0 -31
- package/src/components/Table/hooks/useTableSelect.ts +0 -19
- package/src/components/Table/hooks/useTableSort.ts +0 -8
- package/src/components/Tabs/Tabs.tsx +0 -68
- package/src/components/Tooltip/Tooltip.tsx +0 -191
- package/src/components/Tree/Tree.tsx +0 -22
- package/src/components/Tree/TreeItem.tsx +0 -57
- package/src/components/Wrappers/AppLayout.tsx +0 -17
- package/src/components/Wrappers/ConditionalWrapper.tsx +0 -10
- package/src/components/Wrappers/FormWrapper.tsx +0 -84
- package/src/components/Wrappers/PageLayout.tsx +0 -168
- package/src/hooks/useBackgroundClose.ts +0 -19
- package/src/hooks/useGetFocusableElements.ts +0 -43
- package/src/hooks/useIsMenuOpen.ts +0 -11
- package/src/hooks/useLocalPopoverControl.ts +0 -63
- package/src/hooks/useOnEsc.ts +0 -14
- package/src/hooks/usePopupControl.ts +0 -22
- package/src/hooks/useZendesk.ts +0 -21
- package/src/index.ts +0 -387
- package/src/pages/NoAccessPage.tsx +0 -27
- package/src/pages/NotFoundPage.tsx +0 -26
- package/src/styles/App.scss +0 -47
- package/src/styles/common/_animations.scss +0 -58
- package/src/styles/common/_typography.scss +0 -91
- package/src/styles/common/helpers/_base.scss +0 -55
- package/src/styles/common/helpers/_color.scss +0 -10
- package/src/styles/common/helpers/_display.scss +0 -85
- package/src/styles/common/helpers/_size.scss +0 -25
- package/src/styles/common/maps/_align.scss +0 -21
- package/src/styles/common/maps/_buttonMaps.scss +0 -42
- package/src/styles/common/maps/_info-types.scss +0 -1
- package/src/styles/common/maps/_spacing.scss +0 -78
- package/src/styles/common/maps/_text.scss +0 -14
- package/src/styles/components/_accordions.scss +0 -51
- package/src/styles/components/_alert.scss +0 -23
- package/src/styles/components/_badge.scss +0 -84
- package/src/styles/components/_button.scss +0 -99
- package/src/styles/components/_buttonSplit.scss +0 -65
- package/src/styles/components/_card.scss +0 -24
- package/src/styles/components/_dialog.scss +0 -119
- package/src/styles/components/_form.scss +0 -8
- package/src/styles/components/_header.scss +0 -157
- package/src/styles/components/_input.scss +0 -167
- package/src/styles/components/_inputCheckbox.scss +0 -48
- package/src/styles/components/_inputDateTime.scss +0 -161
- package/src/styles/components/_inputRadio.scss +0 -83
- package/src/styles/components/_inputSelect.scss +0 -8
- package/src/styles/components/_list.scss +0 -58
- package/src/styles/components/_loader.scss +0 -55
- package/src/styles/components/_menu-v2.scss +0 -67
- package/src/styles/components/_menu.scss +0 -62
- package/src/styles/components/_notifications.scss +0 -71
- package/src/styles/components/_page.scss +0 -84
- package/src/styles/components/_portal.scss +0 -8
- package/src/styles/components/_print.scss +0 -77
- package/src/styles/components/_progressBar.scss +0 -83
- package/src/styles/components/_pullover.scss +0 -95
- package/src/styles/components/_scrollbar.scss +0 -18
- package/src/styles/components/_sidebar.scss +0 -204
- package/src/styles/components/_smallComponents.scss +0 -23
- package/src/styles/components/_table.scss +0 -340
- package/src/styles/components/_tabs.scss +0 -33
- package/src/styles/components/_tooltip.scss +0 -48
- package/src/styles/components/_tree.scss +0 -21
- package/src/styles/components/_widget.scss +0 -90
- package/src/styles/pages/_fullScreenPage.scss +0 -64
- package/src/styles/variables/_bp.scss +0 -6
- package/src/styles/variables/_variables.scss +0 -142
- package/src/types/Base/custom.d.ts +0 -9
- package/src/types/IBasic.ts +0 -32
- package/src/types/ICountryCode.ts +0 -5
- package/src/types/IError.ts +0 -5
- package/src/types/IHeader.ts +0 -40
- package/src/types/IInfo.ts +0 -1
- package/src/types/IKeyboard.ts +0 -33
- package/src/types/IMenu.ts +0 -19
- package/src/types/INotifications.ts +0 -15
- package/src/types/IPopup.ts +0 -17
- package/src/types/IRouter.ts +0 -6
- package/src/types/ISelect.ts +0 -54
- package/src/types/ITab.ts +0 -10
- package/src/types/ITable.ts +0 -291
- package/src/types/ITree.ts +0 -6
- package/src/utils/InputPatternValidation.ts +0 -12
- package/src/utils/dateUtils.ts +0 -32
- package/src/utils/fileUtils.ts +0 -177
- package/src/utils/i18n/i18nIUICyrilic.ts +0 -119
- package/src/utils/i18n/i18nIUILatin.ts +0 -120
- package/src/utils/i18n/i18nIUIMe.ts +0 -118
- package/src/utils/icons.ts +0 -13
- package/src/utils/localStorageHelper.ts +0 -24
- package/src/utils/logoUtils.ts +0 -7
- package/src/utils/numberUtils.ts +0 -21
- package/src/utils/objectUtils.ts +0 -114
- package/src/utils/popupUtils.ts +0 -82
- package/src/utils/rootDir.ts +0 -1
- package/src/utils/stringUtils.ts +0 -18
- package/src/utils/tableUtils.ts +0 -130
- package/src/utils/toasts.ts +0 -6
- package/src/utils/urlUtils.ts +0 -4
- package/tsconfig.icons.json +0 -5
- package/tsconfig.json +0 -22
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { ITab } from '../../types/ITab';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { faArrowsToLine, faArrowsUpDown } from '@inceptionbg/icons';
|
|
5
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { Collapse } from '../Helper/Collapse';
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
tabs: ITab[];
|
|
11
|
-
initialValue?: string;
|
|
12
|
-
compact?: boolean;
|
|
13
|
-
keepContentInDom?: boolean;
|
|
14
|
-
control?: {
|
|
15
|
-
value: string;
|
|
16
|
-
setValue: (value: string) => void;
|
|
17
|
-
};
|
|
18
|
-
className?: string;
|
|
19
|
-
classNameContent?: string;
|
|
20
|
-
}
|
|
21
|
-
export const Accordions: FC<Props> = ({
|
|
22
|
-
tabs: allTabs,
|
|
23
|
-
initialValue,
|
|
24
|
-
compact,
|
|
25
|
-
keepContentInDom,
|
|
26
|
-
control,
|
|
27
|
-
className,
|
|
28
|
-
classNameContent,
|
|
29
|
-
}) => {
|
|
30
|
-
const tabs = allTabs.filter(tab => !tab.hidden);
|
|
31
|
-
const [selected, setSelected] = useState(initialValue || '');
|
|
32
|
-
|
|
33
|
-
return tabs.length > 0 ? (
|
|
34
|
-
<div className={clsx('iui-accordions', className)}>
|
|
35
|
-
{tabs.map(tab => {
|
|
36
|
-
const isOpen = (control?.value ?? selected) === tab.value;
|
|
37
|
-
return (
|
|
38
|
-
<div
|
|
39
|
-
key={tab.value}
|
|
40
|
-
className={clsx('iui-accordion', {
|
|
41
|
-
selected: isOpen,
|
|
42
|
-
compact,
|
|
43
|
-
})}
|
|
44
|
-
>
|
|
45
|
-
<div
|
|
46
|
-
className={clsx('summary clickable', {
|
|
47
|
-
disabled: tab.disabled,
|
|
48
|
-
})}
|
|
49
|
-
onClick={
|
|
50
|
-
tab.disabled
|
|
51
|
-
? undefined
|
|
52
|
-
: () => (control?.setValue ?? setSelected)(isOpen ? '' : tab.value)
|
|
53
|
-
}
|
|
54
|
-
>
|
|
55
|
-
<div className="flex center">
|
|
56
|
-
{tab.icon && <FontAwesomeIcon icon={tab.icon} className="iui-icon" />}
|
|
57
|
-
{tab.label}
|
|
58
|
-
</div>
|
|
59
|
-
<FontAwesomeIcon
|
|
60
|
-
icon={isOpen ? faArrowsToLine : faArrowsUpDown}
|
|
61
|
-
className="collapse-icon"
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
<Collapse isOpen={isOpen} keepContentInDom={keepContentInDom}>
|
|
65
|
-
<div className={clsx('iui-accordion-content', classNameContent)}>
|
|
66
|
-
{tab.component}
|
|
67
|
-
</div>
|
|
68
|
-
</Collapse>
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
})}
|
|
72
|
-
</div>
|
|
73
|
-
) : null;
|
|
74
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { IInfoType } from '../../types/IInfo';
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { infoIcons } from '../../utils/icons';
|
|
6
|
-
|
|
7
|
-
export interface IAlertProps {
|
|
8
|
-
text?: string;
|
|
9
|
-
severity: IInfoType;
|
|
10
|
-
fitContent?: boolean;
|
|
11
|
-
className?: string;
|
|
12
|
-
children?: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Alert: FC<IAlertProps> = ({
|
|
16
|
-
text,
|
|
17
|
-
severity,
|
|
18
|
-
fitContent,
|
|
19
|
-
className,
|
|
20
|
-
children,
|
|
21
|
-
}) => (
|
|
22
|
-
<div
|
|
23
|
-
className={clsx('iui-alert', severity, className, {
|
|
24
|
-
'width-fit': fitContent,
|
|
25
|
-
})}
|
|
26
|
-
>
|
|
27
|
-
<FontAwesomeIcon icon={infoIcons[severity]} />
|
|
28
|
-
{text && <p>{text}</p>}
|
|
29
|
-
{children}
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { IInfoType } from '../../types/IInfo';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
label: string;
|
|
7
|
-
color: IInfoType | 'gray';
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const DotBadge: FC<Props> = ({ label, color, className }) => (
|
|
12
|
-
<div className="flex align-center gap-2">
|
|
13
|
-
<div className={clsx('iui-dot-badge', color, className)} />
|
|
14
|
-
{label}
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { IInfoType } from '../../types/IInfo';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
number?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
size?: 's' | 'm';
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
color?: IInfoType | 'primary';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const NotificationBadge: FC<Props> = ({
|
|
14
|
-
number,
|
|
15
|
-
className,
|
|
16
|
-
size = 'm',
|
|
17
|
-
children,
|
|
18
|
-
color = 'primary',
|
|
19
|
-
}) =>
|
|
20
|
-
!!number && number > 0 ? (
|
|
21
|
-
<div className="iui-badge-parent">
|
|
22
|
-
{children}
|
|
23
|
-
<div className={clsx('iui-badge', color, className, size)}>
|
|
24
|
-
{number > 99 ? '99+' : number}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
) : (
|
|
28
|
-
children
|
|
29
|
-
);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { IInfoType } from '../../types/IInfo';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
label: string;
|
|
7
|
-
color: IInfoType | 'gray';
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const PillBadge: FC<Props> = ({ label, color, className }) => (
|
|
12
|
-
<div className={clsx('iui-pill-badge', color, className)}>{label}</div>
|
|
13
|
-
);
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import type { ButtonHTMLAttributes, FC, MouseEventHandler, Ref } from 'react';
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
export type IButtonColor = 'primary' | 'neutral' | 'danger';
|
|
7
|
-
export type IButtonVariant = 'solid' | 'outlined' | 'simple';
|
|
8
|
-
|
|
9
|
-
export interface IButtonProps {
|
|
10
|
-
label: string;
|
|
11
|
-
icon?: IconDefinition;
|
|
12
|
-
iconEnd?: IconDefinition;
|
|
13
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
14
|
-
variant?: IButtonVariant;
|
|
15
|
-
color?: IButtonColor;
|
|
16
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
active?: boolean;
|
|
19
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
20
|
-
className?: string;
|
|
21
|
-
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
22
|
-
ref?: Ref<HTMLButtonElement>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const Button: FC<IButtonProps> = ({
|
|
26
|
-
label,
|
|
27
|
-
icon,
|
|
28
|
-
iconEnd,
|
|
29
|
-
onClick,
|
|
30
|
-
variant = 'solid',
|
|
31
|
-
color,
|
|
32
|
-
size = 'm',
|
|
33
|
-
disabled,
|
|
34
|
-
active,
|
|
35
|
-
type = 'button',
|
|
36
|
-
className,
|
|
37
|
-
buttonProps,
|
|
38
|
-
ref,
|
|
39
|
-
}) => (
|
|
40
|
-
<button
|
|
41
|
-
ref={ref}
|
|
42
|
-
disabled={disabled}
|
|
43
|
-
className={clsx('iui-btn iui-text-btn', variant, color, size, className, {
|
|
44
|
-
active,
|
|
45
|
-
primary: !color && variant === 'solid',
|
|
46
|
-
neutral: !color && variant !== 'solid',
|
|
47
|
-
})}
|
|
48
|
-
onClick={onClick}
|
|
49
|
-
type={type}
|
|
50
|
-
{...buttonProps}
|
|
51
|
-
>
|
|
52
|
-
{icon && <FontAwesomeIcon icon={icon} />}
|
|
53
|
-
<div className="iui-btn-label">{label}</div>
|
|
54
|
-
{iconEnd && <FontAwesomeIcon icon={iconEnd} />}
|
|
55
|
-
</button>
|
|
56
|
-
);
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import type { ButtonHTMLAttributes, FC, MouseEventHandler, Ref } from 'react';
|
|
3
|
-
import type { IButtonColor, IButtonVariant } from './Button';
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import { Tooltip } from '../Tooltip/Tooltip';
|
|
7
|
-
|
|
8
|
-
export interface IIconButtonProps {
|
|
9
|
-
icon: IconDefinition;
|
|
10
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
|
-
variant?: IButtonVariant;
|
|
12
|
-
color?: IButtonColor;
|
|
13
|
-
size?: 's' | 'm' | 'l';
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
active?: boolean;
|
|
16
|
-
tooltip?: string;
|
|
17
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
18
|
-
className?: string;
|
|
19
|
-
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
20
|
-
ref?: Ref<HTMLButtonElement>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const IconButton: FC<IIconButtonProps> = ({
|
|
24
|
-
icon,
|
|
25
|
-
onClick,
|
|
26
|
-
variant = 'simple',
|
|
27
|
-
color = 'primary',
|
|
28
|
-
size = 'm',
|
|
29
|
-
disabled,
|
|
30
|
-
active,
|
|
31
|
-
tooltip,
|
|
32
|
-
type = 'button',
|
|
33
|
-
className,
|
|
34
|
-
buttonProps,
|
|
35
|
-
ref,
|
|
36
|
-
}) => (
|
|
37
|
-
<Tooltip label={tooltip} disabled={disabled}>
|
|
38
|
-
<button
|
|
39
|
-
ref={ref}
|
|
40
|
-
disabled={disabled}
|
|
41
|
-
className={clsx('iui-btn iui-icon-btn', variant, color, size, className, {
|
|
42
|
-
active,
|
|
43
|
-
})}
|
|
44
|
-
onClick={onClick}
|
|
45
|
-
type={type}
|
|
46
|
-
{...buttonProps}
|
|
47
|
-
>
|
|
48
|
-
<FontAwesomeIcon icon={icon} />
|
|
49
|
-
</button>
|
|
50
|
-
</Tooltip>
|
|
51
|
-
);
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import type { ButtonHTMLAttributes, FC, MouseEventHandler, Ref } from 'react';
|
|
3
|
-
import type { IMenuItem, IMenuPlacement } from '../../types/IMenu';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { faCaretDown } from '../../assets/icons/solid/faCaretDown';
|
|
8
|
-
import { useIsMenuOpen } from '../../hooks/useIsMenuOpen';
|
|
9
|
-
import { Menu } from '../Menu/Menu';
|
|
10
|
-
|
|
11
|
-
export type ISplitAction = Pick<IMenuItem, 'label' | 'onClick'> &
|
|
12
|
-
Partial<Pick<IMenuItem, 'icon' | 'active' | 'disabled' | 'hidden'>>;
|
|
13
|
-
|
|
14
|
-
export interface IButtonProps {
|
|
15
|
-
label: string;
|
|
16
|
-
icon?: IconDefinition;
|
|
17
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
18
|
-
splitActions?: ISplitAction[];
|
|
19
|
-
menuPlacement?: IMenuPlacement;
|
|
20
|
-
variant?: 'solid' | 'outlined';
|
|
21
|
-
size?: 'xs' | 's' | 'm' | 'l';
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
24
|
-
className?: string;
|
|
25
|
-
fullWidth?: boolean;
|
|
26
|
-
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
27
|
-
ref?: Ref<HTMLButtonElement>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const SplitButton: FC<IButtonProps> = ({
|
|
31
|
-
label,
|
|
32
|
-
icon,
|
|
33
|
-
onClick,
|
|
34
|
-
splitActions,
|
|
35
|
-
menuPlacement = 'bottom-right',
|
|
36
|
-
variant = 'solid',
|
|
37
|
-
size = 'm',
|
|
38
|
-
disabled,
|
|
39
|
-
type = 'button',
|
|
40
|
-
className,
|
|
41
|
-
fullWidth,
|
|
42
|
-
buttonProps,
|
|
43
|
-
ref,
|
|
44
|
-
}) => {
|
|
45
|
-
const { isOpen, onClose, onOpen } = useIsMenuOpen();
|
|
46
|
-
|
|
47
|
-
const filteredActions = useMemo(
|
|
48
|
-
() => splitActions?.filter(action => !action.hidden),
|
|
49
|
-
[splitActions]
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<button
|
|
54
|
-
ref={ref}
|
|
55
|
-
disabled={disabled}
|
|
56
|
-
className={clsx('iui-btn iui-split-btn', variant, size, className, {
|
|
57
|
-
primary: variant === 'solid',
|
|
58
|
-
neutral: variant !== 'solid',
|
|
59
|
-
})}
|
|
60
|
-
onClick={onClick}
|
|
61
|
-
type={type}
|
|
62
|
-
{...buttonProps}
|
|
63
|
-
>
|
|
64
|
-
<div className={clsx('iui-btn-content', { 'full-width': fullWidth })}>
|
|
65
|
-
{icon && <FontAwesomeIcon icon={icon} />}
|
|
66
|
-
<div className="iui-btn-label">{label}</div>
|
|
67
|
-
</div>
|
|
68
|
-
{!!filteredActions?.length && (
|
|
69
|
-
<Menu
|
|
70
|
-
isOpen={isOpen}
|
|
71
|
-
onClose={onClose}
|
|
72
|
-
placement={menuPlacement}
|
|
73
|
-
renderButton={ref => (
|
|
74
|
-
<div
|
|
75
|
-
className={clsx('btn-actions', { active: isOpen })}
|
|
76
|
-
ref={ref}
|
|
77
|
-
onMouseOver={e => e.stopPropagation()}
|
|
78
|
-
onClick={e => {
|
|
79
|
-
e.stopPropagation();
|
|
80
|
-
onOpen();
|
|
81
|
-
}}
|
|
82
|
-
>
|
|
83
|
-
<FontAwesomeIcon icon={faCaretDown} />
|
|
84
|
-
</div>
|
|
85
|
-
)}
|
|
86
|
-
items={filteredActions}
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
</button>
|
|
90
|
-
);
|
|
91
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export const Dashboard: FC<{ children: ReactNode }> = ({ children }) => (
|
|
4
|
-
<div className="page-container">
|
|
5
|
-
<div className="page-content">
|
|
6
|
-
<div className="widget-container">{children}</div>
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import { faCircleInfo, faTriangleExclamation } from '@inceptionbg/icons';
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { Loader } from '../Loader/Loader';
|
|
6
|
-
|
|
7
|
-
const Icons = {
|
|
8
|
-
warning: faTriangleExclamation,
|
|
9
|
-
info: faCircleInfo,
|
|
10
|
-
};
|
|
11
|
-
interface Props {
|
|
12
|
-
title: string;
|
|
13
|
-
icon?: any;
|
|
14
|
-
type?: 'warning' | 'info';
|
|
15
|
-
span?: 2 | 3 | 4;
|
|
16
|
-
isLoading?: boolean;
|
|
17
|
-
children: ReactNode;
|
|
18
|
-
}
|
|
19
|
-
export const DashboardWidget: FC<Props> = ({
|
|
20
|
-
title,
|
|
21
|
-
icon,
|
|
22
|
-
type,
|
|
23
|
-
span,
|
|
24
|
-
isLoading,
|
|
25
|
-
children,
|
|
26
|
-
}) => (
|
|
27
|
-
<Loader isLoading={!!isLoading}>
|
|
28
|
-
<div
|
|
29
|
-
className={clsx('dashboard-widget', type, {
|
|
30
|
-
[`grid-span${span}`]: !!span,
|
|
31
|
-
})}
|
|
32
|
-
>
|
|
33
|
-
<div className="flex gap-3 mb-3">
|
|
34
|
-
{icon && (
|
|
35
|
-
<div className="widget-icon">
|
|
36
|
-
<FontAwesomeIcon icon={icon || Icons[type!]} />
|
|
37
|
-
</div>
|
|
38
|
-
)}
|
|
39
|
-
<h1>{title}</h1>
|
|
40
|
-
</div>
|
|
41
|
-
{children}
|
|
42
|
-
</div>
|
|
43
|
-
</Loader>
|
|
44
|
-
);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import type { FC } from 'react';
|
|
3
|
-
import { faArrowUpRightFromSquare, faLink } from '@inceptionbg/icons';
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { DashboardWidget } from '../DashboardWidget';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
links: {
|
|
10
|
-
icon?: IconDefinition;
|
|
11
|
-
label: string;
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
}[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const FastLinksWidget: FC<Props> = ({ links }) => {
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<DashboardWidget title={t('FastLinks')} icon={faLink}>
|
|
21
|
-
<div className="short-links-widget mt-4">
|
|
22
|
-
<ul>
|
|
23
|
-
{links.map((l, i) => (
|
|
24
|
-
<li onClick={l.onClick} className="clickable" key={`short-links-${i}`}>
|
|
25
|
-
<FontAwesomeIcon
|
|
26
|
-
icon={l.icon || faArrowUpRightFromSquare}
|
|
27
|
-
className="mr-3"
|
|
28
|
-
/>
|
|
29
|
-
{l.label}
|
|
30
|
-
</li>
|
|
31
|
-
))}
|
|
32
|
-
</ul>
|
|
33
|
-
</div>
|
|
34
|
-
</DashboardWidget>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import type { FC, KeyboardEventHandler, ReactNode } from 'react';
|
|
2
|
-
import type { IInfoType } from '../../types/IInfo';
|
|
3
|
-
import type { ILocalPopupControl } from '../../types/IPopup';
|
|
4
|
-
import type { IDialogFooterActions } from './components/DialogFooter';
|
|
5
|
-
import { useRef } from 'react';
|
|
6
|
-
import { faXmark } from '@inceptionbg/icons';
|
|
7
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
8
|
-
import clsx from 'clsx';
|
|
9
|
-
import { createPortal } from 'react-dom';
|
|
10
|
-
import { useBackgroundClose } from '../../hooks/useBackgroundClose';
|
|
11
|
-
import { useGetFocusableElements } from '../../hooks/useGetFocusableElements';
|
|
12
|
-
import { useLocalPopoverControl } from '../../hooks/useLocalPopoverControl';
|
|
13
|
-
import { infoIcons } from '../../utils/icons';
|
|
14
|
-
import { onPopupKeyDown } from '../../utils/popupUtils';
|
|
15
|
-
import { rootDir } from '../../utils/rootDir';
|
|
16
|
-
import { IconButton } from '../Button/IconButton';
|
|
17
|
-
import { Loader } from '../Loader/Loader';
|
|
18
|
-
import { ConditionalWrapper } from '../Wrappers/ConditionalWrapper';
|
|
19
|
-
import { DialogFooter } from './components/DialogFooter';
|
|
20
|
-
|
|
21
|
-
type BaseProps = {
|
|
22
|
-
title?: string;
|
|
23
|
-
titleEl?: ReactNode;
|
|
24
|
-
desc?: string;
|
|
25
|
-
descEl?: ReactNode;
|
|
26
|
-
onFormSubmit?: () => void;
|
|
27
|
-
onCloseCallback?: () => void;
|
|
28
|
-
isLoading?: boolean;
|
|
29
|
-
footer?: IDialogFooterActions;
|
|
30
|
-
isKeyboardDisabled?: boolean;
|
|
31
|
-
noBackgroundClick?: boolean;
|
|
32
|
-
noOverflow?: boolean;
|
|
33
|
-
type?: IInfoType;
|
|
34
|
-
size?: 'm' | 'l' | 'xl';
|
|
35
|
-
className?: string;
|
|
36
|
-
classNameContent?: string;
|
|
37
|
-
children?: ReactNode;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type ImperativeDialogProps = {
|
|
41
|
-
control: ILocalPopupControl;
|
|
42
|
-
isOpen?: never;
|
|
43
|
-
onClose?: undefined;
|
|
44
|
-
};
|
|
45
|
-
export type DeclarativeDialogProps = {
|
|
46
|
-
isOpen: boolean;
|
|
47
|
-
onClose: () => void;
|
|
48
|
-
control?: never;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
type Props = BaseProps & (ImperativeDialogProps | DeclarativeDialogProps);
|
|
52
|
-
|
|
53
|
-
export const Dialog: FC<Props> = ({
|
|
54
|
-
title,
|
|
55
|
-
titleEl,
|
|
56
|
-
desc,
|
|
57
|
-
descEl,
|
|
58
|
-
onFormSubmit,
|
|
59
|
-
onCloseCallback,
|
|
60
|
-
isLoading,
|
|
61
|
-
footer,
|
|
62
|
-
isKeyboardDisabled,
|
|
63
|
-
noBackgroundClick,
|
|
64
|
-
noOverflow,
|
|
65
|
-
type,
|
|
66
|
-
size = 'm',
|
|
67
|
-
className,
|
|
68
|
-
classNameContent,
|
|
69
|
-
children,
|
|
70
|
-
...rest
|
|
71
|
-
}) => {
|
|
72
|
-
const formRef = useRef<HTMLFormElement>(null);
|
|
73
|
-
|
|
74
|
-
const { elementRef, isOpen, onClose } = useLocalPopoverControl({
|
|
75
|
-
...rest,
|
|
76
|
-
onCloseCallback,
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const focusableElements = useGetFocusableElements({
|
|
80
|
-
elementRef,
|
|
81
|
-
isOpen,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
useBackgroundClose({
|
|
85
|
-
portalRef: elementRef,
|
|
86
|
-
disabled: noBackgroundClick || !isOpen,
|
|
87
|
-
handleClose: onClose,
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const onKeyDown: KeyboardEventHandler<HTMLDivElement> = event => {
|
|
91
|
-
!isKeyboardDisabled &&
|
|
92
|
-
onPopupKeyDown(event, {
|
|
93
|
-
onClose,
|
|
94
|
-
enter: {
|
|
95
|
-
onAction: () => {
|
|
96
|
-
footer?.confirmButton?.onClick?.();
|
|
97
|
-
!footer?.confirmButton?.keepOpen && onClose();
|
|
98
|
-
},
|
|
99
|
-
disabled: !footer?.confirmButton?.onClick,
|
|
100
|
-
},
|
|
101
|
-
focusableElements,
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return isOpen
|
|
106
|
-
? createPortal(
|
|
107
|
-
<div
|
|
108
|
-
ref={elementRef}
|
|
109
|
-
className="iui-dialog"
|
|
110
|
-
aria-label="popup"
|
|
111
|
-
onKeyDown={onKeyDown}
|
|
112
|
-
tabIndex={-1}
|
|
113
|
-
>
|
|
114
|
-
<Loader isLoading={!!isLoading}>
|
|
115
|
-
<ConditionalWrapper
|
|
116
|
-
condition={!!onFormSubmit}
|
|
117
|
-
wrapper={children => (
|
|
118
|
-
<form
|
|
119
|
-
ref={formRef}
|
|
120
|
-
onSubmit={e => {
|
|
121
|
-
e.preventDefault();
|
|
122
|
-
e.stopPropagation();
|
|
123
|
-
onFormSubmit?.();
|
|
124
|
-
!footer?.confirmButton?.keepOpen && onClose();
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
{children}
|
|
128
|
-
</form>
|
|
129
|
-
)}
|
|
130
|
-
>
|
|
131
|
-
<div className={clsx('iui-dialog-container', size, type, className)}>
|
|
132
|
-
<div className="iui-dialog-header">
|
|
133
|
-
{type && (
|
|
134
|
-
<FontAwesomeIcon
|
|
135
|
-
icon={infoIcons[type]}
|
|
136
|
-
className={clsx('dialog-type-icon', type)}
|
|
137
|
-
/>
|
|
138
|
-
)}
|
|
139
|
-
<div className="full-width">
|
|
140
|
-
<div className="iui-dialog-title">
|
|
141
|
-
{title ? <h4>{title}</h4> : titleEl}
|
|
142
|
-
<IconButton
|
|
143
|
-
icon={faXmark}
|
|
144
|
-
onClick={onClose}
|
|
145
|
-
color="neutral"
|
|
146
|
-
size="l"
|
|
147
|
-
className="close-icon"
|
|
148
|
-
buttonProps={{ tabIndex: -1 }}
|
|
149
|
-
/>
|
|
150
|
-
</div>
|
|
151
|
-
{desc ? <p className="iui-dialog-desc">{desc}</p> : descEl}
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
{children && (
|
|
155
|
-
<div
|
|
156
|
-
className={clsx('iui-dialog-content', classNameContent, {
|
|
157
|
-
'no-overflow': noOverflow,
|
|
158
|
-
})}
|
|
159
|
-
>
|
|
160
|
-
{children}
|
|
161
|
-
</div>
|
|
162
|
-
)}
|
|
163
|
-
{footer && (
|
|
164
|
-
<DialogFooter
|
|
165
|
-
{...footer}
|
|
166
|
-
onClose={onClose}
|
|
167
|
-
isForm={!!onFormSubmit}
|
|
168
|
-
type={type}
|
|
169
|
-
/>
|
|
170
|
-
)}
|
|
171
|
-
</div>
|
|
172
|
-
</ConditionalWrapper>
|
|
173
|
-
</Loader>
|
|
174
|
-
</div>,
|
|
175
|
-
rootDir
|
|
176
|
-
)
|
|
177
|
-
: null;
|
|
178
|
-
};
|