@equinor/amplify-component-lib 10.5.1 → 10.6.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/style/lightTokens.js +1 -1
- package/dist/molecules/Dialog/Dialog.d.ts +2 -2
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- package/dist/molecules/InformationalNotice/InformationalNotice.d.ts +2 -2
- package/dist/molecules/InformationalNotice/InformationalNotice.js +1 -1
- package/dist/molecules/InformationalNotice/InformationalNotice.styles.js +4 -3
- package/dist/organisms/Faq/Category/Question/Question.js +1 -1
- package/dist/organisms/Filter/Filter.js +1 -1
- package/dist/organisms/Filter/Filter.styles.js +11 -7
- package/dist/organisms/ReleaseNote/ReleaseNote.js +1 -1
- package/dist/organisms/Status/Description.d.ts +2 -2
- package/dist/organisms/Status/MissingAccesses.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/ToggleGroup/ToggleGroup.types.d.ts +8 -1
- package/dist/organisms/ToggleGroup/ToggleGroupOption.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react147 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/atoms/hooks/useLocalStorage.d.ts
|
|
4
|
-
declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T,
|
|
4
|
+
declare const useLocalStorage: <T>(key: string, defaultState: T, keepAliveMs?: number) => readonly [T, react147.Dispatch<react147.SetStateAction<T>>, () => void];
|
|
5
5
|
//#endregion
|
|
6
6
|
export { useLocalStorage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SelectOption, SelectOptionRequired } from "../../molecules/Select/Select.types.js";
|
|
2
2
|
import { SelectComponentProps } from "../../molecules/Select/Select.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react145 from "react";
|
|
4
4
|
import { ChangeEvent, KeyboardEvent } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/atoms/hooks/useSelect.d.ts
|
|
@@ -16,8 +16,8 @@ declare const useSelect: <T extends SelectOptionRequired>(props: SelectComponent
|
|
|
16
16
|
handleOnOpen: () => void;
|
|
17
17
|
handleOnRemoveItem: (item: SelectOption<T>) => void;
|
|
18
18
|
search: string;
|
|
19
|
-
searchRef:
|
|
20
|
-
itemRefs:
|
|
19
|
+
searchRef: react145.RefObject<HTMLInputElement | null>;
|
|
20
|
+
itemRefs: react145.RefObject<(HTMLButtonElement | null)[]>;
|
|
21
21
|
selectedValues: T[];
|
|
22
22
|
open: boolean;
|
|
23
23
|
tryingToRemoveItem: T | undefined;
|
|
@@ -179,7 +179,7 @@ import{css as e}from"styled-components";const t=e`
|
|
|
179
179
|
);
|
|
180
180
|
|
|
181
181
|
--eds_interactive__icon_on_interactive_colors: var(
|
|
182
|
-
--
|
|
182
|
+
--eds_text__static_icons__primary_white
|
|
183
183
|
);
|
|
184
184
|
|
|
185
185
|
--eds_ui__chip__badge_color: var(--eds_text__static_icons__default);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react11 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { ButtonProps, DialogProps } from "@equinor/eds-core-react";
|
|
4
4
|
import { IconData } from "@equinor/eds-icons";
|
|
@@ -51,6 +51,6 @@ interface DialogProps$1 extends Omit<DialogProps, 'title'> {
|
|
|
51
51
|
* @param additionalInfo - Defaults to empty, and won't show the additional info button
|
|
52
52
|
* Also inherits props from EDS dialog
|
|
53
53
|
*/
|
|
54
|
-
declare const Dialog$1:
|
|
54
|
+
declare const Dialog$1: react11.ForwardRefExoticComponent<DialogProps$1 & react11.RefAttributes<HTMLDivElement>>;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { Dialog$1 as Dialog, DialogAction, DialogProps$1 as DialogProps };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SizeIconProps } from "../../atoms/types/Icon.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react13 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/molecules/EquinorLogo/EquinorLogo.d.ts
|
|
5
5
|
interface EquinorLogoProps extends Partial<SizeIconProps> {
|
|
6
6
|
large?: boolean;
|
|
7
7
|
color?: 'red' | 'white' | 'black';
|
|
8
8
|
}
|
|
9
|
-
declare const EquinorLogo:
|
|
9
|
+
declare const EquinorLogo: react13.ForwardRefExoticComponent<EquinorLogoProps & react13.RefAttributes<SVGSVGElement>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { EquinorLogo, EquinorLogoProps };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/molecules/InformationalNotice/InformationalNotice.d.ts
|
|
4
4
|
interface InformationalNoticeProps {
|
|
5
5
|
color?: 'grey' | 'white';
|
|
6
6
|
spacing?: 'compact' | 'comfortable';
|
|
7
|
-
children: string;
|
|
7
|
+
children: string | ReactNode | ReactNode[];
|
|
8
8
|
}
|
|
9
9
|
declare const InformationalNotice: FC<InformationalNoticeProps>;
|
|
10
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{Container as t}from"./InformationalNotice.styles.js";import{getIconSize as n}from"./InformationalNotice.utils.js";import{Icon as r,Typography as i}from"@equinor/eds-core-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{info_circle as s}from"@equinor/eds-icons";const c=({children:c,color:l=`grey`,spacing:u=`comfortable`})=>o(t,{$spacing:u,$color:l,children:[a(r,{data:s,color:e.text.static_icons__default.rgba,size:n(u)}),a(i,{variant:`body_long`,children:c})]});export{c as InformationalNotice};
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{Container as t}from"./InformationalNotice.styles.js";import{getIconSize as n}from"./InformationalNotice.utils.js";import{Icon as r,Typography as i}from"@equinor/eds-core-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{info_circle as s}from"@equinor/eds-icons";const c=({children:c,color:l=`grey`,spacing:u=`comfortable`})=>o(t,{$spacing:u,$color:l,children:[a(r,{data:s,color:e.text.static_icons__default.rgba,size:n(u)}),typeof c==`string`?a(i,{variant:`body_long`,children:c}):c]});export{c as InformationalNotice};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import n,{css as
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import r,{css as i}from"styled-components";const a={compact:{gap:t.medium_small,padding:t.small},comfortable:{gap:t.medium,padding:t.medium_small}},o=r.div`
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: auto 1fr;
|
|
4
|
+
border-radius: ${n.corners.borderRadius};
|
|
4
5
|
background: ${({$color:t})=>t===`white`?e.ui.background__default.rgba:e.ui.background__light.rgba};
|
|
5
|
-
${({$spacing:e})=>{let{gap:t,padding:n}=
|
|
6
|
+
${({$spacing:e})=>{let{gap:t,padding:n}=a[e];return i`
|
|
6
7
|
padding: ${n};
|
|
7
8
|
gap: ${t};
|
|
8
9
|
`}}
|
|
9
|
-
`;export{
|
|
10
|
+
`;export{o as Container};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatDate as e}from"../../../../atoms/utils/date.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{RichTextDisplay as n}from"../../../../molecules/RichTextDisplay/RichTextDisplay.js";import{Container as r,ExpandWrapper as i,Header as a,TopRight as o,Wrapper as s}from"./Question.styles.js";import{useState as
|
|
1
|
+
import{formatDate as e}from"../../../../atoms/utils/date.js";import{usePrefetchRichTextImages as t}from"../../../../atoms/hooks/usePrefetchRichTextImages.js";import{RichTextDisplay as n}from"../../../../molecules/RichTextDisplay/RichTextDisplay.js";import{Container as r,ExpandWrapper as i,Header as a,TopRight as o,Wrapper as s}from"./Question.styles.js";import{useRef as c,useState as l}from"react";import{Button as u,Icon as d,Typography as f}from"@equinor/eds-core-react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{chevron_down as h,chevron_up as g}from"@equinor/eds-icons";import{AnimatePresence as _}from"motion/react";import{useLocation as v}from"@tanstack/react-router";import{FaqService as y}from"@equinor/subsurface-app-management";const b=({id:b,question:x,createdDate:S,answer:C})=>{t({richTextValues:C?[C]:[],onImageRead:e=>y.getFaqImage(e)});let{hash:w}=v(),T=c(w===`faq-${b}`),[E,D]=l(T.current);return p(s,{children:m(r,{children:[p(a,{id:`faq-${b}`,children:p(f,{variant:`h4`,children:x})}),m(o,{children:[p(f,{group:`paragraph`,variant:`caption`,children:e(S)}),p(u,{variant:`ghost_icon`,onClick:()=>{D(e=>!e),T.current&&=!1},"data-testid":`toggle-open`,"aria-label":E?`Collapse answer to: ${x}`:`Expand answer to: ${x}`,children:p(d,{data:E?g:h})})]}),p(_,{children:E&&p(i,{initial:{height:T.current?`auto`:0},exit:{height:0},animate:{height:`auto`},children:p(n,{value:C,onImageRead:e=>y.getFaqImage(e),padding:`none`})})})]})})};export{b as Question};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{Container as t,Content as n,
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{Container as t,Content as n,SearchAndValuesWrapper as r,SearchField as i,SearchFieldWrapper as a,Section as o,StyledChip as s,Wrapper as c}from"./Filter.styles.js";import{getFilteredAutoCompleteOptions as l}from"./Filter.utils.js";import{AutoCompleteMenu as u}from"./AutoCompleteMenu.js";import{AutoCompleteText as d}from"./AutoCompleteText.js";import{useRef as f,useState as p}from"react";import{Button as m,Icon as h,Typography as g}from"@equinor/eds-core-react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{arrow_drop_down as y,arrow_drop_up as b,clear as x,info_circle as S,search as C}from"@equinor/eds-icons";import{AnimatePresence as w,motion as T}from"motion/react";function E({values:E,search:D,onSearchChange:O,onSearchEnter:k,onClearFilter:A,onClearAllFilters:j,children:M,topContent:N,inlineContent:P,initialOpen:F=!1,placeholder:I=`Search...`,id:L,openOnFocus:R=!0,...z}){let B=f(null),V=f(null),[H,U]=p(F),[W,G]=p(void 0),K=f(F?`auto`:0),q=()=>{U(e=>!e),K.current===`auto`&&(K.current=0)},J=()=>{!H&&R&&U(!0)},Y=()=>{B.current?.focus()},X=e=>{if(!(`autoCompleteOptions`in z)){k(e);return}let t=l({searchValue:e,autoCompleteOptions:z.autoCompleteOptions});if(t.length===1){z.onAutoComplete(t[0].key,t[0]);return}k(e)},Z=e=>{if(e.key===`Enter`&&D!==``)X(D);else if(e.key===`Backspace`&&D===``){if(W===void 0){for(let e of Object.keys(E).toReversed())if(E[e].length>0){G(e);break}return}A(W,E[W].length-1),G(void 0)}},Q=Object.values(E).some(e=>e.length>0);return v(c,{id:L,children:[N,v(t,{children:[v(o,{ref:V,onClick:Y,children:[_(h,{data:C,color:e.text.static_icons__tertiary.rgba}),v(r,{children:[Object.keys(E).flatMap(e=>E[e].map(({label:t,icon:n},r,i)=>_(s,{onDelete:()=>A(e,r),leadingIconData:n,$tryingToRemove:W===e&&r===i.length-1,children:t},`${t}-${r}-${e}`))),v(a,{children:[`autoCompleteOptions`in z&&z.autoCompleteOptions&&_(d,{search:D,autoCompleteOptions:z.autoCompleteOptions}),_(i,{ref:B,id:`filter-search-${L}`,type:`search`,autoComplete:`off`,value:D,placeholder:Q?void 0:I,onChange:O,onKeyDownCapture:Z,onFocus:J})]})]}),Object.values(E).some(e=>e.length>0)&&_(m,{variant:`ghost_icon`,onClick:j,"data-testid":`clear-all-x`,children:_(h,{data:x,size:18,color:e.text.static_icons__tertiary.rgba})})]}),P,v(`button`,{onClick:q,"data-testid":`toggle-open-button`,children:[_(g,{variant:`button`,group:`navigation`,as:`span`,children:`Filters`}),_(h,{data:H?b:y,color:e.text.static_icons__tertiary.rgba})]})]}),_(w,{children:H&&_(T.div,{animate:{height:`auto`},initial:{height:K.current},exit:{height:0},children:v(n,{children:[v(`span`,{children:[_(h,{data:S,size:16,color:e.text.static_icons__tertiary.rgba}),_(g,{variant:`label`,group:`input`,color:e.text.static_icons__tertiary.rgba,children:`Type a keyword and press enter`})]}),M]})})}),`autoCompleteOptions`in z&&z.autoCompleteOptions&&_(u,{isFilterOpen:H,search:D,anchorElement:V.current,autoCompleteOptions:z.autoCompleteOptions,onAutoComplete:z.onAutoComplete,searchElement:B.current})]})}export{E as Filter};
|
|
@@ -42,9 +42,8 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
42
42
|
}
|
|
43
43
|
min-height: calc(48px - (2 * ${t.medium_small}));
|
|
44
44
|
align-items: center;
|
|
45
|
-
flex-grow: 1;
|
|
46
45
|
display: flex;
|
|
47
|
-
flex-
|
|
46
|
+
flex-grow: 1;
|
|
48
47
|
gap: ${t.x_small};
|
|
49
48
|
padding: ${t.medium_small} ${t.small};
|
|
50
49
|
cursor: text;
|
|
@@ -66,7 +65,12 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
66
65
|
height: 24px;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
`,d=a.
|
|
68
|
+
`,d=a.span`
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
flex-grow: 1;
|
|
72
|
+
gap: ${t.x_small};
|
|
73
|
+
`,f=a.input`
|
|
70
74
|
background: transparent;
|
|
71
75
|
width: 0;
|
|
72
76
|
flex-grow: 1;
|
|
@@ -86,7 +90,7 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
86
90
|
&::-webkit-search-results-decoration {
|
|
87
91
|
display: none;
|
|
88
92
|
}
|
|
89
|
-
`,
|
|
93
|
+
`,p=a(s.div)`
|
|
90
94
|
border-bottom-left-radius: ${n.corners.borderRadius};
|
|
91
95
|
border-bottom-right-radius: ${n.corners.borderRadius};
|
|
92
96
|
background: ${e.ui.background__default.rgba};
|
|
@@ -99,12 +103,12 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
99
103
|
display: flex;
|
|
100
104
|
gap: ${t.x_small};
|
|
101
105
|
}
|
|
102
|
-
`,
|
|
106
|
+
`,m=a(i)`
|
|
103
107
|
${({$tryingToRemove:t})=>{if(t)return o`
|
|
104
108
|
background: ${e.interactive.primary__hover_alt.rgba};
|
|
105
109
|
`}}
|
|
106
|
-
`,
|
|
110
|
+
`,h=a.section`
|
|
107
111
|
position: relative;
|
|
108
112
|
flex-grow: 1;
|
|
109
113
|
display: flex;
|
|
110
|
-
`;export{l as Container,
|
|
114
|
+
`;export{l as Container,p as Content,d as SearchAndValuesWrapper,f as SearchField,h as SearchFieldWrapper,u as Section,m as StyledChip,c as Wrapper};
|
|
@@ -24,4 +24,4 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
24
24
|
display: flex;
|
|
25
25
|
gap: ${t.medium};
|
|
26
26
|
align-items: center;
|
|
27
|
-
`,C=d(({applicationName:
|
|
27
|
+
`,C=d(({applicationName:d,releaseDate:h,createdDate:C,tags:w,version:T,title:E,body:D,actionMenu:O,expanded:k=!1},A)=>{let j=o({releaseDate:h,createdDate:C}),M=f(k?`auto`:c),[N,P]=p(k),[F,I]=p(i(D).length>0),L=f(new ResizeObserver(e=>{e.at(0)&&e[0].target.scrollHeight>c&&I(!0)}));return _(b,{ref:A,style:{paddingBottom:N?t.medium:void 0},children:[_(x,{children:[_(S,{children:[g(m,{variant:`caption`,color:e.text.static_icons__secondary.rgba,children:d}),_(m,{variant:`overline`,color:e.text.static_icons__tertiary.rgba,children:[r(j),T?` ・ ${T}`:``,` ・ `,a(D)]})]}),g(u,{tags:w,children:O})]}),g(m,{variant:`h4`,children:E}),g(v.div,{ref:e=>{e&&L.current.observe(e)},initial:{height:M.current},animate:{height:N?`auto`:c},style:{overflow:N?`auto`:void 0,marginBottom:N&&F?`calc(${t.medium} + ${n.button.minHeight})`:void 0},children:g(s,{value:D,onImageRead:y.getReleaseNoteImage,padding:`none`})}),F&&!k&&g(l,{expanded:N,onToggleExpanded:()=>{P(e=>!e)}})]})});C.displayName=`ReleaseNote`;export{C as ReleaseNote};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react135 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: react135.ForwardRefExoticComponent<DescriptionProps & react135.RefAttributes<HTMLHeadingElement>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Description };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react137 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: react137.ForwardRefExoticComponent<MissingAccessesProps & react137.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { MissingAccesses };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
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) => react_jsx_runtime12.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { PageNotFound };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
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) => react_jsx_runtime11.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { ServerError };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
+
import { TooltipProps } from "@equinor/eds-core-react";
|
|
2
3
|
import { IconData } from "@equinor/eds-icons";
|
|
3
4
|
|
|
4
5
|
//#region src/organisms/ToggleGroup/ToggleGroup.types.d.ts
|
|
@@ -8,12 +9,18 @@ interface ToggleGroupOptionWithLabel {
|
|
|
8
9
|
}
|
|
9
10
|
interface ToggleGroupOptionOnlyIcon {
|
|
10
11
|
icon: IconData;
|
|
12
|
+
tooltip?: undefined;
|
|
13
|
+
}
|
|
14
|
+
interface ToggleGroupOptionOnlyIconWithTooltip {
|
|
15
|
+
icon: IconData;
|
|
16
|
+
tooltip: string;
|
|
17
|
+
tooltipPlacement?: TooltipProps['placement'];
|
|
11
18
|
}
|
|
12
19
|
type ToggleGroupOption = {
|
|
13
20
|
onToggle: (newValue: boolean) => void;
|
|
14
21
|
checked: boolean;
|
|
15
22
|
disabled?: boolean;
|
|
16
|
-
} & (ToggleGroupOptionWithLabel | ToggleGroupOptionOnlyIcon);
|
|
23
|
+
} & (ToggleGroupOptionWithLabel | ToggleGroupOptionOnlyIcon | ToggleGroupOptionOnlyIconWithTooltip);
|
|
17
24
|
/**
|
|
18
25
|
* @param variant - Defaults to 'filled'
|
|
19
26
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{OptionalTooltip as r}from"../../molecules/OptionalTooltip/OptionalTooltip.js";import{forwardRef as i}from"react";import{Icon as a,Typography as o}from"@equinor/eds-core-react";import s from"styled-components";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=s.button`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
padding: calc(${t.medium_small} / 2); // 6px in comfortable
|
|
@@ -55,4 +55,4 @@ import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from".
|
|
|
55
55
|
fill: ${e.interactive.disabled__text.rgba};
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,d=i(({checked:e,onToggle:t,icon:n,disabled:i,...s},d)=>{let f=`tooltip`in s?{...s,tooltip:void 0,toolTipPlacement:void 0}:{...s},p=()=>{t(!e)};return l(u,{ref:d,"aria-checked":e,onClick:p,disabled:i,...f,children:[n?`tooltip`in s&&s.tooltip?c(r,{title:s.tooltip,placement:s.tooltipPlacement,children:c(a,{data:n,size:24})}):c(a,{data:n,size:24}):null,`label`in s?c(o,{as:`span`,variant:`button`,group:`navigation`,children:s.label}):null]})});d.displayName=`ToggleGroupOption`;export{d as ToggleGroupOption};
|