@iota/apps-ui-kit 0.6.0 → 0.7.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.
Files changed (96) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.d.ts +177 -18
  3. package/dist/index.es.js +3319 -6032
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +28 -160
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/style.css +1 -1
  8. package/package.json +10 -4
  9. package/src/lib/components/atoms/badge/badge.classes.ts +18 -18
  10. package/src/lib/components/atoms/badge/badge.enums.ts +1 -1
  11. package/src/lib/components/atoms/button/button-variants/ButtonPill.tsx +1 -1
  12. package/src/lib/components/atoms/button/button.classes.ts +12 -12
  13. package/src/lib/components/atoms/button-segment/buttonSegment.classes.ts +15 -36
  14. package/src/lib/components/atoms/checkbox/Checkbox.tsx +20 -9
  15. package/src/lib/components/atoms/divider/divider.classes.ts +1 -1
  16. package/src/lib/components/atoms/header/Header.tsx +1 -1
  17. package/src/lib/components/atoms/image/Image.tsx +32 -0
  18. package/src/lib/components/atoms/image/index.ts +4 -0
  19. package/src/lib/components/atoms/index.ts +3 -1
  20. package/src/lib/components/atoms/info-box/InfoBox.tsx +2 -8
  21. package/src/lib/components/atoms/info-box/infoBox.classes.ts +8 -9
  22. package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +5 -5
  23. package/src/lib/components/atoms/label-text/LabelText.tsx +4 -6
  24. package/src/lib/components/atoms/list-item/ListItem.tsx +3 -4
  25. package/src/lib/components/atoms/loading-indicator/LoadingIndicator.tsx +1 -1
  26. package/src/lib/components/atoms/media-fallback/MediaFallback.tsx +12 -0
  27. package/src/lib/components/atoms/media-fallback/index.ts +4 -0
  28. package/src/lib/components/atoms/panel/Panel.tsx +2 -4
  29. package/src/lib/components/atoms/radio-button/RadioButton.tsx +4 -8
  30. package/src/lib/components/atoms/secondary-text/SecondaryText.tsx +3 -2
  31. package/src/lib/components/atoms/skeleton/Skeleton.tsx +1 -3
  32. package/src/lib/components/atoms/snackbar/snackbar.classes.ts +8 -8
  33. package/src/lib/components/atoms/toggle/toggle.classes.ts +6 -6
  34. package/src/lib/components/atoms/tooltip/Tooltip.tsx +3 -2
  35. package/src/lib/components/atoms/video/Video.tsx +33 -0
  36. package/src/lib/components/atoms/video/index.ts +4 -0
  37. package/src/lib/components/atoms/video/video.constants.ts +31 -0
  38. package/src/lib/components/molecules/account/Account.tsx +4 -4
  39. package/src/lib/components/molecules/address/Address.tsx +1 -1
  40. package/src/lib/components/molecules/asset-media-renderer/AssetMediaRenderer.tsx +50 -0
  41. package/src/lib/components/molecules/asset-media-renderer/index.ts +4 -0
  42. package/src/lib/components/molecules/card/CardAction.tsx +3 -5
  43. package/src/lib/components/molecules/card/CardBody.tsx +3 -2
  44. package/src/lib/components/molecules/card/card.classes.ts +3 -3
  45. package/src/lib/components/molecules/chip/Chip.tsx +9 -2
  46. package/src/lib/components/molecules/chip/chip.classes.ts +5 -5
  47. package/src/lib/components/molecules/chip/chip.enums.ts +5 -0
  48. package/src/lib/components/molecules/chip/index.ts +1 -0
  49. package/src/lib/components/molecules/display-stats/DisplayStats.tsx +2 -2
  50. package/src/lib/components/molecules/display-stats/displayStats.classes.ts +6 -6
  51. package/src/lib/components/molecules/dropdown/Dropdown.tsx +1 -1
  52. package/src/lib/components/molecules/index.ts +2 -0
  53. package/src/lib/components/molecules/input/Input.tsx +3 -5
  54. package/src/lib/components/molecules/input/InputWrapper.tsx +1 -1
  55. package/src/lib/components/molecules/input/TextArea.tsx +2 -5
  56. package/src/lib/components/molecules/input/input.classes.ts +7 -8
  57. package/src/lib/components/molecules/navbar-item/navbarItem.classes.ts +4 -4
  58. package/src/lib/components/molecules/search/Search.tsx +10 -7
  59. package/src/lib/components/molecules/search/search.classes.ts +5 -5
  60. package/src/lib/components/molecules/segmented-button/segmentedButton.classes.ts +2 -2
  61. package/src/lib/components/molecules/select/Select.tsx +6 -13
  62. package/src/lib/components/molecules/table-cell/TableCell.tsx +2 -2
  63. package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +2 -2
  64. package/src/lib/components/molecules/title/Title.tsx +3 -3
  65. package/src/lib/components/{atoms → molecules}/visual-asset-card/VisualAssetCard.tsx +26 -40
  66. package/src/lib/components/organisms/accordion/Accordion.tsx +2 -3
  67. package/src/lib/components/organisms/accordion/accordion.classes.ts +1 -1
  68. package/src/lib/components/organisms/dialog/Dialog.tsx +4 -4
  69. package/src/lib/components/organisms/navbar/Navbar.tsx +2 -2
  70. package/src/lib/components/organisms/navbar/NavbarSlideout.tsx +1 -1
  71. package/src/lib/components/organisms/table/Table.tsx +2 -2
  72. package/src/lib/constants/colors.constants.ts +107 -8
  73. package/src/lib/styles/base.css +97 -0
  74. package/src/lib/styles/components.css +687 -0
  75. package/src/lib/styles/fonts.css +2 -0
  76. package/src/lib/styles/index.css +754 -136
  77. package/src/lib/styles/utilities.css +53 -0
  78. package/src/lib/tailwind/base.presets.ts +14 -9
  79. package/src/lib/tailwind/constants/customColors.constants.ts +13 -0
  80. package/src/lib/tailwind/constants/fontFamily.constants.ts +8 -0
  81. package/src/lib/tailwind/constants/fontSizes.constants.ts +9 -9
  82. package/src/lib/tailwind/constants/index.ts +1 -0
  83. package/src/lib/tailwind/plugins.ts +4 -0
  84. package/src/storybook/blocks/Showcase.tsx +2 -2
  85. package/src/storybook/blocks/TypeSetItem.tsx +3 -3
  86. package/src/storybook/stories/atoms/Skeleton.stories.tsx +1 -1
  87. package/src/storybook/stories/atoms/Tooltip.stories.tsx +4 -2
  88. package/src/storybook/stories/atoms/VisualAssetCard.stories.tsx +3 -2
  89. package/src/storybook/stories/components/VariableSpacingShowcase.tsx +2 -2
  90. package/src/storybook/stories/design-tokens/colors.stories.mdx +9 -0
  91. package/src/storybook/stories/molecules/Account.stories.tsx +3 -1
  92. package/src/storybook/stories/molecules/Search.stories.tsx +2 -2
  93. package/src/storybook/stories/molecules/TableCell.stories.tsx +1 -1
  94. package/src/storybook/stories/molecules/TextArea.stories.tsx +1 -1
  95. /package/src/lib/components/{atoms → molecules}/visual-asset-card/index.ts +0 -0
  96. /package/src/lib/components/{atoms → molecules}/visual-asset-card/visualAssetCard.enums.ts +0 -0
