@iota/apps-ui-kit 0.9.2 → 0.9.4

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 (39) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +34 -4
  3. package/dist/index.d.ts +24 -37
  4. package/dist/index.es.js +2553 -2465
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.umd.js +10 -10
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/style.css +1 -1
  9. package/package.json +3 -3
  10. package/src/lib/components/atoms/button/Button.tsx +4 -2
  11. package/src/lib/components/atoms/button-segment/ButtonSegment.tsx +4 -2
  12. package/src/lib/components/atoms/checkbox/Checkbox.tsx +3 -1
  13. package/src/lib/components/atoms/header/Header.tsx +2 -0
  14. package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +1 -1
  15. package/src/lib/components/atoms/list-item/ListItem.tsx +3 -1
  16. package/src/lib/components/atoms/radio-button/RadioButton.tsx +3 -1
  17. package/src/lib/components/atoms/snackbar/Snackbar.tsx +4 -4
  18. package/src/lib/components/atoms/toggle/Toggle.tsx +4 -1
  19. package/src/lib/components/atoms/toggle/toggle.classes.ts +3 -3
  20. package/src/lib/components/molecules/account/Account.tsx +6 -46
  21. package/src/lib/components/molecules/address/Address.tsx +5 -4
  22. package/src/lib/components/molecules/card/Card.tsx +6 -2
  23. package/src/lib/components/molecules/chip/Chip.tsx +11 -5
  24. package/src/lib/components/molecules/display-stats/DisplayStats.tsx +1 -1
  25. package/src/lib/components/molecules/input/Input.tsx +2 -0
  26. package/src/lib/components/molecules/navbar-item/NavbarItem.tsx +1 -1
  27. package/src/lib/components/molecules/navbar-item/NavbarItemHorizontal.tsx +3 -0
  28. package/src/lib/components/molecules/navbar-item/NavbarItemVertical.tsx +3 -0
  29. package/src/lib/components/molecules/search/Search.tsx +11 -1
  30. package/src/lib/components/molecules/select/Select.tsx +32 -24
  31. package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +12 -1
  32. package/src/lib/components/molecules/visual-asset-card/VisualAssetCard.tsx +2 -1
  33. package/src/lib/components/organisms/accordion/Accordion.tsx +2 -0
  34. package/src/lib/components/organisms/dialog/Dialog.tsx +10 -3
  35. package/src/lib/components/organisms/navbar/Navbar.tsx +2 -0
  36. package/src/lib/components/organisms/navbar/NavbarSlideout.tsx +1 -0
  37. package/src/lib/components/organisms/table/Table.tsx +7 -0
  38. package/src/lib/tailwind/base.presets.ts +42 -0
  39. package/src/storybook/stories/molecules/Account.stories.tsx +2 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @iota/apps-ui-kit
2
2
 
3
+ ## 0.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 4a5ec26: Always show Copy and explorer buttons in Address component.
8
+ - adea573: Enable declarationMap in TS packages
9
+ - 8ec6dd5: Extend support for aria props
10
+ - caf344f: Animations for dialog and Select.
11
+ - Updated dependencies [adea573]
12
+ - Updated dependencies [0142ab5]
13
+ - @iota/apps-ui-icons@0.7.4
14
+
15
+ ## 0.9.3
16
+
17
+ ### Patch Changes
18
+
19
+ - 67cba64: improve Address component to allow onOpen prop
20
+ - 54c7803: Update @types/node to v24.
21
+ - 0528d86: add data testId to Account component
22
+ - 10ee721: Increase Dialog height
23
+ - fc9eba3: Add "isDisabled" to TableRowCheckbox
24
+ - 205e35d: improve button segment for mobile devices
25
+ - 10ee721: remove lock action from account component
26
+ - 5613ae1: Correct Toggle's right spacing when enabled
27
+ - b294bf5: add proper readme
28
+ - Updated dependencies [bb33d49]
29
+ - @iota/apps-ui-icons@0.7.3
30
+
3
31
  ## 0.9.2
4
32
 
5
33
  ### Patch Changes
package/README.md CHANGED
@@ -1,15 +1,45 @@
1
- # `@iota/apps-ui-kit`
1
+ # @iota/apps-ui-kit
2
2
 
3
- ## Usage
3
+ A UI kit library for building consistent IOTA applications.
4
4
 
