@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,15 +1,20 @@
|
|
|
1
|
-
import{VARIANT_COLORS as
|
|
1
|
+
import{tokens as e}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{VARIANT_COLORS as t,colors as n}from"../../atoms/style/colors.js";import{spacings as r}from"../../atoms/style/spacings.js";import{shape as i,typography as a}from"../../atoms/style/index.js";import{typographyTemplate as o}from"../../node_modules/@equinor/eds-utils/dist/esm/utils/templates/index.js";import s,{css as c}from"styled-components";import{EditorContent as l}from"@tiptap/react";const u=e=>{switch(e){case`sm`:return r.small;case`md`:return r.medium;case`lg`:return r.large;default:return`0`}},d=({$highlighted:e,$variant:r})=>e?`inset 0 -2px ${n.dataviz.darkblue.darker}`:r?`inset 0 -2px ${t[r]}`:`inset 0 -1px ${n.ui.background__medium.rgba}`,f=s(l)`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-rows: 1fr;
|
|
4
4
|
overflow-y: auto;
|
|
5
5
|
min-height: ${e=>e.$minHeight||`auto`};
|
|
6
6
|
max-height: ${e=>e.$maxHeight||`auto`};
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
span.mention[data-type='mention'] {
|
|
9
|
+
${o(e.typography.paragraph.body_short_bold)};
|
|
10
|
+
color: ${n.interactive.primary__resting.rgba};
|
|
11
|
+
}
|
|
12
|
+
`,p=s.div`
|
|
8
13
|
display: grid;
|
|
9
14
|
grid-template-rows: auto 1fr;
|
|
10
|
-
background: ${
|
|
11
|
-
border-radius: ${
|
|
12
|
-
border: ${e=>e.$border?`1px solid ${
|
|
15
|
+
background: ${n.ui.background__default.rgba};
|
|
16
|
+
border-radius: ${i.corners.borderRadius} ${i.corners.borderRadius} 0 0;
|
|
17
|
+
border: ${e=>e.$border?`1px solid ${n.ui.background__medium.rgba}`:`none`};
|
|
13
18
|
border-bottom: none;
|
|
14
19
|
|
|
15
20
|
&:has(div[contenteditable='true']) {
|
|
@@ -17,32 +22,32 @@ import{VARIANT_COLORS as e,colors as t}from"../../atoms/style/colors.js";import{
|
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
& [data-placeholder]::before {
|
|
20
|
-
color: ${
|
|
25
|
+
color: ${n.text.static_icons__tertiary.rgba} !important;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
.tiptap {
|
|
24
29
|
box-sizing: border-box;
|
|
25
30
|
overflow-y: auto;
|
|
26
|
-
background: ${e=>e.$lightBackground?`${
|
|
31
|
+
background: ${e=>e.$lightBackground?`${n.ui.background__default.rgba}`:`${n.ui.background__light.rgba}`};
|
|
27
32
|
|
|
28
33
|
&[contenteditable='true'] {
|
|
29
|
-
box-shadow: ${
|
|
34
|
+
box-shadow: ${e=>e.$hasFooter?`none`:d(e)};
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
padding: ${e=>
|
|
37
|
+
padding: ${e=>u(e.$padding)};
|
|
33
38
|
|
|
34
39
|
a {
|
|
35
|
-
color: ${
|
|
40
|
+
color: ${n.interactive.primary__resting.rgba};
|
|
36
41
|
}
|
|
37
42
|
a:hover {
|
|
38
43
|
cursor: pointer;
|
|
39
|
-
color: ${
|
|
44
|
+
color: ${n.interactive.primary__hover.rgba};
|
|
40
45
|
}
|
|
41
46
|
p {
|
|
42
47
|
font-size: 16px;
|
|
43
48
|
font-family: 'Equinor', sans-serif;
|
|
44
|
-
color: ${
|
|
45
|
-
line-height: ${
|
|
49
|
+
color: ${n.text.static_icons__default.rgba};
|
|
50
|
+
line-height: ${a.paragraph.body_long.lineHeight};
|
|
46
51
|
margin: 0;
|
|
47
52
|
}
|
|
48
53
|
ul,
|
|
@@ -91,7 +96,7 @@ import{VARIANT_COLORS as e,colors as t}from"../../atoms/style/colors.js";import{
|
|
|
91
96
|
}
|
|
92
97
|
|
|
93
98
|
th {
|
|
94
|
-
background-color: ${({$lightBackground:e})=>e?`#f1f3f5`:
|
|
99
|
+
background-color: ${({$lightBackground:e})=>e?`#f1f3f5`:n.ui.background__default.rgba};
|
|
95
100
|
font-weight: bold;
|
|
96
101
|
text-align: left;
|
|
97
102
|
}
|
|
@@ -125,30 +130,45 @@ import{VARIANT_COLORS as e,colors as t}from"../../atoms/style/colors.js";import{
|
|
|
125
130
|
|
|
126
131
|
&:focus-visible {
|
|
127
132
|
outline: none;
|
|
128
|
-
box-shadow: inset 0 -2px ${
|
|
133
|
+
box-shadow: ${e=>e.$hasFooter?`none`:`inset 0 -2px ${n.interactive.primary__resting.rgba}`};
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
|
|
132
137
|
.tiptap p.is-editor-empty:first-child::before {
|
|
133
|
-
color: ${
|
|
138
|
+
color: ${n.text.static_icons__default.rgba};
|
|
134
139
|
content: attr(data-placeholder);
|
|
135
140
|
float: left;
|
|
136
141
|
height: 0;
|
|
137
142
|
pointer-events: none;
|
|
138
143
|
}
|
|
139
|
-
`,
|
|
144
|
+
`,m=s.div`
|
|
140
145
|
display: flex;
|
|
141
146
|
flex-direction: column;
|
|
142
|
-
`,
|
|
147
|
+
`,h=s.div`
|
|
148
|
+
display: grid;
|
|
149
|
+
grid-template-rows: 1fr auto;
|
|
150
|
+
min-height: 0;
|
|
151
|
+
background: ${e=>e.$lightBackground?n.ui.background__default.rgba:n.ui.background__light.rgba};
|
|
152
|
+
|
|
153
|
+
${e=>e.$hasFooter&&c`
|
|
154
|
+
box-shadow: ${d(e)};
|
|
155
|
+
|
|
156
|
+
&:focus-within {
|
|
157
|
+
box-shadow: inset 0 -2px ${n.interactive.primary__resting.rgba};
|
|
158
|
+
}
|
|
159
|
+
`}
|
|
160
|
+
`,g=s.div`
|
|
161
|
+
padding: ${e=>`${r.small} ${u(e.$padding)} ${r.small} ${u(e.$padding)}`};
|
|
162
|
+
`,_=s.div`
|
|
143
163
|
display: flex;
|
|
144
164
|
justify-content: space-between;
|
|
145
|
-
padding: 0 ${
|
|
165
|
+
padding: 0 ${r.small};
|
|
146
166
|
> p {
|
|
147
|
-
color: ${
|
|
167
|
+
color: ${n.text.static_icons__tertiary.rgba};
|
|
148
168
|
}
|
|
149
|
-
`,
|
|
169
|
+
`,v=s.div`
|
|
150
170
|
display: flex;
|
|
151
|
-
gap: ${
|
|
152
|
-
padding-left: ${
|
|
153
|
-
margin-top: ${
|
|
154
|
-
`;export{
|
|
171
|
+
gap: ${r.small};
|
|
172
|
+
padding-left: ${r.small};
|
|
173
|
+
margin-top: ${r.small};
|
|
174
|
+
`;export{f as EditorContent,p as EditorStyling,h as FieldWrapper,g as FooterContent,v as HelperWrapper,_ as LabelWrapper,m as Wrapper};
|
|
@@ -2,17 +2,17 @@ import { EditorStylingProps, RichTextContentProps } from "./RichTextEditor.style
|
|
|
2
2
|
import { EditorProviderProps } from "./EditorProvider.js";
|
|
3
3
|
import { MenuBarProps } from "./MenuBar/MenuBar.js";
|
|
4
4
|
import { RichTextEditor } from "./RichTextEditor.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react20 from "react";
|
|
6
6
|
import * as styled_components0 from "styled-components";
|
|
7
7
|
import * as _tiptap_react0 from "@tiptap/react";
|
|
8
8
|
import * as styled_components_dist_types0 from "styled-components/dist/types";
|
|
9
9
|
|
|
10
10
|
//#region src/molecules/RichTextEditor/index.d.ts
|
|
11
11
|
declare const RichText: {
|
|
12
|
-
Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<
|
|
13
|
-
Provider:
|
|
14
|
-
Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> &
|
|
15
|
-
Bar:
|
|
12
|
+
Styling: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<react20.DetailedHTMLProps<react20.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never> & Partial<Pick<styled_components0.FastOmit<react20.DetailedHTMLProps<react20.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof EditorStylingProps> & EditorStylingProps, never>>> & string;
|
|
13
|
+
Provider: react20.FC<EditorProviderProps>;
|
|
14
|
+
Content: styled_components_dist_types0.IStyledComponentBase<"web", styled_components0.FastOmit<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react20.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never> & Partial<Pick<styled_components0.FastOmit<Omit<_tiptap_react0.EditorContentProps, "ref"> & react20.RefAttributes<HTMLDivElement>, keyof RichTextContentProps> & RichTextContentProps, never>>> & string & Omit<react20.NamedExoticComponent<Omit<_tiptap_react0.EditorContentProps, "ref"> & react20.RefAttributes<HTMLDivElement>>, keyof react20.Component<any, {}, any>>;
|
|
15
|
+
Bar: react20.FC<MenuBarProps>;
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
18
18
|
export { RichText };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react46 from "react";
|
|
2
2
|
import { SearchProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Search/Search.d.ts
|
|
5
5
|
interface SearchProps$1 extends SearchProps {
|
|
6
6
|
lightBackground?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const Search$1:
|
|
8
|
+
declare const Search$1: react46.ForwardRefExoticComponent<SearchProps$1 & react46.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Search$1 as Search };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, MultiSelectCommon, SelectOptionRequired } from "../Select.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react53 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Select/ComboBox/ComboBox.d.ts
|
|
5
5
|
type ComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps<T> & MultiSelectCommon<T> & (ListSelectProps<T> | GroupedSelectProps<T>);
|
|
@@ -17,6 +17,6 @@ type ComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps<T> & Mult
|
|
|
17
17
|
* @param showSelectedAsText - If values should be shown as "5/10 Selected", defaults to false
|
|
18
18
|
* @param customMenuItemComponent - Custom component to use for rendering menu item, defaults to a checkbox with label
|
|
19
19
|
*/
|
|
20
|
-
declare function ComboBox<T extends SelectOptionRequired>(props: ComboBoxProps<T>):
|
|
20
|
+
declare function ComboBox<T extends SelectOptionRequired>(props: ComboBoxProps<T>): react53.JSX.Element;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { ComboBox, ComboBoxProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useGroupedSelectItems as e}from"./Select.hooks.js";import{GroupTitle as t,
|
|
1
|
+
import{useGroupedSelectItems as e}from"./Select.hooks.js";import{GroupTitle as t,PersistentGroupsWrapper as n,PersistentNoItemsFoundText as r}from"./Select.styles.js";import{SelectMenuItem as i}from"./SelectMenuItem.js";import{Divider as a}from"@equinor/eds-core-react";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=c=>{let{onItemSelect:l,onItemKeyDown:u,itemRefs:d,CustomMenuItemComponent:f,mode:p}=c,{filteredGroups:m,filteredGroupSum:h}=e(c);return m.length===0?o(r,{children:`No items found`}):`value`in c?null:o(n,{children:m.map((e,n,r)=>s(`div`,{children:[o(t,{group:`navigation`,variant:`label`,children:e.title}),e.items.map((t,r)=>o(i,{index:r+h[n],childOffset:0,item:t,itemRefs:d,onItemKeyDown:u,onItemSelect:l,values:c.values,mode:p,CustomMenuItemComponent:f},`${e.title}-${n}-item-${t.value}`)),n<r.length-1&&o(a,{})]},`${e.title}-${n}`))})};export{c as GroupedSelectPersistent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{capitalize as e}from"../../atoms/utils/string.js";import{getChildOffset as t}from"./Select.utils.js";import{useListSelectItems as n}from"./Select.hooks.js";import{GroupTitle as r,
|
|
1
|
+
import{capitalize as e}from"../../atoms/utils/string.js";import{getChildOffset as t}from"./Select.utils.js";import{useListSelectItems as n}from"./Select.hooks.js";import{GroupTitle as r,NoTagFoundText as i,PersistentNoItemsFoundText as a}from"./Select.styles.js";import{SelectMenuItem as o}from"./SelectMenuItem.js";import{AddTagItem as s}from"./AddTagItem.js";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";const d=d=>{let{search:f,itemRefs:p,onItemKeyDown:m,mode:h}=d,{filteredItems:g}=n(d);if(g.length===0&&(!d.onAddItem||f===``))return l(a,{children:`No items found`});let _=g.some(e=>e.children&&e.children.length>0),v=g.map((e,n)=>({childOffset:t(g,n),index:n,item:e,itemValue:e.value,parentHasNestedItems:_,...d,mode:h}));if(`onAddItem`in d&&d.onAddItem&&f!==``&&(g.length===1&&g.at(0)?.label.toLowerCase()!==f.trim().toLowerCase()||g.length!==1)){let t=d.itemSingularWord?d.itemSingularWord:`tag`;return u(c,{children:[l(r,{group:`navigation`,variant:`label`,children:`Add ${t}`}),l(s,{index:0,itemRefs:p,onItemKeyDown:m,onAddItem:d.onAddItem,addItemSingularWord:t,mode:h,children:f}),l(r,{group:`navigation`,variant:`label`,children:`${e(t)} search results`}),v.length>0?v.map((e,t)=>l(o,{...e,index:t+1},`menu-item-${t}-${e.item.value}`)):u(i,{children:[`No `,t,` for "`,f,`" found.`]})]})}return v.map((e,t)=>l(o,{...e,index:t},`menu-item-${t}-${e.item.value}`))};export{d as ListSelectPersistent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, MultiSelectCommon, PersistentSelectProps, SelectOptionRequired } from "../Select.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react54 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Select/PersistentComboBox/PersistentComboBox.d.ts
|
|
5
5
|
type PersistentComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps<T> & MultiSelectCommon<T> & PersistentSelectProps & (GroupedSelectProps<T> | ListSelectProps<T>);
|
|
@@ -18,6 +18,6 @@ type PersistentComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps
|
|
|
18
18
|
* @param customMenuItemComponent - Custom component to use for rendering menu item, defaults to a checkbox with label
|
|
19
19
|
* @param maxHeight - Max height of the persistent wrapper below the search field, optional
|
|
20
20
|
*/
|
|
21
|
-
declare function PersistentComboBox<T extends SelectOptionRequired>(props: PersistentComboBoxProps<T>):
|
|
21
|
+
declare function PersistentComboBox<T extends SelectOptionRequired>(props: PersistentComboBoxProps<T>): react54.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { PersistentComboBox, PersistentComboBoxProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseChipProps, ClickableChipProps, DeletableChipProps } from "../Chip/Chip.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react55 from "react";
|
|
3
3
|
import "@equinor/eds-core-react";
|
|
4
4
|
import * as styled_components11 from "styled-components";
|
|
5
5
|
import * as styled_components_dist_types5 from "styled-components/dist/types";
|
|
@@ -11,15 +11,15 @@ interface ComboBoxChipProps {
|
|
|
11
11
|
$lightBackground?: boolean;
|
|
12
12
|
className: string;
|
|
13
13
|
}
|
|
14
|
-
declare const ComboBoxChip: styled_components_dist_types5.IStyledComponentBase<"web", styled_components11.FastOmit<styled_components11.FastOmit<((Omit<
|
|
14
|
+
declare const ComboBoxChip: styled_components_dist_types5.IStyledComponentBase<"web", styled_components11.FastOmit<styled_components11.FastOmit<((Omit<react55.HTMLAttributes<HTMLButtonElement | HTMLDivElement>, "onClick"> & ((BaseChipProps & {
|
|
15
15
|
onClick?: undefined;
|
|
16
16
|
onDelete?: undefined;
|
|
17
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
17
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLButtonElement | HTMLDivElement>) & styled_components_dist_types5.BaseObject, keyof ComboBoxChipProps> & ComboBoxChipProps, never> & Partial<Pick<styled_components11.FastOmit<((Omit<react55.HTMLAttributes<HTMLButtonElement | HTMLDivElement>, "onClick"> & ((BaseChipProps & {
|
|
18
18
|
onClick?: undefined;
|
|
19
19
|
onDelete?: undefined;
|
|
20
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
20
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLButtonElement | HTMLDivElement>) & styled_components_dist_types5.BaseObject, keyof ComboBoxChipProps> & ComboBoxChipProps, never>>> & string & Omit<react55.ForwardRefExoticComponent<(Omit<react55.HTMLAttributes<HTMLButtonElement | HTMLDivElement>, "onClick"> & ((BaseChipProps & {
|
|
21
21
|
onClick?: undefined;
|
|
22
22
|
onDelete?: undefined;
|
|
23
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
23
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLButtonElement | HTMLDivElement>>, keyof react55.Component<any, {}, any>>;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { ComboBoxChip };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS as t,VARIANT_HELPER_TEXT_COLORS as n,colors as r}from"../../atoms/style/colors.js";import{spacings as i}from"../../atoms/style/spacings.js";import{shape as a}from"../../atoms/style/index.js";import{Chip as o}from"../Chip/Chip.js";import{Button as s,Menu as c,Typography as l}from"@equinor/eds-core-react";import u,{css as d}from"styled-components";const f=u.div`
|
|
1
|
+
import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS as t,VARIANT_HELPER_TEXT_COLORS as n,colors as r}from"../../atoms/style/colors.js";import{spacings as i}from"../../atoms/style/spacings.js";import{shape as a}from"../../atoms/style/index.js";import{Chip as o}from"../Chip/Chip.js";import{Button as s,Menu as c,Typography as l}from"@equinor/eds-core-react";import u,{css as d}from"styled-components";const f=`calc(${i.medium} * 2 + 24px)`,p=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: ${i.small};
|
|
5
5
|
${({$showBackgroundColor:e})=>e&&d`
|
|
6
6
|
background-color: ${r.ui.background__default.rgba};
|
|
7
7
|
`}
|
|
8
|
-
`,
|
|
8
|
+
`,m=u.span`
|
|
9
9
|
display: flex;
|
|
10
10
|
gap: ${i.x_small};
|
|
11
11
|
width: 100%;
|
|
12
|
-
`,
|
|
12
|
+
`,h=u.span`
|
|
13
13
|
display: flex;
|
|
14
14
|
gap: ${i.small};
|
|
15
15
|
align-items: center;
|
|
@@ -31,7 +31,7 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
31
31
|
border-bottom: 1px solid ${r.ui.background__heavy.rgba};
|
|
32
32
|
padding-bottom: ${i.small};
|
|
33
33
|
`}
|
|
34
|
-
`,
|
|
34
|
+
`,g=u.div`
|
|
35
35
|
position: relative;
|
|
36
36
|
display: grid;
|
|
37
37
|
grid-template-columns: 1fr auto;
|
|
@@ -101,7 +101,7 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
101
101
|
width: calc(100% - 24px);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
104
|
+
`,_=u.section`
|
|
105
105
|
position: relative;
|
|
106
106
|
display: flex;
|
|
107
107
|
flex-wrap: wrap;
|
|
@@ -151,7 +151,7 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`,v=u(s)`
|
|
155
155
|
position: absolute;
|
|
156
156
|
top: 50%;
|
|
157
157
|
transform: translate(0, -50%);
|
|
@@ -171,13 +171,13 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
171
171
|
fill: ${r.interactive.disabled__text.rgba};
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
`,
|
|
174
|
+
`,y=u(o)`
|
|
175
175
|
background: ${({$tryingToRemove:e,$lightBackground:t})=>e?r.interactive.primary__hover_alt.rgba:t?r.ui.background__light.rgba:r.ui.background__default.rgba} !important;
|
|
176
|
-
`,
|
|
176
|
+
`,b=u.div`
|
|
177
177
|
padding: ${i.small} 0;
|
|
178
|
-
`,
|
|
178
|
+
`,x=u(l)`
|
|
179
179
|
padding: ${i.small} 0 ${i.small} ${i.medium};
|
|
180
|
-
`,
|
|
180
|
+
`,S=u(c.Item)`
|
|
181
181
|
flex-grow: 1;
|
|
182
182
|
padding-left: 10px;
|
|
183
183
|
|
|
@@ -201,7 +201,7 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
201
201
|
background: ${r.interactive.primary__selected_hover.rgba};
|
|
202
202
|
}
|
|
203
203
|
`:``}
|
|
204
|
-
`,
|
|
204
|
+
`,C=u.div`
|
|
205
205
|
position: relative;
|
|
206
206
|
isolation: isolate;
|
|
207
207
|
display: flex;
|
|
@@ -211,21 +211,22 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
211
211
|
overflow: hidden;
|
|
212
212
|
background-color: ${r.ui.background__default.rgba};
|
|
213
213
|
height: ${({$shouldShowLabel:e,$maxHeight:t})=>t||(e?d`calc(100% - 16px)`:`100%`)};
|
|
214
|
-
`,
|
|
214
|
+
`,w=u.div`
|
|
215
215
|
position: sticky;
|
|
216
216
|
top: 0;
|
|
217
217
|
z-index: 1;
|
|
218
|
-
`,
|
|
218
|
+
`,T=u.div`
|
|
219
219
|
flex: 1;
|
|
220
220
|
min-height: 0;
|
|
221
221
|
overflow: auto;
|
|
222
|
-
`,
|
|
222
|
+
`,E=u.button`
|
|
223
223
|
width: 100%;
|
|
224
224
|
display: flex;
|
|
225
225
|
align-items: center;
|
|
226
226
|
padding: ${i.medium} ${i.medium};
|
|
227
227
|
justify-content: flex-start;
|
|
228
228
|
gap: ${i.small};
|
|
229
|
+
min-height: ${f};
|
|
229
230
|
box-sizing: border-box;
|
|
230
231
|
svg {
|
|
231
232
|
flex-shrink: 0;
|
|
@@ -236,19 +237,19 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
236
237
|
&:focus-visible {
|
|
237
238
|
outline: 2px dashed ${r.interactive.primary__resting.rgba};
|
|
238
239
|
}
|
|
239
|
-
`,
|
|
240
|
+
`,D=u.hr`
|
|
240
241
|
height: calc(100% + ${i.medium} * 2);
|
|
241
242
|
justify-self: center;
|
|
242
243
|
width: ${i.x_large};
|
|
243
244
|
min-width: ${i.x_large};
|
|
244
|
-
`,
|
|
245
|
+
`,O=u(l)`
|
|
245
246
|
user-select: none;
|
|
246
247
|
pointer-events: none;
|
|
247
248
|
position: absolute;
|
|
248
249
|
color: ${r.text.static_icons__tertiary.rgba};
|
|
249
250
|
top: calc(50%);
|
|
250
251
|
transform: translate(0, -50%);
|
|
251
|
-
`,
|
|
252
|
+
`,k=u(l)`
|
|
252
253
|
user-select: none;
|
|
253
254
|
pointer-events: none;
|
|
254
255
|
position: absolute;
|
|
@@ -260,11 +261,17 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
260
261
|
text-overflow: ellipsis;
|
|
261
262
|
color: ${r.text.static_icons__default.rgba};
|
|
262
263
|
max-width: 100%;
|
|
263
|
-
`,k=u(l)`
|
|
264
|
-
margin: ${i.medium};
|
|
265
264
|
`,A=u(l)`
|
|
266
|
-
margin
|
|
267
|
-
`,j=u(
|
|
265
|
+
margin: ${i.medium};
|
|
266
|
+
`,j=u(l).attrs({group:`navigation`,variant:`menu_title`})`
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
margin: 0;
|
|
270
|
+
padding: ${i.medium};
|
|
271
|
+
box-sizing: border-box;
|
|
272
|
+
`,M=u(j)`
|
|
273
|
+
min-height: ${f};
|
|
274
|
+
`,N=u(c)`
|
|
268
275
|
max-height: 20rem;
|
|
269
276
|
max-width: inherit;
|
|
270
277
|
overflow-y: auto;
|
|
@@ -272,16 +279,16 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
272
279
|
width: inherit;
|
|
273
280
|
max-width: inherit;
|
|
274
281
|
}
|
|
275
|
-
`,
|
|
282
|
+
`,P=u.div`
|
|
276
283
|
display: flex;
|
|
277
284
|
align-items: center;
|
|
278
285
|
gap: ${i.small};
|
|
279
|
-
`,
|
|
286
|
+
`,F=d`
|
|
280
287
|
width: 36px;
|
|
281
288
|
height: 36px;
|
|
282
289
|
flex-shrink: 0;
|
|
283
|
-
`,
|
|
284
|
-
${
|
|
285
|
-
`,
|
|
286
|
-
${
|
|
287
|
-
`;export{
|
|
290
|
+
`,I=u(s)`
|
|
291
|
+
${F}
|
|
292
|
+
`,L=u.div`
|
|
293
|
+
${F}
|
|
294
|
+
`;export{L as ChevronPlaceholder,v as ClearButton,y as ComboBoxChip,g as Container,x as GroupTitle,h as HelperWrapper,m as LabelWrapper,D as MenuItemSpacer,P as MenuItemWrapper,j as NoItemsFoundText,A as NoTagFoundText,C as PersistentComboBoxWrapper,b as PersistentGroupsWrapper,E as PersistentListItem,T as PersistentListScrollArea,M as PersistentNoItemsFoundText,w as PersistentStickyWrapper,O as PlaceholderText,_ as Section,I as SmallButton,N as StyledMenu,S as StyledMenuItem,k as ValueText,p as Wrapper};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, SelectOptionRequired, SingleSelectCommon } from "../Select.types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react171 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Select/SingleSelect/SingleSelect.d.ts
|
|
5
5
|
type SingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps<T> & SingleSelectCommon<T> & (ListSelectProps<T> | GroupedSelectProps<T>);
|
|
@@ -15,6 +15,6 @@ type SingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps<T> &
|
|
|
15
15
|
* @param onSearchFilter - Custom filter function for search, default is "item.label.match(new RegExp(searchValue, 'i'))"
|
|
16
16
|
* @param customMenuItemComponent - Custom component to use for rendering menu item, defaults to a checkbox with label
|
|
17
17
|
*/
|
|
18
|
-
declare function SingleSelect<T extends SelectOptionRequired>(props: SingleSelectProps<T>):
|
|
18
|
+
declare function SingleSelect<T extends SelectOptionRequired>(props: SingleSelectProps<T>): react171.JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { SingleSelect, SingleSelectProps };
|
|
@@ -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 react176 from "react";
|
|
2
2
|
import { RadioProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Radio/Radio.d.ts
|
|
@@ -7,6 +7,6 @@ interface RadioProps$1 extends RadioProps {
|
|
|
7
7
|
outlined?: boolean;
|
|
8
8
|
error?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const Radio$1:
|
|
10
|
+
declare const Radio$1: react176.ForwardRefExoticComponent<RadioProps$1 & react176.RefAttributes<HTMLInputElement>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Radio$1 as Radio, RadioProps$1 as RadioProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react178 from "react";
|
|
2
2
|
import { SwitchProps } from "@equinor/eds-core-react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/SelectionControls/Switch/Switch.d.ts
|
|
5
5
|
interface SwitchProps$1 extends SwitchProps {
|
|
6
6
|
outlined?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare const Switch$1:
|
|
8
|
+
declare const Switch$1: react178.ForwardRefExoticComponent<SwitchProps$1 & react178.RefAttributes<HTMLInputElement>>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Switch$1 as Switch, SwitchProps$1 as SwitchProps };
|
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS as t,colors as n}from"../../atoms/style/colors.js";import{spacings as r}from"../../atoms/style/spacings.js";import{shape as i}from"../../atoms/style/index.js";import{getSkeletonHeight as a,getSkeletonTop as o}from"../../atoms/utils/skeleton.js";import{
|
|
1
|
+
import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS as t,colors as n}from"../../atoms/style/colors.js";import{spacings as r}from"../../atoms/style/spacings.js";import{shape as i}from"../../atoms/style/index.js";import{getSkeletonHeight as a,getSkeletonTop as o}from"../../atoms/utils/skeleton.js";import{InputExplanation as s}from"../InputExplanation/InputExplanation.js";import{SkeletonBase as c}from"../Skeleton/SkeletonBase/SkeletonBase.js";import{useEffect as l,useRef as u,useState as d}from"react";import{TextField as f,Typography as p}from"@equinor/eds-core-react";import m,{css as h}from"styled-components";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=m.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
height: fit-content;
|
|
4
4
|
input,
|
|
@@ -77,7 +77,7 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
`}
|
|
80
|
-
`,y=m(
|
|
80
|
+
`,y=m(c)`
|
|
81
81
|
position: absolute;
|
|
82
82
|
left: ${r.small};
|
|
83
83
|
border-radius: ${i.corners.borderRadius};
|
|
@@ -89,4 +89,4 @@ import{animation as e}from"../../atoms/style/animation.js";import{VARIANT_COLORS
|
|
|
89
89
|
display: flex;
|
|
90
90
|
gap: ${r.x_small};
|
|
91
91
|
align-items: center;
|
|
92
|
-
`,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},
|
|
92
|
+
`,S=e=>{if(e.maxCharacters&&`type`in e&&e.type!==`text`)throw Error('`maxCharacters` prop is not supported for input types other than "text".');if(e.explanation&&!e.label)throw Error("`explanation` prop requires a `label` to be set on the TextField.");let i={...e,variant:e.variant===`dirty`?void 0:e.variant},c=e.loading?void 0:e.variant,p=o(e),m=a(e),h=u(`${Math.max(20,Math.random()*80)}%`),[S,C]=d(typeof e.value==`string`?e.value.length:0),[w,T]=d(0),E=e=>{if(e){let t=e.getBoundingClientRect().width;T(t)}},D=t=>{e.onChange&&e.onChange(t),e.maxCharacters&&C(t.target.value.length)};return l(()=>{typeof e.value==`string`&&e.maxCharacters&&e.value.length!==S&&C(e.value.length)},[S,e.maxCharacters,e.value]),_(v,{ref:t=>{if(!t||!e.maxCharacters)return;let n=t.querySelector(`input, textarea`);n&&C(n.value.length)},$variant:c,$disabled:e.loading?!1:e.disabled,$helperRightWidth:w,style:{marginBottom:!e.helperText&&e.maxCharacters?`calc(${r.small} + 1rem)`:0},children:[g(f,{...i,label:i.label?_(x,{children:[i.label,e.explanation&&g(s,{position:e.explanationPosition,children:e.explanation})]}):void 0,disabled:e.loading||e.disabled,onChange:D}),e.loading&&g(y,{className:`skeleton`,role:`progressbar`,style:{top:p,height:m,width:h.current}}),e.maxCharacters&&_(b,{ref:E,variant:`helper`,group:`input`,color:i.variant?t[i.variant]:n.text.static_icons__tertiary.rgba,style:{bottom:e.helperText?`0`:`calc((${r.small} + 1rem) * -1)`},children:[S,` / `,e.maxCharacters]})]})};export{S as TextField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, RefObject } from "react";
|
|
1
|
+
import { FC, ReactNode, RefObject } from "react";
|
|
2
2
|
import { IconData } from "@equinor/eds-icons";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/Toast/Toast.d.ts
|
|
@@ -7,7 +7,7 @@ interface ToastProps {
|
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
icon?: IconData;
|
|
9
9
|
variant?: 'neutral' | 'info' | 'warning' | 'error' | 'success';
|
|
10
|
-
description?:
|
|
10
|
+
description?: ReactNode;
|
|
11
11
|
action?: {
|
|
12
12
|
onClick: () => void;
|
|
13
13
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{getHeaderIcon as t}from"./Toast.utils.js";import{ActionButton as n,CloseButton as r,Container as i,Description as a,DurationBar as o,Header as s,HeaderIcon as c,Title as l}from"./Toast.styles.js";import{useEffect as u}from"react";import{Icon as d}from"@equinor/eds-core-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{close as m}from"@equinor/eds-icons";const h=({title:h,icon:g,onClose:_,variant:v,description:y,action:b,duration:x,ref:S})=>{if(x!==void 0&&x<=0)throw Error(`Duration must be a positive number`);u(()=>{if(!x)return;let e=setTimeout(()=>{_()},x*1e3);return()=>clearTimeout(e)},[x,_]);let C=()=>{b?.onClick(),_()},w=t({icon:g,variant:v});return p(i,{ref:S,$variant:v,children:[p(s,{$hasIcon:!!w,children:[w&&f(c,{$variant:v,children:f(d,{data:w})}),f(l,{variant:`h6`,color:e.text.static_icons__default.rgba,children:h}),f(r,{icon:m,variant:`ghost`,onClick:_,$variant:v})]}),y&&f(a,{variant:`body_long`,color:e.text.static_icons__secondary.rgba,children:y}),b&&f(n,{variant:`outlined`,onClick:C,$variant:v,children:b.text}),x&&f(o,{role:`progressbar`,$variant:v,$duration:x})]})};export{h as Toast};
|