@iota/apps-ui-kit 0.5.0 → 0.5.1

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 (55) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/index.d.ts +38 -17
  3. package/dist/index.es.js +1827 -1803
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +38 -38
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/style.css +1 -1
  8. package/package.json +1 -3
  9. package/src/lib/components/atoms/badge/Badge.tsx +1 -1
  10. package/src/lib/components/atoms/button/button-variants/ButtonPill.tsx +1 -1
  11. package/src/lib/components/atoms/button/button-variants/ButtonUnstyled.tsx +1 -1
  12. package/src/lib/components/atoms/button/button-variants/buttonVariants.types.ts +1 -1
  13. package/src/lib/components/atoms/info-box/InfoBox.tsx +2 -1
  14. package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +3 -2
  15. package/src/lib/components/atoms/label-text/LabelText.tsx +2 -1
  16. package/src/lib/components/atoms/list-item/ListItem.tsx +2 -2
  17. package/src/lib/components/atoms/snackbar/Snackbar.tsx +1 -1
  18. package/src/lib/components/atoms/tooltip/Tooltip.tsx +3 -3
  19. package/src/lib/components/molecules/account/Account.tsx +21 -3
  20. package/src/lib/components/molecules/address/Address.tsx +1 -1
  21. package/src/lib/components/molecules/card/CardAction.tsx +1 -1
  22. package/src/lib/components/molecules/card/CardBody.tsx +3 -3
  23. package/src/lib/components/molecules/chip/Chip.tsx +1 -1
  24. package/src/lib/components/molecules/display-stats/DisplayStats.tsx +41 -3
  25. package/src/lib/components/molecules/input/Input.tsx +5 -4
  26. package/src/lib/components/molecules/input/InputWrapper.tsx +1 -1
  27. package/src/lib/components/molecules/input/TextArea.tsx +3 -2
  28. package/src/lib/components/molecules/input/input.types.ts +3 -3
  29. package/src/lib/components/molecules/navbar-item/NavbarItemHorizontal.tsx +2 -2
  30. package/src/lib/components/molecules/navbar-item/NavbarItemVertical.tsx +2 -2
  31. package/src/lib/components/molecules/search/Search.tsx +2 -9
  32. package/src/lib/components/molecules/segmented-button/SegmentedButton.tsx +2 -2
  33. package/src/lib/components/molecules/select/Select.tsx +2 -3
  34. package/src/lib/components/molecules/table-cell/TableCell.tsx +2 -2
  35. package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +1 -1
  36. package/src/lib/components/molecules/title/Title.tsx +2 -1
  37. package/src/lib/components/organisms/accordion/Accordion.tsx +2 -2
  38. package/src/lib/components/organisms/dialog/Dialog.tsx +20 -1
  39. package/src/lib/components/organisms/navbar/Navbar.tsx +2 -1
  40. package/src/lib/components/organisms/navbar/NavbarSlideout.tsx +3 -2
  41. package/src/lib/components/organisms/table/Table.tsx +4 -10
  42. package/src/lib/components/organisms/table/TableContext.tsx +2 -1
  43. package/src/lib/tailwind/base.presets.ts +1 -1
  44. package/src/lib/tailwind/constants/fontSizes.constants.ts +1 -1
  45. package/src/lib/tailwind/helpers.ts +1 -1
  46. package/src/lib/tailwind/types.ts +1 -1
  47. package/src/storybook/blocks/TypeSet.tsx +1 -1
  48. package/src/storybook/stories/atoms/Snackbar.stories.tsx +2 -1
  49. package/src/storybook/stories/molecules/Card.stories.tsx +1 -4
  50. package/src/storybook/stories/molecules/Dropdown.stories.tsx +1 -1
  51. package/src/storybook/stories/molecules/Input.stories.tsx +2 -1
  52. package/src/storybook/stories/molecules/Search.stories.tsx +2 -1
  53. package/src/storybook/stories/molecules/SegmentedButton.stories.tsx +2 -1
  54. package/src/storybook/stories/molecules/Select.stories.tsx +2 -1
  55. package/src/storybook/stories/organisms/Navbar.stories.tsx +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iota/apps-ui-kit",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "github.com:iotaledger/iota.git"