@@ -6,9 +6,9 @@ import { ToggleSize } from './toggle.enums';
6
6
  export const TOGGLE = 'relative inline-flex items-center p-xxs border rounded-full cursor-pointer';
7
7
 
8
8
  export const TOGGLE_STATES = {
9
- active: 'bg-primary-30 border-primary-30',
10
- inactive: 'bg-primary-100 dark:bg-neutral-6 border-neutral-70 dark:border-neutral-40',
11
- disabledActive: 'bg-neutral-70 border-neutral-70',
9
+ active: 'toggle-bg-active toggle-border-active',
10
+ inactive: 'toggle-bg-inactive toggle-border-inactive',
11
+ disabledActive: 'toggle-bg-disabled-active toggle-border-disabled-active',
12
12
  disabled: 'opacity-40 cursor-not-allowed',
13
13
  };
14
14
 
@@ -29,8 +29,8 @@ export const TOGGLE_THUMB_POSITION = {
29
29
  },
30
30
  };
31
31
  export const TOGGLE_THUMB_COLOR = {
32
- unchecked: 'bg-neutral-60',
33
- checked: 'bg-white',
32
+ unchecked: 'toggle-thumb-color',
33
+ checked: 'toggle-thumb-color-checked',
34
34
  };
35
35
  export const TOGGLE_THUMB_SIZE = {
36
36
  [ToggleSize.Small]: 'h-3 w-3',
@@ -38,4 +38,4 @@ export const TOGGLE_THUMB_SIZE = {
38
38
  };
39
39
 
40
40
  export const TOGGLE_CONTAINER = 'inline-flex items-center gap-2';
41
- export const TOGGLE_LABEL = 'text-label-lg text-neutral-40 dark:text-neutral-60';
41
+ export const TOGGLE_LABEL = 'text-label-lg toggle-label-color';
@@ -97,8 +97,9 @@ export function Tooltip({
97
97
  };
98
98
  }, [visible]);
99
99
 
