@equinor/fusion-framework-react-components-bookmark 0.1.16 → 0.2.3

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +21 -0
  3. package/dist/esm/components/Bookmark.js +5 -5
  4. package/dist/esm/components/Bookmark.js.map +1 -1
  5. package/dist/esm/components/create-bookmark/CreateBookmark.js +1 -1
  6. package/dist/esm/components/create-bookmark/CreateBookmark.js.map +1 -1
  7. package/dist/esm/components/edit-bookmark/EditBookmark.js +17 -18
  8. package/dist/esm/components/edit-bookmark/EditBookmark.js.map +1 -1
  9. package/dist/esm/components/filter/Filter.js +7 -4
  10. package/dist/esm/components/filter/Filter.js.map +1 -1
  11. package/dist/esm/components/import-bookmark/ImportBookmark.js +4 -4
  12. package/dist/esm/components/import-bookmark/ImportBookmark.js.map +1 -1
  13. package/dist/esm/components/row/Row.js +6 -6
  14. package/dist/esm/components/row/Row.js.map +1 -1
  15. package/dist/esm/components/section/Section.js +20 -21
  16. package/dist/esm/components/section/Section.js.map +1 -1
  17. package/dist/esm/components/shared/SharedIcon.js +16 -14
  18. package/dist/esm/components/shared/SharedIcon.js.map +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/dist/types/components/Bookmark.d.ts +1 -1
  23. package/dist/types/components/BookmarkProvider.d.ts +1 -1
  24. package/dist/types/components/create-bookmark/CreateBookmark.d.ts +1 -1
  25. package/dist/types/components/edit-bookmark/EditBookmark.d.ts +1 -1
  26. package/dist/types/components/filter/Filter.d.ts +1 -1
  27. package/dist/types/components/import-bookmark/ImportBookmark.d.ts +1 -1
  28. package/dist/types/components/loading/Loading.d.ts +1 -1
  29. package/dist/types/components/row/MoreMenu.d.ts +1 -1
  30. package/dist/types/components/row/Row.d.ts +1 -1
  31. package/dist/types/components/section/Section.d.ts +1 -1
  32. package/dist/types/components/sectionList/SectionList.d.ts +1 -1
  33. package/dist/types/components/shared/SharedIcon.d.ts +1 -1
  34. package/dist/types/version.d.ts +1 -1
  35. package/package.json +53 -57
  36. package/src/components/Bookmark.tsx +9 -8
  37. package/src/components/create-bookmark/CreateBookmark.tsx +2 -1
  38. package/src/components/edit-bookmark/EditBookmark.tsx +23 -23
  39. package/src/components/filter/Filter.tsx +15 -5
  40. package/src/components/import-bookmark/ImportBookmark.tsx +6 -5
  41. package/src/components/row/Row.tsx +10 -10
  42. package/src/components/section/Section.tsx +22 -24
  43. package/src/components/shared/SharedIcon.tsx +20 -18
  44. package/src/version.ts +1 -1
  45. package/tsconfig.json +1 -2
@@ -1,2 +1,2 @@
1
- export declare const Bookmark: () => JSX.Element;
1
+ export declare const Bookmark: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default Bookmark;
@@ -1,6 +1,6 @@
1
1
  import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
2
2
  import { PropsWithChildren } from 'react';