@@ -37,11 +37,9 @@
37
37
  "@storybook/addon-essentials": "^7.1.0",
38
38
  "@storybook/addon-interactions": "^7.1.0",
39
39
  "@storybook/addon-links": "^7.1.0",
40
- "@storybook/addon-onboarding": "^8.1.11",
41
40
  "@storybook/blocks": "^7.1.0",
42
41
  "@storybook/react": "^7.1.0",
43
42
  "@storybook/react-vite": "^7.1.0",
44
- "@storybook/test": "^8.1.11",
45
43
  "@types/lodash.merge": "^4.6.9",
46
44
  "@types/node": "^20.14.10",
47
45
  "@types/react": "^18.3.3",
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import cx from 'classnames';
5
- import { BadgeType } from './badge.enums';
5
+ import type { BadgeType } from './badge.enums';
6
6
  import { BACKGROUND_COLORS, BADGE_TEXT_CLASS, BORDER_COLORS, TEXT_COLORS } from './badge.classes';
7
7
 
8
8
  interface BadgeProps {
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { ButtonHtmlType } from '../button.enums';
5
- import { ButtonVariantProps } from './buttonVariants.types';
5
+ import type { ButtonVariantProps } from './buttonVariants.types';
6
6
 
7
7
  export function ButtonPill({
8
8
  htmlType = ButtonHtmlType.Button,
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { ButtonHtmlType } from '../button.enums';
5
- import { ButtonVariantProps } from './buttonVariants.types';
5
+ import type { ButtonVariantProps } from './buttonVariants.types';
6
6
  import cx from 'classnames';
7
7
 
8
8
  export function ButtonUnstyled({
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ButtonProps } from '../Button';
4
+ import type { ButtonProps } from '../Button';
5
5
 
6
6
  type ButtonPickedProps = Pick<ButtonProps, 'htmlType' | 'testId'>;
7
7
  type PropsFromButtonElement = Omit<React.HTMLProps<HTMLButtonElement>, 'type'>;
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import cx from 'classnames';
5
- import { InfoBoxStyle, InfoBoxType } from './infoBox.enums';
5
+ import type { InfoBoxType } from './infoBox.enums';
6
+ import { InfoBoxStyle } from './infoBox.enums';
6
7
  import { BACKGROUND_COLORS, ICON_COLORS } from './infoBox.classes';
7
8
 
8
9
  export interface InfoBoxProps {
@@ -1,11 +1,12 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ReactNode } from 'react';
4
+ import type { ReactNode } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { Copy, Info } from '@iota/apps-ui-icons';
7
7
  import { ValueSize } from './keyValue.enums';
8
- import { Tooltip, TooltipPosition } from '../tooltip';
8
+ import type { TooltipPosition } from '../tooltip';
9
+ import { Tooltip } from '../tooltip';
9
10
  import { ButtonUnstyled } from '../button';
10
11
 
11
12
  interface KeyValueProps {
@@ -5,7 +5,8 @@ import cx from 'classnames';
5
5
  import { LabelTextSize } from './labelText.enums';
6
6
  import { LABEL_TEXT_SIZE, SUPPORTING_TEXT_SIZE, TEXT_SIZE } from './labelText.classes';
7
7
  import { Info } from '@iota/apps-ui-icons';
8
- import { TooltipPosition, Tooltip } from '../tooltip';
8
+ import type { TooltipPosition } from '../tooltip';
9
+ import { Tooltip } from '../tooltip';
9
10
 
10
11
  interface LabelTextProps {
11
12
  /**
@@ -1,10 +1,10 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PropsWithChildren } from 'react';
4
+ import type { PropsWithChildren } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { ArrowRight } from '@iota/apps-ui-icons';
7
- import { Button, ButtonSize, ButtonType } from '@/components';
7
+ import { Button, ButtonSize, ButtonType } from '../button';
8
8
 
9
9
  export interface ListItemProps {
10
10
  /**
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { Close } from '@iota/apps-ui-icons';
7
7
  import { SnackbarType } from './snackbar.enums';
8
- import { BACKGROUND_COLOR, TEXT_COLOR } from '@/components/atoms/snackbar/snackbar.classes';
8
+ import { BACKGROUND_COLOR, TEXT_COLOR } from './snackbar.classes';
9
9
 
10
10
  type Renderable = JSX.Element | string | null;
11
11
  export interface SnackbarProps {
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PropsWithChildren } from 'react';
4
+ import type { PropsWithChildren } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { TooltipPosition } from './tooltip.enums';
7
7
  import { TOOLTIP_POSITION } from './tooltip.classes';
@@ -20,11 +20,11 @@ export function Tooltip({
20
20
  }: PropsWithChildren<TooltipProps>): React.JSX.Element {
21
21
  const tooltipPositionClass = TOOLTIP_POSITION[position];
22
22
  return (
23
- <div className="group relative inline-block">
23
+ <div className="group/tooltip relative inline-block">
24
24
  {children}
25
25
  <div
26
26
  className={cx(
27
- 'absolute z-[999] hidden w-max rounded bg-neutral-80 p-xs text-neutral-10 opacity-0 transition-opacity duration-300 group-hover:block group-hover:opacity-100 group-focus:opacity-100 dark:bg-neutral-30 dark:text-neutral-92',
27
+ 'absolute z-[999] hidden w-max rounded bg-neutral-80 p-xs text-neutral-10 opacity-0 transition-opacity duration-300 group-hover/tooltip:block group-hover/tooltip:opacity-100 group-focus/tooltip:opacity-100 dark:bg-neutral-30 dark:text-neutral-92',
28
28
  tooltipPositionClass,
29
29
  maxWidth,
30
30
  )}
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import cx from 'classnames';
5
- import { ButtonUnstyled } from '../../atoms/button';
6
- import { Badge, BadgeType } from '../../atoms';
5
+ import type { BadgeType } from '@/components/atoms';
6
+ import { Badge, Tooltip, TooltipPosition, ButtonUnstyled } from '@/components/atoms';
7
7
  import {
8
8
  LockLocked,
9
9
  LockUnlocked,
@@ -82,6 +82,14 @@ interface AccountProps {
82
82
  * The text of the badge.
83
83
  */
84
84
  badgeText?: string;
85
+ /**
86
+ * The tooltip text of the badge.
87
+ */
88
+ badgeTooltipText?: string;
89
+ /**
90
+ * The tooltip position of the badge.
91
+ */
92
+ badgeTooltipPosition?: TooltipPosition;
85
93
  }
86
94
 
87
95
  export function Account({
@@ -102,6 +110,8 @@ export function Account({
102
110
  isSelected,
103
111
  isActive,
104
112
  showSelected,
113
+ badgeTooltipText,
114
+ badgeTooltipPosition = TooltipPosition.Bottom,
105
115
  }: AccountProps): React.JSX.Element {
106
116
  const Avatar = avatarContent;
107
117
 
@@ -122,7 +132,15 @@ export function Account({
122
132
  <span className="font-inter text-title-md text-neutral-10 dark:text-neutral-92">
123
133
  {title}
124
134
  </span>
125
- {badgeType && badgeText && <Badge type={badgeType} label={badgeText} />}
135
+ {badgeText && badgeType ? (
136
+ badgeTooltipText ? (
137
+ <Tooltip text={badgeTooltipText} position={badgeTooltipPosition}>
138
+ <Badge type={badgeType} label={badgeText} />
139
+ </Tooltip>
140
+ ) : (
141
+ <Badge type={badgeType} label={badgeText} />
142
+ )
143
+ ) : null}
126
144
  </div>
127
145
  <Address
128
146
  text={subtitle}
@@ -3,7 +3,7 @@
3
3
 
4
4
  import cx from 'classnames';
5
5
  import { Copy, ArrowTopRight } from '@iota/apps-ui-icons';
6
- import { ButtonUnstyled } from '../../atoms/button';
6
+ import { ButtonUnstyled } from '@/components/atoms/button';
7
7
 
8
8
  interface AddressProps {
9
9
  /**
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { ArrowRight } from '@iota/apps-ui-icons';
5
5
  import { CardActionType } from './card.enums';
6
- import { Button, ButtonSize, ButtonType } from '../../atoms/button';
6
+ import { Button, ButtonSize, ButtonType } from '@/components/atoms/button';
7
7
 
8
8
  export type CardActionProps = {
9
9
  title?: string;
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import cx from 'classnames';
4
-
5
- import { ReactNode } from 'react';
6
- import { Tooltip, TooltipPosition } from '../../atoms';
4
+ import type { ReactNode } from 'react';
5
+ import { Tooltip } from '@/components/atoms/tooltip';
6
+ import type { TooltipPosition } from '@/components/atoms/tooltip';
7
7
 
8
8
  export type CardBodyProps = {
9
9
  title: string;
@@ -11,7 +11,7 @@ import {
11
11
  TEXT_COLOR,
12
12
  FOCUS_CLASSES,
13
13
  } from './chip.classes';
14
- import { ButtonUnstyled } from '../../atoms/button';
14
+ import { ButtonUnstyled } from '@/components/atoms/button';
15
15
  import { Close } from '@iota/apps-ui-icons';
16
16
 
17
17
  interface ChipProps {
@@ -1,9 +1,10 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ReactNode } from 'react';
5
- import { Tooltip, TooltipPosition } from '../../atoms';
6
- import { Info } from '@iota/apps-ui-icons';
4
+ import type { ReactNode } from 'react';
5
+ import type { TooltipPosition } from '@/components/atoms';
6
+ import { ButtonUnstyled, Tooltip } from '@/components/atoms';
7
+ import { Copy, Info } from '@iota/apps-ui-icons';
7
8
  import { DisplayStatsType, DisplayStatsSize } from './displayStats.enums';
8
9
  import cx from 'classnames';
9
10
  import {
@@ -48,6 +49,18 @@ interface DisplayStatsProps {
48
49
  * Add icon to the right of the label.
49
50
  */
50
51
  icon?: React.ReactNode;
52
+ /**
53
+ * Text that need to be copied (optional).
54
+ */
55
+ copyText?: string;
56
+ /**
57
+ * The onCopySuccess event of the KeyValue (optional).
58
+ */
59
+ onCopySuccess?: (e: React.MouseEvent<HTMLButtonElement>, text: string) => void;
60
+ /**
61
+ * The onCopyError event of the KeyValue (optional).
62
+ */
63
+ onCopyError?: (e: unknown, text: string) => void;
51
64
  }
52
65
 
53
66
  export function DisplayStats({
@@ -59,6 +72,9 @@ export function DisplayStats({
59
72
  type = DisplayStatsType.Default,
60
73
  size = DisplayStatsSize.Default,
61
74
  icon,
75
+ copyText,
76
+ onCopySuccess,
77
+ onCopyError,
62
78
  }: DisplayStatsProps): React.JSX.Element {
63
79
  const backgroundClass = BACKGROUND_CLASSES[type];
64
80
  const sizeClass = SIZE_CLASSES[size];
@@ -67,6 +83,21 @@ export function DisplayStats({
67
83
  const labelClass = LABEL_TEXT_CLASSES[size];
68
84
  const supportingLabelTextClass = SUPPORTING_LABEL_TEXT_CLASSES[size];
69
85
 
86
+ async function handleCopyClick(event: React.MouseEvent<HTMLButtonElement>) {
87
+ if (!navigator.clipboard) {
88
+ return;
89
+ }
90
+
91
+ if (copyText) {
92
+ try {
93
+ await navigator.clipboard.writeText(copyText);
94
+ onCopySuccess?.(event, copyText);
95
+ } catch (error) {
96
+ console.error('Failed to copy:', error);
97
+ onCopyError?.(error, copyText);
98
+ }
99
+ }
100
+ }
70
101
  return (
71
102
  <div
72
103
  className={cx(
@@ -98,6 +129,13 @@ export function DisplayStats({
98
129
  {supportingLabel}
99
130
  </span>
100
131
  )}
132
+ {copyText && (
133
+ <div className="self-center">
134
+ <ButtonUnstyled onClick={handleCopyClick}>
135
+ <Copy className="text-neutral-60 dark:text-neutral-40" />
136
+ </ButtonUnstyled>
137
+ </div>
138
+ )}
101
139
  </div>
102
140
  </div>
103
141
  );
@@ -3,7 +3,8 @@
3
3
 
4
4
  import { forwardRef, Fragment, useEffect, useRef, useState } from 'react';
5
5
  import cx from 'classnames';
6
- import { InputWrapper, InputWrapperProps } from './InputWrapper';
6
+ import type { InputWrapperProps } from './InputWrapper';
7
+ import { InputWrapper } from './InputWrapper';
7
8
  import {
8
9
  BORDER_CLASSES,
9
10
  INPUT_CLASSES,
@@ -12,10 +13,10 @@ import {
12
13
  INPUT_PLACEHOLDER_CLASSES,
13
14
  } from './input.classes';
14
15
  import { InputType } from './input.enums';
15
- import { SecondaryText } from '../../atoms/secondary-text';
16
+ import { SecondaryText } from '@/components/atoms/secondary-text';
16
17
  import { Close, VisibilityOff, VisibilityOn } from '@iota/apps-ui-icons';
17
- import { ButtonUnstyled } from '../../atoms/button';
18
- import { InputPropsByType, NumericFormatInputProps } from './input.types';
18
+ import { ButtonUnstyled } from '@/components/atoms/button';
19
+ import type { InputPropsByType, NumericFormatInputProps } from './input.types';
19
20
  import { NumericFormat } from 'react-number-format';
20
21
 
21
22
  export interface BaseInputProps extends InputWrapperProps {
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import cx from 'classnames';
5
- import { SecondaryText } from '../../atoms/secondary-text';
5
+ import { SecondaryText } from '@/components/atoms/secondary-text';
6
6
  import { LABEL_CLASSES } from './input.classes';
7
7
  import { createElement } from 'react';
8
8
 
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { forwardRef, useEffect, useState } from 'react';
5
- import { InputWrapper, InputWrapperProps } from './InputWrapper';
5
+ import type { InputWrapperProps } from './InputWrapper';
6
+ import { InputWrapper } from './InputWrapper';
6
7
  import {
7
8
  BORDER_CLASSES,
8
9
  INPUT_CLASSES,
@@ -10,7 +11,7 @@ import {
10
11
  INPUT_PLACEHOLDER_CLASSES,
11
12
  } from './input.classes';
12
13
  import cx from 'classnames';
13
- import { ButtonUnstyled } from '../../atoms/button';
14
+ import { ButtonUnstyled } from '@/components/atoms/button';
14
15
  import { VisibilityOff, VisibilityOn } from '@iota/apps-ui-icons';
15
16
 
16
17
  type TextAreaProps = Omit<
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ComponentProps } from 'react';
5
- import { InputType } from '.';
6
- import { NumericFormat } from 'react-number-format';
4
+ import type { ComponentProps } from 'react';
5
+ import type { InputType } from '.';
6
+ import type { NumericFormat } from 'react-number-format';
7
7
 
8
8
  type InputElementProps = Omit<
9
9
  React.ComponentProps<'input'>,
@@ -13,8 +13,8 @@ import {
13
13
  UNSELECTED_ICON,
14
14
  UNSELECTED_TEXT,
15
15
  } from './navbarItem.classes';
16
- import { Badge, BadgeType } from '../../atoms';
17
- import { NavbarItemProps } from './NavbarItem';
16
+ import { Badge, BadgeType } from '@/components/atoms';
17
+ import type { NavbarItemProps } from './NavbarItem';
18
18
 
19
19
  export function NavbarItemHorizontal({
20
20
  icon,
@@ -9,8 +9,8 @@ import {
9
9
  UNSELECTED_ICON,
10
10
  UNSELECTED_TEXT,
11
11
  } from './navbarItem.classes';
12
- import { Badge, BadgeType } from '../../atoms';
13
- import { NavbarItemProps } from './NavbarItem';
12
+ import { Badge, BadgeType } from '@/components/atoms';
13
+ import type { NavbarItemProps } from './NavbarItem';
14
14
 
15
15
  export function NavbarItemVertical({
16
16
  icon,
@@ -4,7 +4,8 @@
4
4
  import { useEffect, useRef, useState } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { Loader, Search as SearchIcon } from '@iota/apps-ui-icons';
7
- import { Divider, SearchBarType } from '@/components';
7
+ import { Divider } from '@/components/atoms';
8
+ import { SearchBarType } from './search.enums';
8
9
  import {
9
10
  BACKGROUND_COLORS,
10
11
  SUGGESTIONS_WRAPPER_STYLE,
@@ -43,10 +44,6 @@ export interface SearchProps {
43
44
  * Are the suggestions loading.
44
45
  */
45
46
  isLoading: boolean;
46
- /**
47
- * Callback when a key is pressed.
48
- */
49
- onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
50
47
  /**
51
48
  * The type of the search bar. Can be 'outlined' or 'filled'.
52
49
  */
@@ -64,7 +61,6 @@ export function Search({
64
61
  onSuggestionClick,
65
62
  placeholder,
66
63
  isLoading = false,
67
- onKeyDown,
68
64
  type = SearchBarType.Outlined,
69
65
  renderSuggestion,
70
66
  }: SearchProps): React.JSX.Element {
@@ -157,9 +153,6 @@ export function Search({
157
153
  }
158
154
  }
159
155
  }
160
- if (onKeyDown) {
161
- onKeyDown(event);
162
- }
163
156
  };
164
157
 
165
158
  return (
@@ -1,11 +1,11 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PropsWithChildren } from 'react';
4
+ import type { PropsWithChildren } from 'react';
5
5
  import { BACKGROUND_COLORS, OUTLINED_BORDER } from './segmentedButton.classes';
6
6
  import cx from 'classnames';
7
7
  import { SegmentedButtonType } from './segmentedButton.enums';
8
- import { ButtonSegmentType } from '../../atoms';
8
+ import { ButtonSegmentType } from '@/components/atoms';
9
9
 
10
10
  interface SegmentedButtonProps {
11
11
  /**
@@ -5,10 +5,9 @@ import { TriangleDown } from '@iota/apps-ui-icons';
5
5
  import cx from 'classnames';
6
6
  import { forwardRef, useEffect, useState } from 'react';
7
7
  import { Dropdown } from '../dropdown/Dropdown';
8
- import { SecondaryText } from '../../atoms/secondary-text';
8
+ import { SecondaryText } from '@/components/atoms/secondary-text';
9
9
  import { InputWrapper, LabelHtmlTag } from '../input/InputWrapper';
10
- import { ButtonUnstyled } from '../../atoms/button';
11
- import { ListItem } from '../../atoms';
10
+ import { ListItem, ButtonUnstyled } from '@/components/atoms';
12
11
  import { DropdownPosition } from '../dropdown';
13
12
  import { SelectSize } from './select.enums';
14
13
 
@@ -1,8 +1,8 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { PropsWithChildren } from 'react';
3
+ import type { PropsWithChildren } from 'react';
4
4
  import cx from 'classnames';
5
- import { Placeholder } from '../../atoms';
5
+ import { Placeholder } from '@/components/atoms';
6
6
 
7
7
  interface TableCellBaseProps {
8
8
  /**
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { SortByDown, SortByUp } from '@iota/apps-ui-icons';
5
5
  import cx from 'classnames';
6
- import { Checkbox } from '@/lib';
6
+ import { Checkbox } from '@/components/atoms/checkbox';
7
7
  import { TableHeaderCellSortOrder } from './tableHeaderCell.enums';
8
8
 
9
9
  export interface TableHeaderCellProps {
@@ -1,7 +1,8 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Tooltip, TooltipPosition } from '../../atoms';
4
+ import type { TooltipPosition } from '@/components/atoms';
5
+ import { Tooltip } from '@/components/atoms';
5
6
  import { Info } from '@iota/apps-ui-icons';
6
7
  import { TitleSize } from './titleSize.enums';
7
8
  import cx from 'classnames';
@@ -1,10 +1,10 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PropsWithChildren } from 'react';
4
+ import type { PropsWithChildren } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { ArrowDown } from '@iota/apps-ui-icons';
7
- import { Button, ButtonType } from '@/lib';
7
+ import { Button, ButtonType } from '@/components/atoms';
8
8
  import { ICON_STYLE } from './accordion.classes';
9
9
 
10
10
  export interface AccordionHeaderProps {
@@ -9,7 +9,26 @@ import { Close } from '@iota/apps-ui-icons';
9
9
  import { useEffect, useState } from 'react';
10
10
  import { DialogPosition } from './dialog.enums';
11
11
 
12
- const Dialog = RadixDialog.Root;
12
+ const Dialog = ({
13
+ open,
14
+ onOpenChange,
15
+ children,
16
+ ...props
17
+ }: React.ComponentPropsWithoutRef<typeof RadixDialog.Root>) => {
18
+ const handleOpenChange = (isOpen: boolean) => {
19
+ const isMouseOverToast = document.querySelector('.toast-layer:hover');
20
+ if (!isOpen && isMouseOverToast) {
21
+ return;
22
+ }
23
+ onOpenChange?.(isOpen);
24
+ };
25
+
26
+ return (
27
+ <RadixDialog.Root open={open} onOpenChange={handleOpenChange} {...props}>
28
+ {children}
29
+ </RadixDialog.Root>
30
+ );
31
+ };
13
32
  const DialogTrigger = RadixDialog.Trigger;
14
33
  const DialogClose = RadixDialog.Close;
15
34
 
@@ -3,7 +3,8 @@
3
3
 
4
4
  import cx from 'classnames';
5
5
  import { IotaLogoMark, MenuIcon } from '@iota/apps-ui-icons';
6
- import { NavbarItem, NavbarItemProps } from '@/components/molecules/navbar-item/NavbarItem';
6
+ import type { NavbarItemProps } from '@/components/molecules/navbar-item/NavbarItem';
7
+ import { NavbarItem } from '@/components/molecules/navbar-item/NavbarItem';
7
8
 
8
9
  export type NavbarItemWithId = NavbarItemProps & { id: string };
9
10
 
@@ -3,8 +3,9 @@
3
3
 
4
4
  import { ArrowBack } from '@iota/apps-ui-icons';
5
5
  import cx from 'classnames';
6
- import { Button, ButtonType, NavbarItem, NavbarItemType } from '@/components';
7
- import { NavbarProps } from './Navbar';
6
+ import { Button, ButtonType } from '@/components/atoms';
7
+ import { NavbarItem, NavbarItemType } from '@/components/molecules';
8
+ import type { NavbarProps } from './Navbar';
8
9
 
9
10
  export function NavbarSlideout({
10
11
  items,
@@ -1,18 +1,12 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { PropsWithChildren, ReactNode } from 'react';
4
+ import type { PropsWithChildren, ReactNode } from 'react';
5
5
  import cx from 'classnames';
6
6
  import { TableProvider, useTableContext } from './TableContext';
7
- import {
8
- Button,
9
- ButtonProps,
10
- ButtonSize,
11
- ButtonType,
12
- Checkbox,
13
- TableCellBase,
14
- TableHeaderCell,
15
- } from '@/lib';
7
+ import type { ButtonProps } from '@/components/atoms';
8
+ import { Button, ButtonSize, ButtonType, Checkbox } from '@/components/atoms';
9
+ import { TableCellBase, TableHeaderCell } from '@/components/molecules';
16
10
  import { ArrowLeft, DoubleArrowLeft, ArrowRight, DoubleArrowRight } from '@iota/apps-ui-icons';
17
11
 
18
12
  export interface TablePaginationOptions {
@@ -1,7 +1,8 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { createContext, PropsWithChildren, useContext } from 'react';
4
+ import type { PropsWithChildren } from 'react';
5
+ import { createContext, useContext } from 'react';
5
6
 
6
7
  export interface TableProviderProps {
7
8
  /**
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Config } from 'tailwindcss';
4
+ import type { Config } from 'tailwindcss';
5
5
  import { IOTA_PRIMITIVES_COLOR_PALETTE, SHADER_COLOR_PALETTE } from '../constants/colors.constants';
6
6
  import {
7
7
  CUSTOM_FONT_SIZES,
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ThemeConfig } from 'tailwindcss/types/config';
4
+ import type { ThemeConfig } from 'tailwindcss/types/config';
5
5
 
6
6
  type TailwindFontSize = ThemeConfig['fontSize'];
7
7