@equinor/amplify-component-lib 13.2.7 → 14.0.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 +2 -2
- 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/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/molecules/Dialog/DialogAction.js +1 -1
- package/dist/molecules/EquinorLogo/EquinorLogo.d.ts +2 -2
- 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 +7 -7
- 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/index.d.ts +7 -7
- package/dist/molecules/Search/Search.d.ts +2 -2
- package/dist/molecules/Select/ComboBox/ComboBox.d.ts +2 -2
- package/dist/molecules/Select/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 +1 -1
- package/dist/molecules/index.js +1 -1
- 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/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 +2 -2
- 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/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 +1 -1
- package/dist/molecules/OptionalTooltip/OptionalTooltip.d.ts +0 -19
- package/dist/molecules/OptionalTooltip/OptionalTooltip.js +0 -4
|
@@ -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<HTMLDivElement | HTMLButtonElement>, "onClick"> & ((BaseChipProps & {
|
|
15
15
|
onClick?: undefined;
|
|
16
16
|
onDelete?: undefined;
|
|
17
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
17
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLDivElement | HTMLButtonElement>) & styled_components_dist_types5.BaseObject, keyof ComboBoxChipProps> & ComboBoxChipProps, never> & Partial<Pick<styled_components11.FastOmit<((Omit<react55.HTMLAttributes<HTMLDivElement | HTMLButtonElement>, "onClick"> & ((BaseChipProps & {
|
|
18
18
|
onClick?: undefined;
|
|
19
19
|
onDelete?: undefined;
|
|
20
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
20
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLDivElement | HTMLButtonElement>) & styled_components_dist_types5.BaseObject, keyof ComboBoxChipProps> & ComboBoxChipProps, never>>> & string & Omit<react55.ForwardRefExoticComponent<(Omit<react55.HTMLAttributes<HTMLDivElement | HTMLButtonElement>, "onClick"> & ((BaseChipProps & {
|
|
21
21
|
onClick?: undefined;
|
|
22
22
|
onDelete?: undefined;
|
|
23
|
-
}) | ClickableChipProps | DeletableChipProps)) &
|
|
23
|
+
}) | ClickableChipProps | DeletableChipProps)) & react55.RefAttributes<HTMLDivElement | HTMLButtonElement>>, 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 react172 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: react172.ForwardRefExoticComponent<CheckboxProps$1 & react172.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 react50 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<react50.DetailedHTMLProps<react50.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$offset"> & SkeletonBaseProps, never> & Partial<Pick<styled_components8.FastOmit<react50.DetailedHTMLProps<react50.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 react34 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>): react34.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};
|
|
@@ -1,117 +1,85 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{spacings as t}from"../../atoms/style/spacings.js";import{shape as n}from"../../atoms/style/index.js";import{Button as r}from"../Button/Button.js";import{IconButton as i}from"../Button/IconButton/IconButton.js";import{TOAST_COLORS as a}from"./Toast.utils.js";import{Typography as o}from"@equinor/eds-core-react";import s,{keyframes as c}from"styled-components";const l=e=>a[e??`neutral`],u=s.header`
|
|
2
2
|
display: grid;
|
|
3
|
-
grid-template-columns: minmax(0, 1fr);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
grid-template-columns: ${({$hasIcon:e})=>e?`auto minmax(0, 1fr)`:`minmax(0, 1fr)`};
|
|
4
|
+
align-items: start;
|
|
5
|
+
gap: ${t.small};
|
|
6
|
+
`,d=s.span`
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
|
|
10
|
+
> svg {
|
|
11
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
`,f=s(o)`
|
|
14
|
+
padding-right: ${t.xx_large};
|
|
15
|
+
`,p=s(r)`
|
|
16
|
+
align-self: flex-start;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
margin-left: ${t.small};
|
|
19
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
20
|
+
border-color: ${({$variant:e})=>l(e).controlForeground};
|
|
21
|
+
&:hover {
|
|
22
|
+
background: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
23
|
+
color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
24
|
+
border-color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
12
25
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
`,m=s(i)`
|
|
27
|
+
position: absolute;
|
|
28
|
+
top: ${t.x_small};
|
|
29
|
+
right: ${t.x_small};
|
|
30
|
+
color: ${({$variant:e})=>l(e).controlForeground};
|
|
31
|
+
&:hover {
|
|
32
|
+
color: ${({$variant:e})=>l(e).controlForegroundHover};
|
|
33
|
+
background: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
34
|
+
border-color: ${({$variant:e})=>l(e).controlHoverBackground};
|
|
35
|
+
&::before {
|
|
36
|
+
background: transparent;
|
|
37
|
+
border-color: transparent;
|
|
38
|
+
}
|
|
17
39
|
}
|
|
18
|
-
`,s
|
|
40
|
+
`,h=s(o)`
|
|
41
|
+
margin: 0 ${t.medium} 0 ${t.small};
|
|
42
|
+
`,g=s.div`
|
|
19
43
|
position: relative;
|
|
20
44
|
display: flex;
|
|
21
45
|
flex-direction: column;
|
|
22
|
-
gap: ${
|
|
23
|
-
border-radius: ${
|
|
24
|
-
padding: ${
|
|
25
|
-
${
|
|
46
|
+
gap: ${t.small};
|
|
47
|
+
border-radius: ${n.corners.borderRadius};
|
|
48
|
+
padding: ${t.medium_small} ${t.x_small} ${t.medium_small}
|
|
49
|
+
${t.medium_small};
|
|
26
50
|
overflow: hidden;
|
|
27
51
|
min-width: 300px;
|
|
28
52
|
max-width: 420px;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
> p {
|
|
34
|
-
margin-right: ${e.medium};
|
|
53
|
+
background: ${({$variant:e})=>l(e).containerBackground};
|
|
54
|
+
`,_=c`
|
|
55
|
+
from {
|
|
56
|
+
width: 100%;
|
|
35
57
|
}
|
|
36
|
-
|
|
37
|
-
${({$variant:e})=>{let t=n[e??`neutral`];return i`
|
|
38
|
-
background: ${t.background};
|
|
39
|
-
|
|
40
|
-
> button {
|
|
41
|
-
margin-right: auto;
|
|
42
|
-
color: ${t.icon};
|
|
43
|
-
border-color: ${t.icon};
|
|
44
|
-
&:hover {
|
|
45
|
-
background: none;
|
|
46
|
-
color: ${t.actionHover};
|
|
47
|
-
border-color: ${t.actionHover};
|
|
48
|
-
&:before {
|
|
49
|
-
position: absolute;
|
|
50
|
-
left: 0;
|
|
51
|
-
content: '';
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 100%;
|
|
54
|
-
background: ${t.icon};
|
|
55
|
-
opacity: 0.15;
|
|
56
|
-
overflow: visible;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
> ${o} {
|
|
62
|
-
> svg:first-child {
|
|
63
|
-
color: ${t.icon};
|
|
64
|
-
}
|
|
65
|
-
> button {
|
|
66
|
-
svg {
|
|
67
|
-
color: ${t.close};
|
|
68
|
-
}
|
|
69
|
-
&:hover {
|
|
70
|
-
background: none;
|
|
71
|
-
&:before {
|
|
72
|
-
position: absolute;
|
|
73
|
-
left: 0;
|
|
74
|
-
content: '';
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
background: ${t.close};
|
|
78
|
-
opacity: 0.15;
|
|
79
|
-
border-radius: 50%;
|
|
80
|
-
overflow: visible;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`}}
|
|
86
|
-
`,c=a`
|
|
87
|
-
from {
|
|
88
|
-
width: 100%
|
|
89
|
-
}
|
|
90
58
|
to {
|
|
91
|
-
width: 0
|
|
59
|
+
width: 0;
|
|
92
60
|
}
|
|
93
|
-
`,
|
|
94
|
-
background:
|
|
61
|
+
`,v=s.span`
|
|
62
|
+
background: ${e.ui.background__default.rgba};
|
|
95
63
|
width: 100%;
|
|
96
64
|
height: 2px;
|
|
97
65
|
position: absolute;
|
|
98
66
|
bottom: 0;
|
|
99
67
|
left: 0;
|
|
100
|
-
|
|
68
|
+
&::before {
|
|
101
69
|
content: '';
|
|
102
70
|
position: absolute;
|
|
103
71
|
width: inherit;
|
|
104
72
|
height: inherit;
|
|
105
|
-
background: ${({$variant:e})=>
|
|
73
|
+
background: ${({$variant:e})=>l(e).containerBackground};
|
|
106
74
|
opacity: 0.5;
|
|
107
75
|
}
|
|
108
|
-
|
|
76
|
+
&::after {
|
|
109
77
|
content: '';
|
|
110
78
|
position: absolute;
|
|
111
79
|
width: inherit;
|
|
112
80
|
height: inherit;
|
|
113
|
-
background: ${({$variant:e})=>
|
|
114
|
-
animation: ${
|
|
81
|
+
background: ${({$variant:e})=>l(e).progressFill};
|
|
82
|
+
animation: ${_} ${({$duration:e})=>e}s linear;
|
|
115
83
|
animation-fill-mode: forwards;
|
|
116
84
|
}
|
|
117
|
-
`;export{
|
|
85
|
+
`;export{p as ActionButton,m as CloseButton,g as Container,h as Description,v as DurationBar,u as Header,d as HeaderIcon,f as Title};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{colors as e}from"../../atoms/style/colors.js";import{check_circle_outlined as t,error_outlined as n,info_circle as r,warning_outlined as i}from"@equinor/eds-icons";function a({icon:e,variant:a}){if(e)return e;switch(a){case`info`:return r;case`warning`:return i;case`error`:return n;case`success`:return t;default:return}}const o={neutral:{
|
|
1
|
+
import{colors as e}from"../../atoms/style/colors.js";import{check_circle_outlined as t,error_outlined as n,info_circle as r,warning_outlined as i}from"@equinor/eds-icons";function a({icon:e,variant:a}){if(e)return e;switch(a){case`info`:return r;case`warning`:return i;case`error`:return n;case`success`:return t;default:return}}const o={neutral:{containerBackground:e.ui.background__light.rgba,controlForeground:e.interactive.secondary__resting.rgba,controlForegroundHover:e.text.static_icons__default.rgba,controlHoverBackground:e.ui.background__light_medium.rgba,progressFill:e.text.static_icons__secondary.rgba},info:{containerBackground:e.ui.background__info.rgba,controlForeground:e.interactive.info__text.rgba,controlForegroundHover:e.interactive.info__text_hover.rgba,controlHoverBackground:e.interactive.info__nested_hover.rgba,progressFill:e.interactive.info__text.rgba},warning:{containerBackground:e.ui.background__warning.rgba,controlForeground:e.interactive.warning__text.rgba,controlForegroundHover:e.interactive.warning__text_hover.rgba,controlHoverBackground:e.interactive.warning__nested_hover.rgba,progressFill:e.interactive.warning__resting.rgba},error:{containerBackground:e.ui.background__danger.rgba,controlForeground:e.interactive.danger__text.rgba,controlForegroundHover:e.interactive.danger__text_hover.rgba,controlHoverBackground:e.interactive.danger__nested_hover.rgba,progressFill:e.interactive.danger__resting.rgba},success:{containerBackground:e.ui.background__success.rgba,controlForeground:e.interactive.success__text.rgba,controlForegroundHover:e.interactive.success__text_hover.rgba,controlHoverBackground:e.interactive.success__nested_hover.rgba,progressFill:e.interactive.success__resting.rgba}};export{o as TOAST_COLORS,a as getHeaderIcon};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/molecules/Tooltip/Tooltip.d.ts
|
|
4
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
type TooltipProps = {
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
placement?: TooltipPlacement;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
enterDelay?: number;
|
|
10
|
+
exitDelay?: number;
|
|
11
|
+
} & Omit<ComponentPropsWithRef<'div'>, 'title'>;
|
|
12
|
+
declare const Tooltip: FC<TooltipProps>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Tooltip, TooltipProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LeftAlignedText as e,TooltipWrapper as t,Wrapper as n}from"./Tooltip.styles.js";import{assignRef as r,getResolvedPlacement as i}from"./utils.js";import{useId as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({title:u,children:d,ref:f,disabled:p=!1,placement:m=`top`,enterDelay:h=0,exitDelay:g=300,..._})=>{let v=a().replace(/:/g,``),y=o(null),b=o(null),x=o(null),S=o(null),[C,w]=s({placement:m,offset:{x:void 0,y:void 0}}),T=()=>{if(!y.current?.matches(`:popover-open`))return;let e=y.current.getBoundingClientRect(),t=b.current?.getBoundingClientRect();if(!t)return;let n=i(e,t);if(n===`top`||n===`bottom`){let r=t.left+t.width/2;w({placement:n,offset:{x:Math.max(12,Math.min(r-e.left,e.width-12))}})}else{let r=t.top+t.height/2;w({placement:n,offset:{y:Math.max(12,Math.min(r-e.top,e.height-12))}})}},E=e=>{y.current=e,r(f,e)},D=()=>{x.current&&=(clearTimeout(x.current),null),!(S.current||y.current?.matches(`:popover-open`))&&(S.current=setTimeout(()=>{S.current=null,!y.current?.matches(`:popover-open`)&&(y.current?.showPopover(),requestAnimationFrame(T))},h))},O=()=>{S.current&&=(clearTimeout(S.current),null),x.current=setTimeout(()=>{x.current=null,y.current?.matches(`:popover-open`)&&y.current.hidePopover()},g)};return!u||p?d:l(n,{onMouseEnter:D,onMouseLeave:O,onFocus:D,onBlur:O,$anchor:`--tooltip-${v}`,ref:b,..._,children:[d,c(t,{ref:E,role:`tooltip`,popover:`hint`,$anchor:`--tooltip-${v}`,$placement:m,$arrow:C,children:typeof u==`string`?c(e,{children:u}):u})]})};export{u as Tooltip};
|