@equinor/amplify-component-lib 9.1.0 → 9.1.2
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/types/Guidelines.d.ts +4 -5
- package/dist/molecules/DatePicker/DatePicker.js +1 -1
- package/dist/organisms/SideBar/index.d.ts +7 -2
- package/dist/organisms/Template/Template.js +2 -2
- package/dist/organisms/TopBar/Account/ImpersonateMenu/hooks/useActiveImpersonationUser.js +1 -1
- package/dist/organisms/TopBar/Guidelines/Guidelines.js +1 -1
- package/package.json +3 -4
- package/dist/node_modules/@react-aria/i18n/dist/context.js +0 -1
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.js +0 -1
- package/dist/node_modules/@react-aria/i18n/dist/utils.js +0 -1
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.js +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { IconData } from '@equinor/eds-icons';
|
|
3
|
-
interface IconItem {
|
|
3
|
+
export interface IconItem {
|
|
4
4
|
title: string;
|
|
5
5
|
icon: IconData;
|
|
6
6
|
color: string;
|
|
7
7
|
colorBox?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
interface ElementItem {
|
|
9
|
+
export interface ElementItem {
|
|
10
10
|
title: string;
|
|
11
11
|
element: ReactNode;
|
|
12
12
|
}
|
|
13
|
-
export type GuidelineItem = IconItem | ElementItem;
|
|
14
|
-
export {};
|
|
13
|
+
export type GuidelineItem = IconItem | ElementItem | ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{DatePicker as o,Typography as i}from"@equinor/eds-core-react";import{DatePickerWrapper as a}from"./DatePicker.styles.js";
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{DatePicker as o,Typography as i}from"@equinor/eds-core-react";import{DatePickerWrapper as a}from"./DatePicker.styles.js";const m=t(((t,m)=>{const n=t.locale??"en-GB",c=void 0!==t.formatOptions?t.formatOptions:{month:"long",day:"2-digit",year:"numeric"};return r(a,{children:[e(o,{...t,ref:m,locale:n,formatOptions:c}),t.meta&&e(i,{variant:"helper",group:"input",children:t.meta})]})}));m.displayName="DatePicker";export{m as DatePicker};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { SideBarMenuItem
|
|
1
|
+
import { SideBarMenuItem } from '../../atoms/types/SideBar';
|
|
2
2
|
import { MenuItem } from './MenuItem';
|
|
3
3
|
import { SideBar as BaseSideBar } from './SideBar';
|
|
4
4
|
type SidebarType = typeof BaseSideBar & {
|
|
5
5
|
Item: typeof MenuItem;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Unnecessary rename of SideBarMenuItem, use SideBarMenuItem instead
|
|
9
|
+
*/
|
|
10
|
+
type ItemType = SideBarMenuItem;
|
|
7
11
|
export declare const SideBar: SidebarType;
|
|
8
|
-
export type { ItemType
|
|
12
|
+
export type { ItemType };
|
|
13
|
+
export type { SidebarType };
|
|
@@ -6,7 +6,7 @@ import{tokens as o}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
6
6
|
background: ${r.ui.background__light.rgba};
|
|
7
7
|
`,l=a.div`
|
|
8
8
|
display: flex;
|
|
9
|
-
`,c="
|
|
9
|
+
`,c="fullwidth",m=a.div`
|
|
10
10
|
position: relative;
|
|
11
11
|
display: flex;
|
|
12
12
|
/* 64px is height of TopBar */
|
|
@@ -15,7 +15,7 @@ import{tokens as o}from"../../node_modules/@equinor/eds-tokens/dist/esm/base/ind
|
|
|
15
15
|
overflow: auto;
|
|
16
16
|
/* 231px and 64px is width of Sidebar when open/closed */
|
|
17
17
|
min-width: calc(100% - ${o=>o.$open?"231px":"64px"});
|
|
18
|
-
&:not(:has(
|
|
18
|
+
&:not(:has(.${c})) {
|
|
19
19
|
padding: 0
|
|
20
20
|
max(${i.xxx_large}, calc(50% - ${i.xxx_large} - 1280px / 2));
|
|
21
21
|
margin: 0 auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ImpersonateUserService as t,ApiError as
|
|
1
|
+
import{ImpersonateUserService as t,ApiError as e}from"@equinor/subsurface-app-management";import{useQuery as n}from"@tanstack/react-query";import{ACTIVE_USERIMPERSONATION as r}from"../Impersonate.constants.js";import{environment as o}from"../../../../../atoms/utils/auth_environment.js";function a(){return n({queryKey:[r],queryFn:async()=>{try{const e=await t.getActiveUser();return void 0===e?null:e}catch(t){if(t instanceof e&&(204===t.status||404===t.status))return null}},enabled:"production"!==o.getEnvironmentName(import.meta.env.VITE_ENVIRONMENT_NAME)})}export{a as useActiveImpersonationUser};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as o,Fragment as t,jsx as e}from"react/jsx-runtime";import{useState as r,useRef as i}from"react";import{Icon as
|
|
1
|
+
import{jsxs as o,Fragment as t,jsx as e}from"react/jsx-runtime";import{useState as r,useRef as i,isValidElement as n}from"react";import{Icon as c}from"@equinor/eds-core-react";import{info_circle as l}from"@equinor/eds-icons";import{TopBarButton as m}from"../TopBar.styles.js";import{TopBarMenu as s}from"../TopBarMenu.js";import{Colorbox as a}from"./Colorbox.js";import{Item as p}from"./Item.js";import{Section as d}from"./Section.js";const f=({sections:f})=>{const[h,u]=r(!1),$=i(null);return o(t,{children:[e(m,{variant:"ghost_icon",ref:$,onClick:()=>{u(!h)},"data-testid":"show-hide-button",children:e(c,{data:l})},"topbar-notifications"),e(s,{open:h,anchorEl:$.current,onClose:()=>{u(!1)},withGap:!0,children:f.map(((t,r)=>e(d,{title:t.sectionName,children:t.items.map(((t,i)=>n(t)?t:"element"in t?e(p,{title:t.title,children:t.element},`${i}-${r}`):o(p,{title:t.title,children:[t.colorBox&&e(a,{"data-testid":`color-box-${t.title}`,$color:t.color}),e(c,{data:t.icon,color:t.color,size:24})]},`${i}-${r}`)))},`section-${t.sectionName}`)))})]})};f.displayName="TopBar.Guidelines";export{f as Guidelines};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/amplify-component-lib",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "Frontend Typescript components for the Amplify team",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"test": "vitest watch",
|
|
30
30
|
"test:ci": "CI=true vitest run",
|
|
31
31
|
"test:coverage": "vitest run --coverage",
|
|
32
|
-
"test:coverage-ci": "CI=true vitest run --coverage --coverage.reporter=json --coverage.reporter=json-summary --silent",
|
|
33
32
|
"build": "npm run build-components",
|
|
34
33
|
"build-components": "rollup -c && tsc --project tsconfig.build.json && resolve-tspaths --project tsconfig.build.json",
|
|
35
34
|
"build-and-use": "node tooling/build-and-use.mjs",
|
|
@@ -48,8 +47,8 @@
|
|
|
48
47
|
]
|
|
49
48
|
},
|
|
50
49
|
"dependencies": {
|
|
51
|
-
"@azure/msal-browser": "
|
|
52
|
-
"@azure/msal-react": "
|
|
50
|
+
"@azure/msal-browser": "3.28.0",
|
|
51
|
+
"@azure/msal-react": "2.2.0",
|
|
53
52
|
"@equinor/eds-core-react": "0.42.5",
|
|
54
53
|
"@equinor/eds-data-grid-react": "^0.7.4",
|
|
55
54
|
"@microsoft/signalr": "^8.0.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isRTL as e}from"./utils.js";import{useDefaultLocale as r}from"./useDefaultLocale.js";import t from"react";const o=t.createContext(null);function l(l){let{locale:a,children:c}=l,i=r(),s=t.useMemo((()=>a?{locale:a,direction:e(a)?"rtl":"ltr"}:i),[i,a]);return t.createElement(o.Provider,{value:s},c)}export{l as I18nProvider};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isRTL as e}from"./utils.js";import{useState as t,useEffect as n}from"react";import{useIsSSR as a}from"../../ssr/dist/SSRProvider.js";const o=Symbol.for("react-aria.i18n.locale");function r(){let t="undefined"!=typeof window&&window[o]||"undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:e(t)?"rtl":"ltr"}}let i=r(),l=new Set;function s(){i=r();for(let e of l)e(i)}function c(){let e=a(),[o,r]=t(i);return n((()=>(0===l.size&&window.addEventListener("languagechange",s),l.add(r),()=>{l.delete(r),0===l.size&&window.removeEventListener("languagechange",s)})),[]),e?{locale:"en-US",direction:"ltr"}:o}export{r as getDefaultLocale,c as useDefaultLocale};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),t=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function n(n){if(Intl.Locale){let t=new Intl.Locale(n).maximize(),r="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(r)return"rtl"===r.direction;if(t.script)return e.has(t.script)}let r=n.split("-")[0];return t.has(r)}export{n as isRTL};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n,{useContext as e,useState as t,useRef as o}from"react";String(Math.round(1e10*Math.random()));const r=n.createContext(!1);Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),new WeakMap;function u(){return!1}function c(){return!0}function a(n){return()=>{}}function i(){return"function"==typeof n.useSyncExternalStore?n.useSyncExternalStore(a,u,c):e(r)}n.useId;export{i as useIsSSR};
|