@equinor/amplify-component-lib 9.1.1 → 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.
@@ -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";import{I18nProvider as n}from"../../node_modules/@react-aria/i18n/dist/context.js";const m=t(((t,m)=>{const c=t.locale??"en-GB",s=void 0!==t.formatOptions?t.formatOptions:{month:"long",day:"2-digit",year:"numeric"};return r(a,{children:[e(n,{locale:c,children:e(o,{...t,ref:m,formatOptions:s})}),t.meta&&e(i,{variant:"helper",group:"input",children:t.meta})]})}));m.displayName="DatePicker";export{m as DatePicker};
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 as ItemType } from '../../atoms/types/SideBar';
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, SidebarType };
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=".fullwidth",m=a.div`
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(${c})) {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/amplify-component-lib",
3
- "version": "9.1.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",
@@ -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};