@iota/apps-ui-kit 0.11.0 → 0.13.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 (30) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/index.d.ts +43 -14
  3. package/dist/index.es.js +1281 -1214
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +15 -15
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/style.css +1 -1
  8. package/package.json +2 -8
  9. package/src/lib/components/atoms/badge/Badge.tsx +18 -2
  10. package/src/lib/components/atoms/button/Button.tsx +1 -1
  11. package/src/lib/components/atoms/checkbox/Checkbox.tsx +2 -2
  12. package/src/lib/components/atoms/divider/Divider.tsx +2 -3
  13. package/src/lib/components/atoms/info-box/InfoBox.tsx +1 -1
  14. package/src/lib/components/atoms/key-value-info/KeyValueInfo.tsx +20 -5
  15. package/src/lib/components/atoms/tooltip/Tooltip.tsx +89 -21
  16. package/src/lib/components/molecules/card/CardAction.tsx +2 -2
  17. package/src/lib/components/molecules/card/CardBody.tsx +1 -1
  18. package/src/lib/components/molecules/display-stats/DisplayStats.tsx +2 -2
  19. package/src/lib/components/molecules/input/Input.tsx +2 -2
  20. package/src/lib/components/molecules/input/InputWrapper.tsx +3 -2
  21. package/src/lib/components/molecules/select/Select.tsx +1 -2
  22. package/src/lib/components/molecules/table-cell/TableCell.tsx +6 -0
  23. package/src/lib/components/organisms/accordion/Accordion.tsx +10 -1
  24. package/src/lib/components/organisms/table/Table.tsx +31 -3
  25. package/src/lib/constants/index.ts +1 -0
  26. package/src/lib/constants/interactive.constants.ts +19 -0
  27. package/src/lib/styles/base.css +3 -2
  28. package/src/lib/tailwind/base.presets.ts +2 -2
  29. package/src/lib/tailwind/plugins.ts +14 -0
  30. package/src/storybook/stories/atoms/Panel.stories.tsx +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @iota/apps-ui-kit
2
2
 
3
+ ## 0.13.0
4
+ ### Minor Changes
5
+
6
+ - 94c9333: Clickable `TableRow`s ignore clicks coming from interactive elements inside them (links, buttons, inputs, `role="button"`…) or that end a text selection, and accept an `onAuxClick` handler. While one of those elements is hovered the row is not highlighted and the hovered link is highlighted instead. Links spread with `ROW_LINK_PROPS`, which go where the row goes, keep the row hover and are not highlighted. Adds `INTERACTIVE_ELEMENT_SELECTOR`, `ROW_LINK_ATTRIBUTE`, `ROW_LINK_PROPS` and the `row-hover`, `inner-link` and `inner-link-hover` Tailwind variants.
7
+
8
+ ### Patch Changes
9
+
10
+ - b1718f3: add overflow wrap to infobox
11
+ - a24230f: align Cardaction supporting text
12
+ - fe39bd9: Improve tooltip positioning when there's not enough space
13
+ - 9fe2669: Allow `CardBody` to receive a React node as `title`, not only a string.
14
+ - Updated dependencies [fecdf36]
15
+ - @iota/apps-ui-icons@0.7.6
16
+
17
+ ## 0.12.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 352991b: fix checkbox alignment
22
+
23
+ ### Patch Changes
24
+
25
+ - dd41759: Add icon for Badge
26
+ - 437f907: Fix Tooltip not closing on scroll and overflowing the viewport.
27
+ - 3ac0260: add prop to disable state layer in the accordion and add a receipt layout option for the keyvalue
28
+ - 2dcb8d1: update some types in displaystats and keyvalueinfo components
29
+
3
30
  ## 0.11.0
4
31
 
5
32
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -34,7 +34,7 @@ declare interface AccordionContentProps {
34
34
  isExpanded: boolean;
35
35
  }
36
36
 
37
- export declare function AccordionHeader({ onToggle, children, isExpanded, hideArrow, }: PropsWithChildren<AccordionHeaderProps>): JSX_2.Element;
37
+ export declare function AccordionHeader({ onToggle, children, isExpanded, hideArrow, disableStateLayer, }: PropsWithChildren<AccordionHeaderProps>): JSX_2.Element;
38
38
 
