@iota/apps-ui-kit 0.2.1 → 0.5.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 (43) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +16 -0
  3. package/dist/index.d.ts +91 -15
  4. package/dist/index.es.js +4536 -4297
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.umd.js +52 -52
  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/badge/badge.classes.ts +9 -0
  11. package/src/lib/components/atoms/badge/badge.enums.ts +3 -0
  12. package/src/lib/components/atoms/button/button.classes.ts +4 -4
  13. package/src/lib/components/atoms/index.ts +1 -0
  14. package/src/lib/components/atoms/info-box/InfoBox.tsx +1 -1
  15. package/src/lib/components/atoms/info-box/infoBox.classes.ts +7 -2
  16. package/src/lib/components/atoms/info-box/infoBox.enums.ts +2 -0
  17. package/src/lib/components/atoms/snackbar/snackbar.classes.ts +5 -1
  18. package/src/lib/components/atoms/snackbar/snackbar.enums.tsx +2 -0
  19. package/src/lib/components/atoms/toggle/Toggle.tsx +140 -0
  20. package/src/lib/components/atoms/toggle/index.ts +6 -0
  21. package/src/lib/components/atoms/toggle/toggle.classes.ts +41 -0
  22. package/src/lib/components/atoms/toggle/toggle.enums.ts +12 -0
  23. package/src/lib/components/atoms/tooltip/Tooltip.tsx +4 -1
  24. package/src/lib/components/atoms/visual-asset-card/VisualAssetCard.tsx +26 -18
  25. package/src/lib/components/molecules/address/Address.tsx +1 -1
  26. package/src/lib/components/molecules/card/CardAction.tsx +4 -2
  27. package/src/lib/components/molecules/card/CardBody.tsx +12 -1
  28. package/src/lib/components/molecules/card/card.classes.ts +1 -0
  29. package/src/lib/components/molecules/card/card.enums.ts +1 -0
  30. package/src/lib/components/molecules/input/input.classes.ts +2 -2
  31. package/src/lib/components/molecules/search/Search.tsx +39 -5
  32. package/src/lib/components/molecules/table-header-cell/TableHeaderCell.tsx +27 -13
  33. package/src/lib/components/molecules/title/Title.tsx +9 -1
  34. package/src/lib/components/organisms/accordion/Accordion.tsx +3 -5
  35. package/src/lib/components/organisms/dialog/Dialog.tsx +6 -5
  36. package/src/lib/components/organisms/navbar/Navbar.tsx +10 -10
  37. package/src/lib/components/organisms/table/Table.tsx +19 -3
  38. package/src/lib/constants/colors.constants.ts +6 -0
  39. package/src/lib/styles/index.css +13 -0
  40. package/src/lib/tailwind/base.presets.ts +2 -0
  41. package/src/lib/tailwind/plugins.ts +8 -0
  42. package/src/storybook/stories/atoms/Toggle.stories.tsx +59 -0
  43. package/src/storybook/stories/organisms/Navbar.stories.tsx +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # @iota/apps-ui-kit
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a4b46bc: add more badge types
8
+
9
+ ### Patch Changes
10
+
11
+ - 6d274df: make renderSuggestion prop optional in Search component
12
+ - 976e7f8: Add heightFull configuration props to Table component
13
+ - bb45cb5: Add new type for CardImage component
14
+ - Updated dependencies [a4b46bc]
15
+ - @iota/apps-ui-icons@0.3.0
16
+
17
+ ## 0.4.0
18
+
19
+ ### Minor Changes
20
+
21
+ - a3f08da: add toggle component
22
+
23
+ ### Patch Changes
24
+
25
+ - 1ad39f9: Update dependencies
26
+ - 4e4f710: replace supportingText from string to ReactNode in InfoBox component
27
+ - d0cb92e: manage unreachable images by displaying a placeholder instead in VisualAssetCard
28
+
29
+ ## 0.3.0
30
+
31
+ ### Minor Changes
32
+
33
+ - 3b8b320: update input styles for darkmode
34
+ - b28a0be: Improve search input behavior:
35
+
36
+ - Allow navigation through suggestions with arrow up/down keys
37
+ - Select suggestion on Enter
38
+
39
+ ### Patch Changes
40
+
41
+ - b83b198: improve darkmode styles for destructive button
42
+ - b06e657: Improve styling for small screens
43
+ - 9f4c5e4: Enhance snackbar and infobox with warning type. Update styles for default type.
44
+ - 2bd31a2: fix tooltip max-width
45
+ - Updated dependencies [8f73b75]
46
+ - @iota/apps-ui-icons@0.2.2
47
+
48
+ ## 0.2.2
49
+
50
+ ### Patch Changes
51
+
52
+ - c0ef9f2: Update scrollbar styles for firefox and add firefox only class selector
53
+
3
54
  ## 0.2.1