5
- Installation:
5
+ ## Installation
6
+
7
+ Install the package using your preferred package manager:
6
8
 
7
9
  ```bash
8
10
  # Replace with npm, yarn, bun, etc.
9
11
  pnpm install @iota/apps-ui-kit
10
12
  ```
11
13
 
12
- Importing:
14
+ ## Configuration
15
+
16
+ 1. Import the UI Kit global styles in your app global CSS file (e.g., `src/index.css` or `src/global.css`):
17
+
18
+ ```css
19
+ @import '@iota/apps-ui-kit/styles';
20
+
21
+ @tailwind base;
22
+ @tailwind components;
23
+ @tailwind utilities;
24
+ ```
25
+
26
+ 2. Configure your Tailwind CSS setup to include the UI Kit styles. Update your `tailwind.config.ts` file:
27
+
28
+ ```js
29
+ import { uiKitResponsivePreset } from '@iota/apps-ui-kit';
30
+ import type { Config } from 'tailwindcss';
31
+
32
+ export default {
33
+ presets: [uiKitResponsivePreset],
34
+ content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
35
+ darkMode: 'class', // configure as needed ('selector' or 'class')
36
+ theme: {
37
+ extend: {},
38
+ },
39
+ } satisfies Partial<Config>;
40
+ ```
41
+
42
+ 3. Use components from the UI kit in your application:
13
43
 
