@equinor/amplify-component-lib 14.0.0 → 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/deprecated/ExpandingIconButton/ExpandingIconButton.d.ts +2 -2
- package/dist/deprecated/IconToggleButton.d.ts +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/molecules/Chip/Chip.d.ts +1 -1
- package/dist/molecules/DatePicker/DatePicker.d.ts +3 -3
- package/dist/molecules/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- 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 +7 -7
- 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 +7 -7
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
- package/dist/molecules/Select/Select.styles.d.ts +4 -4
- package/dist/molecules/SelectionControls/Checkbox/Checkbox.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/index.d.ts +2 -2
- 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/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/SideBar.d.ts +2 -2
- package/dist/organisms/SideSheet/SideSheet.types.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/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 +3 -3
- package/dist/organisms/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/organisms/ToggleGroup/ToggleGroupOption.d.ts +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/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/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react174 from "react";
|
|
2
2
|
import { CheckboxProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Checkbox/Checkbox.d.ts
|
|
@@ -7,6 +7,6 @@ interface CheckboxProps$1 extends CheckboxProps {
|
|
|
7
7
|
outlined?: boolean;
|
|
8
8
|
error?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const Checkbox$1:
|
|
10
|
+
declare const Checkbox$1: react174.ForwardRefExoticComponent<CheckboxProps$1 & react174.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Checkbox$1 as Checkbox, CheckboxProps$1 as CheckboxProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react48 from "react";
|
|
2
2
|
import * as styled_components8 from "styled-components";
|
|
3
3
|
import * as styled_components_dist_types4 from "styled-components/dist/types";
|
|
4
4
|
import * as styled_components_dist_models_Keyframes0 from "styled-components/dist/models/Keyframes";
|
|
@@ -8,6 +8,6 @@ declare const skeletonBaseloading: styled_components_dist_models_Keyframes0.defa
|
|
|
8
8
|
interface SkeletonBaseProps {
|
|
9
9
|
$offset?: number;
|
|
10
10
|
}
|
|
11
|
-
declare const SkeletonBase: styled_components_dist_types4.IStyledComponentBase<"web", styled_components8.FastOmit<styled_components8.FastOmit<
|
|
11
|
+
declare const SkeletonBase: styled_components_dist_types4.IStyledComponentBase<"web", styled_components8.FastOmit<styled_components8.FastOmit<react48.DetailedHTMLProps<react48.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$offset"> & SkeletonBaseProps, never> & Partial<Pick<styled_components8.FastOmit<react48.DetailedHTMLProps<react48.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$offset"> & SkeletonBaseProps, never>>> & string;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { SkeletonBase, SkeletonBaseProps, skeletonBaseloading };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tabs as Tabs$1 } from "./Tabs.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react45 from "react";
|
|
3
3
|
import { HTMLAttributes, Ref } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/molecules/Tabs/Tabs.d.ts
|
|
@@ -27,6 +27,6 @@ declare function Tabs<T>({
|
|
|
27
27
|
onHover,
|
|
28
28
|
ref,
|
|
29
29
|
...rest
|
|
30
|
-
}: TabsProps<T>):
|
|
30
|
+
}: TabsProps<T>): react45.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
32
|
export { Tabs, TabsProps };
|
|
@@ -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"./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,Typography as
|
|
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,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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react222 from "react";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/SideBar/SideBar.d.ts
|
|
@@ -16,6 +16,6 @@ interface SideBarWithCreate extends SideBarProps {
|
|
|
16
16
|
createDisabled?: boolean;
|
|
17
17
|
createActive?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare const SideBar:
|
|
19
|
+
declare const SideBar: react222.ForwardRefExoticComponent<(SideBarWithCreate | BaseSideBar) & react222.RefAttributes<HTMLDivElement>>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { SideBar };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, ReactElement } from "react";
|
|
1
|
+
import { CSSProperties, ReactElement, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/SideSheet/SideSheet.types.d.ts
|
|
4
4
|
interface BaseSideSheetProps {
|
|
@@ -7,7 +7,7 @@ interface BaseSideSheetProps {
|
|
|
7
7
|
title: string;
|
|
8
8
|
headerElements?: ReactElement | ReactElement[];
|
|
9
9
|
width?: number | undefined;
|
|
10
|
-
children:
|
|
10
|
+
children: ReactNode;
|
|
11
11
|
}
|
|
12
12
|
interface StandardSideSheetProps extends BaseSideSheetProps {
|
|
13
13
|
type?: 'standard' | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react232 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/Description.d.ts
|
|
4
4
|
interface DescriptionProps {
|
|
5
5
|
text?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const Description:
|
|
7
|
+
declare const Description: react232.ForwardRefExoticComponent<DescriptionProps & react232.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react234 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/MissingAccesses.d.ts
|
|
4
4
|
interface AccessType {
|
|
@@ -9,6 +9,6 @@ interface MissingAccessesProps {
|
|
|
9
9
|
accesses?: AccessType[];
|
|
10
10
|
text?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const MissingAccesses:
|
|
12
|
+
declare const MissingAccesses: react234.ForwardRefExoticComponent<MissingAccessesProps & react234.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { MissingAccesses };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react228 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/Title.d.ts
|
|
4
4
|
interface TitleProps {
|
|
5
5
|
title?: string;
|
|
6
6
|
}
|
|
7
|
-
declare const Title:
|
|
7
|
+
declare const Title: react228.ForwardRefExoticComponent<TitleProps & react228.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Title };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react236 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/BadRequest.d.ts
|
|
4
4
|
interface BadRequestProps {
|
|
@@ -12,6 +12,6 @@ declare const BadRequest: ({
|
|
|
12
12
|
redirectFallbackUrl,
|
|
13
13
|
onBackClick,
|
|
14
14
|
hideBackButton
|
|
15
|
-
}: BadRequestProps) =>
|
|
15
|
+
}: BadRequestProps) => react236.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { BadRequest };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react237 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/GenericError.d.ts
|
|
4
4
|
interface GenericErrorProps {
|
|
@@ -14,6 +14,6 @@ declare const GenericError: ({
|
|
|
14
14
|
redirectFallbackUrl,
|
|
15
15
|
onBackClick,
|
|
16
16
|
hideBackButton
|
|
17
|
-
}: GenericErrorProps) =>
|
|
17
|
+
}: GenericErrorProps) => react237.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { GenericError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react238 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/MissingPermissions.d.ts
|
|
4
4
|
interface MissingPermissionsProps {
|
|
@@ -14,6 +14,6 @@ declare const MissingPermissions: ({
|
|
|
14
14
|
redirectFallbackUrl,
|
|
15
15
|
onBackClick,
|
|
16
16
|
hideBackButton
|
|
17
|
-
}: MissingPermissionsProps) =>
|
|
17
|
+
}: MissingPermissionsProps) => react238.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { MissingPermissions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react239 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/PageNotFound.d.ts
|
|
4
4
|
interface PageNotFoundProps {
|
|
@@ -12,6 +12,6 @@ declare const PageNotFound: ({
|
|
|
12
12
|
redirectFallbackUrl,
|
|
13
13
|
onBackClick,
|
|
14
14
|
hideBackButton
|
|
15
|
-
}: PageNotFoundProps) =>
|
|
15
|
+
}: PageNotFoundProps) => react239.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { PageNotFound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react240 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/organisms/Status/collections/ServerError.d.ts
|
|
4
4
|
interface ServerErrorProps {
|
|
@@ -12,6 +12,6 @@ declare const ServerError: ({
|
|
|
12
12
|
redirectFallbackUrl,
|
|
13
13
|
onBackClick,
|
|
14
14
|
hideBackButton
|
|
15
|
-
}: ServerErrorProps) =>
|
|
15
|
+
}: ServerErrorProps) => react240.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { ServerError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react181 from "react";
|
|
2
2
|
import * as styled_components63 from "styled-components";
|
|
3
3
|
import { IStyledComponent } from "styled-components";
|
|
4
4
|
import * as styled_components_dist_types47 from "styled-components/dist/types";
|
|
@@ -7,8 +7,8 @@ import * as styled_components_dist_types47 from "styled-components/dist/types";
|
|
|
7
7
|
interface ContentProps {
|
|
8
8
|
$open: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const Content: styled_components_dist_types47.IStyledComponentBase<"web", styled_components63.FastOmit<styled_components63.FastOmit<
|
|
11
|
-
declare const GlobalStyles:
|
|
10
|
+
declare const Content: styled_components_dist_types47.IStyledComponentBase<"web", styled_components63.FastOmit<styled_components63.FastOmit<react181.DetailedHTMLProps<react181.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$open"> & ContentProps, never> & Partial<Pick<styled_components63.FastOmit<react181.DetailedHTMLProps<react181.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$open"> & ContentProps, never>>> & string;
|
|
11
|
+
declare const GlobalStyles: react181.NamedExoticComponent<styled_components63.ExecutionProps & object>;
|
|
12
12
|
type TemplateType = IStyledComponent<'web', any> & {
|
|
13
13
|
Container: IStyledComponent<'web', any>;
|
|
14
14
|
Content: typeof Content;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToggleGroup as ToggleGroup$1 } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react243 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/ToggleGroup/ToggleGroup.d.ts
|
|
5
|
-
declare const ToggleGroup:
|
|
5
|
+
declare const ToggleGroup: react243.ForwardRefExoticComponent<ToggleGroup$1 & react243.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ToggleGroup };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToggleGroupOption as ToggleGroupOption$1 } from "./ToggleGroup.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react241 from "react";
|
|
3
3
|
import { HTMLAttributes } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/organisms/ToggleGroup/ToggleGroupOption.d.ts
|
|
6
6
|
type ToggleGroupOptionProps = ToggleGroupOption$1 & Omit<HTMLAttributes<HTMLButtonElement>, 'onToggle' | 'disabled'>;
|
|
7
|
-
declare const ToggleGroupOption:
|
|
7
|
+
declare const ToggleGroupOption: react241.ForwardRefExoticComponent<ToggleGroupOptionProps & react241.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { ToggleGroupOption };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react226 from "react";
|
|
2
2
|
import { HTMLAttributes } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/Actions.d.ts
|
|
5
|
-
declare const Actions:
|
|
5
|
+
declare const Actions: react226.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react226.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Actions };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Field } from "../../../atoms/types/Field.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react224 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/organisms/TopBar/FieldMenu/FieldMenu.d.ts
|
|
5
5
|
interface FieldMenuProps {
|
|
6
6
|
availableFields: Field[];
|
|
7
7
|
onSelect: (selectedField: Field) => void;
|
|
8
|
+
onClear?: () => void;
|
|
8
9
|
itemNameSingular?: string;
|
|
9
10
|
showAccessITLink?: boolean;
|
|
10
11
|
}
|
|
11
|
-
declare const FieldMenu:
|
|
12
|
+
declare const FieldMenu: react224.ForwardRefExoticComponent<FieldMenuProps & react224.RefAttributes<HTMLDivElement>>;
|
|
12
13
|
//#endregion
|
|
13
14
|
export { FieldMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{TopBarMenu as t}from"../TopBarMenu.js";import{TopBarButton as n}from"../TopBar.styles.js";import{ListContainer as r,MenuFixedItem as i,MenuItem as a,MenuSection as o,NoFieldsText as s,NoSearchResultsContainer as c,SearchContainer as l,TextContainer as u}from"./FieldMenu.styles.js";import{useTopBarInternalContext as d}from"../TopBarInternalContextProvider.js";import{forwardRef as f,useMemo as p,useRef as m,useState as h}from"react";import{Icon as g,Search as _,Typography as v}from"@equinor/eds-core-react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{arrow_drop_down as x,arrow_drop_up as S,check as C,
|
|
1
|
+
import{tokens as e}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{TopBarMenu as t}from"../TopBarMenu.js";import{TopBarButton as n}from"../TopBar.styles.js";import{ListContainer as r,MenuFixedItem as i,MenuItem as a,MenuSection as o,NoFieldsText as s,NoSearchResultsContainer as c,SearchContainer as l,TextContainer as u}from"./FieldMenu.styles.js";import{useTopBarInternalContext as d}from"../TopBarInternalContextProvider.js";import{forwardRef as f,useMemo as p,useRef as m,useState as h}from"react";import{Icon as g,Search as _,Typography as v}from"@equinor/eds-core-react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{arrow_drop_down as x,arrow_drop_up as S,check as C,clear as w,exit_to_app as T,platform as E}from"@equinor/eds-icons";const{colors:D}=e,O=f(({availableFields:e,onSelect:f,itemNameSingular:O=`field`,showAccessITLink:k=!0,onClear:A},j)=>{let{selectedField:M}=d(),[N,P]=h(!1),F=m(null),[I,L]=h(``),R=()=>P(!1),z=()=>P(!N),B=p(()=>I===``?e.filter(e=>e.name?.toLowerCase()!==M?.name?.toLowerCase()):e.filter(e=>e.name?.toLowerCase().includes(I.toLowerCase())),[e,I,M]),V=p(()=>{if(M?.name)return M.name.charAt(0).toUpperCase()+M.name.slice(1)},[M?.name]),H=e=>{L(e.target.value)},U=e.length>=4,W=B.length===0&&U;return!M&&!A?null:b(`div`,{ref:j,children:[b(n,{variant:`ghost`,ref:F,onClick:z,"data-testid":`field-selector-top-bar-button`,$fieldSelector:!0,children:[y(g,{data:E,size:24}),M?V:`No ${O} selected`,y(g,{data:N?S:x})]}),y(t,{open:N,title:`Field Selection`,onClose:R,anchorEl:F.current,contentPadding:!1,children:b(`section`,{children:[b(o,{children:[U&&y(l,{children:y(_,{autoFocus:!0,placeholder:`Search fields`,value:I,onChange:H})}),b(r,{children:[!W&&I===``&&M&&y(i,{$active:!0,$clearable:A!==void 0,"data-testid":`selected-field-item`,onClick:()=>{A&&(A(),R())},children:b(`div`,{children:[y(u,{children:y(v,{variant:`h6`,children:M?.name?.toLowerCase()})}),y(g,{className:`check-icon`,data:C,color:D.interactive.primary__resting.rgba,size:24}),y(g,{className:`clear-icon`,data:w,size:24,color:D.interactive.primary__resting.rgba})]})}),W?y(c,{children:b(s,{variant:`body_short`,color:D.text.static_icons__tertiary.rgba,children:[`No `,O,`s matching your search`]})}):B.map(e=>y(a,{onClick:()=>{f(e),R()},children:y(u,{children:y(v,{variant:`h6`,children:e.name?.toLowerCase()})})},e.uuid))]})]}),k&&!W&&y(i,{"data-testid":`access-it-link`,onClick:()=>window.open(`https://accessit.equinor.com/#`,`_blank`),children:b(`div`,{children:[b(u,{children:[b(v,{variant:`overline`,children:[`Missing a `,O,`?`]}),y(v,{variant:`h6`,children:`Go to AccessIT`})]}),y(g,{data:T,color:D.interactive.primary__resting.rgba,size:24})]})})]})})]})});O.displayName=`FieldSelector`;export{O as FieldMenu};
|