@equinor/amplify-component-lib 13.2.7 → 14.1.0
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/atoms/hooks/useLocalStorage.d.ts +2 -2
- package/dist/atoms/hooks/useSelect.d.ts +3 -3
- package/dist/atoms/index.js +1 -1
- package/dist/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +6 -5
- package/dist/deprecated/IconToggleButton.js +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/molecules/Chip/Chip.d.ts +3 -3
- package/dist/molecules/Chip/Chip.styles.js +3 -3
- package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
- package/dist/molecules/Dialog/DialogAction.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
- package/dist/molecules/FileUploadArea/FileUploadArea.js +1 -1
- package/dist/molecules/IconCell/IconCell.styles.js +1 -1
- package/dist/molecules/ListItem/ListItem.d.ts +2 -2
- package/dist/molecules/OptionDrawer/OptionDrawer.d.ts +2 -2
- package/dist/molecules/ProfileAvatar/ProfileAvatar.d.ts +2 -2
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.d.ts +5 -5
- package/dist/molecules/RichTextEditor/MenuBar/MenuButton.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/TableColumn.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/TableMerge.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/TableRow.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/Table/ToggleTable.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextColor.js +2 -2
- package/dist/molecules/RichTextEditor/RichTextEditor.d.ts +6 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.js +1 -1
- package/dist/molecules/RichTextEditor/RichTextEditor.styles.d.ts +1 -0
- package/dist/molecules/RichTextEditor/RichTextEditor.styles.js +45 -25
- package/dist/molecules/RichTextEditor/index.d.ts +5 -5
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
- package/dist/molecules/Select/GroupedSelectPersistent.js +1 -1
- package/dist/molecules/Select/ListSelectPersistent.js +1 -1
- package/dist/molecules/Select/PersistentComboBox/PersistentComboBox.d.ts +2 -2
- package/dist/molecules/Select/Select.styles.d.ts +5 -5
- package/dist/molecules/Select/Select.styles.js +35 -28
- package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +2 -2
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.d.ts +2 -2
- package/dist/molecules/SelectionControls/Radio/Radio.d.ts +2 -2
- package/dist/molecules/SelectionControls/Switch/Switch.d.ts +2 -2
- package/dist/molecules/Skeleton/SkeletonBase/SkeletonBase.d.ts +2 -2
- package/dist/molecules/Tabs/Tabs.d.ts +2 -2
- package/dist/molecules/TextField/TextField.js +3 -3
- package/dist/molecules/Toast/Toast.d.ts +2 -2
- package/dist/molecules/Toast/Toast.js +1 -1
- package/dist/molecules/Toast/Toast.styles.js +55 -87
- package/dist/molecules/Toast/Toast.utils.js +1 -1
- package/dist/molecules/Tooltip/Tooltip.d.ts +14 -0
- package/dist/molecules/Tooltip/Tooltip.js +1 -0
- package/dist/molecules/Tooltip/Tooltip.styles.js +91 -0
- package/dist/molecules/Tooltip/utils.js +1 -0
- package/dist/molecules/index.d.ts +3 -3
- package/dist/molecules/index.js +1 -1
- package/dist/organisms/Comments/AddComment.js +13 -0
- package/dist/organisms/Comments/Comment.d.ts +40 -0
- package/dist/organisms/Comments/Comment.js +32 -0
- package/dist/organisms/Comments/Comments.d.ts +33 -0
- package/dist/organisms/Comments/Comments.js +15 -0
- package/dist/organisms/Comments/DeleteConfirmation.js +1 -0
- package/dist/organisms/Comments/VerticalDivider.js +16 -0
- package/dist/organisms/Comments/mentions/MentionList.js +1 -0
- package/dist/organisms/Comments/mentions/MentionList.styles.js +22 -0
- package/dist/organisms/Comments/mentions/suggestions.js +1 -0
- package/dist/organisms/Comments/mentions/utils.js +1 -0
- package/dist/organisms/Comments/utils.js +1 -0
- package/dist/organisms/DataGrid/DataGrid.d.ts +2 -2
- package/dist/organisms/Filter/Filter.d.ts +2 -2
- package/dist/organisms/Filter/QuickFilter.d.ts +2 -2
- package/dist/organisms/Filter/SortMenu.d.ts +2 -2
- package/dist/organisms/ReleaseNote/ReleaseNote.d.ts +3 -3
- package/dist/organisms/SideBar/CreateItem.js +1 -1
- package/dist/organisms/SideBar/MenuItem/BasicMenuItem.js +1 -1
- package/dist/organisms/SideBar/MenuItem/CollapsableMenuItem.js +4 -4
- package/dist/organisms/SideBar/SideBar.d.ts +2 -2
- package/dist/organisms/SideBar/ToggleOpen.js +1 -1
- package/dist/organisms/SideSheet/SideSheet.types.d.ts +2 -2
- package/dist/organisms/Status/Action.d.ts +2 -2
- package/dist/organisms/Status/Description.d.ts +2 -2
- package/dist/organisms/Status/MissingAccesses.d.ts +2 -2
- package/dist/organisms/Status/Title.d.ts +2 -2
- package/dist/organisms/Status/collections/BadRequest.d.ts +2 -2
- package/dist/organisms/Status/collections/GenericError.d.ts +2 -2
- package/dist/organisms/Status/collections/MissingAccessToApp.js +1 -1
- package/dist/organisms/Status/collections/MissingPermissions.d.ts +2 -2
- package/dist/organisms/Status/collections/PageNotFound.d.ts +2 -2
- package/dist/organisms/Status/collections/ServerError.d.ts +2 -2
- package/dist/organisms/Template/Template.d.ts +5 -5
- package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.js +2 -2
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/UserImpersonation.js +2 -2
- package/dist/organisms/TopBar/Actions.d.ts +2 -2
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.d.ts +3 -2
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.js +1 -1
- package/dist/organisms/TopBar/FieldMenu/FieldMenu.styles.js +23 -9
- package/dist/organisms/TopBar/Guidelines/Colorbox.d.ts +4 -4
- package/dist/organisms/TopBar/Notifications/NotificationProvider.d.ts +2 -2
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/RequestChangeOrca.js +4 -4
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/RequestReviewOrca.js +4 -4
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationTemplate.js +1 -1
- package/dist/organisms/TopBar/Resources/Feedback/FeedbackForm/LockedInputTooltip.js +3 -3
- package/dist/organisms/TopBar/TopBar.d.ts +1 -0
- package/dist/organisms/TopBar/TopBar.js +1 -1
- package/dist/organisms/index.d.ts +1 -0
- package/dist/organisms/index.js +1 -1
- package/dist/providers/SurveyProvider/SurveyDialog/SurveyDialog.js +1 -1
- package/dist/providers/SurveyProvider/SurveyDialog/SurveyQuestion/SurveyFreeTextQuestion.js +2 -2
- package/dist/providers/SurveyProvider/SurveyDialog/SurveyQuestion/SurveyLinearScaleQuestion.js +2 -2
- package/dist/providers/SurveyProvider/SurveyDialog/SurveyQuestion/SurveyMultipleChoiceQuestion.js +2 -2
- package/dist/providers/SurveyProvider/SurveyDialog/UmuxDialog.js +2 -2
- package/package.json +3 -1
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +0 -19
- package/dist/molecules/OptionalTooltip/OptionalTooltip.js +0 -4
|
@@ -1,117 +1,85 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{Button as r}from"../Button/Button.js";import{IconButton as i}from"../Button/IconButton/IconButton.js";import{TOAST_COLORS as a}from"./Toast.utils.js";import{Typography as o}from"@equinor/eds-core-react";import s,{keyframes as c}from"styled-components";const l=e=>a[e??`neutral`],u=s.header`
|
|
2
2
|
display: grid;
|
|
3
|
-
grid-template-columns: minmax(0, 1fr);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
grid-template-columns: ${({$hasIcon:e})=>e?`auto minmax(0, 1fr)`:`minmax(0, 1fr)`};
|
|
4
|
+
align-items: start;
|
|
5
|
+
gap: ${t.small};
|
|
6
|
+
`,d=s.span`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
> svg {
|
|
11
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
`,f=s(o)`
|
|
14
|
+
padding-right: ${t.xx_large};
|
|
15
|
+
`,p=s(r)`
|
|
16
|
+
align-self: flex-start;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
margin-left: ${t.small};
|
|
19
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
20
|
+
border-color: ${({$variant:e})=>l(e).controlForeground};
|
|
21
|
+
&:hover {
|
|
22
|
+
background: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
23
|
+
color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
24
|
+
border-color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
12
25
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
`,m=s(i)`
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: ${t.x_small};
|
|
29
|
+
right: ${t.x_small};
|
|
30
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
31
|
+
&:hover {
|
|
32
|
+
color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
33
|
+
background: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
34
|
+
border-color: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
35
|
+
&::before {
|
|
36
|
+
background: transparent;
|
|
37
|
+
border-color: transparent;
|
|
38
|
+
}
|
|
17
39
|
}
|
|
18
|
-
`,s
|
|
40
|
+
`,h=s(o)`
|
|
41
|
+
margin: 0 ${t.medium} 0 ${t.small};
|
|
42
|
+
`,g=s.div`
|
|
19
43
|
position: relative;
|
|
20
44
|
display: flex;
|
|
21
45
|
flex-direction: column;
|
|
22
|
-
gap: ${
|
|
23
|
-
border-radius: ${
|
|
24
|
-
padding: ${
|
|
25
|
-
${
|
|
46
|
+
gap: ${t.small};
|
|
47
|
+
border-radius: ${n.corners.borderRadius};
|
|
48
|
+
padding: ${t.medium_small} ${t.x_small} ${t.medium_small}
|
|
49
|
+
${t.medium_small};
|
|
26
50
|
overflow: hidden;
|
|
27
51
|
min-width: 300px;
|
|
28
52
|
max-width: 420px;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
> p {
|
|
34
|
-
margin-right: ${e.medium};
|
|
53
|
+
background: ${({$variant:e})=>l(e).containerBackground};
|
|
54
|
+
`,_=c`
|
|
55
|
+
from {
|
|
56
|
+
width: 100%;
|
|
35
57
|
}
|
|
36
|
-
|
|
37
|
-
${({$variant:e})=>{let t=n[e??`neutral`];return i`
|
|
38
|
-
background: ${t.background};
|
|
39
|
-
|
|
40
|
-
> button {
|
|
41
|
-
margin-right: auto;
|
|
42
|
-
color: ${t.icon};
|
|
43
|
-
border-color: ${t.icon};
|
|
44
|
-
&:hover {
|
|
45
|
-
background: none;
|
|
46
|
-
color: ${t.actionHover};
|
|
47
|
-
border-color: ${t.actionHover};
|
|
48
|
-
&:before {
|
|
49
|
-
position: absolute;
|
|
50
|
-
left: 0;
|
|
51
|
-
content: '';
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 100%;
|
|
54
|
-
background: ${t.icon};
|
|
55
|
-
opacity: 0.15;
|
|
56
|
-
overflow: visible;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
> ${o} {
|
|
62
|
-
> svg:first-child {
|
|
63
|
-
color: ${t.icon};
|
|
64
|
-
}
|
|
65
|
-
> button {
|
|
66
|
-
svg {
|
|
67
|
-
color: ${t.close};
|
|
68
|
-
}
|
|
69
|
-
&:hover {
|
|
70
|
-
background: none;
|
|
71
|
-
&:before {
|
|
72
|
-
position: absolute;
|
|
73
|
-
left: 0;
|
|
74
|
-
content: '';
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
background: ${t.close};
|
|
78
|
-
opacity: 0.15;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
overflow: visible;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`}}
|
|
86
|
-
`,c=a`
|
|
87
|
-
from {
|
|
88
|
-
width: 100%
|
|
89
|
-
}
|
|
90
58
|
to {
|
|
91
|
-
width: 0
|
|
59
|
+
width: 0;
|
|
92
60
|
}
|
|
93
|
-
`,
|
|
94
|
-
background:
|
|
61
|
+
`,v=s.span`
|
|
62
|
+
background: ${e.ui.background__default.rgba};
|
|
95
63
|
width: 100%;
|
|
96
64
|
height: 2px;
|
|
97
65
|
position: absolute;
|
|
98
66
|
bottom: 0;
|
|
99
67
|
left: 0;
|
|
100
|
-
|
|
68
|
+
&::before {
|
|
101
69
|
content: '';
|
|
102
70
|
position: absolute;
|
|
103
71
|
width: inherit;
|
|
104
72
|
height: inherit;
|
|
105
|
-
background: ${({$variant:e})=>
|
|
73
|
+
background: ${({$variant:e})=>l(e).containerBackground};
|
|
106
74
|
opacity: 0.5;
|
|
107
75
|
}
|
|
108
|
-
|
|
76
|
+
&::after {
|
|
109
77
|
content: '';
|
|
110
78
|
position: absolute;
|
|
111
79
|
width: inherit;
|
|
112
80
|
height: inherit;
|
|
113
|
-
background: ${({$variant:e})=>
|
|
114
|
-
animation: ${
|
|
81
|
+
background: ${({$variant:e})=>l(e).progressFill};
|
|
82
|
+
animation: ${_} ${({$duration:e})=>e}s linear;
|
|
115
83
|
animation-fill-mode: forwards;
|
|
116
84
|
}
|
|
117
|
-
`;export{
|
|
85
|
+
`;export{p as ActionButton,m as CloseButton,g as Container,h as Description,v as DurationBar,u as Header,d as HeaderIcon,f as Title};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{check_circle_outlined as t,error_outlined as n,info_circle as r,warning_outlined as i}from"@equinor/eds-icons";function a({icon:e,variant:a}){if(e)return e;switch(a){case`info`:return r;case`warning`:return i;case`error`:return n;case`success`:return t;default:return}}const o={neutral:{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{check_circle_outlined as t,error_outlined as n,info_circle as r,warning_outlined as i}from"@equinor/eds-icons";function a({icon:e,variant:a}){if(e)return e;switch(a){case`info`:return r;case`warning`:return i;case`error`:return n;case`success`:return t;default:return}}const o={neutral:{containerBackground:e.ui.background__light.rgba,controlForeground:e.interactive.secondary__resting.rgba,controlForegroundHover:e.text.static_icons__default.rgba,controlHoverBackground:e.ui.background__light_medium.rgba,progressFill:e.text.static_icons__secondary.rgba},info:{containerBackground:e.ui.background__info.rgba,controlForeground:e.interactive.info__text.rgba,controlForegroundHover:e.interactive.info__text_hover.rgba,controlHoverBackground:e.interactive.info__nested_hover.rgba,progressFill:e.interactive.info__text.rgba},warning:{containerBackground:e.ui.background__warning.rgba,controlForeground:e.interactive.warning__text.rgba,controlForegroundHover:e.interactive.warning__text_hover.rgba,controlHoverBackground:e.interactive.warning__nested_hover.rgba,progressFill:e.interactive.warning__resting.rgba},error:{containerBackground:e.ui.background__danger.rgba,controlForeground:e.interactive.danger__text.rgba,controlForegroundHover:e.interactive.danger__text_hover.rgba,controlHoverBackground:e.interactive.danger__nested_hover.rgba,progressFill:e.interactive.danger__resting.rgba},success:{containerBackground:e.ui.background__success.rgba,controlForeground:e.interactive.success__text.rgba,controlForegroundHover:e.interactive.success__text_hover.rgba,controlHoverBackground:e.interactive.success__nested_hover.rgba,progressFill:e.interactive.success__resting.rgba}};export{o as TOAST_COLORS,a as getHeaderIcon};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/molecules/Tooltip/Tooltip.d.ts
|
|
4
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
type TooltipProps = {
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
placement?: TooltipPlacement;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
enterDelay?: number;
|
|
10
|
+
exitDelay?: number;
|
|
11
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'title'>;
|
|
12
|
+
declare const Tooltip: FC<TooltipProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Tooltip, TooltipProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LeftAlignedText as e,TooltipWrapper as t,Wrapper as n}from"./Tooltip.styles.js";import{assignRef as r,getResolvedPlacement as i}from"./utils.js";import{useId as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({title:u,children:d,ref:f,disabled:p=!1,placement:m=`top`,enterDelay:h=0,exitDelay:g=300,..._})=>{let v=a().replace(/:/g,``),y=o(null),b=o(null),x=o(null),S=o(null),[C,w]=s({placement:m,offset:{x:void 0,y:void 0}}),T=()=>{if(!y.current?.matches(`:popover-open`))return;let e=y.current.getBoundingClientRect(),t=b.current?.getBoundingClientRect();if(!t)return;let n=i(e,t);if(n===`top`||n===`bottom`){let r=t.left+t.width/2;w({placement:n,offset:{x:Math.max(12,Math.min(r-e.left,e.width-12))}})}else{let r=t.top+t.height/2;w({placement:n,offset:{y:Math.max(12,Math.min(r-e.top,e.height-12))}})}},E=e=>{y.current=e,r(f,e)},D=()=>{x.current&&=(clearTimeout(x.current),null),!(S.current||y.current?.matches(`:popover-open`))&&(S.current=setTimeout(()=>{S.current=null,!y.current?.matches(`:popover-open`)&&(y.current?.showPopover(),requestAnimationFrame(T))},h))},O=()=>{S.current&&=(clearTimeout(S.current),null),x.current=setTimeout(()=>{x.current=null,y.current?.matches(`:popover-open`)&&y.current.hidePopover()},g)};return!u||p?d:l(n,{onMouseEnter:D,onMouseLeave:O,onFocus:D,onBlur:O,$anchor:`--tooltip-${v}`,ref:b,..._,children:[d,c(t,{ref:E,role:`tooltip`,popover:`hint`,$anchor:`--tooltip-${v}`,$placement:m,$arrow:C,children:typeof u==`string`?c(e,{children:u}):u})]})};export{u as Tooltip};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{elevation as n,shape as r,typography as i}from"../../atoms/style/index.js";import{typographyTemplate as a}from"../../node_modules/@equinor/eds-utils/dist/esm/utils/templates/index.js";import o,{css as s}from"styled-components";const c=o.span`
|
|
2
|
+
anchor-name: ${e=>e.$anchor};
|
|
3
|
+
display: inline-block;
|
|
4
|
+
`,l=o.div`
|
|
5
|
+
position-anchor: ${e=>e.$anchor};
|
|
6
|
+
|
|
7
|
+
/* UA popover reset */
|
|
8
|
+
position: fixed;
|
|
9
|
+
margin: 0;
|
|
10
|
+
inset: auto;
|
|
11
|
+
border: none;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
|
|
14
|
+
/* custom popover styles */
|
|
15
|
+
//has to be set before color to not override the color tokens
|
|
16
|
+
${a(i.ui.tooltip)}
|
|
17
|
+
|
|
18
|
+
min-width: 56px;
|
|
19
|
+
max-width: 280px;
|
|
20
|
+
background-color: ${e.text.static_icons__default.rgba};
|
|
21
|
+
box-shadow: ${n.raised};
|
|
22
|
+
border-radius: ${r.corners.borderRadius};
|
|
23
|
+
color: ${e.text.static_icons__primary_white.rgba};
|
|
24
|
+
padding: ${t.small};
|
|
25
|
+
text-align: center;
|
|
26
|
+
|
|
27
|
+
&::before {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
z-index: -1;
|
|
31
|
+
background: inherit;
|
|
32
|
+
margin: inherit;
|
|
33
|
+
${({$arrow:e})=>{switch(e.placement){case`top`:return s`
|
|
34
|
+
inset: 0 0 -${`4px`} 0;
|
|
35
|
+
`;case`bottom`:return s`
|
|
36
|
+
inset: -${`4px`} 0 0 0;
|
|
37
|
+
`;case`left`:return s`
|
|
38
|
+
inset: 0 -${`4px`} 0 0;
|
|
39
|
+
`;case`right`:return s`
|
|
40
|
+
inset: 0 0 0 -${`4px`};
|
|
41
|
+
`}}}
|
|
42
|
+
|
|
43
|
+
${({$arrow:{offset:e}})=>{let t=e.x?`${e.x}px`:`50%`,n=e.y?`${e.y}px`:`50%`;return s`
|
|
44
|
+
clip-path: polygon(
|
|
45
|
+
/* top */
|
|
46
|
+
calc(${t} - ${`4px`}) ${`4px`},
|
|
47
|
+
${t} 0,
|
|
48
|
+
${t} 0,
|
|
49
|
+
calc(${t} + ${`4px`}) ${`4px`},
|
|
50
|
+
/* right */
|
|
51
|
+
calc(100% - ${`4px`})
|
|
52
|
+
calc(${n} - ${`4px`}),
|
|
53
|
+
100% ${n},
|
|
54
|
+
100% ${n},
|
|
55
|
+
calc(100% - ${`4px`}) calc(${n} + ${`4px`}),
|
|
56
|
+
/* bottom */
|
|
57
|
+
calc(${t} + ${`4px`})
|
|
58
|
+
calc(100% - ${`4px`}),
|
|
59
|
+
${t} 100%,
|
|
60
|
+
${t} 100%,
|
|
61
|
+
calc(${t} - ${`4px`}) calc(100% - ${`4px`}),
|
|
62
|
+
/* left */
|
|
63
|
+
${`4px`} calc(${n} + ${`4px`}),
|
|
64
|
+
0 ${n},
|
|
65
|
+
0 ${n},
|
|
66
|
+
${`4px`} calc(${n} - ${`4px`})
|
|
67
|
+
);
|
|
68
|
+
`}};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
${e=>{switch(e.$placement){case`top`:return s`
|
|
72
|
+
position-area: top;
|
|
73
|
+
bottom: ${`5px`};
|
|
74
|
+
position-try-fallbacks: flip-block;
|
|
75
|
+
`;case`bottom`:return s`
|
|
76
|
+
position-area: bottom;
|
|
77
|
+
top: ${`5px`};
|
|
78
|
+
position-try-fallbacks: flip-block;
|
|
79
|
+
`;case`left`:return s`
|
|
80
|
+
position-area: left;
|
|
81
|
+
right: ${`5px`};
|
|
82
|
+
position-try-fallbacks: flip-inline;
|
|
83
|
+
`;case`right`:return s`
|
|
84
|
+
position-area: right;
|
|
85
|
+
left: ${`5px`};
|
|
86
|
+
position-try-fallbacks: flip-inline;
|
|
87
|
+
`}}})
|
|
88
|
+
`,u=o.span`
|
|
89
|
+
display: inline-block;
|
|
90
|
+
text-align: left;
|
|
91
|
+
`;export{u as LeftAlignedText,l as TooltipWrapper,c as Wrapper};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=(e,t)=>e.bottom<=t.top?`top`:e.top>=t.bottom?`bottom`:e.right<=t.left?`left`:`right`;function t(e,t){typeof e==`function`?e(t):e&&(e.current=t)}export{t as assignRef,e as getResolvedPlacement};
|
|
@@ -23,7 +23,7 @@ import { IconCellColor, IconCellColorObject, IconCellColors, IconCellState, Icon
|
|
|
23
23
|
import { IconCell, IconCellProps } from "./IconCell/IconCell.js";
|
|
24
24
|
import { InfoElement, InfoElementProps } from "./InfoElement/InfoElement.js";
|
|
25
25
|
import { InformationalNotice, InformationalNoticeProps } from "./InformationalNotice/InformationalNotice.js";
|
|
26
|
-
import {
|
|
26
|
+
import { Tooltip as Tooltip$1, TooltipProps as TooltipProps$1 } from "./Tooltip/Tooltip.js";
|
|
27
27
|
import { ProfileAvatar, ProfileAvatarProps } from "./ProfileAvatar/ProfileAvatar.js";
|
|
28
28
|
import { RichTextDisplay, RichTextDisplayProps } from "./RichTextDisplay/RichTextDisplay.js";
|
|
29
29
|
import { AmplifyBar, EditorMenu, EditorText } from "./RichTextEditor/MenuBar/MenuBar.js";
|
|
@@ -51,5 +51,5 @@ import { Checkbox as Checkbox$1, CheckboxProps as CheckboxProps$1 } from "./Sele
|
|
|
51
51
|
import { Radio as Radio$1, RadioProps as RadioProps$1 } from "./SelectionControls/Radio/Radio.js";
|
|
52
52
|
import { Switch as Switch$1, SwitchProps as SwitchProps$1 } from "./SelectionControls/Switch/Switch.js";
|
|
53
53
|
import { Waves } from "./Waves/Waves.js";
|
|
54
|
-
import { Accordion, AccordionHeaderActionsProps, AccordionHeaderProps, AccordionHeaderTitleProps, AccordionItemProps, AccordionPanelProps, AccordionProps, BreadcrumbProps, Breadcrumbs, BreadcrumbsProps, CircularProgress as CircularProgress$1, CircularProgressProps, Dialog as EDSDialog, DialogProps as EDSDialogProps, Divider as Divider$1, DividerProps, DotProgress as DotProgress$1, DotProgressProps, Icon as Icon$1, IconProps as IconProps$1, LinearProgress as LinearProgress$1, LinearProgressProps, Menu as Menu$1, MenuProps, SearchProps as SearchProps$1, Typography as Typography$1, TypographyProps } from "@equinor/eds-core-react";
|
|
55
|
-
export { Accordion, type AccordionHeaderActionsProps, type AccordionHeaderProps, type AccordionHeaderTitleProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, CircularProgress$1 as CircularProgress, type CircularProgressProps, Divider$1 as Divider, type DividerProps, DotProgress$1 as DotProgress, type DotProgressProps, EDSDialog, type EDSDialogProps, Icon$1 as Icon, type IconProps$1 as IconProps, LinearProgress$1 as LinearProgress, type LinearProgressProps, Menu$1 as Menu, type MenuProps, type SearchProps$1 as SearchProps, Typography$1 as Typography, type TypographyProps };
|
|
54
|
+
import { Accordion, AccordionHeaderActionsProps, AccordionHeaderProps, AccordionHeaderTitleProps, AccordionItemProps, AccordionPanelProps, AccordionProps, BreadcrumbProps, Breadcrumbs, BreadcrumbsProps, CircularProgress as CircularProgress$1, CircularProgressProps, Dialog as EDSDialog, DialogProps as EDSDialogProps, Divider as Divider$1, DividerProps, DotProgress as DotProgress$1, DotProgressProps, Icon as Icon$1, IconProps as IconProps$1, LinearProgress as LinearProgress$1, LinearProgressProps, Menu as Menu$1, MenuProps, Popover as Popover$1, PopoverActions, PopoverActionsProps, PopoverContent, PopoverContentProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTitle, PopoverTitleProps, SearchProps as SearchProps$1, Typography as Typography$1, TypographyProps } from "@equinor/eds-core-react";
|
|
55
|
+
export { Accordion, type AccordionHeaderActionsProps, type AccordionHeaderProps, type AccordionHeaderTitleProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, CircularProgress$1 as CircularProgress, type CircularProgressProps, Divider$1 as Divider, type DividerProps, DotProgress$1 as DotProgress, type DotProgressProps, EDSDialog, type EDSDialogProps, Icon$1 as Icon, type IconProps$1 as IconProps, LinearProgress$1 as LinearProgress, type LinearProgressProps, Menu$1 as Menu, type MenuProps, Popover$1 as Popover, PopoverActions, type PopoverActionsProps, PopoverContent, type PopoverContentProps, PopoverHeader, type PopoverHeaderProps, type PopoverProps, PopoverTitle, type PopoverTitleProps, type SearchProps$1 as SearchProps, Typography$1 as Typography, type TypographyProps };
|
package/dist/molecules/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./FullPageSpinner/FullPageSpinner.js";import"./RichTextEditor/RichTextEditor.types.js";import"./RichTextEditor/custom-extensions/AmplifyKit.js";import"./
|
|
1
|
+
import"./FullPageSpinner/FullPageSpinner.js";import"./RichTextEditor/RichTextEditor.types.js";import"./RichTextEditor/custom-extensions/AmplifyKit.js";import"./Button/Button.js";import"./Button/IconButton/IconButton.js";import"./Toast/Toast.js";import"./Confetti/Confetti.js";import"./Skeleton/SkeletonBase/SkeletonBase.js";import"./TextField/TextField.js";import"./SelectionControls/Checkbox/Checkbox.js";import"./SelectionControls/Radio/Radio.js";import"./AnimatedCheckmark/AnimatedCheckmark.js";import"./ApplicationIcon/ApplicationIcon.js";import"./Badge/Badge.js";import"./Banner/Banner.js";import"./Chip/Chip.js";import"./DatePicker/DatePicker.js";import"./DateRangePicker/DateRangePicker.js";import"./Dialog/Dialog.js";import"./EquinorLogo/EquinorLogo.js";import"./FileProgress/FileProgress.js";import"./FileUploadArea/FileUploadArea.js";import"./IconCell/IconCell.types.js";import"./IconCell/IconCell.js";import"./InfoElement/InfoElement.js";import"./InformationalNotice/InformationalNotice.js";import"./Tooltip/Tooltip.js";import"./ProfileAvatar/ProfileAvatar.js";import"./RichTextDisplay/RichTextDisplay.js";import"./RichTextEditor/MenuBar/Table/TableBar.js";import"./RichTextEditor/MenuBar/MenuBar.js";import"./RichTextEditor/RichTextEditor.js";import"./RichTextEditor/index.js";import"./Tabs/Tabs.js";import"./Search/Search.js";import"./Skeleton/SkeletonGradient/SkeletonGradient.js";import"./Stepper/Stepper.js";import"./OptionDrawer/OptionDrawer.js";import"./Select/Select.styles.js";import"./Select/ComboBox/ComboBox.js";import"./Select/PersistentComboBox/PersistentComboBox.js";import"./Select/SingleSelect/SingleSelect.js";import"./Tag/Tag.js";import"./TableHeader/TableHeader.js";import"./FeedBackIcon/FeedBackIcon.js";import"./ListItem/ListItem.js";import"./SelectionControls/Switch/Switch.js";import"./Waves/Waves.js";import{Accordion as e,Breadcrumbs as t,CircularProgress as n,Dialog as r,Divider as i,DotProgress as a,Icon as o,LinearProgress as s,Menu as c,Popover as l,PopoverActions as u,PopoverContent as d,PopoverHeader as f,PopoverTitle as p,Typography as m}from"@equinor/eds-core-react";export{e as Accordion,t as Breadcrumbs,n as CircularProgress,i as Divider,a as DotProgress,r as EDSDialog,o as Icon,s as LinearProgress,c as Menu,l as Popover,u as PopoverActions,d as PopoverContent,f as PopoverHeader,p as PopoverTitle,m as Typography};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import"../../molecules/RichTextEditor/RichTextEditor.types.js";import{IconButton as n}from"../../molecules/Button/IconButton/IconButton.js";import{RichTextEditor as r}from"../../molecules/RichTextEditor/RichTextEditor.js";import{getSuggestions as i}from"./mentions/suggestions.js";import{extractMentions as a}from"./mentions/utils.js";import{isRichTextEmpty as o}from"./utils.js";import{useState as s}from"react";import{Icon as c,Typography as l}from"@equinor/eds-core-react";import u from"styled-components";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{info_circle as p,send as m}from"@equinor/eds-icons";import h from"@tiptap/extension-mention";const g=u.div`
|
|
2
|
+
background: ${e.ui.background__light.rgba};
|
|
3
|
+
padding: ${t.large};
|
|
4
|
+
margin-top: auto;
|
|
5
|
+
`,_=u.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: ${t.x_small};
|
|
8
|
+
padding: ${t.x_small} ${t.small};
|
|
9
|
+
`,v=u.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
`,y=u(n)`
|
|
12
|
+
margin-left: auto;
|
|
13
|
+
`,b=({onAddComment:t,users:n,zIndex:u})=>{let[b,x]=s(``);return f(g,{children:[d(r,{value:b,onChange:x,lightBackground:!0,maxHeight:`50vh`,minHeight:`130px`,footer:d(v,{children:d(y,{"data-testid":`send-comment-button`,variant:`ghost`,icon:m,disabled:o(b),onClick:()=>{t?.({text:b,mentions:a(b)}),x(``)}})}),removeFeatures:[`alignment`,`images`,`table`,`links`,`undoRedo`,`headers`,`text-color`,`code`],extensions:[h.configure({HTMLAttributes:{class:`mention`},suggestions:i(n||[],u)})]}),!!n?.length&&f(_,{children:[d(c,{color:e.text.static_icons__tertiary.rgba,data:p,size:16}),d(l,{group:`input`,variant:`label`,color:e.text.static_icons__tertiary.rgba,children:`Type @ to mention team members.`})]})]})};export{b as AddComment};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/organisms/Comments/Comment.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Controls the visibility and enabled state of a comment action button.
|
|
7
|
+
*/
|
|
8
|
+
interface CommentAction {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the button is visible but cannot be clicked.
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the button is not rendered at all.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
hidden?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The tooltip displayed when the button is disabled.
|
|
23
|
+
*
|
|
24
|
+
* Ignored unless `disabled` is `true`.
|
|
25
|
+
*/
|
|
26
|
+
disabledReason?: string;
|
|
27
|
+
}
|
|
28
|
+
interface CommentData {
|
|
29
|
+
id: string;
|
|
30
|
+
text: string;
|
|
31
|
+
editAction?: CommentAction;
|
|
32
|
+
deleteAction?: CommentAction;
|
|
33
|
+
timestamp: Date | string;
|
|
34
|
+
author: {
|
|
35
|
+
name: string;
|
|
36
|
+
avatar?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { CommentData };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{formatDateTime as n}from"../../atoms/utils/date.js";import{DEFAULT_FEATURES as r}from"../../molecules/RichTextEditor/RichTextEditor.types.js";import{useAmplifyKit as i}from"../../atoms/hooks/useAmplifyKit.js";import{Button as a}from"../../molecules/Button/Button.js";import{IconButton as o}from"../../molecules/Button/IconButton/IconButton.js";import{Tooltip as s}from"../../molecules/Tooltip/Tooltip.js";import{ProfileAvatar as c}from"../../molecules/ProfileAvatar/ProfileAvatar.js";import{RichTextDisplay as l}from"../../molecules/RichTextDisplay/RichTextDisplay.js";import{RichTextEditor as u}from"../../molecules/RichTextEditor/RichTextEditor.js";import{DeleteConfirmation as d}from"./DeleteConfirmation.js";import{getSuggestions as f}from"./mentions/suggestions.js";import{extractMentions as p}from"./mentions/utils.js";import{isRichTextEmpty as m}from"./utils.js";import{VerticalDivider as h}from"./VerticalDivider.js";import{useEffect as g,useRef as _,useState as v}from"react";import{Typography as y}from"@equinor/eds-core-react";import{styled as b}from"styled-components";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{delete_forever as w,edit as T}from"@equinor/eds-icons";import E from"@tiptap/extension-mention";const D=b.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
|
|
6
|
+
> div:first-child {
|
|
7
|
+
flex-shrink: 0;
|
|
8
|
+
}
|
|
9
|
+
`,O=b.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-grow: 1;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: ${t.small};
|
|
14
|
+
`,k=b.div`
|
|
15
|
+
display: none;
|
|
16
|
+
`,A=b.div`
|
|
17
|
+
margin-right: auto;
|
|
18
|
+
`,j=b.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
`,M=b.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: ${t.small};
|
|
23
|
+
cursor: auto;
|
|
24
|
+
|
|
25
|
+
&:hover ${k} {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
`,N=b.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
gap: ${t.medium_small};
|
|
32
|
+
`,P=({comment:t,onDelete:b,onEdit:P,readonly:F,users:I,zIndex:L})=>{let R=i({features:r}),z=_(null),[B,V]=v(t.text),[H,U]=v(!1),[W,G]=v(!1);return g(()=>{W&&z.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[W]),C(x,{children:[C(M,{ref:z,children:[C(D,{children:[S(c,{url:t.author.avatar,name:t.author.name}),S(h,{})]}),C(O,{children:[C(j,{children:[C(A,{children:[S(y,{group:`paragraph`,variant:`body_short_bold`,children:t.author.name}),S(y,{group:`paragraph`,variant:`meta`,color:e.text.static_icons__tertiary.rgba,children:n(t.timestamp)})]}),!F&&C(k,{"data-testid":`comment-actions`,children:[!t.editAction?.hidden&&S(s,{title:t.editAction?.disabled&&t.editAction?.disabledReason,children:S(o,{"data-testid":`edit-comment-button`,icon:T,variant:`ghost`,disabled:t.editAction?.disabled,onClick:()=>G(e=>!e)})}),!t.deleteAction?.hidden&&S(s,{title:t.deleteAction?.disabled&&t.deleteAction?.disabledReason,children:S(o,{"data-testid":`delete-comment-button`,icon:w,variant:`ghost`,onClick:()=>U(!0),disabled:t.deleteAction?.disabled})})]})]}),W?S(u,{value:B,onChange:V,lightBackground:!0,maxHeight:`130px`,minHeight:`130px`,footer:C(N,{children:[S(a,{variant:`ghost`,onClick:()=>{V(t.text),G(!1)},children:`Cancel`}),S(a,{disabled:m(B),variant:`outlined`,onClick:()=>{P?.({id:t.id,text:B,mentions:p(B)}),G(!1)},children:`Update`})]}),removeFeatures:[`alignment`,`images`,`table`,`links`,`undoRedo`,`headers`,`text-color`,`code`],extensions:[E.configure({HTMLAttributes:{class:`mention`},suggestions:f(I||[],L)})]}):S(l,{value:t.text,padding:`none`,extensions:[R,E.configure({HTMLAttributes:{class:`mention`},suggestions:f(I||[],L)})]})]})]}),H&&S(d,{onClose:()=>U(!1),onConfirm:()=>{U(!1),b?.(t.id)}})]})};export{P as Comment};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SideSheetProps } from "../SideSheet/SideSheet.types.js";
|
|
2
|
+
import { CommentData } from "./Comment.js";
|
|
3
|
+
import { FC, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/organisms/Comments/Comments.d.ts
|
|
6
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
7
|
+
type CommentsProps = {
|
|
8
|
+
comments: CommentData[];
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
onAddComment?: ({
|
|
11
|
+
text,
|
|
12
|
+
mentions
|
|
13
|
+
}: {
|
|
14
|
+
text: string;
|
|
15
|
+
mentions: string[];
|
|
16
|
+
}) => void;
|
|
17
|
+
onEditComment?: ({
|
|
18
|
+
id,
|
|
19
|
+
text,
|
|
20
|
+
mentions
|
|
21
|
+
}: {
|
|
22
|
+
id: string;
|
|
23
|
+
text: string;
|
|
24
|
+
mentions: string[];
|
|
25
|
+
}) => void;
|
|
26
|
+
onDeleteComment?: (commentId: string) => void;
|
|
27
|
+
subHeaderElements?: ReactNode;
|
|
28
|
+
emptyContent?: ReactNode;
|
|
29
|
+
users?: string[];
|
|
30
|
+
} & DistributiveOmit<SideSheetProps, 'children'>;
|
|
31
|
+
declare const Comments: FC<CommentsProps>;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Comments, CommentsProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{SideSheet as n}from"../SideSheet/SideSheet.js";import{Comment as r}from"./Comment.js";import{AddComment as i}from"./AddComment.js";import{useEffect as a,useRef as o}from"react";import{Divider as s,Typography as c}from"@equinor/eds-core-react";import{styled as l}from"styled-components";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=l(s)`
|
|
2
|
+
margin: 0;
|
|
3
|
+
`,m=l.div`
|
|
4
|
+
padding: ${t.medium};
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: ${t.medium};
|
|
8
|
+
overflow: auto;
|
|
9
|
+
`,h=l.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
border: 1px dashed ${e.ui.background__medium.rgba};
|
|
14
|
+
padding: ${t.medium} ${t.large};
|
|
15
|
+
`,g=({subHeaderElements:t,comments:s,onDeleteComment:l,onAddComment:g,onEditComment:_,readonly:v,users:y,emptyContent:b,...x})=>{let S=o(null),C=`zIndex`in x&&x.zIndex!=null?Number(x.zIndex):void 0,w=s.at(-1)?.id;return a(()=>{S.current?.scrollTo({top:S.current.scrollHeight,behavior:`smooth`})},[w]),f(n,{...x,children:[t!=null&&f(u,{children:[t,d(p,{})]}),d(m,{ref:S,children:s.length>0?s.map(e=>d(r,{comment:e,onDelete:l,readonly:v,onEdit:_,users:y,zIndex:C},e.id)):b??d(h,{children:d(c,{group:`paragraph`,variant:`body_short`,color:e.text.static_icons__tertiary.rgba,children:`No comments yet.`})})}),!v&&d(i,{onAddComment:g,users:y,zIndex:C})]})};export{g as Comments};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dialog as e}from"../../molecules/Dialog/Dialog.js";import{jsx as t}from"react/jsx-runtime";const n=({onClose:n,onConfirm:r})=>t(e,{open:!0,title:`Delete this comment`,width:400,actions:[{text:`Cancel`,variant:`outlined`,onClick:n},{text:`Delete`,variant:`filled`,color:`danger`,onClick:r}],onClose:n,children:`You are about to delete your comment.`});export{n as DeleteConfirmation};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import t from"styled-components";const n=t.div`
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
&::after {
|
|
7
|
+
content: '';
|
|
8
|
+
position: absolute;
|
|
9
|
+
top: 0;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
left: 50%;
|
|
12
|
+
transform: translateX(-0.5px);
|
|
13
|
+
width: 1px;
|
|
14
|
+
background: ${e.ui.background__medium.rgba};
|
|
15
|
+
}
|
|
16
|
+
`;export{n as VerticalDivider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DropDown as e,DropDownButton as t,NoResult as n}from"./MentionList.styles.js";import{useEffect as r,useImperativeHandle as i,useState as a}from"react";import{Typography as o}from"@equinor/eds-core-react";import{jsx as s}from"react/jsx-runtime";const c=c=>{let[l,u]=a(0),d=e=>{let t=c.items[e];t&&c.command({id:t})},f=()=>{u((l+c.items.length-1)%c.items.length)},p=()=>{u((l+1)%c.items.length)},m=()=>{d(l)};return r(()=>u(0),[c.items]),i(c.ref,()=>({onKeyDown:({event:e})=>e.key===`ArrowUp`?(f(),!0):e.key===`ArrowDown`?(p(),!0):e.key===`Enter`?(m(),!0):!1})),s(e,{children:c.items.length?c.items.map((e,n)=>s(t,{$isSelected:n===l,onMouseEnter:()=>u(n),onClick:()=>d(n),children:s(o,{variant:`menu_title`,group:`navigation`,children:e})},n)):s(n,{children:s(o,{variant:`menu_title`,group:`navigation`,children:`No result`})})})};export{c as MentionList};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{colors as e}from"../../../atoms/style/colors.js";import{spacings as t}from"../../../atoms/style/spacings.js";import{elevation as n}from"../../../atoms/style/index.js";import r from"styled-components";const i=r.div`
|
|
2
|
+
background: ${e.ui.background__default.rgba};
|
|
3
|
+
border-radius: 2px;
|
|
4
|
+
box-shadow: ${n.raised};
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
overflow: auto;
|
|
8
|
+
position: relative;
|
|
9
|
+
padding: ${t.small} 0;
|
|
10
|
+
`,a=r.button`
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
display: flex;
|
|
14
|
+
text-align: left;
|
|
15
|
+
height: 48px;
|
|
16
|
+
padding: ${t.small} ${t.medium};
|
|
17
|
+
width: 100%;
|
|
18
|
+
|
|
19
|
+
${({$isSelected:t})=>t&&`background-color: ${e.interactive.primary__hover_alt.rgba};`}
|
|
20
|
+
`,o=r.div`
|
|
21
|
+
padding: ${t.small} ${t.medium};
|
|
22
|
+
`;export{i as DropDown,a as DropDownButton,o as NoResult};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MentionList as e}from"./MentionList.js";import{ReactRenderer as t,posToDOMRect as n}from"@tiptap/react";const r=(e,t)=>{let r=n(e.view,e.state.selection.from,e.state.selection.to);t.style.width=`max-content`,t.style.position=`absolute`;let{width:i,height:a}=t.getBoundingClientRect(),o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,c=r.left,l=r.bottom,u=s-r.bottom,d=r.top;a>u&&a<=d&&(l=r.top-a),c+i>o&&(c=o-i),c<0&&(c=0),t.style.left=`${c+window.scrollX}px`,t.style.top=`${l+window.scrollY}px`},i=(n,i)=>[{items:({query:e})=>n.filter(t=>t.toLowerCase().startsWith(e.toLowerCase())).slice(0,3),render:()=>{let n;return{onStart:a=>{n=new t(e,{props:a,editor:a.editor}),a.clientRect&&(n.element.style.position=`absolute`,i!==void 0&&(n.element.style.zIndex=String(i+1)),document.body.appendChild(n.element),r(a.editor,n.element))},onUpdate(e){n.updateProps(e),e.clientRect&&r(e.editor,n.element)},onKeyDown(e){return e.event.key===`Escape`?(n.destroy(),!0):n.ref?.onKeyDown(e)??!1},onExit(){n.destroy()}}}}];export{i as getSuggestions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>{if(typeof document>`u`||!e)return[];let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelectorAll(`[data-type="mention"], .mention`),r=Array.from(n).map(e=>e.getAttribute(`data-id`)).filter(e=>!!e);return[...new Set(r)]};export{e as extractMentions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=e=>{let t=document.createElement(`div`);return t.innerHTML=e,!t.textContent.trim()};export{e as isRichTextEmpty};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react180 from "react";
|
|
2
2
|
import { EdsDataGridProps } from "@equinor/eds-data-grid-react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/DataGrid/DataGrid.d.ts
|
|
5
|
-
declare const DataGrid: <T>(props: EdsDataGridProps<T>) =>
|
|
5
|
+
declare const DataGrid: <T>(props: EdsDataGridProps<T>) => react180.JSX.Element;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DataGrid };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilterProps } from "./Filter.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react220 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/Filter/Filter.d.ts
|
|
5
5
|
|
|
@@ -32,6 +32,6 @@ declare function Filter<T extends string>({
|
|
|
32
32
|
id,
|
|
33
33
|
openOnFocus,
|
|
34
34
|
...rest
|
|
35
|
-
}: FilterProps<T>):
|
|
35
|
+
}: FilterProps<T>): react220.JSX.Element;
|
|
36
36
|
//#endregion
|
|
37
37
|
export { Filter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectOptionRequired } from "../../molecules/Select/Select.types.js";
|
|
2
2
|
import { FilterProps } from "./Filter.types.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react221 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/Filter/QuickFilter.d.ts
|
|
6
6
|
interface QuickFilterProps<T extends string> {
|
|
@@ -14,6 +14,6 @@ declare function QuickFilter<T extends string>({
|
|
|
14
14
|
items,
|
|
15
15
|
onQuickFilter,
|
|
16
16
|
label
|
|
17
|
-
}: QuickFilterProps<T>):
|
|
17
|
+
}: QuickFilterProps<T>): react221.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { QuickFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react219 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Filter/SortMenu.d.ts
|
|
4
4
|
interface SortMenuProps<S> {
|
|
@@ -13,6 +13,6 @@ declare function SortMenu<S>({
|
|
|
13
13
|
value,
|
|
14
14
|
onChange,
|
|
15
15
|
items
|
|
16
|
-
}: SortMenuProps<S>):
|
|
16
|
+
}: SortMenuProps<S>): react219.JSX.Element;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { SortMenu };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react186 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { ReleaseNote } from "@equinor/subsurface-app-management";
|
|
4
4
|
|
|
@@ -7,9 +7,9 @@ type ReleaseNoteProps = {
|
|
|
7
7
|
actionMenu?: ReactNode;
|
|
8
8
|
expanded?: boolean;
|
|
9
9
|
} & ReleaseNote;
|
|
10
|
-
declare const ReleaseNote$1:
|
|
10
|
+
declare const ReleaseNote$1: react186.ForwardRefExoticComponent<{
|
|
11
11
|
actionMenu?: ReactNode;
|
|
12
12
|
expanded?: boolean;
|
|
13
|
-
} & ReleaseNote &
|
|
13
|
+
} & ReleaseNote & react186.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { ReleaseNote$1 as ReleaseNote, ReleaseNoteProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSideBar as e}from"../../providers/SideBarProvider.js";import{
|
|
1
|
+
import{useSideBar as e}from"../../providers/SideBarProvider.js";import{CreateButton as t,MenuItemContainer as n}from"./CreateItem.styles.js";import{Icon as r,Tooltip as i}from"@equinor/eds-core-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{add as s}from"@equinor/eds-icons";const c=({createLabel:c,onCreate:l,disabled:u=!1,active:d=!1})=>{let{isOpen:f}=e(),p=u?void 0:l;return f?a(n,{$active:d,onClick:p,"data-testid":`create-item-container`,children:o(t,{$open:!0,variant:`contained`,disabled:u,children:[a(r,{data:s}),c]})}):a(i,{title:c,placement:`right`,children:a(n,{$active:d,onClick:p,"data-testid":`create-item-container`,children:a(t,{variant:`contained`,disabled:u,children:a(r,{data:s})})})})};export{c as CreateItem};
|