@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
@@ -0,0 +1,53 @@
1
+ @layer utilities {
2
+ .state-layer,
3
+ .state-layer-inverted,
4
+ .state-active {
5
+ &::after {
6
+ content: '';
7
+ border-radius: inherit;
8
+ @apply absolute;
9
+ @apply h-full w-full;
10
+ @apply left-0 top-0;
11
+ @apply transition-opacity duration-75;
12
+ @apply pointer-events-none;
13
+ }
14
+ }
15
+
16
+ .state-layer,
17
+ .state-layer-inverted {
18
+ &::after {
19
+ @apply opacity-0;
20
+ }
21
+
22
+ &:hover::after {
23
+ @apply opacity-8;
24
+ }
25
+
26
+ &:active::after {
27
+ @apply opacity-12;
28
+ }
29
+
30
+ &:disabled::after {
31
+ @apply opacity-0;
32
+ }
33
+ }
34
+
35
+ .state-active,
36
+ .state-layer {
37
+ &::after {
38
+ @apply bg-iota-primary-60;
39
+ }
40
+ }
41
+
42
+ .state-layer-inverted {
43
+ &::after {
44
+ @apply bg-iota-primary-80;
45
+ }
46
+ }
47
+
48
+ .state-active {
49
+ &::after {
50
+ @apply opacity-12;
51
+ }
52
+ }
53
+ }
@@ -2,20 +2,26 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import type { Config } from 'tailwindcss';
5
- import { IOTA_PRIMITIVES_COLOR_PALETTE, SHADER_COLOR_PALETTE } from '../constants/colors.constants';
6
5
  import {
7
- CUSTOM_FONT_SIZES,
6
+ IOTA_PRIMITIVES_COLOR_PALETTE,
7
+ IOTA_NAMES_COLOR_PALETTE,
8
+ SHADER_COLOR_PALETTE,
9
+ } from '../constants/colors.constants';
10
+ import {
8
11
  BORDER_RADIUS,
12
+ CUSTOM_FONT_SIZES,
9
13
  CUSTOM_SPACING,
14
+ FONT_FAMILIES,
10
15
  OPACITY,
11
16
  generateVariableSpacing,
12
17
  } from './constants';
13
- import { firefoxPlugin } from './plugins';
18
+ import { THEMED_CUSTOM_COLORS } from './constants/customColors.constants';
19
+ import { firefoxPlugin, namesVariant } from './plugins';
14
20
 
