@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @iota/apps-ui-kit
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9b4b517: support multi-theme
8
+ - 6fcddb3: Make react a peer dependency
9
+
10
+ ### Patch Changes
11
+
12
+ - b83d356: add chip size prop
13
+ - 01f03fb: Refactor components to improve reusability
14
+ - Updated dependencies [6fcddb3]
15
+ - @iota/apps-ui-icons@0.4.0
16
+
3
17
  ## 0.6.0
4
18
 
5
19
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -4,7 +4,9 @@ import { ButtonSegmentType as ButtonSegmentType_2 } from '../../../../components
4
4
  import { ButtonType as ButtonType_2 } from '../../../../components/atoms/button';
5
5
  import { ComponentProps } from 'react';
6
6
  import { Config } from 'tailwindcss';
7
+ import { DetailedHTMLProps } from 'react';
7
8
  import { ForwardRefExoticComponent } from 'react';
9
+ import { ImgHTMLAttributes } from 'react';
8
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
11
  import { NavbarItemProps as NavbarItemProps_2 } from '../../../../components/molecules/navbar-item/NavbarItem';
10
12
  import { NumericFormat } from 'react-number-format';
@@ -15,6 +17,7 @@ import { ReactNode } from 'react';
15
17
  import { RefAttributes } from 'react';
16
18
  import { TooltipPosition as TooltipPosition_2 } from '../../../../components/atoms';
17
19
  import { TooltipPosition as TooltipPosition_3 } from '../../../../components/atoms/tooltip';
20
+ import { VideoHTMLAttributes } from 'react';
18
21
 
