@iota/apps-ui-kit 0.10.0 → 0.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iota/apps-ui-kit",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "sideEffects": false,
5
5
  "repository": "https://github.com/iotaledger/ts-packages",
6
6
  "license": "Apache-2.0",
@@ -12,9 +12,9 @@
12
12
  ],
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.es.js",
16
- "require": "./dist/index.umd.js",
17
- "types": "./dist/index.d.ts"
17
+ "require": "./dist/index.umd.js"
18
18
  },
19
19
  "./styles": "./dist/style.css"
20
20
  },
@@ -34,14 +34,12 @@
34
34
  "react-dom": "^18 || ^19"
35
35
  },
36
36
  "devDependencies": {
37
- "@chromatic-com/storybook": "^1.6.0",
38
- "@storybook/addon-essentials": "^7.1.0",
39
- "@storybook/addon-interactions": "^7.1.0",
40
- "@storybook/addon-links": "^7.1.0",
41
- "@storybook/addon-themes": "^7.6.20",
42
- "@storybook/blocks": "^7.1.0",
43
- "@storybook/react": "^7.1.0",
44
- "@storybook/react-vite": "^7.1.0",
37
+ "@chromatic-com/storybook": "^5.1.2",
38
+ "@storybook/addon-a11y": "^10.3.6",
39
+ "@storybook/addon-docs": "^10.3.6",
40
+ "@storybook/addon-themes": "^10.3.6",
41
+ "@storybook/react": "^10.3.6",
42
+ "@storybook/react-vite": "^10.3.6",
45
43
  "@types/lodash.merge": "^4.6.9",
46
44
  "@types/node": "^24.0.0",
47
45
  "@types/react": "^18.3.3",
@@ -53,13 +51,11 @@
53
51
  "postcss": "^8.4.31",
54
52
  "react": "^18.3.1",
55
53
  "react-dom": "^18.3.1",
56
- "storybook": "^7.1.0",
57
- "storybook-dark-mode": "^4.0.2",
54
+ "storybook": "^10.3.6",
58
55
  "tailwindcss": "^3.3.3",
59
56
  "typescript": "^5.5.3",
60
57
  "vite": "^8.0.1",
61
- "vite-plugin-dts": "^4.5.4",
62
- "vite-tsconfig-paths": "^6.1.1"
58
+ "vite-plugin-dts": "^4.5.4"
63
59
  },