15
21
  export const BASE_CONFIG: Config = {
16
22
  content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
17
- darkMode: 'class',
18
- plugins: [firefoxPlugin],
23
+ darkMode: 'selector',
24
+ plugins: [firefoxPlugin, namesVariant],
19
25
  theme: {
20
26
  extend: {
21
27
  fontSize: {
@@ -38,12 +44,11 @@ export const BASE_CONFIG: Config = {
38
44
  },
39
45
  colors: {
40
46
  ...IOTA_PRIMITIVES_COLOR_PALETTE,
47
+ ...IOTA_NAMES_COLOR_PALETTE,
41
48
  ...SHADER_COLOR_PALETTE,
49
+ ...THEMED_CUSTOM_COLORS,
42
50
  },
43
- fontFamily: {
44
- 'alliance-no2': ['AllianceNo2', 'sans-serif'],
45
- inter: ['Inter', 'sans-serif'],
46
- },
51
+ fontFamily: FONT_FAMILIES,
47
52
  },
48
53
  },
49
54
  };
@@ -0,0 +1,13 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const THEMED_CUSTOM_COLORS = {
5
+ 'default-surface': 'var(--default-surface)',
6
+ 'on-default': 'var(--on-default)',
7
+ 'warning-surface': 'var(--warning-surface)',
8
+ 'on-warning': 'var(--on-warning)',
9
+ 'error-surface': 'var(--error-surface)',
10
+ 'on-error': 'var(--on-error)',
11
+ 'success-surface': 'var(--success-surface)',
12
+ 'on-success': 'var(--on-success)',
13
+ } as const;
@@ -0,0 +1,8 @@
1
+ // Copyright (c) 2025 IOTA Stiftung
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const FONT_FAMILIES: Record<string, string[]> = {
5
+ inter: ['Inter', 'sans-serif'],
6
+ 'alliance-no2': ['AllianceNo2', 'sans-serif'],
7
+ 'roboto-flex': ['Roboto Flex Variable', 'sans-serif'],
8
+ } as const;
@@ -136,24 +136,24 @@ export const TEXT_HEADLINE_CLASSES: TailwindCustomFonts = {
136
136
  '24px',
137
137
  {
138
138
  lineHeight: '120%',
139
+ fontWeight: 'var(--headline-sm-font-weight)',
139
140
  letterSpacing: '-0.2px',
140
- fontWeight: 500,
141
141
  },
142
142
  ],
143
143
  'text-headline-md': [
144
144
  '28px',
145
145
  {
146
146
  lineHeight: '120%',
147
+ fontWeight: 'var(--headline-md-font-weight)',
147
148
  letterSpacing: '-0.4px',
148
- fontWeight: 500,
149
149
  },
150
150
  ],
151
151
  'text-headline-lg': [
152
152
  '32px',
153
153
  {
154
154
  lineHeight: '120%',
155
+ fontWeight: 'var(--headline-lg-font-weight)',
155
156
  letterSpacing: '-0.4px',
156
- fontWeight: 500,
157
157
  },
158
158
  ],
159
159
  };
@@ -162,22 +162,22 @@ export const TEXT_DISPLAY_CLASSES: TailwindCustomFonts = {
162
162
  'text-display-sm': [
163
163
  '36px',
164
164
  {
165
- lineHeight: '120%',
166
- fontWeight: 500,
165
+ lineHeight: 'var(--display-sm-line-height)',
166
+ fontWeight: 'var(--display-sm-font-weight)',
167
167
  },
168
168
  ],
169
169
  'text-display-md': [
170
170
  '48px',
171
171
  {
172
- lineHeight: '120%',
173
- fontWeight: 500,
172
+ lineHeight: 'var(--display-md-line-height)',
173
+ fontWeight: 'var(--display-md-font-weight)',
174
174
  },
175
175
  ],
176
176
  'text-display-lg': [
177
177
  '60px',
178
178
  {
179
- lineHeight: '120%',
180
- fontWeight: 500,
179
+ lineHeight: 'var(--display-lg-line-height)',
180
+ fontWeight: 'var(--display-lg-font-weight)',
181
181
  },
182
182
  ],
183
183
  };
@@ -4,3 +4,4 @@
4
4
  export * from './scaling.constants';
5
5
  export * from './fontSizes.constants';
6
6
  export * from './variableSpacing.constants';
7
+ export * from './fontFamily.constants';
@@ -6,3 +6,7 @@ import plugin from 'tailwindcss/plugin';
6
6
  export const firefoxPlugin = plugin(({ addVariant }) => {
7
7
  addVariant('firefox', '@-moz-document url-prefix()');
8
8
  });