3
- export declare const BookmarkProvider: ({ children }: PropsWithChildren<unknown>) => JSX.Element;
3
+ export declare const BookmarkProvider: ({ children }: PropsWithChildren<unknown>) => import("react/jsx-runtime").JSX.Element;
4
4
  declare module '@equinor/fusion-framework-module-event' {
5
5
  interface FrameworkEventMap {
6
6
  onBookmarkOpen: FrameworkEvent<FrameworkEventInit<boolean, unknown>>;
@@ -1,4 +1,4 @@
1
1
  export declare const CreateBookmarkModal: ({ isOpen, onClose, }: {
2
2
  readonly isOpen: boolean;
3
3
  readonly onClose: (b: boolean) => void;
4
- }) => JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -2,4 +2,4 @@ export declare const EditBookmarkModal: ({ isOpen, onClose, bookmarkId, }: {
2
2
  readonly isOpen: boolean;
3
3
  readonly onClose: (b: boolean) => void;
4
4
  readonly bookmarkId?: string | undefined;
5
- }) => JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,5 @@ type BookmarkFilterProps = {
6
6
  readonly groupingModes: string[];
7
7
  readonly groupBy: string;
8
8
  };
9
- export declare const BookmarkFilter: ({ searchText, setGroupBy, setSearchText, groupingModes, groupBy, }: BookmarkFilterProps) => JSX.Element;
9
+ export declare const BookmarkFilter: ({ searchText, setGroupBy, setSearchText, groupingModes, groupBy, }: BookmarkFilterProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1 +1 @@
1
- export declare const ImportBookmarkModal: () => JSX.Element;
1
+ export declare const ImportBookmarkModal: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export declare const Loading: () => JSX.Element;
1
+ export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,5 @@ type MenuProps = {
6
6
  readonly open: boolean;
7
7
  readonly options: MenuOption[];
8
8
  };
9
- export declare const MoreMenu: ({ pRef, onClose, open, options }: MenuProps) => JSX.Element;
9
+ export declare const MoreMenu: ({ pRef, onClose, open, options }: MenuProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -13,5 +13,5 @@ type RowProps = {
13
13
  readonly menuOptions: MenuOption[];
14
14
  readonly children?: ReactNode;
15
15
  };
16
- export declare const Row: ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: RowProps) => JSX.Element;
16
+ export declare const Row: ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: RowProps) => import("react/jsx-runtime").JSX.Element;
17
17
  export {};
@@ -3,5 +3,5 @@ type SectionProps = {
3
3
  readonly name: string;
4
4
  readonly children: ReactNode;
5
5
  };
6
- export declare const Section: ({ children, name }: SectionProps) => JSX.Element;
6
+ export declare const Section: ({ children, name }: SectionProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export {};
@@ -2,5 +2,5 @@ import { useBookmarkGrouping } from '../../hooks';
2
2
  type SectionListProps = {
3
3
  readonly bookmarkGroups: ReturnType<typeof useBookmarkGrouping>['bookmarkGroups'];
4
4
  };
5
- export declare const SectionList: ({ bookmarkGroups }: SectionListProps) => JSX.Element;
5
+ export declare const SectionList: ({ bookmarkGroups }: SectionListProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -2,5 +2,5 @@ type SharedIconProps = {
2
2
  readonly createdBy: string;
3
3
  readonly createdById: string;
4
4
  };
5
- export declare const SharedIcon: ({ createdBy, createdById }: SharedIconProps) => JSX.Element;
5
+ export declare const SharedIcon: ({ createdBy, createdById }: SharedIconProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1 +1 @@
1
- export declare const version = "0.1.16";
1
+ export declare const version = "0.2.3";
package/package.json CHANGED
@@ -1,59 +1,55 @@
1
1
  {
2
- "name": "@equinor/fusion-framework-react-components-bookmark",
3
- "version": "0.1.16",
4
- "description": "",
5
- "main": "dist/esm/index.js",
6
- "exports": {
7
- ".": "./dist/esm/index.js"
8
- },
9
- "types": "./dist/types/index.d.ts",
10
- "scripts": {
11
- "build": "tsc -b",
12
- "prepack": "yarn build"
13
- },
14
- "keywords": [],
15
- "author": "",
16
- "license": "ISC",
17
- "publishConfig": {
18
- "access": "public"
19
- },
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/equinor/fusion-framework.git",
23
- "directory": "packages/react/components/bookmark"
24
- },
25
- "dependencies": {
26
- "@equinor/eds-utils": "^0.8.1",
27
- "@equinor/fusion-framework-react": "^5.2.3",
28
- "@equinor/fusion-framework-react-module-bookmark": "^2.0.13"
29
- },
30
- "devDependencies": {
31
- "@emotion/css": "^11.10.6",
32
- "@emotion/react": "^11.10.6",
33
- "@emotion/styled": "^11.10.6",
34
- "@equinor/eds-core-react": "^0.30.0",
35
- "@equinor/eds-icons": "^0.19.1",
36
- "@equinor/eds-tokens": "^0.9.0",
37
- "@equinor/fusion-framework-module-app": "^5.2.1",
38
- "@equinor/fusion-framework-module-event": "^4.0.3",
39
- "@types/react": "^17.0.11",
40
- "react": "^17.0.2",
41
- "styled-components": "^5.3.9",
42
- "typescript": "^5.1.3"
43
- },
44
- "peerDependencies": {
45
- "@emotion/css": "^11.10.6",
46
- "@emotion/styled": "^11.10.6",
47
- "@equinor/eds-core-react": "^0.30.0",
48
- "@equinor/eds-icons": "^0.19.1",
49
- "@equinor/eds-tokens": "^0.9.0",
50
- "@types/react": "^17.0.0 || ^18.0.0",
51
- "react": "^17.0.0 || ^18.0.0",
52
- "styled-components": "^5.3.9"
53
- },
54
- "peerDependenciesMeta": {
55
- "@types/react": {
56
- "optional": true
57
- }
2
+ "name": "@equinor/fusion-framework-react-components-bookmark",
3
+ "version": "0.2.3",
4
+ "description": "",
5
+ "main": "dist/esm/index.js",
6
+ "exports": {
7
+ ".": "./dist/esm/index.js"
8
+ },
9
+ "types": "./dist/types/index.d.ts",
10
+ "keywords": [],
11
+ "author": "",
12
+ "license": "ISC",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/equinor/fusion-framework.git",
19
+ "directory": "packages/react/components/bookmark"
20
+ },
21
+ "dependencies": {
22
+ "@equinor/fusion-framework-react": "^5.2.5",
23
+ "@equinor/fusion-framework-react-module-bookmark": "^2.0.15"
24
+ },
25
+ "devDependencies": {
26
+ "@equinor/eds-core-react": "^0.32.4",
27
+ "@equinor/eds-icons": "^0.19.3",
28
+ "@equinor/eds-tokens": "^0.9.2",
29
+ "@equinor/eds-utils": "^0.8.1",
30
+ "@types/react": "^18.2.20",
31
+ "react": "^18.2.0",
32
+ "styled-components": "^6.0.7",
33
+ "typescript": "^5.1.3",
34
+ "@equinor/fusion-framework-module-app": "^5.2.3",
35
+ "@equinor/fusion-framework-module-bookmark": "^1.0.9",
36
+ "@equinor/fusion-framework-module-event": "^4.0.4"
37
+ },
38
+ "peerDependencies": {
39
+ "@equinor/eds-core-react": "^0.30.0",
40
+ "@equinor/eds-icons": "^0.19.3",
41
+ "@equinor/eds-tokens": "^0.9.2",
42
+ "@equinor/eds-utils": "^0.8.1",
43
+ "@types/react": "^17.0.0 || ^18.0.0",
44
+ "react": "^17.0.0 || ^18.0.0",
45
+ "styled-components": "^6.0.7"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "@types/react": {
49
+ "optional": true
58
50
  }
59
- }
51
+ },
52
+ "scripts": {
53
+ "build": "tsc -b"
54
+ }
55
+ }
@@ -2,12 +2,13 @@ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
2
2
  import { useBookmarkGrouping } from '../hooks';
3
3
  import { BookmarkFilter } from './filter/Filter';
4
4
  import { SectionList } from './sectionList/SectionList';
5
- import { css } from '@emotion/css';
6
5
  import { useEffect } from 'react';
7
6
 
8
7
  import { Icon } from '@equinor/eds-core-react';
9
8
  import { chevron_down, chevron_right, share, more_vertical, add } from '@equinor/eds-icons';
10
9
 
10
+ import styled from 'styled-components';
11
+
11
12
  Icon.add({
12
13
  chevron_down,
13
14
  chevron_right,
@@ -16,14 +17,14 @@ Icon.add({
16
17
  add,
17
18
  });
18
19
 
19
- const style = {
20
- wrapper: css`
20
+ const Styled = {
21
+ Wrapper: styled.div`
21
22
  padding-right: 1rem;
22
23
  display: flex;
23
24
  flex-direction: column;
24
25
  gap: 1rem;
25
26
  `,
26
- list: css`
27
+ List: styled.div`
27
28
  overflow-y: auto;
28
29
  overflow-x: hidden;
29
30
  height: calc((100vh - 85px) - 3rem);
@@ -41,7 +42,7 @@ export const Bookmark = () => {
41
42
  useBookmarkGrouping(bookmarks);
42
43
 
43
44
  return (
44
- <div className={style.wrapper}>
45
+ <Styled.Wrapper>
45
46
  <BookmarkFilter
46
47
  groupBy={groupByKey}
47
48
  groupingModes={Object.keys(groupingModes)}
@@ -49,10 +50,10 @@ export const Bookmark = () => {
49
50
  setGroupBy={setGroupBy}
50
51
  setSearchText={setSearchText}
51
52
  />
52
- <div className={style.list}>
53
+ <Styled.List>
53
54
  <SectionList bookmarkGroups={bookmarkGroups} />
54
- </div>
55
- </div>
55
+ </Styled.List>
56
+ </Styled.Wrapper>
56
57
  );
57
58
  };
58
59
 
@@ -1,10 +1,11 @@
1
- import styled from '@emotion/styled';
2
1
  import { Button, Checkbox, Dialog, Input, Label, TextField } from '@equinor/eds-core-react';
3
2
  import type { AppModule } from '@equinor/fusion-framework-module-app';
4
3
  import { useFramework } from '@equinor/fusion-framework-react';
5
4
  import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
6
5
  import { ChangeEvent, useState } from 'react';
7
6
 
7
+ import styled from 'styled-components';
8
+ // TODO
8
9
  const StyledContent = styled(Dialog.Content)`
9
10
  display: flex;
10
11
  flex-direction: column;
@@ -1,30 +1,30 @@
1
- import { css } from '@emotion/css';
2
- import styled from '@emotion/styled';
1
+ import { ChangeEvent, useEffect, useState } from 'react';
2
+
3
3
  import { Button, Checkbox, Dialog, Input, Label, TextField } from '@equinor/eds-core-react';
4
4
  import type { AppModule } from '@equinor/fusion-framework-module-app';
5
5
  // TODO - export from `@equinor/fusion-framework-react-module-bookmark`
6
6
  import type { PatchBookmark } from '@equinor/fusion-framework-module-bookmark';
7
7
  import { useFramework } from '@equinor/fusion-framework-react';
8
8
  import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
9
- import { ChangeEvent, useEffect, useState } from 'react';
10
9
  import { appendBookmarkIdToUrl } from '../../utils/append-bookmark-to-uri';
11
10
 
12
- const StyledContent = styled(Dialog.Content)`
13
- display: flex;
14
- flex-direction: column;
15
- gap: 1rem;
16
- `;
17
- const StyledDialog = styled(Dialog)`
18
- width: 500px;
19
- `;
11
+ import styled from 'styled-components';
20
12
 
21
- const styles = {
22
- checkboxWrapper: css`
13
+ const Styled = {
14
+ Dialog: styled(Dialog)`
15
+ width: 500px;
16
+ `,
17
+ DialogContent: styled(Dialog.Content)`
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 1rem;
21
+ `,
22
+ CheckboxWrapper: styled.div`
23
23
  display: flex;
24
24
  gap: 1rem;
25
25
  `,
26
- actions: css`
27
- display: 'flex';
26
+ Actions: styled.div`
27
+ display: flex;
28
28
  gap: 0.2em;
29
29
  `,
30
30
  };
@@ -61,9 +61,9 @@ export const EditBookmarkModal = ({
61
61
  }, [bookmarkId, bookmarks]);
62
62
 
63
63
  return (
64
- <StyledDialog open={isOpen}>
64
+ <Styled.Dialog open={isOpen}>
65
65
  <Dialog.Header>Edit bookmark</Dialog.Header>
66
- <StyledContent>
66
+ <Styled.DialogContent>
67
67
  <div>
68
68
  <Label htmlFor="name" label="Name" />
69
69
  <Input
@@ -93,7 +93,7 @@ export const EditBookmarkModal = ({
93
93
  <Input readOnly={true} value={current?.manifest?.name || ''} />
94
94
  </div>
95
95
 
96
- <div className={styles.checkboxWrapper}>
96
+ <Styled.CheckboxWrapper>
97
97
  <Checkbox
98
98
  label="Is Shared"
99
99
  checked={state.isShared}
@@ -113,10 +113,10 @@ export const EditBookmarkModal = ({
113
113
  setUpdatePayload((s) => !s);
114
114
  }}
115
115
  />
116
- </div>
117
- </StyledContent>
116
+ </Styled.CheckboxWrapper>
117
+ </Styled.DialogContent>
118
118
  <Dialog.Actions>
119
- <div className={styles.actions}>
119
+ <Styled.Actions>
120
120
  <Button onClick={() => onClose(false)} variant="ghost">
121
121
  Cancel
122
122
  </Button>
@@ -130,8 +130,8 @@ export const EditBookmarkModal = ({
130
130
  >
131
131
  Save
132
132
  </Button>
133
- </div>
133
+ </Styled.Actions>
134
134
  </Dialog.Actions>
135
- </StyledDialog>
135
+ </Styled.Dialog>
136
136
  );
137
137
  };
@@ -1,7 +1,8 @@
1
- import { css } from '@emotion/css';
2
1
  import { Search, Autocomplete } from '@equinor/eds-core-react';
3
2
  import { GroupingKeys } from '../../hooks/useBookmarkGrouping';
4
3
 
4
+ import styled from 'styled-components';
5
+
5
6
  type BookmarkFilterProps = {
6
7
  readonly searchText: string;
7
8
  readonly setSearchText: (newVal: string | null) => void;
@@ -10,8 +11,8 @@ type BookmarkFilterProps = {
10
11
  readonly groupBy: string;
11
12
  };
12
13
 
13
- const styles = {
14
- row: css`
14
+ const Styled = {
15
+ Root: styled.div`
15
16
  display: flex;
16
17
  align-items: center;
17
18
  justify-content: space-between;
@@ -26,7 +27,16 @@ export const BookmarkFilter = ({
26
27
  groupBy,
27
28
  }: BookmarkFilterProps) => {
28
29
  return (
29
- <div className={styles.row}>
30
+ <Search
31
+ placeholder="Search in my bookmarks"
32
+ value={searchText ?? ''}
33
+ onChange={(e) => {
34
+ setSearchText(e.currentTarget.value.length ? e.currentTarget.value : null);
35
+ }}
36
+ />
37
+ );
38
+ return (
39
+ <Styled.Root>
30
40
  <Search
31
41
  placeholder="Search in my bookmarks"
32
42
  value={searchText ?? ''}
@@ -43,6 +53,6 @@ export const BookmarkFilter = ({
43
53
  onOptionsChange={(changes) => setGroupBy(changes.selectedItems[0] as GroupingKeys)}
44
54
  label={''}
45
55
  />
46
- </div>
56
+ </Styled.Root>
47
57
  );
48
58
  };
@@ -1,10 +1,11 @@
1
- import { css } from '@emotion/css';
2
1
  import { Button, Dialog } from '@equinor/eds-core-react';
3
2
  import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
4
3
  import { useEffect, useState } from 'react';
5
4
 
6
- const styles = {
7
- actionWrapper: css`
5
+ import styled from 'styled-components';
6
+
7
+ const Styled = {
8
+ Actions: styled.div`
8
9
  display: flex;
9
10
  gap: 1rem;
10
11
  `,
@@ -31,7 +32,7 @@ export const ImportBookmarkModal = () => {
31
32
  <p>Would you like to import it?</p>
32
33
  </Dialog.Content>
33
34
  <Dialog.Actions>
34
- <div className={styles.actionWrapper}>
35
+ <Styled.Actions>
35
36
  <Button
36
37
  onClick={() => setIsOpen(false)}
37
38
  variant={'ghost'}
@@ -49,7 +50,7 @@ export const ImportBookmarkModal = () => {
49
50
  >
50
51
  Import
51
52
  </Button>
52
- </div>
53
+ </Styled.Actions>
53
54
  </Dialog.Actions>
54
55
  </Dialog>
55
56
  );
@@ -1,4 +1,3 @@
1
- import { css } from '@emotion/css';
2
1
  import { Icon, Typography } from '@equinor/eds-core-react';
3
2
  import { tokens } from '@equinor/eds-tokens';
4
3
  import { useOutsideClick } from '@equinor/eds-utils';
@@ -6,6 +5,8 @@ import { useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
6
5
  import { MutableRefObject, ReactNode, useRef } from 'react';
7
6
  import { MoreMenu } from './MoreMenu';
8
7
 
8
+ import styled from 'styled-components';
9
+
9
10
  export type MenuOption = {
10
11
  name: string;
11
12
  disabled: boolean;
@@ -22,14 +23,14 @@ type RowProps = {
22
23
  readonly children?: ReactNode;
23
24
  };
24
25
 
25
- const styles = {
26
- iconRow: css`
26
+ const Styled = {
27
+ Icons: styled.div`
27
28
  display: flex;
28
29
  flex-direction: row;
29
30
  gap: 0.2em;
30
31
  align-items: center;
31
32
  `,
32
- row: css`
33
+ ListItem: styled.div`
33
34
  cursor: pointer;
34
35
  &:hover {
35
36
  background-color: ${tokens.colors.ui.background__light.hex};
@@ -53,9 +54,8 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
53
54
 
54
55
  // TODO: @noggling fix this
55
56
  return (
56
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events
57
- <li
58
- className={styles.row}
57
+ /* eslint-disable-next-line styled-components-a11y/click-events-have-key-events, styled-components-a11y/no-static-element-interactions*/
58
+ <Styled.ListItem
59
59
  onClick={(e) => {
60
60
  e.preventDefault();
61
61
  e.stopPropagation();
@@ -63,7 +63,7 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
63
63
  }}
64
64
  >
65
65
  <Typography>{name}</Typography>
66
- <div className={styles.iconRow}>
66
+ <Styled.Icons>
67
67
  {children}
68
68
  {!!menuOptions?.length && (
69
69
  <Icon
@@ -86,7 +86,7 @@ export const Row = ({ name, menuOptions, children, id, menuOpen, onMenuOpen }: R
86
86
  }}
87
87
  pRef={pRef}
88
88
  />
89
- </div>
90
- </li>
89
+ </Styled.Icons>
90
+ </Styled.ListItem>
91
91
  );
92
92
  };
@@ -3,12 +3,27 @@ import { ReactNode } from 'react';
3
3
  import { Button, Icon, Typography } from '@equinor/eds-core-react';
4
4
  import { chevron_down, chevron_right } from '@equinor/eds-icons';
5
5
 
6
- import { css } from '@emotion/css';
7
6
  import { tokens } from '@equinor/eds-tokens';
8
- import styled from '@emotion/styled';
7
+ import styled from 'styled-components';
9
8
 
10
- const styles = {
11
- childrenFlex: css`
9
+ const Styled = {
10
+ Button: styled(Button)`
11
+ width: 100%;
12
+ padding: 0;
13
+ padding-top: 0.5rem;
14
+ margin-bottom: 0.5rem;
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ background: none;
19
+ border: none;
20
+ color: ${tokens.colors.infographic.primary__moss_green_100.hex};
21
+ cursor: pointer;
22
+ :hover {
23
+ background: none;
24
+ }
25
+ `,
26
+ List: styled.ol`
12
27
  margin-left: 0.7rem;
13
28
  padding-left: 1rem;
14
29
  display: flex;
@@ -18,23 +33,6 @@ const styles = {
18
33
  `,
19
34
  };
20
35
 
21
- const StyledButton = styled(Button)`
22
- width: 100%;
23
- padding: 0;
24
- padding-top: 0.5rem;
25
- margin-bottom: 0.5rem;
26
- display: flex;
27
- justify-content: space-between;
28
- align-items: center;
29
- background: none;
30
- border: none;
31
- color: ${tokens.colors.infographic.primary__moss_green_100.hex};
32
- cursor: pointer;
33
- :hover {
34
- background: none;
35
- }
36
- `;
37
-
38
36
  Icon.add({
39
37
  chevron_down,
40
38
  chevron_right,
@@ -49,11 +47,11 @@ export const Section = ({ children, name }: SectionProps) => {
49
47
 
50
48
  return (
51
49
  <div>
52
- <StyledButton variant="ghost" onClick={() => setIsExpanded((s) => !s)}>
50
+ <Styled.Button variant="ghost" onClick={() => setIsExpanded((s) => !s)}>
53
51
  <Icon name={isExpanded ? chevron_down.name : chevron_right.name} />
54
52
  <Typography variant="h6">{name}</Typography>
55
- </StyledButton>
56
- {isExpanded && <ol className={styles.childrenFlex}>{children}</ol>}
53
+ </Styled.Button>
54
+ {isExpanded && <Styled.List>{children}</Styled.List>}
57
55
  </div>
58
56
  );
59
57
  };
@@ -1,8 +1,24 @@
1
- import styled from '@emotion/styled';
2
1
  import { Icon } from '@equinor/eds-core-react';
3
2
  import { tokens } from '@equinor/eds-tokens';
4
3
  import { useFramework } from '@equinor/fusion-framework-react';
5
4
 
5
+ import styled from 'styled-components';
6
+
7
+ const Styled = {
8
+ Row: styled.div`
9
+ display: flex;
10
+ align-items: center;
11
+ gap: 0.2em;
12
+ `,
13
+ CreatedBy: styled.p`
14
+ font-size: 12px;
15
+ font-weight: 500;
16
+ line-height: 16px;
17
+ letter-spacing: 0em;
18
+ text-align: right;
19
+ `,
20
+ };
21
+
6
22
  type SharedIconProps = {
7
23
  readonly createdBy: string;
8
24
  readonly createdById: string;
@@ -14,8 +30,8 @@ export const SharedIcon = ({ createdBy, createdById }: SharedIconProps) => {
14
30
  const isMe = createdById === myId;
15
31
 
16
32
  return (
17
- <StyledRow>
18
- {!isMe && <StyledCreatedBy>shared by {createdBy}</StyledCreatedBy>}
33
+ <Styled.Row>
34
+ {!isMe && <Styled.CreatedBy>shared by {createdBy}</Styled.CreatedBy>}
19
35
  <Icon
20
36
  name="share"
21
37
  color={
@@ -24,20 +40,6 @@ export const SharedIcon = ({ createdBy, createdById }: SharedIconProps) => {
24
40
  : tokens.colors.interactive.disabled__border.hex
25
41
  }
26
42
  />
27
- </StyledRow>
43
+ </Styled.Row>
28
44
  );
29
45
  };
30
-
31
- const StyledRow = styled.div`
32
- display: flex;
33
- align-items: center;
34
- gap: 0.2em;
35
- `;
36
-
37
- const StyledCreatedBy = styled.p`
38
- font-size: 12px;
39
- font-weight: 500;
40
- line-height: 16px;
41
- letter-spacing: 0em;
42
- text-align: right;
43
- `;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '0.1.16';
2
+ export const version = '0.2.3';
package/tsconfig.json CHANGED
@@ -3,8 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "dist/esm",
5
5
  "rootDir": "src",
6
- "declarationDir": "./dist/types",
7
- "baseUrl": "src",
6
+ "declarationDir": "./dist/types"
8
7
  },
9
8
  "references": [
10
9
  {