64
60
  "scripts": {
65
61
  "prettier:check": "prettier -c --ignore-unknown --ignore-path=../../.prettierignore --ignore-path=.prettierignore .",
@@ -41,7 +41,9 @@ export function InfoBox({
41
41
  return (
42
42
  <div
43
43
  className={cx('flex flex-row items-start gap-4 py-xs pr-lg', backgroundClass, {
44
- 'rounded-lg pl-xs': style === InfoBoxStyle.Elevated,
44
+ 'rounded-lg': style === InfoBoxStyle.Elevated,
45
+ 'pl-xs': style === InfoBoxStyle.Elevated && !!icon,
46
+ 'pl-lg': style === InfoBoxStyle.Elevated && !icon,
45
47
  })}
46
48
  >
47
49
  {icon && (
@@ -14,6 +14,10 @@ interface KeyValueProps {
14
14
  * The key of the KeyValue.
15
15
  */
16
16
  keyText: string;
17
+ /**
18
+ * An icon shown next to the key text (optional).
19
+ */
20
+ keyIcon?: ReactNode;
17
21
  /**
18
22
  * The value of the KeyValue.
19
23
  */
@@ -29,7 +33,7 @@ interface KeyValueProps {
29
33
  /**
30
34
  * The supporting label of the KeyValue (optional).
31
35
  */
32
- supportingLabel?: string;
36
+ supportingLabel?: string | ReactNode;
33
37
  /**
34
38
  * The size of the value (optional).
35
39
  */
@@ -66,6 +70,7 @@ interface KeyValueProps {
66
70
 
67
71
  export function KeyValueInfo({
68
72
  keyText,
73
+ keyIcon,
69
74
  value,
70
75
  tooltipPosition,
71
76
  tooltipText,
@@ -102,7 +107,7 @@ export function KeyValueInfo({
102
107
  'flex w-full items-baseline gap-xs py-xxs font-inter',
103
108
  flexDirectionClass,
104
109
  {
105
- 'justify-between': fullwidth,
110
+ 'flex-wrap justify-between': fullwidth,
106
111
  },
107
112
  )}
108
113
  >
@@ -111,7 +116,10 @@ export function KeyValueInfo({
111
116
  'w-1/4': !fullwidth,
112
117
  })}
113
118
  >
114
- <span className="key-value-key-text-color text-body-md">{keyText}</span>
119
+ {keyIcon}
120
+ <span className="key-value-key-text-color break-normal text-body-md">
121
+ {keyText}
122
+ </span>
115
123
  {tooltipText && (
116
124
  <Tooltip text={tooltipText} position={tooltipPosition}>
117
125
  <Info className="key-supporting-text-color" />
@@ -119,15 +127,16 @@ export function KeyValueInfo({
119
127
  )}
120
128
  </div>
121
129
  <div
122
- className={cx('flex flex-row items-baseline gap-1 break-all', {
130
+ className={cx('flex min-w-0 flex-row items-baseline gap-1 break-all', {
123
131
  'w-3/4': !fullwidth,
132
+ 'flex-wrap': fullwidth,
124
133
  truncate: isTruncated,
125
134
  })}
126
135
  >
127
136
  <span
128
137
  title={valueHoverTitle}
129
138
  className={cx(
130
- 'key-value-hover-text-color',
139
+ 'key-value-hover-text-color min-w-0',
131
140
  size === ValueSize.Medium ? 'text-body-lg' : 'text-body-md',
132
141
  { truncate: isTruncated },
133
142
  )}
@@ -7,7 +7,7 @@ import { Button, ButtonSize, ButtonType } from '@/components/atoms/button';
7
7
 
8
8
  export type CardActionProps = {
9
9
  title?: string;
10
- subtitle?: string;
10
+ subtitle?: string | React.ReactNode;
11
11
  type: CardActionType;
12
12
  onClick?: () => void;
13
13
  icon?: React.ReactNode;
@@ -39,7 +39,7 @@ export function CardBody({
39
39
  })}
40
40
  >
41
41
  <div
42
- className={cx('card-body-title-color font-inter text-title-md', {
42
+ className={cx('card-body-title-color text-start font-inter text-title-md', {
43
43
  truncate: isTextTruncated,
44
44
  })}
45
45
  >
@@ -61,7 +61,7 @@ export function CardBody({
61
61
  </div>
62
62
  {subtitle && (
63
63
  <div
64
- className={cx('card-body-subtitle-color font-inter text-body-md', {
64
+ className={cx('card-body-subtitle-color text-start font-inter text-body-md', {
65
65
  truncate: isTextTruncated,
66
66
  })}
67
67
  >
@@ -60,6 +60,8 @@ export interface TableHeaderCellProps extends React.AriaAttributes {
60
60
  export function TableHeaderCell({
61
61
  label,
62
62
  columnKey,
63
+ actionLeft,
64
+ actionRight,
63
65
  hasSort,
64
66
  hasCheckbox,
65
67
  isChecked,
@@ -136,15 +138,19 @@ export function TableHeaderCell({
136
138
  onCheckedChange={onCheckboxChange}
137
139
  />
138
140
  ) : (
139
- <span
140
- className={cx({
141
- 'text-left': !isContentCentered,
142
- })}
143
- >
144
- {label}
145
- </span>
141
+ <>
142
+ {actionLeft}
143
+ <span
144
+ className={cx({
145
+ 'text-left': !isContentCentered,
146
+ })}
147
+ >
148
+ {label}
149
+ </span>
150
+ </>
146
151
  )}
147
152
  {sortElement}
153
+ {actionRight}
148
154
  </div>
149
155
  </th>
150
156
  );
@@ -1,4 +1,4 @@
1
- import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
1
+ import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs/blocks';
2
2
  import {
3
3
  IOTA_PRIMITIVES_COLOR_PALETTE,
4
4
  IOTA_NAMES_COLOR_PALETTE,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Meta, Title, IconGallery, IconItem } from '@storybook/blocks';
2
+ import { Meta, Title, IconGallery, IconItem } from '@storybook/addon-docs/blocks';
3
3
  import * as Icons from '@iota/apps-ui-icons';
4
4
  import { DocsSyncTheme } from '../components';
5
5
 
@@ -1,4 +1,4 @@
1
- import { Meta, Typeset, Unstyled } from '@storybook/blocks';
1
+ import { Meta, Typeset, Unstyled } from '@storybook/addon-docs/blocks';
2
2
  import { TYPESETS } from '../../constants';
3
3
  import { TypeSet, TypeSetItem } from '../../blocks';
4
4
  import { DocsSyncTheme } from '../components';
@@ -1,4 +1,4 @@
1
- import { Meta, Typeset, Unstyled } from '@storybook/blocks';
1
+ import { Meta, Typeset, Unstyled } from '@storybook/addon-docs/blocks';
2
2
  import { VariableSpacingShowcase, DocsSyncTheme } from '../components';
3
3
 
4
4
  <DocsSyncTheme />