@bitrise/bitkit-v2 0.3.393-beta.2528 → 0.3.393-beta.2532
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.
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { Table } from '@chakra-ui/react/table';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { BitkitLinkProps } from '../BitkitLink/BitkitLink';
|
|
2
4
|
export type BitkitLinkedRowProps = Omit<Table.RowProps, 'onClick'>;
|
|
3
|
-
export
|
|
5
|
+
export interface BitkitLinkedRowLinkCellProps extends Omit<Table.CellProps, 'children'> {
|
|
6
|
+
/**
|
|
7
|
+
* The row's link: a single `BitkitLink` with its own `href`, `isExternal`, `colorVariant` and any
|
|
8
|
+
* other link prop. The type only rules out bare text and multiple children — a non-link element,
|
|
9
|
+
* or a `BitkitLink` without an `href`, type-checks as well and leaves the row looking linked
|
|
10
|
+
* while navigating nowhere. Anything else the cell should show (an icon, a `VisuallyHidden` name)
|
|
11
|
+
* goes inside the link.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactElement<BitkitLinkProps>;
|
|
14
|
+
}
|
|
4
15
|
declare const _default: import('react').ForwardRefExoticComponent<BitkitLinkedRowProps & import('react').RefAttributes<HTMLTableRowElement>> & {
|
|
5
|
-
LinkCell: import('react').ForwardRefExoticComponent<
|
|
16
|
+
LinkCell: import('react').ForwardRefExoticComponent<BitkitLinkedRowLinkCellProps & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
6
17
|
};
|
|
7
18
|
export default _default;
|
|
@@ -11,6 +11,9 @@ import { Table, useTableStyles } from "@chakra-ui/react/table";
|
|
|
11
11
|
* Interactive elements in the other cells (buttons, checkboxes, other links) stay clickable: they
|
|
12
12
|
* are lifted above the stretched link, so a `BitkitRowActionsCell` works inside a linked row.
|
|
13
13
|
*
|
|
14
|
+
* Neither requirement is enforced: a row without a `LinkCell`, or one whose link has no `href`,
|
|
15
|
+
* still renders with the linked-row styling — hover affordance included — and navigates nowhere.
|
|
16
|
+
*
|
|
14
17
|
* @example
|
|
15
18
|
* ```tsx
|
|
16
19
|
* <BitkitLinkedRow>
|
|
@@ -36,9 +39,8 @@ var BitkitLinkedRow = forwardRef((props, ref) => {
|
|
|
36
39
|
});
|
|
37
40
|
BitkitLinkedRow.displayName = "BitkitLinkedRow";
|
|
38
41
|
/**
|
|
39
|
-
* The cell that carries the row's link, so give it the cell that names the row.
|
|
40
|
-
*
|
|
41
|
-
* the cell only stretches that link across the row, leaving its styling to the link itself.
|
|
42
|
+
* The cell that carries the row's link, so give it the cell that names the row. The cell only
|
|
43
|
+
* stretches its link across the row, leaving the styling to the link itself.
|
|
42
44
|
*/
|
|
43
45
|
var LinkCell = forwardRef((props, ref) => {
|
|
44
46
|
const { children, ...rest } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitkitLinkedRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitLinkedRow.tsx"],"sourcesContent":["import { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\n\nexport type BitkitLinkedRowProps = Omit<Table.RowProps, 'onClick'>;\n\n/**\n * A table row that navigates as a whole. Exactly one of its cells must be a\n * `BitkitLinkedRow.LinkCell` holding the row's link — that link's text becomes the row's accessible\n * name, and its stretched pseudo-element makes the entire row the click and focus target.\n *\n * Interactive elements in the other cells (buttons, checkboxes, other links) stay clickable: they\n * are lifted above the stretched link, so a `BitkitRowActionsCell` works inside a linked row.\n *\n * @example\n * ```tsx\n * <BitkitLinkedRow>\n * <BitkitLinkedRow.LinkCell>\n * <BitkitLink colorVariant=\"purple\" href={`/workflows/${row.id}`}>\n * {row.name}\n * </BitkitLink>\n * </BitkitLinkedRow.LinkCell>\n * <Table.Cell>{row.status}</Table.Cell>\n * <BitkitRowActionsCell actions={actions} />\n * </BitkitLinkedRow>\n * ```\n */\nconst BitkitLinkedRow = forwardRef<HTMLTableRowElement, BitkitLinkedRowProps>((props, ref) => {\n const { children, ...rest } = props;\n const styles = useTableStyles();\n\n return (\n <Table.Row ref={ref} css={styles.linkedRow} {...rest}>\n {children}\n </Table.Row>\n );\n});\n\nBitkitLinkedRow.displayName = 'BitkitLinkedRow';\n\nexport
|
|
1
|
+
{"version":3,"file":"BitkitLinkedRow.js","names":[],"sources":["../../../lib/components/BitkitTable/BitkitLinkedRow.tsx"],"sourcesContent":["import { Table, useTableStyles } from '@chakra-ui/react/table';\nimport { forwardRef, type ReactElement } from 'react';\n\nimport { withSubComponents } from '../../utilities/withSubComponents';\nimport { type BitkitLinkProps } from '../BitkitLink/BitkitLink';\n\nexport type BitkitLinkedRowProps = Omit<Table.RowProps, 'onClick'>;\n\n/**\n * A table row that navigates as a whole. Exactly one of its cells must be a\n * `BitkitLinkedRow.LinkCell` holding the row's link — that link's text becomes the row's accessible\n * name, and its stretched pseudo-element makes the entire row the click and focus target.\n *\n * Interactive elements in the other cells (buttons, checkboxes, other links) stay clickable: they\n * are lifted above the stretched link, so a `BitkitRowActionsCell` works inside a linked row.\n *\n * Neither requirement is enforced: a row without a `LinkCell`, or one whose link has no `href`,\n * still renders with the linked-row styling — hover affordance included — and navigates nowhere.\n *\n * @example\n * ```tsx\n * <BitkitLinkedRow>\n * <BitkitLinkedRow.LinkCell>\n * <BitkitLink colorVariant=\"purple\" href={`/workflows/${row.id}`}>\n * {row.name}\n * </BitkitLink>\n * </BitkitLinkedRow.LinkCell>\n * <Table.Cell>{row.status}</Table.Cell>\n * <BitkitRowActionsCell actions={actions} />\n * </BitkitLinkedRow>\n * ```\n */\nconst BitkitLinkedRow = forwardRef<HTMLTableRowElement, BitkitLinkedRowProps>((props, ref) => {\n const { children, ...rest } = props;\n const styles = useTableStyles();\n\n return (\n <Table.Row ref={ref} css={styles.linkedRow} {...rest}>\n {children}\n </Table.Row>\n );\n});\n\nBitkitLinkedRow.displayName = 'BitkitLinkedRow';\n\nexport interface BitkitLinkedRowLinkCellProps extends Omit<Table.CellProps, 'children'> {\n /**\n * The row's link: a single `BitkitLink` with its own `href`, `isExternal`, `colorVariant` and any\n * other link prop. The type only rules out bare text and multiple children — a non-link element,\n * or a `BitkitLink` without an `href`, type-checks as well and leaves the row looking linked\n * while navigating nowhere. Anything else the cell should show (an icon, a `VisuallyHidden` name)\n * goes inside the link.\n */\n children: ReactElement<BitkitLinkProps>;\n}\n\n/**\n * The cell that carries the row's link, so give it the cell that names the row. The cell only\n * stretches its link across the row, leaving the styling to the link itself.\n */\nconst LinkCell = forwardRef<HTMLTableCellElement, BitkitLinkedRowLinkCellProps>((props, ref) => {\n const { children, ...rest } = props;\n const styles = useTableStyles();\n\n return (\n <Table.Cell ref={ref} css={styles.linkCell} data-link-cell {...rest}>\n {children}\n </Table.Cell>\n );\n});\n\nLinkCell.displayName = 'BitkitLinkedRow.LinkCell';\n\nexport default withSubComponents(BitkitLinkedRow, { LinkCell });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,IAAM,kBAAkB,YAAuD,OAAO,QAAQ;CAC5F,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,MAAM,KAAP;EAAgB;EAAK,KAAK,OAAO;EAAW,GAAI;EAC7C;CACQ,CAAA;AAEf,CAAC;AAED,gBAAgB,cAAc;;;;;AAiB9B,IAAM,WAAW,YAAgE,OAAO,QAAQ;CAC9F,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,MAAM,SAAS,eAAe;CAE9B,OACE,oBAAC,MAAM,MAAP;EAAiB;EAAK,KAAK,OAAO;EAAU,kBAAA;EAAe,GAAI;EAC5D;CACS,CAAA;AAEhB,CAAC;AAED,SAAS,cAAc;AAEvB,IAAA,0BAAe,kBAAkB,iBAAiB,EAAE,SAAS,CAAC"}
|