9
+
10
+ export const namesVariant = plugin(({ addVariant }) => {
11
+ addVariant('names', '&:is(.names *)');
12
+ });
@@ -9,9 +9,9 @@ interface ShowcaseProps {
9
9
  export function Showcase({ children, title }: ShowcaseProps) {
10
10
  return (
11
11
  <div className="flex flex-col gap-2">
12
- <code className="inline w-fit rounded-md bg-neutral-96 px-xxs">{title}</code>
12
+ <code className="inline w-fit rounded-md bg-iota-neutral-96 px-xxs">{title}</code>
13
13
  <div className="flex">
14
- <div className="flex flex-row items-center justify-center rounded-xl border border-neutral-70 p-md">
14
+ <div className="flex flex-row items-center justify-center rounded-xl border border-iota-neutral-70 p-md">
15
15
  {children}
16
16
  </div>
17
17
  </div>
@@ -44,7 +44,7 @@ export function TypeSetItem({ sampleText, sizeText, fontClass }: TypeSetItemProp
44
44
  return (
45
45
  <div className="flex flex-row items-start gap-x-md">
46
46
  {styles && (
47
- <div className="text-xs text-neutral-60">
47
+ <div className="text-xs text-iota-neutral-60">
48
48
  {styles[FontStyleProperties.FontSize]}
49
49
  </div>
50
50
  )}
@@ -59,9 +59,9 @@ export function TypeSetItem({ sampleText, sizeText, fontClass }: TypeSetItemProp
59
59
  .map(([key, value], index) => (
60
60
  <Fragment key={index}>
61
61
  {index > 0 && (
62
- <span className="text-xs text-neutral-60">|</span>
62
+ <span className="text-xs text-iota-neutral-60">|</span>
63
63
  )}
64
- <span className="text-xs text-neutral-60">
64
+ <span className="text-xs text-iota-neutral-60">
65
65
  {key}: {value}
66
66
  </span>
67
67
  </Fragment>
@@ -17,7 +17,7 @@ export const SkeletonCard: Story = {
17
17
  render: () => (
18
18
  <Card>
19
19
  <CardImage shape={ImageShape.SquareRounded}>
20
- <div className="h-10 w-10 animate-pulse bg-neutral-90 dark:bg-neutral-12" />
20
+ <div className="h-10 w-10 animate-pulse bg-iota-neutral-90 names:bg-names-neutral-12 dark:bg-iota-neutral-12" />
21
21
  <Skeleton widthClass="w-10" heightClass="h-10" isRounded={false} />
22
22
  </CardImage>
23
23
  <div className="flex flex-col gap-y-xs">
@@ -12,7 +12,9 @@ const meta: Meta<typeof Tooltip> = {
12
12
  return (
13
13
  <div className="flex h-20 items-center p-sm">
14
14
  <Tooltip {...props}>
15
- <span className="text-neutral-10 dark:text-neutral-92">Hover me</span>
15
+ <span className="text-iota-neutral-10 names:text-names-neutral-92 dark:text-names-neutral-92">
16
+ Hover me
17
+ </span>
16
18
  </Tooltip>
17
19
  </div>
18
20
  );
@@ -50,7 +52,7 @@ export const WithIcon: Story = {
50
52
  render: (props) => {
51
53
  return (
52
54
  <Tooltip {...props}>
53
- <Info className="text-neutral-10 dark:text-neutral-92" />
55
+ <Info className="text-iota-neutral-10 names:text-names-neutral-92 dark:text-names-neutral-92" />
54
56
  </Tooltip>
55
57
  );
56
58
  },
@@ -22,7 +22,8 @@ type Story = StoryObj<typeof meta>;
22
22
 
23
23
  export const Default: Story = {
24
24
  args: {
25
- assetSrc: 'https://d315pvdvxi2gex.cloudfront.net/528399e23c1bb7b14cced0b89.png',
25
+ assetType: VisualAssetType.Image,
26
+ src: 'https://d315pvdvxi2gex.cloudfront.net/528399e23c1bb7b14cced0b89.png',
26
27
  altText: 'IOTA Logo',
27
28
  onIconClick: () => {
28
29
  console.log('Icon clicked');
@@ -33,7 +34,7 @@ export const Default: Story = {
33
34
  assetTitle: 'IOTA Logo',
34
35
  },
35
36
  argTypes: {
36
- assetSrc: {
37
+ src: {
37
38
  control: 'text',
38
39
  },
39
40
  altText: {
@@ -8,7 +8,7 @@ import { VARIABLE_GAP_CLASSES, VARIABLE_PADDING_CLASSES } from '@/storybook/cons
8
8
  export function VariableSpacingShowcase() {
9
9
  return (
10
10
  <div className="flex flex-col gap-10">
11
- <p className="text-headline-sm text-neutral-10">
11
+ <p className="text-headline-sm text-iota-neutral-10">
12
12
  The variable spacing changes based on the screen size.
13
13
  </p>
14
14
 
@@ -39,7 +39,7 @@ export function VariableSpacingShowcase() {
39
39
  function DocumentedBlock({ title, children }: React.PropsWithChildren<{ title: string }>) {
40
40
  return (
41
41
  <div className="flex flex-col gap-y-4">
42
- <h2 className="text-headline-md text-neutral-10">{title}</h2>
42
+ <h2 className="text-headline-md text-iota-neutral-10">{title}</h2>
43
43
  <div className="flex flex-row flex-wrap gap-10">{children}</div>
44
44
  </div>
45
45
  );
@@ -1,6 +1,7 @@
1
1
  import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
2
2
  import {
3
3
  IOTA_PRIMITIVES_COLOR_PALETTE,
4
+ IOTA_NAMES_COLOR_PALETTE,
4
5
  SHADER_COLOR_PALETTE,
5
6
  } from '../../../lib/constants/colors.constants';
6
7
 
@@ -14,6 +15,14 @@ import {
14
15
  })}
15
16
  </ColorPalette>
16
17
 
18
+ ## Names
19
+
20
+ <ColorPalette>
21
+ {Object.entries(IOTA_NAMES_COLOR_PALETTE).map(([color, values]) => {
22
+ return <ColorItem key={color} title={color} colors={values} />;
23
+ })}
24
+ </ColorPalette>
25
+
17
26
  ## Shaders
18
27
 
19
28
  <ColorPalette>
@@ -22,7 +22,9 @@ export default meta;
22
22
  type Story = StoryObj<typeof meta>;
23
23
 
24
24
  const Avatar = ({ isLocked }: { isLocked?: boolean }) => {
25
- const circleFillClass = isLocked ? 'fill-neutral-80 dark:fill-neutral-30' : 'fill-primary-30';
25
+ const circleFillClass = isLocked
26
+ ? 'fill-iota-neutral-80 dark:fill-iota-neutral-30 names:fill-names-neutral-30'
27
+ : 'fill-iota-primary-30';
26
28
  return (
27
29
  <svg
28
30
  xmlns="http://www.w3.org/2000/svg"
@@ -49,10 +49,10 @@ const meta: Meta<typeof Search> = {
49
49
  suggestion.supportingText ? 'justify-between' : 'justify-start',
50
50
  )}
51
51
  >
52
- <span className="text-body-lg text-neutral-10 dark:text-neutral-92">
52
+ <span className="text-body-lg text-iota-neutral-10 names:text-names-neutral-92 dark:text-iota-neutral-92">
53
53
  {suggestion.label}
54
54
  </span>
55
- <span className="text-body-md text-neutral-40 dark:text-neutral-60">
55
+ <span className="text-body-md text-iota-neutral-40 names:text-names-neutral-60 dark:text-iota-neutral-60">
56
56
  {suggestion.supportingText}
57
57
  </span>
58
58
  </div>
@@ -38,7 +38,7 @@ const Avatar = () => {
38
38
  viewBox="0 0 33 32"
39
39
  fill="none"
40
40
  >
41
- <circle cx="16.5" cy="16" r="16" className="fill-primary-40" />
41
+ <circle cx="16.5" cy="16" r="16" className="fill-iota-primary-40" />
42
42
  </svg>
43
43
  );
44
44
  };
@@ -71,7 +71,7 @@ export const Default: Story = {
71
71
  isVisibilityToggleEnabled
72
72
  {...storyProps}
73
73
  />
74
- <div className="flex w-full justify-end">
74
+ <div className="flex w-full justify-end pt-2">
75
75
  <Button onClick={() => onSubmit()} text="Submit" />
76
76
  </div>
77
77
  </div>