100
- const base =
101
- 'z-[999] w-max rounded bg-neutral-80 p-xs text-neutral-10 dark:bg-neutral-30 dark:text-neutral-92';
100
+ // z-[9999999999]: needed because we must exceed the popup’s ≈2 147 483 647 z-index;
101
+ // otherwise the tooltip renders but stays invisible inside a Chrome extension
102
+ const base = 'z-[9999999999] w-max rounded p-xs tooltip-bg tooltip-text-color';
102
103
 
103
104
  return (
104
105
  <>
@@ -0,0 +1,33 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { forwardRef } from 'react';
5
+ import { VIDEO_AUTOPLAY_FLAGS, VIDEO_AUTOPLAY_FLAGS_NO_CONTROLS } from './video.constants';
6
+
7
+ export interface VideoProps {
8
+ /**
9
+ * Whether the video should autoplay.
10
+ */
11
+ isAutoPlayEnabled?: boolean;
12
+ /**
13
+ * If the video controls should be disabled.
14
+ */
15
+ disableControls?: boolean;
16
+ }
17
+
18
+ export const Video = forwardRef<
19
+ HTMLVideoElement,
20
+ React.ComponentPropsWithoutRef<'video'> & VideoProps
21
+ >(({ width = '100%', height = 'auto', isAutoPlayEnabled, disableControls, ...props }, ref) => {
22
+ const videoProps = isAutoPlayEnabled
23
+ ? disableControls
24
+ ? VIDEO_AUTOPLAY_FLAGS_NO_CONTROLS
25
+ : VIDEO_AUTOPLAY_FLAGS
26
+ : { preload: 'metadata', autoPlay: false };
27
+
28
+ return (
29
+ <video ref={ref} width={width} height={height} {...videoProps} {...props}>
30
+ Your browser does not support the video tag.
31
+ </video>
32
+ );
33
+ });
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export * from './Video';
@@ -0,0 +1,31 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const VIDEO_AUTOPLAY_FLAGS: Partial<
5
+ Omit<React.VideoHTMLAttributes<HTMLVideoElement>, 'src'>
6
+ > = {
7
+ autoPlay: true,
8
+ muted: true,
9
+ playsInline: true,
10
+ controls: true,
11
+ controlsList: 'nodownload',
12
+ disablePictureInPicture: true,
13
+ preload: 'auto',
14
+ loop: true,
15
+ width: '100%',
16
+ height: 'auto',
17
+ };
18
+
19
+ export const VIDEO_AUTOPLAY_FLAGS_NO_CONTROLS: Partial<
20
+ Omit<React.VideoHTMLAttributes<HTMLVideoElement>, 'src'>
21
+ > = {
22
+ autoPlay: true,
23
+ muted: true,
24
+ playsInline: true,
25
+ controls: false,
26
+ disablePictureInPicture: true,
27
+ preload: 'auto',
28
+ loop: true,
29
+ width: '100%',
30
+ height: 'auto',
31
+ };
@@ -129,7 +129,7 @@ export function Account({
129
129
  <Avatar isLocked={isLocked} />
130
130
  <div className="flex flex-col items-start py-xs">
131
131
  <div className="flex items-center space-x-2">
132
- <span className="font-inter text-title-md text-neutral-10 dark:text-neutral-92">
132
+ <span className="account-title-color font-inter text-title-md">
133
133
  {title}
134
134
  </span>
135
135
  {badgeText && badgeType ? (
@@ -153,7 +153,7 @@ export function Account({
153
153
  </div>
154
154
  </div>
155
155
  <div className="z-10 ml-auto flex items-center space-x-2 [&_button]:h-5 [&_button]:w-5 [&_svg]:h-5 [&_svg]:w-5">
156
- <div className="flex items-center space-x-2 [&_button:not(.locked)]:hidden group-hover:[&_button:not(.locked)]:flex [&_svg]:text-neutral-40 [&_svg]:dark:text-neutral-60">
156
+ <div className="account-icon-color flex items-center space-x-2 [&_button:not(.locked)]:hidden group-hover:[&_button:not(.locked)]:flex">
157
157
  {onOptionsClick && (
158
158
  <ButtonUnstyled onClick={onOptionsClick}>
159
159
  <MoreHoriz />
@@ -180,9 +180,9 @@ export function Account({
180
180
  {showSelected && (
181
181
  <ButtonUnstyled>
182
182
  {isSelected ? (
183
- <CheckmarkFilled className="h-5 w-5 text-primary-30 dark:text-primary-80" />
183
+ <CheckmarkFilled className="account-check-active-color h-5 w-5" />
184
184
  ) : (
185
- <RadioOff className="h-5 w-5 text-neutral-40 dark:text-neutral-60" />
185
+ <RadioOff className="account-check-inactive-color h-5 w-5" />
186
186
  )}
187
187
  </ButtonUnstyled>
188
188
  )}
@@ -78,7 +78,7 @@ export function Address({
78
78
  }
79
79
 
80
80
  return (
81
- <div className="group flex flex-row items-center gap-1 text-neutral-40 dark:text-neutral-60">
81
+ <div className="address-text-color group flex flex-row items-center gap-1">
82
82
  <span className={cx('font-inter text-body-sm')}>{text}</span>
83
83
  {isCopyable && (
84
84
  <ButtonUnstyled
@@ -0,0 +1,50 @@
1
+ // Copyright (c) 2024 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { VisualAssetType } from '../visual-asset-card/visualAssetCard.enums';
5
+ import { Video, ImageWithFallback, Image } from '../../atoms';
6
+ import type { VideoProps } from '../../atoms';
7
+
8
+ export interface AssetMediaRendererProps extends VideoProps {
9
+ /**
10
+ * The source of the media to be displayed.
11
+ */
12
+ src: string;
13
+ /**
14
+ * The type of the asset to be displayed.
15
+ */
16
+ assetType: VisualAssetType;
17
+ /**
18
+ * Alt text for the image..
19
+ */
20
+ altText?: string;
21
+ /**
22
+ * Whether to show a fallback image if the main image fails to load.
23
+ */
24
+ showFallback?: boolean;
25
+ }
26
+
27
+ export function AssetMediaRenderer({
28
+ src,
29
+ isAutoPlayEnabled,
30
+ assetType,
31
+ altText: alt,
32
+ showFallback,
33
+ disableControls,
34
+ }: AssetMediaRendererProps): React.JSX.Element {
35
+ if (assetType === VisualAssetType.Video) {
36
+ return (
37
+ <Video
38
+ src={src}
39
+ isAutoPlayEnabled={isAutoPlayEnabled}
40
+ disableControls={disableControls}
41
+ />
42
+ );
43
+ }
44
+
45
+ if (showFallback) {
46
+ return <ImageWithFallback src={src} alt={alt} />;
47
+ }
48
+
49
+ return <Image src={src} alt={alt} />;
50
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export * from './AssetMediaRenderer';
@@ -37,7 +37,7 @@ export function CardAction({
37
37
  return (
38
38
  <div
39
39
  onClick={handleActionClick}
40
- className="shrink-0 text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5"
40
+ className="card-action-link-color shrink-0 [&_svg]:h-5 [&_svg]:w-5"
41
41
  >
42
42
  {icon ? icon : <ArrowRight />}
43
43
  </div>
@@ -48,12 +48,10 @@ export function CardAction({
48
48
  return (
49
49
  <div className="shrink-0 text-right">
50
50
  {title && (
51
- <div className="font-inter text-label-md text-neutral-10 dark:text-neutral-92">
52
- {title}
53
- </div>
51
+ <div className="card-action-title-color font-inter text-label-md">{title}</div>
54
52
  )}
55
53
  {subtitle && (
56
- <div className="font-inter text-label-sm text-neutral-60 dark:text-neutral-40">
54
+ <div className="card-action-subtitle-color font-inter text-label-sm">
57
55
  {subtitle}
58
56
  </div>
59
57
  )}
@@ -39,12 +39,13 @@ export function CardBody({
39
39
  })}
40
40
  >
41
41
  <div
42
- className={cx('font-inter text-title-md text-neutral-10 dark:text-neutral-92', {
42
+ className={cx('card-body-title-color font-inter text-title-md', {
43
43
  truncate: isTextTruncated,
44
44
  })}
45
45
  >
46
46
  {title}
47
47
  </div>
48
+
48
49
  {tooltipText ? (
49
50
  <Tooltip text={tooltipText} position={tooltipPosition}>
50
51
  {icon}
@@ -60,7 +61,7 @@ export function CardBody({
60
61
  </div>
61
62
  {subtitle && (
62
63
  <div
63
- className={cx('font-inter text-body-md text-neutral-40 dark:text-neutral-60', {
64
+ className={cx('card-body-subtitle-color font-inter text-body-md', {
64
65
  truncate: isTextTruncated,
65
66
  })}
66
67
  >
@@ -14,8 +14,8 @@ export const IMAGE_VARIANT_CLASSES: { [key in ImageShape]: string } = {
14
14
 
15
15
  export const IMAGE_BG_CLASSES: { [key in ImageType]: string } = {
16
16
  [ImageType.Placeholder]: '',
17
- [ImageType.BgSolid]: 'bg-neutral-96 dark:bg-neutral-10',
18
- [ImageType.BgWhite]: 'bg-white dark:bg-neutral-6',
17
+ [ImageType.BgSolid]: 'card-image-bg-solid',
18
+ [ImageType.BgWhite]: 'card-image-bg-white',
19
19
  [ImageType.BgTransparent]: '',
20
20
  };
21
21
 
@@ -23,5 +23,5 @@ export const CARD_TYPE_CLASSES: Record<CardType, string> = {
23
23
  [CardType.Default]: 'border border-transparent',
24
24
  [CardType.Outlined]:
25
25
  'border border-shader-neutral-light-8 dark:border-shader-primary-dark-8 p-xs',
26
- [CardType.Filled]: 'border border-transparent bg-neutral-96 dark:bg-neutral-10 p-xs',
26
+ [CardType.Filled]: 'border border-transparent card-filled-bg p-xs',
27
27
  };
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import cx from 'classnames';
5
- import { ChipState } from './chip.enums';
5
+ import { ChipSize, ChipState } from './chip.enums';
6
6
  import {
7
7
  BORDER_CLASSES,
8
8
  BACKGROUND_CLASSES,
@@ -51,6 +51,10 @@ interface ChipProps {
51
51
  * The button is disabled or not.
52
52
  */
53
53
  disabled?: boolean;
54
+ /**
55
+ * The size of the chip.
56
+ */
57
+ size?: ChipSize;
54
58
  }
55
59
 
56
60
  export function Chip({
@@ -63,6 +67,7 @@ export function Chip({
63
67
  leadingElement,
64
68
  trailingElement,
65
69
  disabled,
70
+ size = ChipSize.Default,
66
71
  }: ChipProps) {
67
72
  const chipState = selected ? ChipState.Selected : ChipState.Default;
68
73
  return (
@@ -89,7 +94,9 @@ export function Chip({
89
94
  )}
90
95
  >
91
96
  {avatar ?? leadingElement}
92
- <span className="text-body-md">{label}</span>
97
+ <span className={cx(size === ChipSize.Small ? 'text-label-md' : 'text-body-md')}>
98
+ {label}
99
+ </span>
93
100
  {trailingElement}
94
101
  {showClose && (
95
102
  <ButtonUnstyled
@@ -7,7 +7,7 @@ export const ROUNDED_CLASS = 'rounded-full';
7
7
 
8
8
  export const BACKGROUND_CLASSES: Record<ChipState, string> = {
9
9
  [ChipState.Default]: 'bg-transparent',
10
- [ChipState.Selected]: 'bg-primary-90 dark:bg-primary-10',
10
+ [ChipState.Selected]: 'chip-bg-selected',
11
11
  };
12
12
 
13
13
  const STATE_LAYER_OUTLINE =
@@ -19,14 +19,14 @@ const STATE_LAYER_BG_CLASSES =
19
19
  export const STATE_LAYER_CLASSES = `${STATE_LAYER_OUTLINE} ${STATE_LAYER_BG_CLASSES}`;
20
20
 
21
21
  export const BORDER_CLASSES: Record<ChipState, string> = {
22
- [ChipState.Default]: 'border-neutral-70 dark:border-neutral-40',
22
+ [ChipState.Default]: 'chip-border-default',
23
23
  [ChipState.Selected]: 'border-transparent',
24
24
  };
25
25
 
26
26
  export const TEXT_COLOR: Record<ChipState, string> = {
27
- [ChipState.Default]: 'text-neutral-40 dark:text-neutral-60',
28
- [ChipState.Selected]: 'text-neutral-10 dark:text-neutral-92',
27
+ [ChipState.Default]: 'chip-text-default',
28
+ [ChipState.Selected]: 'chip-text-selected',
29
29
  };
30
30
 
31
31
  export const FOCUS_CLASSES =
32
- 'focus-visible:shadow-[0_0_0_2px] focus-visible:shadow-primary-30 focus-visible:outline-none dark:focus-visible:shadow-primary-80';
32
+ 'focus-visible:shadow-[0_0_0_2px] focus-visible:chip-focus-ring focus-visible:outline-none';
@@ -5,3 +5,8 @@ export enum ChipState {
5
5
  Default = 'default',
6
6
  Selected = 'selected',
7
7
  }
8
+
9
+ export enum ChipSize {
10
+ Small = 'small',
11
+ Default = 'default',
12
+ }
@@ -2,3 +2,4 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  export * from './Chip';
5
+ export * from './chip.enums';
@@ -120,7 +120,7 @@ export function DisplayStats({
120
120
  </Tooltip>
121
121
  )}
122
122
  </div>
123
- {icon && <span className="text-neutral-10 dark:text-neutral-92">{icon}</span>}
123
+ {icon && <span className="display-stats-icon-color">{icon}</span>}
124
124
  </div>
125
125
  <div className="flex w-full flex-row items-baseline gap-xxs">
126
126
  <span className={cx('break-all', valueClass)}>{value}</span>
@@ -132,7 +132,7 @@ export function DisplayStats({
132
132
  {copyText && (
133
133
  <div className="self-center">
134
134
  <ButtonUnstyled onClick={handleCopyClick}>
135
- <Copy className="text-neutral-60 dark:text-neutral-40" />
135
+ <Copy className="display-stats-copy-icon-color" />
136
136
  </ButtonUnstyled>
137
137
  </div>
138
138
  )}
@@ -4,15 +4,15 @@
4
4
  import { DisplayStatsType, DisplayStatsSize } from './displayStats.enums';
5
5
 
6
6
  export const BACKGROUND_CLASSES: Record<DisplayStatsType, string> = {
7
- [DisplayStatsType.Default]: 'bg-neutral-96 dark:bg-neutral-10',
8
- [DisplayStatsType.Highlight]: 'bg-primary-30 dark:bg-primary-80',
9
- [DisplayStatsType.Secondary]: 'bg-secondary-90 dark:bg-secondary-10',
7
+ [DisplayStatsType.Default]: 'display-stats-bg-default',
8
+ [DisplayStatsType.Highlight]: 'display-stats-bg-highlight',
9
+ [DisplayStatsType.Secondary]: 'display-stats-bg-secondary',
10
10
  };
11
11
 
12
12
  export const TEXT_CLASSES: Record<DisplayStatsType, string> = {
13
- [DisplayStatsType.Default]: 'text-neutral-10 dark:text-neutral-92',
14
- [DisplayStatsType.Highlight]: 'text-neutral-100 dark:text-primary-10',
15
- [DisplayStatsType.Secondary]: 'text-neutral-10 dark:text-neutral-92',
13
+ [DisplayStatsType.Default]: 'display-stats-text-default',
14
+ [DisplayStatsType.Highlight]: 'display-stats-text-highlight',
15
+ [DisplayStatsType.Secondary]: 'display-stats-text-secondary',
16
16
  };
17
17
 
18
18
  export const SIZE_CLASSES: Record<DisplayStatsSize, string> = {
@@ -3,7 +3,7 @@
3
3
 
4
4
  export function Dropdown({ children }: React.PropsWithChildren): React.JSX.Element {
5
5
  return (
6
- <ul className="list-none rounded-lg border border-neutral-80 bg-neutral-100 py-xs dark:border-neutral-20 dark:bg-neutral-6">
6
+ <ul className="dropdown-bg dropdown-border-color list-none rounded-lg border py-xs">
7
7
  {children}
8
8
  </ul>
9
9
  );
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  export * from './address';
5
+ export * from './asset-media-renderer';
5
6
  export * from './chip';
6
7
  export * from './segmented-button';
7
8
  export * from './title';
@@ -15,3 +16,4 @@ export * from './table-header-cell';
15
16
  export * from './search';
16
17
  export * from './card';
17
18
  export * from './display-stats';
19
+ export * from './visual-asset-card';
@@ -115,9 +115,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function InputComp
115
115
  onClick={focusOnInput}
116
116
  ref={inputWrapperRef}
117
117
  >
118
- {leadingIcon && (
119
- <span className="text-neutral-10 dark:text-neutral-92">{leadingIcon}</span>
120
- )}
118
+ {leadingIcon && <span className="input-icon-color">{leadingIcon}</span>}
121
119
  <InputElement
122
120
  {...inputProps}
123
121
  inputRef={forwardRef}
@@ -223,7 +221,7 @@ function InputTrailingElement({
223
221
  if (showClearInput) {
224
222
  return (
225
223
  <ButtonUnstyled
226
- className="text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5"
224
+ className="input-icon-color [&_svg]:h-5 [&_svg]:w-5"
227
225
  onClick={onClearInput}
228
226
  tabIndex={-1}
229
227
  >
@@ -234,7 +232,7 @@ function InputTrailingElement({
234
232
  return (
235
233
  <ButtonUnstyled
236
234
  onClick={onToggleButtonClick}
237
- className="text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5"
235
+ className="input-icon-color [&_svg]:h-5 [&_svg]:w-5"
238
236
  tabIndex={-1}
239
237
  >
240
238
  {isContentVisible ? <VisibilityOn /> : <VisibilityOff />}
@@ -74,7 +74,7 @@ export function InputWrapper({
74
74
  <div
75
75
  className={cx(
76
76
  'flex flex-row items-center',
77
- caption || errorMessage ? 'justify-between' : 'justify-end',
77
+ caption || errorMessage ? 'justify-between gap-md' : 'justify-end',
78
78
  )}
79
79
  >
80
80
  {(errorMessage || caption) && (
@@ -115,7 +115,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextFieldBaseProps>(func
115
115
  <span className="absolute bottom-4 right-4 flex">
116
116
  <ButtonUnstyled
117
117
  onClick={onToggleButtonClick}
118
- className="text-neutral-10 dark:text-neutral-92 [&_svg]:h-5 [&_svg]:w-5"
118
+ className="input-icon-color [&_svg]:h-5 [&_svg]:w-5"
119
119
  tabIndex={-1}
120
120
  >
121
121
  {isInputContentVisible ? <VisibilityOn /> : <VisibilityOff />}
@@ -139,10 +139,7 @@ function VisibilityOffBar({ rows, halfWidthRow }: VisibilityOffBarProps) {
139
139
  const isHalfWidth = halfWidthRow === index + 1;
140
140
  const width = isHalfWidth ? 'w-1/2' : 'w-full';
141
141
  return (
142
- <div
143
- key={index}
144
- className={`h-2.5 rounded bg-neutral-92/60 dark:bg-neutral-10/60 ${width}`}
145
- />
142
+ <div key={index} className={`input-visibility-bar h-2.5 rounded ${width}`} />
146
143
  );
147
144
  })}
148
145
  </>
@@ -2,13 +2,12 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  export const INPUT_CLASSES =
5
- 'w-full bg-transparent text-body-lg caret-primary-30 dark:caret-primary-80 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed';
6
- export const INPUT_TEXT_CLASSES = 'text-neutral-10 dark:text-neutral-92';
7
- export const INPUT_PLACEHOLDER_CLASSES =
8
- 'enabled:placeholder:text-neutral-40/40 dark:placeholder:text-neutral-60/40 enabled:dark:placeholder:text-neutral-60/40';
9
- export const BORDER_CLASSES =
10
- 'px-md py-sm rounded-lg border border-neutral-80 group-[.enabled]:cursor-text group-[.errored]:border-error-30 hover:group-[.enabled]:border-neutral-50 dark:border-neutral-20 dark:hover:border-neutral-60 dark:group-[.errored]:border-error-80 [&:has(input:focus)]:!border-primary-30 [&:has(input:focus)]:dark:!border-primary-80';
5
+ 'w-full input-caret-color bg-transparent text-body-lg caret-input-caret-color focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed';
6
+ export const INPUT_TEXT_CLASSES = 'input-text-color';
7
+ export const INPUT_PLACEHOLDER_CLASSES = 'input-placeholder-color';
11
8
  export const INPUT_NUMBER_CLASSES =
12
9
  '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none disabled:cursor-not-allowed';
13
- export const LABEL_CLASSES =
14
- 'flex flex-col gap-y-2 text-label-lg text-neutral-40 dark:text-neutral-60';
10
+ export const BORDER_CLASSES =
11
+ 'px-md py-sm rounded-lg border input-border-color input-border-color-disabled group-[.enabled]:cursor-text input-border-error-color hover:group-[.enabled]:input-border-color-hover input-border-color-focus';
12
+
13
+ export const LABEL_CLASSES = 'flex flex-col gap-y-2 text-label-lg input-label-color';
@@ -1,8 +1,8 @@
1
1
  // Copyright (c) 2024 IOTA Stiftung
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export const SELECTED_ICON = 'text-neutral-10 dark:text-neutral-92';
5
- export const UNSELECTED_ICON = 'text-neutral-40 dark:text-neutral-60';
4
+ export const SELECTED_ICON = 'navbar-item-icon-selected-color';
5
+ export const UNSELECTED_ICON = 'navbar-item-icon-color';
6
6
 
7
7
  export const PADDING_WITH_TEXT = 'py-xxs px-sm';
8
8
  export const PADDING_WITHOUT_TEXT = 'p-sm';
@@ -12,5 +12,5 @@ export const SELECTED_BACKGROUND = 'bg-shader-primary-light-12 dark:bg-shader-pr
12
12
  export const BADGE_WITH_TEXT = '-top-3 right-3';
13
13
  export const BADGE_WITHOUT_TEXT = '-top-1 right-3';
14
14
 
15
- export const SELECTED_TEXT = 'text-neutral-10 dark:text-neutral-92';
16
- export const UNSELECTED_TEXT = 'text-neutral-60 dark:text-neutral-40';
15
+ export const SELECTED_TEXT = 'navbar-item-label-selected-color';
16
+ export const UNSELECTED_TEXT = 'navbar-item-label-color';
@@ -116,7 +116,12 @@ export function Search({
116
116
  const showSuggestions = isSuggestionsVisible && suggestions && suggestions.length > 0;
117
117
 
118
118
  const roundedStyleWithSuggestions = showSuggestions
119
- ? 'rounded-t-3xl border-b border-b-transparent'
119
+ ? cx(
120
+ 'rounded-t-3xl border-b',
121
+ type === SearchBarType.Outlined
122
+ ? '[&:not(.dark_*,.names_*)]:border-b-transparent'
123
+ : 'border-b-transparent',
124
+ )
120
125
  : type === SearchBarType.Outlined
121
126
  ? 'rounded-3xl border-b'
122
127
  : 'rounded-full';
@@ -159,7 +164,7 @@ export function Search({
159
164
  <div className="relative w-full">
160
165
  <div
161
166
  className={cx(
162
- 'flex items-center overflow-hidden px-md py-sm text-neutral-10 dark:text-neutral-92 [&_svg]:h-6 [&_svg]:w-6',
167
+ 'search-text-color flex items-center overflow-hidden px-md py-sm [&_svg]:h-6 [&_svg]:w-6',
163
168
  roundedStyleWithSuggestions,
164
169
  searchTypeClass,
165
170
  )}
@@ -173,7 +178,7 @@ export function Search({
173
178
  onFocus={() => setIsSuggestionsVisible(true)}
174
179
  placeholder={placeholder}
175
180
  className={cx(
176
- 'w-full flex-1 outline-none placeholder:text-neutral-40 placeholder:dark:text-neutral-60',
181
+ 'search-placeholder-color w-full flex-1 outline-none',
177
182
  backgroundColorClass,
178
183
  )}
179
184
  />
@@ -183,7 +188,7 @@ export function Search({
183
188
  <div
184
189
  ref={suggestionsListRef}
185
190
  className={cx(
186
- 'absolute left-0 top-full flex w-full flex-col items-center overflow-hidden bg-neutral-100 dark:bg-neutral-10',
191
+ 'absolute left-0 top-full flex w-full flex-col items-center overflow-hidden',
187
192
  suggestionsStyle,
188
193
  )}
189
194
  >
@@ -200,9 +205,7 @@ export function Search({
200
205
  onMouseEnter={() => setSelectedIndex(index)}
201
206
  className={cx(
202
207
  'w-full cursor-pointer px-md py-sm',
203
- selectedIndex === index
204
- ? 'bg-shader-primary-dark-16 dark:bg-shader-inverted-dark-16'
205
- : '',
208
+ selectedIndex === index ? 'search-selected-index-bg-color' : '',
206
209
  )}
207
210
  >
208
211
  {renderSuggestion(suggestion, index)}
@@ -5,16 +5,16 @@ import { SearchBarType } from './search.enums';
5
5
 
6
6
  export const BACKGROUND_COLORS: Record<SearchBarType, string> = {
7
7
  [SearchBarType.Outlined]: 'bg-transparent',
8
- [SearchBarType.Filled]: 'bg-neutral-92 dark:bg-neutral-12',
8
+ [SearchBarType.Filled]: 'search-bg-color-filled',
9
9
  };
10
10
 
11
11
  export const SEARCH_WRAPPER_STYLE: Record<SearchBarType, string> = {
12
- [SearchBarType.Outlined]: 'border-l border-r border-t border-neutral-70 dark:border-neutral-40',
13
- [SearchBarType.Filled]: 'bg-neutral-92 dark:bg-neutral-12',
12
+ [SearchBarType.Outlined]: 'border-l border-r border-t search-border-color',
13
+ [SearchBarType.Filled]: 'search-bg-color-filled',
14
14
  };
15
15
 
16
16
  export const SUGGESTIONS_WRAPPER_STYLE: Record<SearchBarType, string> = {
17
17
  [SearchBarType.Outlined]:
18
- 'rounded-b-3xl border-b border-l border-r border-neutral-70 dark:border-neutral-40',
19
- [SearchBarType.Filled]: 'rounded-b-3xl bg-neutral-92 dark:bg-neutral-12',
18
+ 'rounded-b-3xl border-b border-l border-r search-border-color search-suggestion-bg-color',
19
+ [SearchBarType.Filled]: 'rounded-b-3xl search-bg-color-filled',
20
20
  };
@@ -5,8 +5,8 @@ import { SegmentedButtonType } from './segmentedButton.enums';
5
5
 
6
6
  export const BACKGROUND_COLORS: Record<SegmentedButtonType, string> = {
7
7
  [SegmentedButtonType.Outlined]: 'bg-transparent',
8
- [SegmentedButtonType.Filled]: 'bg-neutral-96 dark:bg-neutral-10',
8
+ [SegmentedButtonType.Filled]: 'segmented-filled-bg-color',
9
9
  [SegmentedButtonType.Transparent]: 'bg-transparent',
10
10
  };
11
11
 
12
- export const OUTLINED_BORDER = 'border border-neutral-70 dark:border-neutral-40';
12
+ export const OUTLINED_BORDER = 'border segmented-outlined-border';