@equinor/amplify-component-lib 8.12.1 → 8.13.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/useSelect.js +1 -1
- package/dist/deprecated/Workflow/WorkflowDescription.js +1 -1
- package/dist/index.js +1 -1
- package/dist/molecules/Badge/Badge.js +1 -1
- package/dist/molecules/Dialog/DialogAction.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.js +1 -1
- package/dist/molecules/FileProgress/CompactFileProgress.styles.d.ts +2 -1
- package/dist/molecules/FileProgress/CompactFileProgress.styles.js +46 -38
- package/dist/molecules/FileProgress/FileProgress.utils.d.ts +4 -1
- package/dist/molecules/FileProgress/FileProgress.utils.js +1 -1
- package/dist/molecules/FileUploadArea/FileUploadArea.js +36 -18
- package/dist/molecules/FileUploadArea/UploadIllustration.js +1 -1
- package/dist/molecules/InfoElement/InfoElement.js +1 -1
- package/dist/molecules/ListItem/ListItem.d.ts +1 -0
- package/dist/molecules/ListItem/ListItem.js +10 -8
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.styles.d.ts +0 -5
- package/dist/molecules/RichTextEditor/MenuBar/MenuBar.styles.js +10 -10
- package/dist/molecules/RichTextEditor/MenuBar/MenuButton.d.ts +0 -5
- package/dist/molecules/RichTextEditor/MenuBar/MenuButton.js +1 -1
- package/dist/molecules/RichTextEditor/MenuBar/TextClearFormating.js +3 -3
- package/dist/molecules/RichTextEditor/custom-extensions/ExtendedHeaders.js +1 -1
- package/dist/molecules/Search/Search.js +11 -4
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +4 -2
- package/dist/molecules/Select/GroupedSelectMenu.js +1 -1
- package/dist/molecules/Select/ListSelectMenu.js +1 -1
- package/dist/molecules/Select/Select.d.ts +1 -1
- package/dist/molecules/Select/Select.js +1 -1
- package/dist/molecules/Select/Select.styles.d.ts +4 -4
- package/dist/molecules/Select/Select.styles.js +58 -54
- package/dist/molecules/Select/Select.types.d.ts +9 -2
- package/dist/molecules/Select/SingleSelect/SingleSelect.d.ts +3 -2
- package/dist/molecules/Stepper/Step/Step.js +8 -4
- package/dist/molecules/TextField/TextField.js +19 -13
- package/dist/molecules/index.d.ts +1 -0
- package/dist/organisms/ErrorPage/Description.js +1 -1
- package/dist/organisms/ErrorPage/Title.js +1 -1
- package/dist/organisms/TopBar/Account/Account.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.js +1 -1
- package/dist/organisms/TopBar/Account/ImpersonateMenu/ImpersonateMenu.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/DefaultNotification.js +1 -1
- package/dist/organisms/TopBar/Notifications/NotificationsTemplate/NotificationElements/NoNotifications.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotes.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleaseNotesHeader.js +1 -1
- package/dist/organisms/TopBar/Resources/ReleaseNotesDialog/ReleasePosts/ReleasePosts.js +1 -1
- package/dist/organisms/TopBar/TopBar.js +1 -1
- package/dist/providers/LoadingProvider.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{tokens as r}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{colors as
|
|
1
|
+
import{tokens as r}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{colors as t}from"../../../atoms/style/colors.js";import i from"styled-components";const{spacings:e,shape:o}=r,a=i.section`
|
|
2
2
|
display: flex;
|
|
3
3
|
> button:not(:first-child):not(:last-child) {
|
|
4
4
|
border-radius: 0;
|
|
@@ -11,24 +11,24 @@ import{tokens as r}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/
|
|
|
11
11
|
border-bottom-left-radius: 0;
|
|
12
12
|
border-top-left-radius: 0;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,s=i.button`
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
|
-
border-radius: ${
|
|
18
|
-
padding: ${
|
|
19
|
-
color: ${r=>
|
|
17
|
+
border-radius: ${o.button.borderRadius};
|
|
18
|
+
padding: ${e.comfortable.x_small};
|
|
19
|
+
color: ${r=>d(r)};
|
|
20
20
|
background: ${r=>n(r)};
|
|
21
21
|
transition: 200ms;
|
|
22
22
|
> svg {
|
|
23
|
-
fill: ${r=>
|
|
23
|
+
fill: ${r=>d(r)};
|
|
24
24
|
transition: 200ms fill;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&:hover:not(:disabled) {
|
|
28
28
|
background: ${r=>b(r)};
|
|
29
|
-
color: ${r=>
|
|
29
|
+
color: ${r=>l(r)};
|
|
30
30
|
> svg {
|
|
31
|
-
fill: ${r=>
|
|
31
|
+
fill: ${r=>l(r)};
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -37,6 +37,6 @@ import{tokens as r}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&:disabled > svg {
|
|
40
|
-
fill: ${
|
|
40
|
+
fill: ${t.interactive.disabled__text.rgba};
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,d=r=>r.$active?t.ui.background__light.rgba:t.interactive.primary__resting.rgba,l=r=>r.$active?t.text.static_icons__primary_white.rgba:t.interactive.primary__hover.rgba,n=r=>r.$active?t.interactive.primary__resting.rgba:t.ui.background__light.rgba,b=r=>r.$active?t.interactive.primary__hover.rgba:t.interactive.primary__hover_alt.rgba;export{s as MenuButtonStyle,a as MenuSection};
|
|
@@ -8,10 +8,5 @@ export interface MenuButtonProps {
|
|
|
8
8
|
active?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
tooltip?: string;
|
|
11
|
-
customColors?: {
|
|
12
|
-
resting: string;
|
|
13
|
-
hover: string;
|
|
14
|
-
backgroundHover: string;
|
|
15
|
-
};
|
|
16
11
|
}
|
|
17
12
|
export declare const MenuButton: import("react").ForwardRefExoticComponent<Omit<MenuButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as o}from"react/jsx-runtime";import{forwardRef as e}from"react";import{Icon as i}from"@equinor/eds-core-react";import{MenuButtonStyle as r}from"./MenuBar.styles.js";import{OptionalTooltip as l}from"../../OptionalTooltip/OptionalTooltip.js";const n=e((({icon:e,onClick:n,active:a=!1,disabled:c=!1,tooltip:m,children:p,...d},s)=>t(l,{title:m,placement:"bottom",children:o(r,{ref:s,$active:a,onClick:n,disabled:c,type:"button",...d,children:[t(i,{data:e}),p]})})));n.displayName="MenuButton";export{n as MenuButton};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as o,Fragment as r,jsx as e}from"react/jsx-runtime";import{format_clear as i}from"@equinor/eds-icons";import{tokens as t}from"../../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{RichTextEditorFeatures as s}from"../RichTextEditor.types.js";import{EditorMenu as n}from"./MenuBar.js";import m from"styled-components";const{colors:d}=t,u=m.hr`
|
|
2
2
|
width: 1px;
|
|
3
|
-
background: ${
|
|
4
|
-
`,
|
|
3
|
+
background: ${d.ui.background__medium.rgba};
|
|
4
|
+
`,c=({editor:t,features:m})=>{if(!m||m.includes(s.CLEAR_FORMATTING))return o(r,{children:[e(u,{}),e(n.Button,{icon:i,onClick:()=>t.chain().focus().clearNodes().unsetAllMarks().run()})]})};export{c as TextClearFormating};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import o from"@tiptap/extension-heading";import{ReactNodeViewRenderer as t,NodeViewWrapper as e,NodeViewContent as i}from"@tiptap/react";import"../../AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../ApplicationIcon/ApplicationIcon.js";import"../../Badge/Badge.styles.js";import{Typography as s}from"@equinor/eds-core-react";import"../../Banner/Banner.styles.js";import"@equinor/eds-icons";import"../../Chip/Chip.js";import"../../ContentMenu/ContentMenu.js";import"../../Dialog/Dialog.js";import"../../EquinorLogo/EquinorLogo.js";import"react";import"
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import o from"@tiptap/extension-heading";import{ReactNodeViewRenderer as t,NodeViewWrapper as e,NodeViewContent as i}from"@tiptap/react";import"../../AnimatedCheckmark/AnimatedCheckmark.styles.js";import"../../ApplicationIcon/ApplicationIcon.js";import"../../Badge/Badge.styles.js";import{Typography as s}from"@equinor/eds-core-react";import"../../Banner/Banner.styles.js";import"@equinor/eds-icons";import"../../Chip/Chip.js";import"../../ContentMenu/ContentMenu.js";import"../../Dialog/Dialog.js";import"../../EquinorLogo/EquinorLogo.js";import"react";import"../../FileProgress/CompactFileProgress.styles.js";import"../../../atoms/style/colors.js";import"./AmplifyKit.js";import"../MenuBar/MenuBar.js";import"../RichTextEditor.styles.js";import"../RichTextEditor.types.js";import"../../../_virtual/lodash.js";import"@equinor/subsurface-app-management";import"@microsoft/signalr";import"@tanstack/react-query";import"../../../atoms/enums/Environment.js";import"../../../atoms/utils/auth_environment.js";import"../../../organisms/TopBar/Notifications/NotificationProvider.js";import"../../../providers/AuthProvider/AuthProvider.js";import"../../../providers/ReleaseNotesProvider.js";import"../../../providers/SideBarProvider.js";import"../../../providers/SnackbarProvider/SnackbarProvider.js";import"../../../providers/StepperProvider.js";import"../../../providers/TableOfContentsProvider.js";import"../../../providers/ThemeProvider/ThemeProvider.js";import"../../../providers/TutorialStepsProvider.js";import"../../../atoms/enums/Errors.js";import"../../../atoms/enums/Theme.js";import"../../../atoms/enums/SpacingsMode.js";import"../../../organisms/ErrorPage/illustrations/GlitchAnimation.js";import"../../../organisms/ErrorPage/illustrations/QuestioningAnimation.js";import"proj4";import"html2canvas";import"../../FileProgress/RegularFileProgress.styles.js";import"../../FileUploadArea/FileUploadArea.js";import"../../FullPageSpinner/FullPageSpinner.js";import"../../InfoElement/InfoElement.js";import"../../OptionalTooltip/OptionalTooltip.js";import"../../ProfileAvatar/ProfileAvatar.js";import"../MenuBar/MenuBar.styles.js";import"../MenuBar/MenuButton.js";import"../../Search/Search.js";import"react-router-dom";import"../../Sieve/Sieve.styles.js";import"../../SingleFilterMenu/SingleFilterMenu.js";import"../../Skeleton/SkeletonBase/SkeletonBase.js";import"../../Stepper/Stepper.js";import"../../OptionDrawer/OptionDrawer.js";import"../../Select/Select.styles.js";import"../../ListItem/ListItem.js";import"../../SelectionControls/Checkbox/Checkbox.js";import"../../SelectionControls/Radio/Radio.js";import"../../SelectionControls/Switch/Switch.js";const p=o=>{const t=o.node.attrs.level;let p="h1";return 2===t&&(p="h2"),3===t&&(p="h3"),4===t&&(p="h4"),5===t&&(p="h5"),6===t&&(p="h6"),r(e,{children:r(s,{variant:p,children:r(i,{className:"content is-editable"})})})};var n=o.extend({content:"inline*",addNodeView:()=>t(p)});export{n as default};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as o}from"react";import{Search as r}from"@equinor/eds-core-react";import{animation as i}from"../../atoms/style/animation.js";import{colors as a}from"../../atoms/style/colors.js";import e from"styled-components";const n=e(r)`
|
|
2
2
|
input {
|
|
3
|
-
color: ${
|
|
3
|
+
color: ${a.text.static_icons__default.rgba};
|
|
4
|
+
transition:
|
|
5
|
+
background ${i.transitionMS},
|
|
6
|
+
box-shadow ${i.transitionMS};
|
|
7
|
+
&:hover {
|
|
8
|
+
background: ${a.ui.background__light_medium.rgba};
|
|
9
|
+
box-shadow: inset 0 -2px 0 0 ${a.text.static_icons__tertiary.rgba};
|
|
10
|
+
}
|
|
4
11
|
}
|
|
5
12
|
|
|
6
13
|
div:focus-within {
|
|
7
14
|
outline: none !important;
|
|
8
15
|
|
|
9
16
|
input {
|
|
10
|
-
box-shadow: inset 0 -2px 0 0 ${
|
|
17
|
+
box-shadow: inset 0 -2px 0 0 ${a.interactive.primary__resting.rgba};
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
|
-
`,
|
|
20
|
+
`,s=o(((o,r)=>t(n,{...o,ref:r,autoComplete:"off"})));s.displayName="HeaderDrawer";export{s as Search};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, MultiSelectCommon, SelectOptionRequired } from '../Select.types';
|
|
2
|
-
export type ListComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps & MultiSelectCommon<T> & ListSelectProps<T>;
|
|
3
|
-
export type GroupedComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps & MultiSelectCommon<T> & GroupedSelectProps<T>;
|
|
2
|
+
export type ListComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps<T> & MultiSelectCommon<T> & ListSelectProps<T>;
|
|
3
|
+
export type GroupedComboBoxProps<T extends SelectOptionRequired> = CommonSelectProps<T> & MultiSelectCommon<T> & GroupedSelectProps<T>;
|
|
4
4
|
/**
|
|
5
5
|
* @param clearable - If users should be able to clear the input, defaults to true
|
|
6
6
|
* @param loading - Show loader, defaults to false
|
|
@@ -9,5 +9,7 @@ export type GroupedComboBoxProps<T extends SelectOptionRequired> = CommonSelectP
|
|
|
9
9
|
* @param inDialog - Fixes weird issue that EDS menus has when it's used in dialogs, defaults to false
|
|
10
10
|
* @param showHelperIcon - Show helper variant icon, defaults to true
|
|
11
11
|
* @param syncParentChildSelection - Syncs parents/child selections, default is true
|
|
12
|
+
* @param onAddItem - Enables the possibility to add extra tags and is called when submitting a new item, either via menu click 'add' or {Enter}. Not supported with groups prop.
|
|
13
|
+
* @param onSearchFilter - Custom filter function for search, default is "item.label.match(new RegExp(searchValue, 'i'))"
|
|
12
14
|
*/
|
|
13
15
|
export declare function ComboBox<T extends SelectOptionRequired>(props: ListComboBoxProps<T> | GroupedComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";const r=r=>{const{onItemSelect:o,onItemKeyDown:s,itemRefs:c,groups:a,search:f}=r,
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t}from"react";import{Menu as i}from"@equinor/eds-core-react";import{NoItemsFoundText as m}from"./Select.styles.js";import{getCumulativeArrayFromNumberedArray as l}from"./Select.utils.js";import{SelectMenuItem as n}from"./SelectMenuItem.js";const r=r=>{const{onItemSelect:o,onItemKeyDown:s,itemRefs:c,groups:a,search:f,onSearchFilter:u}=r,p=t((()=>{if(""===f)return a;const e=new RegExp(f,"i");return a.map((t=>({title:t.title,items:t.items.filter((t=>void 0!==u?u(f,t):t.label.match(e)))}))).filter((e=>e.items.length>0))}),[a,u,f]),d=t((()=>{const e=p.map((e=>e.items.length));return l(e)}),[p]);return 0===p.length?e(m,{children:"No items found"}):"values"in r?p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,multiselect:!0,itemRefs:c,onItemKeyDown:s,onItemSelect:o,values:r.values},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`))):p.map(((t,m)=>e(i.Section,{index:m,title:t.title,children:t.items.map(((i,l)=>e(n,{index:l+d[m],childOffset:0,item:i,itemRefs:c,onItemKeyDown:s,onItemSelect:o},`${t.title}-${m}-item-${i.value}`)))},`${t.title}-${m}`)))};export{r as GroupedSelectMenu};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as m}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as o}from"./AddTagItem.js";import{NoItemsFoundText as r,NoTagFoundText as l}from"./Select.styles.js";import{flattenOptions as s,getChildOffset as d}from"./Select.utils.js";import{SelectMenuItem as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useMemo as m}from"react";import{Menu as i}from"@equinor/eds-core-react";import{AddTagItem as o}from"./AddTagItem.js";import{NoItemsFoundText as r,NoTagFoundText as l}from"./Select.styles.js";import{flattenOptions as s,getChildOffset as d}from"./Select.utils.js";import{SelectMenuItem as c}from"./SelectMenuItem.js";const a=a=>{const{search:u,items:f,onItemSelect:h,itemRefs:I,onItemKeyDown:p,onSearchFilter:x}=a,S=m((()=>{if(""===u)return f;const e=new RegExp(u,"i");return s(f).filter((t=>void 0!==x?x(u,t):t.label.match(e)))}),[f,x,u]);if(0===S.length&&!a.onAddItem)return e(r,{children:"No items found"});const g=S.some((e=>e.children&&e.children.length>0));if("values"in a){const m=S.map(((e,t)=>({childOffset:d(S,t),index:t,item:e,itemRefs:I,onItemKeyDown:p,onItemSelect:h,itemValue:e.value,values:a.values,parentHasNestedItems:g})));return"onAddItem"in a&&a.onAddItem&&""!==u?t(n,{children:[e(i.Section,{title:"Add tag",index:0,children:e(o,{index:0,itemRefs:I,onItemKeyDown:p,onAddItem:a.onAddItem,children:u})}),e(i.Section,{title:"Tag search results",index:1,children:m.length>0?m.map(((t,n)=>e(c,{multiselect:!0,...t,index:n+1},`menu-item-${n}-${t.itemValue}`))):t(l,{children:['No tag for "',u,'" found.']})})]}):m.map(((t,n)=>e(c,{multiselect:!0,...t},`menu-item-${n}-${t.itemValue}`)))}return S.map(((t,n)=>e(c,{childOffset:d(S,n),index:n,item:t,itemRefs:I,onItemKeyDown:p,onItemSelect:h,parentHasNestedItems:g},`menu-item-${n}-${t.value}`)))};export{a as ListSelectMenu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, MultiSelectCommon, SelectOptionRequired, SingleSelectCommon } from './Select.types';
|
|
2
|
-
export type SelectComponentProps<T extends SelectOptionRequired> = CommonSelectProps & (SingleSelectCommon<T> | MultiSelectCommon<T>) & (ListSelectProps<T> | GroupedSelectProps<T>);
|
|
2
|
+
export type SelectComponentProps<T extends SelectOptionRequired> = CommonSelectProps<T> & (SingleSelectCommon<T> | MultiSelectCommon<T>) & (ListSelectProps<T> | GroupedSelectProps<T>);
|
|
3
3
|
export declare const Select: <T extends SelectOptionRequired>(props: SelectComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useRef as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{useRef as o,useMemo as t}from"react";import{Label as r,CircularProgress as l,Icon as a}from"@equinor/eds-core-react";import{thumbs_up as i,warning_filled as c,error_filled as s,arrow_drop_up as d,arrow_drop_down as m,clear as u}from"@equinor/eds-icons";import{tokens as h}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/index.js";import{useSelect as p}from"../../atoms/hooks/useSelect.js";import{GroupedSelectMenu as g}from"./GroupedSelectMenu.js";import{ListSelectMenu as b}from"./ListSelectMenu.js";import{ValueText as v,ComboBoxChip as f,Wrapper as y,Container as x,Section as C,PlaceholderText as S,ClearButton as I,HelperWrapper as O,StyledMenu as k}from"./Select.styles.js";import{useOutsideClick as w}from"../../node_modules/@equinor/eds-utils/dist/esm/hooks/useOutsideClick.js";const{colors:D}=h,R=h=>{const{clearable:R=!0,loading:$=!1,disabled:j=!1,lightBackground:V=!1,underlineHighlight:B=!1,sortValues:F=!0,placeholder:K="Select...",label:T,helperText:_,showHelperIcon:q=!0,meta:z,id:A=`amplify-combobox-${T}`,variant:H,inDialog:W=!1,onSearchFilter:M}=h,{handleOnAddItem:E,handleOnClear:G,handleOnItemKeyDown:L,handleOnItemSelect:N,handleOnSearchChange:J,handleOnSearchKeyDown:P,handleToggleOpen:Q,itemRefs:U,search:X,selectedValues:Y,handleOnClose:Z,handleOnOpen:ee,handleOnRemoveItem:ne,open:oe,searchRef:te,tryingToRemoveItem:re}=p({...h,clearable:R,loading:$,disabled:j,lightBackground:V,underlineHighlight:B,sortValues:F,placeholder:K}),le=o(null),ae=o(null),ie=t((()=>!!T||!!z),[T,z]),ce=t((()=>!!_),[_]),se=t((()=>{if(q)switch(H){case"error":return s;case"warning":return c;case"success":return i}}),[q,H]);w(ae.current,(e=>{W&&oe&&e.target&&le.current&&ae.current&&!le.current.contains(e.target)&&!ae.current?.contains(e.target)&&Z()}));const de=t((()=>"value"in h&&h.value?e(v,{children:h.value.label}):Y.map((n=>"customValueComponent"in h&&h.customValueComponent?e(h.customValueComponent,{item:n,onDelete:()=>ne(n),tryingToRemove:void 0!==re&&re.value===n.value},n.value):e(f,{"data-testid":"amplify-combobox-chip",className:"amplify-combo-box-chip",onDelete:()=>ne(n),$tryingToRemove:re?.value===n.value,$lightBackground:V,children:n.label},n.value)))),[Y,re,V,h,ne]);return n("div",{children:[ie&&e(r,{label:T,meta:z,htmlFor:A}),n(y,{children:[n(x,{"data-testid":"combobox-container",ref:le,onClick:ee,"aria-expanded":oe,$variant:H,$lightBackground:V,children:[n(C,{children:[""===X&&0===Y.length&&e(S,{children:K}),(""===X||"values"in h&&Y.length>0)&&de,e("input",{id:A,disabled:j||$,ref:te,type:"search",role:"combobox",value:X,autoComplete:"off",onChange:J,onKeyDownCapture:P})]}),$?e(l,{size:16}):e(a,{onClick:Q,data:oe?d:m,color:D.interactive.primary__resting.rgba}),R&&Y.length>0&&!$&&e(I,{id:"clear",variant:"ghost_icon",onClick:G,"data-testid":"clearBtn",children:e(a,{data:u,size:18})})]}),ce&&n(O,{$variant:H,children:[se&&e(a,{data:se,size:16}),e(r,{label:_,htmlFor:A})]})]}),oe&&e(k,{ref:ae,open:!0,id:"combobox-menu",anchorEl:le.current,onClose:Z,placement:"bottom",style:{width:`${le.current?.clientWidth}px`,maxWidth:`${le.current?.clientWidth}px`},children:"groups"in h&&h.groups?e(g,{...h,search:X,itemRefs:U,onItemSelect:N,onItemKeyDown:L,onSearchFilter:M}):e(b,{...h,search:X,itemRefs:U,onAddItem:"values"in h&&h.onAddItem?E:void 0,onItemSelect:N,onItemKeyDown:L,onSearchFilter:M})})]})};export{R as Select};
|
|
@@ -24,12 +24,12 @@ declare const ClearButton: import("styled-components/dist/types").IStyledCompone
|
|
|
24
24
|
Group: typeof import("@equinor/eds-core-react/dist/types/components/Button/ButtonGroup").ButtonGroup;
|
|
25
25
|
Toggle: typeof import("@equinor/eds-core-react/dist/types/components/Button/ToggleButton/ToggleButton").ToggleButton;
|
|
26
26
|
}, keyof import("react").Component<any, {}, any>>;
|
|
27
|
-
interface
|
|
27
|
+
interface ComboBoxChipProps {
|
|
28
28
|
$tryingToRemove: boolean;
|
|
29
29
|
$lightBackground?: boolean;
|
|
30
30
|
className: string;
|
|
31
31
|
}
|
|
32
|
-
declare const
|
|
32
|
+
declare const ComboBoxChip: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(Omit<Omit<import("react").HTMLAttributes<HTMLDivElement | HTMLButtonElement>, "onClick"> & import("../Chip/Chip").BaseChipProps & import("../Chip/Chip").InteractiveChipBase & {
|
|
33
33
|
onClick: (event: import("react").MouseEvent<HTMLButtonElement> | import("react").KeyboardEvent<HTMLButtonElement>) => void;
|
|
34
34
|
onDelete?: undefined;
|
|
35
35
|
} & import("react").RefAttributes<HTMLDivElement | HTMLButtonElement>, "ref"> & {
|
|
@@ -44,7 +44,7 @@ declare const StyledChip: import("styled-components/dist/types").IStyledComponen
|
|
|
44
44
|
onDelete?: undefined;
|
|
45
45
|
} & import("react").RefAttributes<HTMLDivElement | HTMLButtonElement>, "ref"> & {
|
|
46
46
|
ref?: ((instance: HTMLDivElement | HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement | HTMLButtonElement> | null | undefined;
|
|
47
|
-
}),
|
|
47
|
+
}), ComboBoxChipProps>> & string & Omit<import("react").ForwardRefExoticComponent<(Omit<import("react").HTMLAttributes<HTMLDivElement | HTMLButtonElement>, "onClick"> & (import("../Chip/Chip").ClickableChipProps | import("../Chip/Chip").DeletableChipProps | (import("../Chip/Chip").BaseChipProps & {
|
|
48
48
|
onClick?: undefined;
|
|
49
49
|
onDelete?: undefined;
|
|
50
50
|
}))) & import("react").RefAttributes<HTMLDivElement | HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
@@ -128,4 +128,4 @@ declare const SmallButton: import("styled-components/dist/types").IStyledCompone
|
|
|
128
128
|
Group: typeof import("@equinor/eds-core-react/dist/types/components/Button/ButtonGroup").ButtonGroup;
|
|
129
129
|
Toggle: typeof import("@equinor/eds-core-react/dist/types/components/Button/ToggleButton/ToggleButton").ToggleButton;
|
|
130
130
|
}, keyof import("react").Component<any, {}, any>>;
|
|
131
|
-
export { Button, ClearButton, Container, MenuItemSpacer, StyledMenu, NoTagFoundText, NoItemsFoundText, PlaceholderText,
|
|
131
|
+
export { Button, ClearButton, Container, MenuItemSpacer, StyledMenu, NoTagFoundText, NoItemsFoundText, PlaceholderText, ComboBoxChip, Section, MenuItemWrapper, SmallButton, StyledMenuItem, ValueText, };
|
|
@@ -1,56 +1,60 @@
|
|
|
1
|
-
import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";export{Button}from"@equinor/eds-core-react";import{VARIANT_HELPER_COLORS as
|
|
1
|
+
import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";export{Button}from"@equinor/eds-core-react";import{animation as a}from"../../atoms/style/animation.js";import{VARIANT_HELPER_COLORS as i,colors as o,VARIANT_COLORS as n}from"../../atoms/style/colors.js";import{spacings as s}from"../../atoms/style/spacings.js";import{Chip as l}from"../Chip/Chip.js";import d,{css as c}from"styled-components";const p=d.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: ${
|
|
5
|
-
`,
|
|
4
|
+
gap: ${s.small};
|
|
5
|
+
`,g=d.span`
|
|
6
6
|
display: flex;
|
|
7
|
-
gap: ${
|
|
7
|
+
gap: ${s.small};
|
|
8
8
|
align-items: center;
|
|
9
|
-
margin-left: ${
|
|
10
|
-
width: calc(100% - ${
|
|
9
|
+
margin-left: ${s.small};
|
|
10
|
+
width: calc(100% - ${s.small});
|
|
11
11
|
> label {
|
|
12
12
|
margin: 0;
|
|
13
13
|
}
|
|
14
|
-
${({$variant:t})=>t?
|
|
14
|
+
${({$variant:t})=>t?c`
|
|
15
15
|
> label {
|
|
16
|
-
color: ${
|
|
16
|
+
color: ${i[t]};
|
|
17
17
|
}
|
|
18
18
|
> svg {
|
|
19
19
|
flex-shrink: 0;
|
|
20
|
-
fill: ${
|
|
20
|
+
fill: ${i[t]};
|
|
21
21
|
}
|
|
22
22
|
`:""}
|
|
23
|
-
`,
|
|
23
|
+
`,b=d.div`
|
|
24
24
|
position: relative;
|
|
25
25
|
display: grid;
|
|
26
26
|
grid-template-columns: 1fr auto;
|
|
27
27
|
align-items: center;
|
|
28
28
|
padding: 6px 8px;
|
|
29
|
+
transition:
|
|
30
|
+
background ${a.transitionMS},
|
|
31
|
+
box-shadow ${a.transitionMS};
|
|
29
32
|
&:hover:not(:has(input:disabled)) {
|
|
30
33
|
cursor: pointer;
|
|
34
|
+
background: ${o.ui.background__light_medium.rgba};
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
${({$variant:t})=>t?"dirty"===t?
|
|
34
|
-
box-shadow: inset 0 -2px 0 0 ${
|
|
37
|
+
${({$variant:t})=>t?"dirty"===t?c`
|
|
38
|
+
box-shadow: inset 0 -2px 0 0 ${n[t]};
|
|
35
39
|
&:hover {
|
|
36
|
-
box-shadow: inset 0 -2px 0 0 ${
|
|
40
|
+
box-shadow: inset 0 -2px 0 0 ${n[t]};
|
|
37
41
|
}
|
|
38
|
-
`:
|
|
39
|
-
outline: 1px solid ${
|
|
42
|
+
`:c`
|
|
43
|
+
outline: 1px solid ${n[t]};
|
|
40
44
|
&:hover {
|
|
41
|
-
box-shadow: inset 0 -1px 0 0 ${
|
|
45
|
+
box-shadow: inset 0 -1px 0 0 ${n[t]};
|
|
42
46
|
}
|
|
43
|
-
`:
|
|
44
|
-
box-shadow: inset 0 -1px 0 0 ${
|
|
47
|
+
`:c`
|
|
48
|
+
box-shadow: inset 0 -1px 0 0 ${o.text.static_icons__tertiary.rgba};
|
|
45
49
|
&:hover {
|
|
46
|
-
box-shadow: inset 0 -2px 0 0 ${
|
|
50
|
+
box-shadow: inset 0 -2px 0 0 ${o.text.static_icons__tertiary.rgba};
|
|
47
51
|
}
|
|
48
52
|
`}
|
|
49
53
|
|
|
50
|
-
${({$lightBackground:t})=>t?`background-color: ${
|
|
54
|
+
${({$lightBackground:t})=>t?`background-color: ${o.ui.background__default.rgba}`:`background-color: ${o.ui.background__light.rgba}`};
|
|
51
55
|
|
|
52
56
|
&[aria-expanded='true'] {
|
|
53
|
-
box-shadow: inset 0 -2px 0 0 ${
|
|
57
|
+
box-shadow: inset 0 -2px 0 0 ${o.interactive.primary__resting.rgba};
|
|
54
58
|
}
|
|
55
59
|
&:has(input:disabled) {
|
|
56
60
|
outline: none;
|
|
@@ -63,7 +67,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
63
67
|
> svg:not([role='progressbar']) {
|
|
64
68
|
cursor: pointer;
|
|
65
69
|
&:hover {
|
|
66
|
-
background: ${
|
|
70
|
+
background: ${o.interactive.primary__hover_alt.rgba};
|
|
67
71
|
border-radius: 50%;
|
|
68
72
|
}
|
|
69
73
|
}
|
|
@@ -73,13 +77,13 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
73
77
|
box-shadow: none;
|
|
74
78
|
> svg:not([role='progressbar']) {
|
|
75
79
|
cursor: not-allowed;
|
|
76
|
-
fill: ${
|
|
80
|
+
fill: ${o.interactive.disabled__text.rgba};
|
|
77
81
|
&:hover {
|
|
78
82
|
background: transparent;
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
> label {
|
|
82
|
-
color: ${
|
|
86
|
+
color: ${o.interactive.disabled__text.rgba};
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
|
|
@@ -88,11 +92,11 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
88
92
|
width: calc(100% - 24px);
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
|
-
`,
|
|
95
|
+
`,u=d.section`
|
|
92
96
|
position: relative;
|
|
93
97
|
display: flex;
|
|
94
98
|
flex-wrap: wrap;
|
|
95
|
-
gap: ${
|
|
99
|
+
gap: ${s.x_small};
|
|
96
100
|
min-height: 24px;
|
|
97
101
|
input[type='search'] {
|
|
98
102
|
background: transparent;
|
|
@@ -100,7 +104,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
100
104
|
flex-grow: 1;
|
|
101
105
|
padding: 0;
|
|
102
106
|
font-family: 'Equinor', sans-serif;
|
|
103
|
-
color: ${
|
|
107
|
+
color: ${o.text.static_icons__default.rgba};
|
|
104
108
|
outline: none;
|
|
105
109
|
border: none;
|
|
106
110
|
}
|
|
@@ -115,14 +119,14 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
115
119
|
}
|
|
116
120
|
&:has(input:disabled) {
|
|
117
121
|
> p {
|
|
118
|
-
color: ${
|
|
122
|
+
color: ${o.interactive.disabled__text.rgba};
|
|
119
123
|
}
|
|
120
124
|
> .amplify-combo-box-chip {
|
|
121
125
|
cursor: not-allowed;
|
|
122
|
-
background: ${
|
|
123
|
-
color: ${
|
|
126
|
+
background: ${o.interactive.disabled__fill.rgba};
|
|
127
|
+
color: ${o.interactive.disabled__text.rgba};
|
|
124
128
|
> svg {
|
|
125
|
-
fill: ${
|
|
129
|
+
fill: ${o.interactive.disabled__text.rgba};
|
|
126
130
|
&:hover {
|
|
127
131
|
cursor: not-allowed;
|
|
128
132
|
background: none;
|
|
@@ -130,7 +134,7 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
|
-
`,h=
|
|
137
|
+
`,h=d(t)`
|
|
134
138
|
position: absolute;
|
|
135
139
|
top: 50%;
|
|
136
140
|
transform: translate(0, -50%);
|
|
@@ -138,16 +142,16 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
138
142
|
width: 24px;
|
|
139
143
|
height: 24px;
|
|
140
144
|
svg {
|
|
141
|
-
fill: ${
|
|
145
|
+
fill: ${o.text.static_icons__secondary.rgba};
|
|
142
146
|
}
|
|
143
147
|
&:after {
|
|
144
148
|
width: 24px;
|
|
145
149
|
height: 24px;
|
|
146
150
|
left: 0;
|
|
147
151
|
}
|
|
148
|
-
`,
|
|
149
|
-
background: ${({$tryingToRemove:t,$lightBackground:e})=>t?
|
|
150
|
-
`,x=
|
|
152
|
+
`,m=d(l)`
|
|
153
|
+
background: ${({$tryingToRemove:t,$lightBackground:e})=>t?o.interactive.primary__hover_alt.rgba:e?o.ui.background__light.rgba:o.ui.background__default.rgba} !important;
|
|
154
|
+
`,x=d(e.Item)`
|
|
151
155
|
flex-grow: 1;
|
|
152
156
|
border-radius: 2px;
|
|
153
157
|
${({$paddedLeft:t})=>t&&"margin-left: 36px"};
|
|
@@ -159,32 +163,32 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
&:hover {
|
|
162
|
-
background: ${
|
|
166
|
+
background: ${o.interactive.primary__hover_alt.rgba};
|
|
163
167
|
}
|
|
164
168
|
|
|
165
169
|
&:focus-visible {
|
|
166
|
-
outline: 2px dashed ${
|
|
170
|
+
outline: 2px dashed ${o.interactive.primary__resting.rgba};
|
|
167
171
|
}
|
|
168
|
-
`,
|
|
169
|
-
height: calc(100% + ${
|
|
172
|
+
`,_=d.hr`
|
|
173
|
+
height: calc(100% + ${s.medium} * 2);
|
|
170
174
|
justify-self: center;
|
|
171
|
-
width: ${
|
|
172
|
-
`,
|
|
175
|
+
width: ${s.x_large};
|
|
176
|
+
`,f=d(r)`
|
|
173
177
|
position: absolute;
|
|
174
|
-
color: ${
|
|
178
|
+
color: ${o.text.static_icons__tertiary.rgba};
|
|
175
179
|
top: calc(50%);
|
|
176
180
|
transform: translate(0, -50%);
|
|
177
|
-
|
|
181
|
+
`,$=d(f)`
|
|
178
182
|
white-space: nowrap;
|
|
179
183
|
overflow: hidden;
|
|
180
184
|
text-overflow: ellipsis;
|
|
181
|
-
color: ${
|
|
185
|
+
color: ${o.text.static_icons__default.rgba};
|
|
182
186
|
max-width: 100%;
|
|
183
|
-
|
|
184
|
-
margin: ${
|
|
185
|
-
`,
|
|
186
|
-
margin-left: ${
|
|
187
|
-
`,
|
|
187
|
+
`,v=d(r)`
|
|
188
|
+
margin: ${s.medium};
|
|
189
|
+
`,w=d(r)`
|
|
190
|
+
margin-left: ${s.medium};
|
|
191
|
+
`,y=d(e)`
|
|
188
192
|
max-height: 20rem;
|
|
189
193
|
max-width: inherit;
|
|
190
194
|
overflow-y: auto;
|
|
@@ -192,11 +196,11 @@ import{Button as t,Menu as e,Typography as r}from"@equinor/eds-core-react";expor
|
|
|
192
196
|
width: inherit;
|
|
193
197
|
max-width: inherit;
|
|
194
198
|
}
|
|
195
|
-
`,
|
|
199
|
+
`,k=d.div`
|
|
196
200
|
display: flex;
|
|
197
201
|
align-items: center;
|
|
198
|
-
padding: 0 ${
|
|
199
|
-
`,
|
|
202
|
+
padding: 0 ${s.small};
|
|
203
|
+
`,j=d(t)`
|
|
200
204
|
width: 36px;
|
|
201
205
|
height: 36px;
|
|
202
|
-
`;export{h as ClearButton,
|
|
206
|
+
`;export{h as ClearButton,m as ComboBoxChip,b as Container,g as HelperWrapper,_ as MenuItemSpacer,k as MenuItemWrapper,w as NoItemsFoundText,v as NoTagFoundText,f as PlaceholderText,u as Section,j as SmallButton,y as StyledMenu,x as StyledMenuItem,$ as ValueText,p as Wrapper};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyboardEvent, MutableRefObject } from 'react';
|
|
1
|
+
import { FC, KeyboardEvent, MutableRefObject } from 'react';
|
|
2
2
|
import { Variants } from '../../atoms/types/variants';
|
|
3
3
|
export interface SelectOptionRequired {
|
|
4
4
|
value: string;
|
|
@@ -16,6 +16,11 @@ export interface MultiSelectCommon<T extends SelectOptionRequired> {
|
|
|
16
16
|
onSelect: (values: SelectOption<T>[], selectedValue?: SelectOption<T>) => void;
|
|
17
17
|
syncParentChildSelection?: boolean;
|
|
18
18
|
onAddItem?: (item: string) => void;
|
|
19
|
+
customValueComponent?: FC<{
|
|
20
|
+
item: SelectOption<T>;
|
|
21
|
+
onDelete: () => void;
|
|
22
|
+
tryingToRemove: boolean;
|
|
23
|
+
}>;
|
|
19
24
|
}
|
|
20
25
|
export interface SelectGroup<T extends SelectOptionRequired> {
|
|
21
26
|
title: string;
|
|
@@ -37,6 +42,7 @@ export interface SelectMenuProps<T extends SelectOptionRequired> {
|
|
|
37
42
|
itemRefs: MutableRefObject<(HTMLButtonElement | null)[]>;
|
|
38
43
|
onItemKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
39
44
|
onItemSelect: (item: SelectOption<T>) => void;
|
|
45
|
+
onSearchFilter?: (searchValue: string, item: T) => void;
|
|
40
46
|
}
|
|
41
47
|
interface SelectMenuItemProps<T extends SelectOptionRequired> {
|
|
42
48
|
item: SelectOption<T>;
|
|
@@ -56,7 +62,7 @@ export type MultiSelectMenuItemProps<T extends SelectOptionRequired> = {
|
|
|
56
62
|
values: SelectOption<T>[];
|
|
57
63
|
} & Omit<SelectMenuProps<T>, 'search'> & SelectMenuItemProps<T>;
|
|
58
64
|
export declare const VARIANT_OPTIONS: Variants[];
|
|
59
|
-
export interface CommonSelectProps {
|
|
65
|
+
export interface CommonSelectProps<T extends SelectOptionRequired> {
|
|
60
66
|
id?: string;
|
|
61
67
|
variant?: Variants;
|
|
62
68
|
label?: string;
|
|
@@ -73,5 +79,6 @@ export interface CommonSelectProps {
|
|
|
73
79
|
onSearchChange?: (inputValue: string) => void;
|
|
74
80
|
inDialog?: boolean;
|
|
75
81
|
onOpenCallback?: (value: boolean) => void;
|
|
82
|
+
onSearchFilter?: (searchValue: string, item: T) => void;
|
|
76
83
|
}
|
|
77
84
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonSelectProps, GroupedSelectProps, ListSelectProps, SelectOptionRequired, SingleSelectCommon } from '../Select.types';
|
|
2
|
-
export type ListSingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps & SingleSelectCommon<T> & ListSelectProps<T>;
|
|
3
|
-
export type GroupedSingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps & SingleSelectCommon<T> & GroupedSelectProps<T>;
|
|
2
|
+
export type ListSingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps<T> & SingleSelectCommon<T> & ListSelectProps<T>;
|
|
3
|
+
export type GroupedSingleSelectProps<T extends SelectOptionRequired> = CommonSelectProps<T> & SingleSelectCommon<T> & GroupedSelectProps<T>;
|
|
4
4
|
/**
|
|
5
5
|
* @param clearable - If users should be able to clear the input, defaults to true
|
|
6
6
|
* @param loading - Show loader, defaults to false
|
|
@@ -8,5 +8,6 @@ export type GroupedSingleSelectProps<T extends SelectOptionRequired> = CommonSel
|
|
|
8
8
|
* @param sortValues - Sort the provided values, defaults to true
|
|
9
9
|
* @param inDialog - Fixes weird issue that EDS menus has when it's used in dialogs, defaults to false
|
|
10
10
|
* @param showHelperIcon - Show helper variant icon, defaults to true
|
|
11
|
+
* @param onSearchFilter - Custom filter function for search, default is "item.label.match(new RegExp(searchValue, 'i'))"
|
|
11
12
|
*/
|
|
12
13
|
export declare function SingleSelect<T extends SelectOptionRequired>(props: ListSingleSelectProps<T> | GroupedSingleSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as r,jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import{Typography as o}from"@equinor/eds-core-react";import{colors as i}from"../../../atoms/style/colors.js";import{spacings as s}from"../../../atoms/style/spacings.js";import{StepIcon as a}from"./StepIcon.js";import{useStepper as c}from"../../../providers/StepperProvider.js";import n,{css as l}from"styled-components";const p=n.div`
|
|
2
2
|
display: flex;
|
|
3
|
-
gap: ${
|
|
3
|
+
gap: ${s.small};
|
|
4
4
|
align-items: center;
|
|
5
5
|
white-space: nowrap;
|
|
6
|
-
${
|
|
7
|
-
|
|
6
|
+
${r=>r.$clickable&&l`
|
|
7
|
+
&:hover {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
}
|
|
10
|
+
`}
|
|
11
|
+
`,m=({index:s,onlyShowCurrentStepLabel:n=!1,children:l})=>{const{currentStep:m,setCurrentStep:d}=c(),f=e((()=>s<m?"body_short":"body_short_bold"),[m,s]),b=e((()=>s>m?i.interactive.disabled__text.rgba:i.text.static_icons__default.rgba),[m,s]);return r(p,{"data-testid":"step",$clickable:s<m,onClick:()=>{s<m&&d(s)},children:[t(a,{index:s}),(!n||m===s)&&t(o,{variant:f,color:b,children:l})]})};export{m as Step,m as default};
|