19
22
  export declare function Accordion({ children, hideBorder, }: {
20
23
  children: React.ReactNode;
@@ -175,6 +178,27 @@ declare interface AddressProps {
175
178
  onOpen?: (e: React.MouseEvent<HTMLButtonElement>) => void;
176
179
  }
177
180
 
181
+ export declare function AssetMediaRenderer({ src, isAutoPlayEnabled, assetType, altText: alt, showFallback, disableControls, }: AssetMediaRendererProps): React.JSX.Element;
182
+
183
+ export declare interface AssetMediaRendererProps extends VideoProps {
184
+ /**
185
+ * The source of the media to be displayed.
186
+ */
187
+ src: string;
188
+ /**
189
+ * The type of the asset to be displayed.
190
+ */
191
+ assetType: VisualAssetType;
192
+ /**
193
+ * Alt text for the image..
194
+ */
195
+ altText?: string;
196
+ /**
197
+ * Whether to show a fallback image if the main image fails to load.
198
+ */
199
+ showFallback?: boolean;
200
+ }
201
+
178
202
  export declare function Badge({ type, label }: BadgeProps): React.JSX.Element;
179
203
 
180
204
  declare interface BadgeProps {
@@ -191,7 +215,7 @@ declare interface BadgeProps {
191
215
  export declare enum BadgeType {
192
216
  Neutral = "neutral",
193
217
  PrimarySolid = "primary-solid",
194
- PrimarySoft = "primary-fill",
218
+ PrimarySoft = "primary-soft",
195
219
  Success = "success",
196
220
  Warning = "warning",
197
221
  Error = "error"
@@ -461,7 +485,7 @@ declare interface CheckboxProps {
461
485
  name?: string;
462
486
  }
463
487
 
464
- export declare function Chip({ label, showClose, selected, onClose, onClick, avatar, leadingElement, trailingElement, disabled, }: ChipProps): JSX_2.Element;
488
+ export declare function Chip({ label, showClose, selected, onClose, onClick, avatar, leadingElement, trailingElement, disabled, size, }: ChipProps): JSX_2.Element;
465
489
 
466
490
  declare interface ChipProps {
467
491
  /**
@@ -500,6 +524,27 @@ declare interface ChipProps {
500
524
  * The button is disabled or not.
501
525
  */
502
526
  disabled?: boolean;
527
+ /**
528
+ * The size of the chip.
529
+ */
530
+ size?: ChipSize;
531
+ }
532
+
533
+ export declare enum ChipSize {
534
+ Small = "small",
535
+ Default = "default"
536
+ }
537
+
538
+ export declare enum ChipState {
539
+ Default = "default",
540
+ Selected = "selected"
541
+ }
542
+
543
+ declare interface CustomAssetDisplayProps {
544
+ /**
545
+ * The media to be displayed inside the card.
546
+ */
547
+ renderAsset?: React.ReactNode;
503
548
  }
504
549
 
505
550
  export declare const Dialog: ({ open, onOpenChange, children, ...props }: React_2.ComponentPropsWithoutRef<typeof RadixDialog.Root>) => JSX_2.Element;
@@ -646,6 +691,9 @@ declare interface HeaderProps {
646
691
  testId?: string;
647
692
  }
648
693
 
694
+ declare const Image_2: ForwardRefExoticComponent<ImgHTMLAttributes<HTMLImageElement> & RefAttributes<HTMLImageElement>>;
695
+ export { Image_2 as Image }
696
+
649
697
  export declare enum ImageShape {
650
698
  Rounded = "rounded",
651
699
  SquareRounded = "square-rounded"
@@ -658,6 +706,12 @@ export declare enum ImageType {
658
706
  BgTransparent = "bg-transparent"
659
707
  }
660
708
 
709
+ export declare const ImageWithFallback: ForwardRefExoticComponent<ImageWithFallbackProps & RefAttributes<HTMLImageElement>>;
710
+
711
+ export declare interface ImageWithFallbackProps extends React.ImgHTMLAttributes<HTMLImageElement> {
712
+ renderFallback?: React.ReactNode;
713
+ }
714
+
661
715
  export declare function InfoBox({ icon, title, supportingText, type, style, }: InfoBoxProps): React.JSX.Element;
662
716
 
663
717
  export declare interface InfoBoxProps {
@@ -741,8 +795,101 @@ declare interface InputWrapperProps {
741
795
  labelHtmlTag?: LabelHtmlTag;
742
796
  }
743
797
 
798
+ export declare const IOTA_NAMES_COLOR_PALETTE: {
799
+ 'names-primary': {
800
+ '0': string;
801
+ '10': string;
802
+ '20': string;
803
+ '30': string;
804
+ '40': string;
805
+ '50': string;
806
+ '60': string;
807
+ '70': string;
808
+ '80': string;
809
+ '90': string;
810
+ '100': string;
811
+ };
812
+ 'names-secondary': {
813
+ '0': string;
814
+ '10': string;
815
+ '20': string;
816
+ '30': string;
817
+ '40': string;
818
+ '50': string;
819
+ '60': string;
820
+ '70': string;
821
+ '80': string;
822
+ '90': string;
823
+ '100': string;
824
+ };
825
+ 'names-tertiary': {
826
+ '0': string;
827
+ '10': string;
828
+ '20': string;
829
+ '30': string;
830
+ '40': string;
831
+ '50': string;
832
+ '60': string;
833
+ '70': string;
834
+ '80': string;
835
+ '90': string;
836
+ '100': string;
837
+ };
838
+ 'names-error': {
839
+ '0': string;
840
+ '10': string;
841
+ '20': string;
842
+ '30': string;
843
+ '40': string;
844
+ '50': string;
845
+ '60': string;
846
+ '70': string;
847
+ '80': string;
848
+ '90': string;
849
+ '100': string;
850
+ };
851
+ 'names-neutral': {
852
+ '0': string;
853
+ '4': string;
854
+ '6': string;
855
+ '10': string;
856
+ '12': string;
857
+ '20': string;
858
+ '30': string;
859
+ '40': string;
860
+ '50': string;
861
+ '60': string;
862
+ '70': string;
863
+ '80': string;
864
+ '90': string;
865
+ '92': string;
866
+ '96': string;
867
+ '98': string;
868
+ '100': string;
869
+ };
870
+ 'names-gradient': {
871
+ 'stop-1': string;
872
+ 'stop-2': string;
873
+ 'stop-3': string;
874
+ 'stop-4': string;
875
+ };
876
+ 'names-warning': {
877
+ '0': string;
878
+ '10': string;
879
+ '20': string;
880
+ '30': string;
881
+ '40': string;
882
+ '50': string;
883
+ '60': string;
884
+ '70': string;
885
+ '80': string;
886
+ '90': string;
887
+ '100': string;
888
+ };
889
+ };
890
+
744
891
  export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
745
- primary: {
892
+ 'iota-primary': {
746
893
  '0': string;
747
894
  '10': string;
748
895
  '20': string;
@@ -755,7 +902,7 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
755
902
  '90': string;
756
903
  '100': string;
757
904
  };
758
- secondary: {
905
+ 'iota-secondary': {
759
906
  '0': string;
760
907
  '10': string;
761
908
  '20': string;
@@ -768,7 +915,7 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
768
915
  '90': string;
769
916
  '100': string;
770
917
  };
771
- tertiary: {
918
+ 'iota-tertiary': {
772
919
  '0': string;
773
920
  '10': string;
774
921
  '20': string;
@@ -781,7 +928,7 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
781
928
  '90': string;
782
929
  '100': string;
783
930
  };
784
- error: {
931
+ 'iota-error': {
785
932
  '0': string;
786
933
  '10': string;
787
934
  '20': string;
@@ -794,7 +941,7 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
794
941
  '90': string;
795
942
  '100': string;
796
943
  };
797
- neutral: {
944
+ 'iota-neutral': {
798
945
  '0': string;
799
946
  '4': string;
800
947
  '6': string;
@@ -813,11 +960,18 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
813
960
  '98': string;
814
961
  '100': string;
815
962
  };
816
- warning: {
963
+ 'iota-warning': {
964
+ '0': string;
817
965
  '10': string;
818
966
  '20': string;
967
+ '30': string;
968
+ '40': string;
969
+ '50': string;
819
970
  '60': string;
971
+ '70': string;
972
+ '80': string;
820
973
  '90': string;
974
+ '100': string;
821
975
  };
822
976
  };
823
977
 
@@ -968,6 +1122,8 @@ export declare interface LoadingIndicatorProps {
968
1122
  testId?: string;
969
1123
  }
970
1124
 
1125
+ export declare function MediaFallback(): JSX_2.Element;
1126
+
971
1127
  export declare function Navbar({ items, activeId, onClickItem, isCollapsible, onToggleNavbar, }: NavbarProps): JSX_2.Element;
972
1128
 
973
1129
  export declare function NavbarItem(props: NavbarItemProps): React.JSX.Element;
@@ -1681,21 +1837,20 @@ export declare enum ValueSize {
1681
1837
  Medium = "medium"
1682
1838
  }
1683
1839
 
1684
- export declare function VisualAssetCard({ assetType, assetSrc, altText, onIconClick, onClick, icon, assetTitle, isHoverable, }: VisualAssetCardProps): React.JSX.Element;
1840
+ export declare const Video: ForwardRefExoticComponent<Omit<DetailedHTMLProps<VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "ref"> & VideoProps & RefAttributes<HTMLVideoElement>>;
1685
1841
 
1686
- export declare interface VisualAssetCardProps {
1842
+ export declare interface VideoProps {
1687
1843
  /**
1688
- * The type of the asset to be displayed.
1689
- */
1690
- assetType?: VisualAssetType;
1691
- /**
1692
- * The source of the image to be displayed.
1844
+ * Whether the video should autoplay.
1693
1845
  */
1694
- assetSrc: string;
1846
+ isAutoPlayEnabled?: boolean;
1695
1847
  /**
1696
- * Alt text for the image.
1848
+ * If the video controls should be disabled.
1697
1849
  */
1698
- altText: string;
1850
+ disableControls?: boolean;
1851
+ }
1852
+
1853
+ declare interface VisualAssetBaseProps {
1699
1854
  /**
1700
1855
  * The onClick event for the icon.
1701
1856
  */
@@ -1718,6 +1873,10 @@ export declare interface VisualAssetCardProps {
1718
1873
  isHoverable?: boolean;
1719
1874
  }
1720
1875
 
1876
+ export declare function VisualAssetCard({ onIconClick, onClick, icon, assetTitle, isHoverable, ...assetProps }: VisualAssetBaseProps & (AssetMediaRendererProps | CustomAssetDisplayProps)): React.JSX.Element;
1877
+
1878
+ export declare type VisualAssetCardProps = VisualAssetBaseProps & (AssetMediaRendererProps | CustomAssetDisplayProps);
1879
+
1721
1880
  export declare enum VisualAssetType {
1722
1881
  Image = "image",
1723
1882
  Video = "video"