4
55
 
5
56
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # `@iota/apps-ui-kit`
2
+
3
+ ## Usage
4
+
5
+ Installation:
6
+
7
+ ```bash
8
+ # Replace with npm, yarn, bun, etc.
9
+ pnpm install @iota/apps-ui-kit
10
+ ```
11
+
12
+ Importing:
13
+
14
+ ```typescript
15
+ import { Button } from '@iota/apps-ui-kit';
16
+ ```
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ declare interface AccordionContentProps {
25
25
  isExpanded: boolean;
26
26
  }
27
27
 
28
- export declare function AccordionHeader({ onToggle, children, isExpanded, hideArrow, hideBorder, }: PropsWithChildren<AccordionHeaderProps>): JSX_2.Element;
28
+ export declare function AccordionHeader({ onToggle, children, isExpanded, hideArrow, }: PropsWithChildren<AccordionHeaderProps>): JSX_2.Element;
29
29
 
30
30
  export declare interface AccordionHeaderProps {
31
31
  /**
@@ -178,7 +178,10 @@ declare interface BadgeProps {
178
178
  export declare enum BadgeType {
179
179
  Neutral = "neutral",
180
180
  PrimarySolid = "primary-solid",
181
- PrimarySoft = "primary-fill"
181
+ PrimarySoft = "primary-fill",
182
+ Success = "success",
183
+ Warning = "warning",
184
+ Error = "error"
182
185
  }
183
186
 
184
187
  export declare interface BaseInputProps extends InputWrapperProps {
@@ -353,7 +356,7 @@ export declare enum CardActionType {
353
356
  Button = "button"
354
357
  }
355
358
 
356
- export declare function CardBody({ title, subtitle, clickableAction, icon, isTextTruncated, }: CardBodyProps): JSX_2.Element;
359
+ export declare function CardBody({ title, subtitle, clickableAction, icon, isTextTruncated, tooltipText, tooltipPosition, }: CardBodyProps): JSX_2.Element;
357
360
 
358
361
  export declare type CardBodyProps = {
359
362
  title: string;
@@ -361,6 +364,8 @@ export declare type CardBodyProps = {
361
364
  clickableAction?: React.ReactNode;
362
365
  icon?: React.ReactNode;
363
366
  isTextTruncated?: boolean;
367
+ tooltipText?: string;
368
+ tooltipPosition?: TooltipPosition;
364
369
  };
365
370
 
366
371
  export declare function CardImage({ type, shape, url, children, }: CardImageProps): JSX_2.Element;
@@ -620,6 +625,7 @@ export declare enum ImageShape {
620
625
  export declare enum ImageType {
621
626
  Placeholder = "placeholder",
622
627
  BgSolid = "bg-solid",
628
+ BgWhite = "bg-white",
623
629
  BgTransparent = "bg-transparent"
624
630
  }
625
631
 
@@ -637,7 +643,7 @@ export declare interface InfoBoxProps {
637
643
  /**
638
644
  * The supporting text of the info box (optional).
639
645
  */
640
- supportingText?: string;
646
+ supportingText?: React.ReactNode;
641
647
  /**
642
648
  * The type of the info box.
643
649
  */
@@ -655,7 +661,9 @@ export declare enum InfoBoxStyle {
655
661
 
656
662
  export declare enum InfoBoxType {
657
663
  Default = "default",
658
- Error = "error"
664
+ Error = "error",
665
+ Success = "success",
666
+ Warning = "warning"
659
667
  }
660
668
 
661
669
  export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
@@ -776,6 +784,12 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
776
784
  '98': string;
777
785
  '100': string;
778
786
  };
787
+ warning: {
788
+ '10': string;
789
+ '20': string;
790
+ '60': string;
791
+ '90': string;
792
+ };
779
793
  };
780
794
 