39
39
  export declare interface AccordionHeaderProps {
40
40
  /**
@@ -57,6 +57,12 @@ export declare interface AccordionHeaderProps {
57
57
  * Flag for hiding border.
58
58
  */
59
59
  hideBorder?: boolean;
60
+ /**
61
+ * Disable the header state layer while an interactive child is active.
62
+ * This keeps the parent hover treatment from competing with child links
63
+ * and controls.
64
+ */
65
+ disableStateLayer?: boolean;
60
66
  }
61
67
 
62
68
  export declare function Account({ title, subtitle, badgeType, badgeText, avatarContent, onOptionsClick, onCopy, copyText, onOpen, isCopyable, isExternal, isSelected, isActive, showSelected, badgeTooltipText, badgeTooltipPosition, }: AccountProps): React.JSX.Element;
@@ -186,7 +192,7 @@ export declare interface AssetMediaRendererProps extends VideoProps {
186
192
  showFallback?: boolean;
187
193
  }
188
194
 
189
- export declare function Badge({ type, label, size }: BadgeProps): React.JSX.Element;
195
+ export declare function Badge({ type, label, size, icon, }: BadgeProps): React.JSX.Element;
190
196
 
191
197
  declare interface BadgeProps {
192
198
  /**
@@ -201,6 +207,10 @@ declare interface BadgeProps {
201
207
  * The size of the badge
202
208
  */
203
209
  size?: BadgeSize;
210
+ /**
211
+ * An icon rendered before the label.
212
+ */
213
+ icon?: ReactNode;
204
214
  }
205
215
 