14
44
  ```typescript
15
45
  import { Button } from '@iota/apps-ui-kit';
package/dist/index.d.ts CHANGED
@@ -59,7 +59,7 @@ export declare interface AccordionHeaderProps {
59
59
  hideBorder?: boolean;
60
60
  }
61
61
 
62
- export declare function Account({ title, subtitle, badgeType, badgeText, isLocked, avatarContent, onOptionsClick, onLockAccountClick, onUnlockAccountClick, onCopy, copyText, onOpen, isCopyable, isExternal, isSelected, isActive, showSelected, badgeTooltipText, badgeTooltipPosition, }: AccountProps): React.JSX.Element;
62
+ export declare function Account({ title, subtitle, badgeType, badgeText, avatarContent, onOptionsClick, onCopy, copyText, onOpen, isCopyable, isExternal, isSelected, isActive, showSelected, badgeTooltipText, badgeTooltipPosition, }: AccountProps): React.JSX.Element;
63
63
 
64
64
  declare interface AccountProps {
65
65
  /**
@@ -70,28 +70,14 @@ declare interface AccountProps {
70
70
  * The subtitle of the account.
71
71
  */
72
72
  subtitle: string;
73
- /**
74
- * Whether the account is unlocked.
75
- */
76
- isLocked?: boolean;
77
73
  /**
78
74
  * Handler for more options click.
79
75
  */
80
76
  onOptionsClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
81
- /**
82
- * Handler for the lock account icon click.
83
- */
84
- onLockAccountClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
85
- /**
86
- * Handle for the unlock account icon click.
87
- */
88
- onUnlockAccountClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
89
77
  /**
90
78
  * Function to render avatar content.
91
79
  */
92
- avatarContent: ({ isLocked }: {
93
- isLocked?: boolean;
94
- }) => React.JSX.Element;
80
+ avatarContent: () => React.JSX.Element;
95
81
  /**
96
82
  * The onCopy event of the Address (optional).
97
83
  */
@@ -277,7 +263,7 @@ declare type ButtonPickedProps = Pick<ButtonProps, 'htmlType' | 'testId'>;
277
263
 
278
264
  export declare function ButtonPill({ htmlType, children, tabIndex, ...buttonProps }: Omit<ButtonVariantProps, 'className'>): JSX_2.Element;
279
265
 
280
- export declare interface ButtonProps {
266
+ export declare interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
281
267
  /**
282
268
  * The size of the button.
283
269
  */
@@ -324,9 +310,9 @@ export declare interface ButtonProps {
324
310
  testId?: string;
325
311
  }
326
312
 
327
- export declare function ButtonSegment({ icon, label, selected, disabled, onClick, type, isNested, }: ButtonSegmentProps): React.JSX.Element;
313
+ export declare function ButtonSegment({ icon, label, selected, disabled, onClick, type, isNested, ...ariaProps }: ButtonSegmentProps): React.JSX.Element;
328
314
 
329
- declare interface ButtonSegmentProps {
315
+ declare interface ButtonSegmentProps extends React.AriaAttributes {
330
316
  /**
331
317
  * The label of the button.
332
318
  */
@@ -381,7 +367,7 @@ declare interface ButtonVariantProps extends ButtonPickedProps, PropsFromButtonE
381
367
  children: React.ReactNode;
382
368
  }
383
369
 
384
- export declare function Card({ isDisabled, type, isHoverable, onClick, children, testId, }: CardProps): JSX_2.Element;
370
+ export declare function Card({ isDisabled, type, isHoverable, onClick, children, testId, ...ariaProps }: CardProps): JSX_2.Element;
385
371
 
386
372
  export declare function CardAction({ type, onClick, subtitle, title, icon, iconAfterText, buttonType, buttonDisabled, }: CardActionProps): JSX_2.Element | null;
387
373
 
@@ -423,7 +409,7 @@ export declare interface CardImageProps {
423
409
  children?: React.ReactNode;
424
410
  }
425
411
 
426
- export declare interface CardProps {
412
+ export declare interface CardProps extends React.AriaAttributes {
427
413
  /**
428
414
  * If `true`, the card will be disabled.
429
415
  */
@@ -459,7 +445,7 @@ export declare enum CardType {
459
445
 
460
446
  export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
461
447
 
462
- declare interface CheckboxProps {
448
+ declare interface CheckboxProps extends React.AriaAttributes {
463
449
  /**
464
450
  * The label of the checkbox.
465
451
  */
@@ -490,9 +476,9 @@ declare interface CheckboxProps {
490
476
  name?: string;
491
477
  }
492
478
 
493
- export declare function Chip({ label, type, selected, showClose, onClose, onClick, avatar, leadingElement, trailingElement, disabled, size, }: ChipProps): JSX_2.Element;
479
+ export declare function Chip({ label, type, selected, showClose, onClose, onClick, avatar, leadingElement, trailingElement, disabled, size, ...ariaProps }: ChipProps): JSX_2.Element;
494
480
 
495
- declare interface ChipProps {
481
+ declare interface ChipProps extends React.AriaAttributes {
496
482
  /**
497
483
  * The label of the chip
498
484
  */
@@ -1089,9 +1075,9 @@ export declare enum LabelTextSize {
1089
1075
  Large = "large"
1090
1076
  }
1091
1077
 
1092
- export declare function ListItem({ showRightIcon, hideBottomBorder, onClick, isDisabled, children, isHighlighted, }: PropsWithChildren<ListItemProps>): React.JSX.Element;
1078
+ export declare function ListItem({ showRightIcon, hideBottomBorder, onClick, isDisabled, children, isHighlighted, ...ariaProps }: PropsWithChildren<ListItemProps>): React.JSX.Element;
1093
1079
 
1094
- export declare interface ListItemProps {
1080
+ export declare interface ListItemProps extends React.AriaAttributes {
1095
1081
  /**
1096
1082
  * Has right icon (optional).
1097
1083
  */
@@ -1141,7 +1127,7 @@ export declare function Navbar({ items, activeId, onClickItem, isCollapsible, on
1141
1127
 
1142
1128
  export declare function NavbarItem(props: NavbarItemProps): React.JSX.Element;
1143
1129
 
1144
- export declare interface NavbarItemProps {
1130
+ export declare interface NavbarItemProps extends React.AriaAttributes {
1145
1131
  /**
1146
1132
  * The type of the navbar item.
1147
1133
  */
@@ -1250,9 +1236,9 @@ declare interface PlaceholderProps {
1250
1236
 
1251
1237
  declare type PropsFromButtonElement = Omit<React.HTMLProps<HTMLButtonElement>, 'type'>;
1252
1238
 
1253
- export declare function RadioButton({ id, name, label, supportingLabel, body, isChecked, isDisabled, onChange, }: RadioButtonProps): React.JSX.Element;
1239
+ export declare function RadioButton({ id, name, label, supportingLabel, body, isChecked, isDisabled, onChange, ...ariaProps }: RadioButtonProps): React.JSX.Element;
1254
1240
 
1255
- declare interface RadioButtonProps {
1241
+ declare interface RadioButtonProps extends React.AriaAttributes {
1256
1242
  /**
1257
1243
  * The id of the radio button.
1258
1244
  */
@@ -1301,14 +1287,14 @@ export declare enum ScreenSize {
1301
1287
  Xl = "xl"
1302
1288
  }
1303
1289
 
1304
- export declare function Search({ searchValue, suggestions, onSearchValueChange, onSuggestionClick, placeholder, isLoading, type, renderSuggestion, }: SearchProps): React.JSX.Element;
1290
+ export declare function Search({ searchValue, suggestions, onSearchValueChange, onSuggestionClick, placeholder, isLoading, type, renderSuggestion, ...ariaProps }: SearchProps): React.JSX.Element;
1305
1291
 
1306
1292
  export declare enum SearchBarType {
1307
1293
  Outlined = "outlined",
1308
1294
  Filled = "filled"
1309
1295
  }
1310
1296
 
1311
- export declare interface SearchProps {
1297
+ export declare interface SearchProps extends React.AriaAttributes {
1312
1298
  /**
1313
1299
  * The value of the search input.
1314
1300
  */
@@ -1385,7 +1371,7 @@ export declare type SelectOption = string | {
1385
1371
  label: React.ReactNode;
1386
1372
  };
1387
1373
 
1388
- declare interface SelectProps extends Pick<React.HTMLProps<HTMLSelectElement>, 'disabled'> {
1374
+ declare interface SelectProps extends Pick<React.HTMLProps<HTMLSelectElement>, 'disabled'>, React.AriaAttributes {
1389
1375
  /**
1390
1376
  * The selected option value.
1391
1377
  */
@@ -1579,9 +1565,9 @@ export declare interface TableCellTextProps {
1579
1565
 
1580
1566
  export declare function TableHeader({ children }: PropsWithChildren): JSX.Element;
1581
1567
 
1582
- export declare function TableHeaderCell({ label, columnKey, hasSort, hasCheckbox, isChecked, isIndeterminate, isContentCentered, onSortClick, onCheckboxChange, sortOrder, }: TableHeaderCellProps): JSX.Element;
1568
+ export declare function TableHeaderCell({ label, columnKey, hasSort, hasCheckbox, isChecked, isIndeterminate, isContentCentered, onSortClick, onCheckboxChange, sortOrder, ...ariaProps }: TableHeaderCellProps): JSX.Element;
1583
1569
 
1584
- export declare interface TableHeaderCellProps {
1570
+ export declare interface TableHeaderCellProps extends React.AriaAttributes {
1585
1571
  /**
1586
1572
  * The column key.
1587
1573
  */
@@ -1713,11 +1699,12 @@ export declare function TableRow({ children, leading, }: PropsWithChildren<{
1713
1699
  leading?: React.ReactNode;
1714
1700
  }>): JSX.Element;
1715
1701
 
1716
- export declare function TableRowCheckbox({ rowIndex, onCheckboxChange, }: TableRowCheckboxProps): React.JSX.Element;
1702
+ export declare function TableRowCheckbox({ rowIndex, onCheckboxChange, isDisabled, }: TableRowCheckboxProps): React.JSX.Element;
1717
1703
 
1718
1704
  export declare interface TableRowCheckboxProps {
1719
1705
  rowIndex: number;
1720
1706
  onCheckboxChange: (checked: boolean) => void;
1707
+ isDisabled?: boolean;
1721
1708
  }
1722
1709
 
1723
1710
  export declare const TextArea: ForwardRefExoticComponent<TextFieldBaseProps & RefAttributes<HTMLTextAreaElement>>;
@@ -1804,7 +1791,7 @@ export declare enum ToggleLabelPosition {
1804
1791
  Right = "right"
1805
1792
  }
1806
1793
 
1807
- declare interface ToggleProps {
1794
+ declare interface ToggleProps extends React.AriaAttributes {
1808
1795
  /**
1809
1796
  * The label for the toggle.
1810
1797
  */
@@ -1890,7 +1877,7 @@ export declare interface VideoProps {
1890
1877
  disableControls?: boolean;
1891
1878
  }
1892
1879
 
1893
- declare interface VisualAssetBaseProps {
1880
+ declare interface VisualAssetBaseProps extends React.AriaAttributes {
1894
1881
  /**
1895
1882
  * The onClick event for the icon.
1896
1883
  */