781
795
  export declare function KeyValueInfo({ keyText, value, tooltipPosition, tooltipText, supportingLabel, size, isTruncated, copyText, onCopySuccess, onCopyError, fullwidth, isReverse, valueHoverTitle, }: KeyValueProps): React.JSX.Element;
@@ -925,7 +939,7 @@ export declare interface LoadingIndicatorProps {
925
939
  testId?: string;
926
940
  }
927
941
 
928
- export declare function Navbar({ items, activeId, onClickItem, isCollapsable, onToggleNavbar, }: NavbarProps): JSX_2.Element;
942
+ export declare function Navbar({ items, activeId, onClickItem, isCollapsible, onToggleNavbar, }: NavbarProps): JSX_2.Element;
929
943
 
930
944
  export declare function NavbarItem(props: NavbarItemProps): React.JSX.Element;
931
945
 
@@ -971,9 +985,9 @@ export declare type NavbarItemWithId = NavbarItemProps_2 & {
971
985
 
972
986
  export declare interface NavbarProps {
973
987
  /**
974
- * If this flag is true we need to leave only the icon and collapsable button
988
+ * If this flag is true we need to leave only the icon and collapsible button
975
989
  */
976
- isCollapsable?: boolean;
990
+ isCollapsible?: boolean;
977
991
  /**
978
992
  * List of elements to be displayed in the navbar.
979
993
  */
@@ -987,7 +1001,7 @@ export declare interface NavbarProps {
987
1001
  */
988
1002
  onClickItem: (id: string) => void;
989
1003
  /**
990
- * If the navbar is collapsable, this flag indicates if it is open or not.
1004
+ * If the navbar is collapsible, this flag indicates if it is open or not.
991
1005
  */
992
1006
  isOpen?: boolean;
993
1007
  /**
@@ -1116,7 +1130,7 @@ export declare interface SearchProps {
1116
1130
  /**
1117
1131
  * Render suggestion.
1118
1132
  */
1119
- renderSuggestion: (suggestion: Suggestion, index: number) => React.ReactNode;
1133
+ renderSuggestion?: (suggestion: Suggestion, index: number) => React.ReactNode;
1120
1134
  }
1121
1135
 
1122
1136
  export declare function SegmentedButton({ type, children, shape, }: PropsWithChildren<SegmentedButtonProps>): React.JSX.Element;
@@ -1303,7 +1317,9 @@ export declare interface SnackbarProps {
1303
1317
 
1304
1318
  export declare enum SnackbarType {
1305
1319
  Default = "default",
1306
- Error = "error"
1320
+ Error = "error",
1321
+ Warning = "warning",
1322
+ Success = "success"
1307
1323
  }
1308
1324
 
1309
1325
  export declare interface Suggestion {
@@ -1313,7 +1329,7 @@ export declare interface Suggestion {
1313
1329
  type?: string;
1314
1330
  }
1315
1331
 
1316
- export declare function Table({ paginationOptions, action, supportingLabel, selectedRowIndexes, rowIndexes, children, pageSizeSelector, }: PropsWithChildren<TableProps>): JSX.Element;
1332
+ export declare function Table({ paginationOptions, action, supportingLabel, selectedRowIndexes, rowIndexes, children, pageSizeSelector, heightFull, }: PropsWithChildren<TableProps>): JSX.Element;
1317
1333
 
1318
1334
  export declare function TableActionButton(props: PropsWithChildren<ButtonProps>): JSX_2.Element;
1319
1335
 
@@ -1346,7 +1362,7 @@ export declare interface TableCellTextProps {
1346
1362
 
1347
1363
  export declare function TableHeader({ children }: PropsWithChildren): JSX.Element;
1348
1364
 
1349
- export declare function TableHeaderCell({ label, columnKey, hasSort, hasCheckbox, isChecked, isIndeterminate, isContentCentered, onSortClick, onCheckboxChange, }: TableHeaderCellProps): JSX.Element;
1365
+ export declare function TableHeaderCell({ label, columnKey, hasSort, hasCheckbox, isChecked, isIndeterminate, isContentCentered, onSortClick, onCheckboxChange, sortOrder, }: TableHeaderCellProps): JSX.Element;
1350
1366
 
1351
1367
  export declare interface TableHeaderCellProps {
1352
1368
  /**
@@ -1393,6 +1409,10 @@ export declare interface TableHeaderCellProps {
1393
1409
  * Whether the cell content should be centered.
1394
1410
  */
1395
1411
  isContentCentered?: boolean;
1412
+ /**
1413
+ * Sort order when cell is initialized
1414
+ */
1415
+ sortOrder?: TableHeaderCellSortOrder;
1396
1416
  }
1397
1417
 
1398
1418
  export declare enum TableHeaderCellSortOrder {
@@ -1466,6 +1486,10 @@ export declare type TableProps = {
1466
1486
  * The page size selector component.
1467
1487
  */
1468
1488
  pageSizeSelector?: ReactNode;
1489
+ /**
1490
+ * If the table should take the full height of the parent.
1491
+ */
1492
+ heightFull?: boolean;
1469
1493
  };
1470
1494
 
1471
1495
  export declare function TableRow({ children, leading, }: PropsWithChildren<{
@@ -1514,7 +1538,7 @@ declare interface TextFieldBaseProps extends TextAreaProps, InputWrapperProps {
1514
1538
  isResizeEnabled?: boolean;
1515
1539
  }
1516
1540
 
1517
- export declare function Title({ title, subtitle, trailingElement, tooltipText, supportingElement, tooltipPosition, size, }: TitleProps): JSX_2.Element;
1541
+ export declare function Title({ title, subtitle, trailingElement, tooltipText, supportingElement, tooltipPosition, size, testId, }: TitleProps): JSX_2.Element;
1518
1542
 
1519
1543
  declare interface TitleProps {
1520
1544
  /**
@@ -1545,6 +1569,10 @@ declare interface TitleProps {
1545
1569
  * The size of the component
1546
1570
  */
1547
1571
  size?: TitleSize;
1572
+ /**
1573
+ * The 'data-testid' attribute value (used in e2e tests)
1574
+ */
1575
+ testId?: string;
1548
1576
  }
1549
1577
 
1550
1578
  export declare enum TitleSize {
@@ -1552,7 +1580,54 @@ export declare enum TitleSize {
1552
1580
  Medium = "medium"
1553
1581
  }
1554
1582
 
1555
- export declare function Tooltip({ text, position, children, }: PropsWithChildren<TooltipProps>): React.JSX.Element;
1583
+ export declare const Toggle: ForwardRefExoticComponent<ToggleProps & RefAttributes<HTMLInputElement>>;
1584
+
1585
+ export declare enum ToggleLabelPosition {
1586
+ Left = "left",
1587
+ Right = "right"
1588
+ }
1589
+
1590
+ declare interface ToggleProps {
1591
+ /**
1592
+ * The label for the toggle.
1593
+ */
1594
+ label?: string | React.ReactNode;
1595
+ /**
1596
+ * The state of the toggle (on or off).
1597
+ */
1598
+ isToggled: boolean;
1599
+ /**
1600
+ * Whether the label should be placed before the toggle.
1601
+ */
1602
+ labelPosition?: ToggleLabelPosition;
1603
+ /**
1604
+ * If true, the toggle will be disabled.
1605
+ */
1606
+ isDisabled?: boolean;
1607
+ /**
1608
+ * The callback to call when the toggle state changes.
1609
+ */
1610
+ onChange?: (isToggled: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
1611
+ /**
1612
+ * The name and id of the toggle input.
1613
+ */
1614
+ name?: string;
1615
+ /**
1616
+ * The size of the toggle.
1617
+ */
1618
+ size?: ToggleSize;
1619
+ /**
1620
+ * The 'data-testid' attribute value (used in e2e tests)
1621
+ */
1622
+ testId?: string;
1623
+ }
1624
+
1625
+ export declare enum ToggleSize {
1626
+ Small = "small",
1627
+ Default = "default"
1628
+ }
1629
+
1630
+ export declare function Tooltip({ text, position, maxWidth, children, }: PropsWithChildren<TooltipProps>): React.JSX.Element;
1556
1631
 
1557
1632
  export declare enum TooltipPosition {
1558
1633
  Top = "top",
@@ -1564,6 +1639,7 @@ export declare enum TooltipPosition {
1564
1639
  declare interface TooltipProps {
1565
1640
  text: string;
1566
1641
  position?: TooltipPosition;
1642
+ maxWidth?: string;
1567
1643
  }
1568
1644
 
1569
1645
  export declare function truncate(value: string, startLength?: number, endLength?: number): string;