206
216
  export declare enum BadgeSize {
@@ -230,7 +240,7 @@ export declare interface BaseInputProps extends InputWrapperProps {
230
240
  /**
231
241
  * Amount counter that is shown at the side of the caption text.
232
242
  */
233
- amountCounter?: string | number;
243
+ amountCounter?: React.ReactNode;
234
244
  /**
235
245
  * Trailing element that is shown after the input
236
246
  */
@@ -246,7 +256,7 @@ export declare interface BaseInputProps extends InputWrapperProps {
246
256
  /**
247
257
  * Text that is shown below the value of the input.
248
258
  */
249
- supportingValue?: string | null;
259
+ supportingValue?: React.ReactNode;
250
260
  /**
251
261
  * Default value of the input
252
262
  */
@@ -285,7 +295,7 @@ export declare interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTM
285
295
  /**
286
296
  * The text of the button.
287
297
  */
288
- text?: string;
298
+ text?: React.ReactNode;
289
299
  /**
290
300
  The icon of the button
291
301
  */
@@ -382,7 +392,7 @@ export declare function Card({ isDisabled, type, isHoverable, onClick, children,
382
392
  export declare function CardAction({ type, onClick, subtitle, title, icon, iconAfterText, buttonType, buttonDisabled, }: CardActionProps): JSX_2.Element | null;
383
393
 
384
394
  export declare type CardActionProps = {
385
- title?: string;
395
+ title?: React.ReactNode;
386
396
  subtitle?: string | React.ReactNode;
387
397
  type: CardActionType;
388
398
  onClick?: () => void;
@@ -401,7 +411,7 @@ export declare enum CardActionType {
401
411
  export declare function CardBody({ title, subtitle, clickableAction, icon, isTextTruncated, tooltipText, tooltipPosition, }: CardBodyProps): JSX_2.Element;
402
412
 
403
413
  export declare type CardBodyProps = {
404
- title: string;
414
+ title: ReactNode;
405
415
  subtitle?: string | ReactNode;
406
416
  clickableAction?: React.ReactNode;
407
417
  icon?: React.ReactNode;
@@ -643,7 +653,7 @@ declare interface DisplayStatsProps {
643
653
  /**
644
654
  * The tooltip text.
645
655
  */
646
- tooltipText?: string;
656
+ tooltipText?: ReactNode;
647
657
  /**
648
658
  * The value of the stats.
649
659
  */
@@ -832,7 +842,7 @@ declare interface InputWrapperProps {
832
842
  /**
833
843
  * Shows a caption with the text below the input.
834
844
  */
835
- caption?: string;
845
+ caption?: ReactNode;
836
846
  /**
837
847
  * Error Message. Overrides the caption.
838
848
  */
@@ -840,7 +850,7 @@ declare interface InputWrapperProps {
840
850
  /**
841
851
  * Amount counter that is shown at the side of the caption text.
842
852
  */
843
- amountCounter?: string | number;
853
+ amountCounter?: React.ReactNode;
844
854
  /**
845
855
  * Is the input required
846
856
  */
@@ -855,6 +865,8 @@ declare interface InputWrapperProps {
855
865
  labelHtmlTag?: LabelHtmlTag;
856
866
  }
857
867
 
868
+ export declare const INTERACTIVE_ELEMENT_SELECTOR: string;
869
+
858
870
  export declare const IOTA_NAMES_COLOR_PALETTE: {
859
871
  'names-primary': {
860
872
  '0': string;
@@ -1035,13 +1047,13 @@ export declare const IOTA_PRIMITIVES_COLOR_PALETTE: {
1035
1047
  };
1036
1048
  };
1037
1049
 
1038
- export declare function KeyValueInfo({ keyText, keyIcon, value, tooltipPosition, tooltipText, supportingLabel, size, isTruncated, copyText, onCopySuccess, onCopyError, fullwidth, isReverse, valueHoverTitle, }: KeyValueProps): React.JSX.Element;
1050
+ export declare function KeyValueInfo({ keyText, keyIcon, value, tooltipPosition, tooltipText, supportingLabel, size, isTruncated, copyText, onCopySuccess, onCopyError, fullwidth, isReverse, layout, valueHoverTitle, }: KeyValueProps): React.JSX.Element;
1039
1051
 
1040
1052
  declare interface KeyValueProps {
1041
1053
  /**
1042
1054
  * The key of the KeyValue.
1043
1055
  */
1044
- keyText: string;
1056
+ keyText: ReactNode;
1045
1057
  /**
1046
1058
  * An icon shown next to the key text (optional).
1047
1059
  */
@@ -1090,6 +1102,11 @@ declare interface KeyValueProps {
1090
1102
  * Reverse the KeyValue (optional).
1091
1103
  */
1092
1104
  isReverse?: boolean;
1105
+ /**
1106
+ * Use a receipt-style row with a dotted leader and right-aligned value.
1107
+ * This is opt-in so existing KeyValueInfo layouts remain unchanged.
1108
+ */
1109
+ layout?: 'default' | 'receipt';
1093
1110
  /**
1094
1111
  * Text shown on value hover.
1095
1112
  */
@@ -1345,6 +1362,12 @@ export declare enum Resize {
1345
1362
  Vertical = "vertical"
1346
1363
  }
1347
1364
 
1365
+ export declare const ROW_LINK_ATTRIBUTE = "data-row-link";
1366
+
1367
+ export declare const ROW_LINK_PROPS: {
1368
+ readonly "data-row-link": true;
1369
+ };
1370
+
1348
1371
  export declare enum ScreenSize {
1349
1372
  Sm = "sm",
1350
1373
  Md = "md",
@@ -1603,7 +1626,7 @@ export declare function TableActionButton(props: PropsWithChildren<ButtonProps_2
1603
1626
 
1604
1627
  export declare function TableBody({ children }: PropsWithChildren): JSX.Element;
1605
1628
 
1606
- export declare function TableCellBase({ children, hasLastBorderNoneClass, isContentCentered, }: PropsWithChildren<TableCellBaseProps>): JSX_2.Element;
1629
+ export declare function TableCellBase({ children, hasLastBorderNoneClass, isContentCentered, colSpan, }: PropsWithChildren<TableCellBaseProps>): JSX_2.Element;
1607
1630
 
1608
1631
  declare interface TableCellBaseProps {
1609
1632
  /**
@@ -1618,6 +1641,10 @@ declare interface TableCellBaseProps {
1618
1641
  * Whether the cell content should be centered.
1619
1642
  */
1620
1643
  isContentCentered?: boolean;
1644
+ /**
1645
+ * The number of columns the cell should span.
1646
+ */
1647
+ colSpan?: number;
1621
1648
  }
1622
1649
 
1623
1650
  export declare function TableCellPlaceholder(): JSX_2.Element;
@@ -1760,8 +1787,10 @@ export declare type TableProps = {
1760
1787
  heightFull?: boolean;
1761
1788
  };
1762
1789
 
1763
- export declare function TableRow({ children, leading, }: PropsWithChildren<{
1790
+ export declare function TableRow({ children, leading, onClick, onAuxClick, }: PropsWithChildren<{
1764
1791
  leading?: React.ReactNode;
1792
+ onClick?: React.MouseEventHandler<HTMLTableRowElement>;
1793
+ onAuxClick?: React.MouseEventHandler<HTMLTableRowElement>;
1765
1794
  }>): JSX.Element;
1766
1795
 
1767
1796
  export declare function TableRowCheckbox({ rowIndex, onCheckboxChange, isDisabled, }: TableRowCheckboxProps): React.JSX.Element;