@conveyorhq/arrow-ds 1.20.0 → 1.23.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 (44) hide show
  1. package/package.json +1 -1
  2. package/public/components/Table/Table.d.ts +3 -1
  3. package/public/components/Table/Table.js +10 -3
  4. package/public/components/Table/TableCell.js +3 -1
  5. package/public/components/Table/index.d.ts +3 -0
  6. package/public/components/VendorLogo/VendorLogo.d.ts +3 -2
  7. package/public/components/VendorLogo/VendorLogo.js +2 -2
  8. package/public/css/styles.css +6579 -1259
  9. package/public/css/styles.min.css +1 -1
  10. package/public/css/styles.min.css.map +1 -1
  11. package/public/tokens/_tailwind-config.d.ts +656 -236
  12. package/public/tokens/_tailwind-config.js +2 -2
  13. package/public/tokens/box-shadow.d.ts +1 -0
  14. package/public/tokens/box-shadow.js +1 -0
  15. package/public/tokens/height.d.ts +65 -43
  16. package/public/tokens/height.js +3 -44
  17. package/public/tokens/index.d.ts +526 -173
  18. package/public/tokens/index.js +1 -1
  19. package/public/tokens/margin.d.ts +129 -47
  20. package/public/tokens/margin.js +3 -47
  21. package/public/tokens/padding.d.ts +65 -24
  22. package/public/tokens/padding.js +2 -24
  23. package/public/tokens/sizing-scale.d.ts +133 -0
  24. package/public/tokens/sizing-scale.js +136 -0
  25. package/public/tokens/width.d.ts +197 -63
  26. package/public/tokens/width.js +6 -63
  27. package/public/types/index.d.ts +3 -2
  28. package/public/types/index.js +2 -4
  29. package/src/components/Table/Table.story.mdx +90 -0
  30. package/src/components/Table/Table.tsx +32 -1
  31. package/src/components/Table/TableCell.tsx +8 -1
  32. package/src/components/Table/index.css +58 -6
  33. package/src/components/Table/index.ts +3 -0
  34. package/src/components/TopBar/index.css +2 -1
  35. package/src/components/VendorLogo/VendorLogo.tsx +11 -4
  36. package/src/tokens/_tailwind-config.ts +1 -2
  37. package/src/tokens/box-shadow.ts +1 -0
  38. package/src/tokens/height.ts +3 -44
  39. package/src/tokens/index.ts +2 -2
  40. package/src/tokens/margin.ts +4 -47
  41. package/src/tokens/padding.ts +3 -24
  42. package/src/tokens/sizing-scale.ts +134 -0
  43. package/src/tokens/width.ts +7 -63
  44. package/src/types/index.ts +8 -5
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@conveyorhq/arrow-ds",
3
3
  "author": "Conveyor",
4
4
  "license": "MIT",
5
- "version": "1.20.0",
5
+ "version": "1.23.0",
6
6
  "description": "Arrow Design System",
7
7
  "repository": "https://github.com/conveyor/arrow-ds",
8
8
  "publishConfig": {
@@ -13,9 +13,11 @@ interface TableProps extends React.HTMLProps<HTMLTableElement> {
13
13
  stickyColumn?: boolean;
14
14
  hasBatchActions?: boolean;
15
15
  spaceRows?: boolean;
16
+ enableGridSizing?: boolean;
17
+ gridSizing?: string | string[];
16
18
  }
17
19
  declare const Table: {
18
- ({ children, className, onSort, outerBorder, sortColumnId, sortDirection, affixHeader, removeSpacerColumn, noResults, renderInModal, enableHorizontalScroll, stickyColumn, hasBatchActions, spaceRows, ...rest }: TableProps): JSX.Element;
20
+ ({ children, className, onSort, outerBorder, sortColumnId, sortDirection, affixHeader, removeSpacerColumn, noResults, renderInModal, enableHorizontalScroll, stickyColumn, hasBatchActions, spaceRows, style, enableGridSizing, gridSizing, ...rest }: TableProps): JSX.Element;
19
21
  Body: ({ className, children, ...rest }: React.HTMLProps<HTMLTableSectionElement>) => JSX.Element;
20
22
  Row: ({ className, children, selected, ...rest }: import("./TableRow").TableRowProps) => JSX.Element;
21
23
  Cell: React.FunctionComponent<import("./TableCell").TableCellProps>;
@@ -35,9 +35,9 @@ Object.defineProperty(exports, "SORT_DIRECTION", { enumerable: true, get: functi
35
35
  const bem_1 = require("../../utilities/bem");
36
36
  const cn = "Table";
37
37
  const wrapperCn = "TableWrapper";
38
- const Table = ({ children, className, onSort = () => { }, outerBorder = false, sortColumnId, sortDirection, affixHeader = false, removeSpacerColumn = false, noResults = false, renderInModal = false, enableHorizontalScroll = false, stickyColumn = false, hasBatchActions = false, spaceRows = false, ...rest }) => {
38
+ const Table = ({ children, className, onSort = () => { }, outerBorder = false, sortColumnId, sortDirection, affixHeader = false, removeSpacerColumn = false, noResults = false, renderInModal = false, enableHorizontalScroll = false, stickyColumn = false, hasBatchActions = false, spaceRows = false, style, enableGridSizing = false, gridSizing, ...rest }) => {
39
39
  const wrapperClasses = classnames_1.default(bem_1.bem(wrapperCn), enableHorizontalScroll && bem_1.bem(wrapperCn, { m: "enable-hscroll" }), spaceRows && bem_1.bem(wrapperCn, { m: "space-rows" }));
40
- const classes = classnames_1.default(bem_1.bem(cn), removeSpacerColumn && bem_1.bem(cn, { m: "remove-spacer" }), outerBorder && bem_1.bem(cn, { m: "outer-border" }), affixHeader && bem_1.bem(cn, { m: "affix-header" }), noResults && bem_1.bem(cn, { m: "no-results" }), stickyColumn && bem_1.bem(cn, { m: "sticky-column" }), hasBatchActions && bem_1.bem(cn, { m: "batch-actions" }), spaceRows && bem_1.bem(cn, { m: "space-rows" }), className);
40
+ const classes = classnames_1.default(bem_1.bem(cn), removeSpacerColumn && bem_1.bem(cn, { m: "remove-spacer" }), outerBorder && bem_1.bem(cn, { m: "outer-border" }), affixHeader && bem_1.bem(cn, { m: "affix-header" }), noResults && bem_1.bem(cn, { m: "no-results" }), stickyColumn && bem_1.bem(cn, { m: "sticky-column" }), hasBatchActions && bem_1.bem(cn, { m: "batch-actions" }), spaceRows && bem_1.bem(cn, { m: "space-rows" }), enableGridSizing && gridSizing && bem_1.bem(cn, { m: "grid-sizing" }), className);
41
41
  return (react_1.default.createElement(TableContext_1.default.Provider, { value: {
42
42
  handleSort: onSort,
43
43
  sortDirection,
@@ -49,7 +49,14 @@ const Table = ({ children, className, onSort = () => { }, outerBorder = false, s
49
49
  hasBatchActions,
50
50
  } },
51
51
  react_1.default.createElement("div", { className: wrapperClasses },
52
- react_1.default.createElement("table", Object.assign({ className: classes }, rest), children))));
52
+ react_1.default.createElement("table", Object.assign({ className: classes, style: enableGridSizing && gridSizing
53
+ ? {
54
+ gridTemplateColumns: Array.isArray(gridSizing)
55
+ ? gridSizing.join(" ")
56
+ : gridSizing,
57
+ ...style,
58
+ }
59
+ : style }, rest), children))));
53
60
  };
54
61
  exports.Table = Table;
55
62
  Table.Body = TableBody_1.default;
@@ -25,6 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  const react_1 = __importStar(require("react"));
26
26
  const classnames_1 = __importDefault(require("classnames"));
27
27
  const bem_1 = require("../../utilities/bem");
28
+ const Flex_1 = require("../Flex");
28
29
  const Skeleton_1 = require("../Skeleton");
29
30
  const cn = "TableCell";
30
31
  const TableCell = react_1.forwardRef(({ className, removePadding = false, isLoading = false, children, columnWidth, align = "left", style, ...rest }, ref) => {
@@ -32,6 +33,7 @@ const TableCell = react_1.forwardRef(({ className, removePadding = false, isLoad
32
33
  if (columnWidth) {
33
34
  computedStyle.width = columnWidth;
34
35
  }
35
- return (react_1.default.createElement("td", Object.assign({ style: computedStyle, className: classnames_1.default(bem_1.bem(cn), removePadding && bem_1.bem(cn, { m: "removePadding" }), align && `text-${align}`, className), ref: ref }, rest), isLoading ? react_1.default.createElement(Skeleton_1.Skeleton, null) : children));
36
+ return (react_1.default.createElement("td", Object.assign({ style: computedStyle, className: classnames_1.default(bem_1.bem(cn), removePadding && bem_1.bem(cn, { m: "removePadding" }), align && `text-${align}`, className), ref: ref }, rest), isLoading ? (react_1.default.createElement(Flex_1.Flex, { className: "h-full items-center" },
37
+ react_1.default.createElement(Skeleton_1.Skeleton, { className: "w-full" }))) : (children)));
36
38
  });
37
39
  exports.default = TableCell;
@@ -1 +1,4 @@
1
1
  export * from "./Table";
2
+ export type { TableCellProps } from "./TableCell";
3
+ export type { TableHeaderCellProps } from "./TableHeaderCell";
4
+ export type { TableRowProps } from "./TableRow";
@@ -1,7 +1,8 @@
1
1
  import { ReactElement } from "react";
2
+ import { SizingKeys } from "../../types";
2
3
  import { BoxProps } from "../Box";
3
4
  import { IconType } from "../Icon";
4
- export declare type VendorLogoSize = 4 | 6 | 10 | 14 | 20 | 40;
5
+ export declare type VendorLogoSize = SizingKeys;
5
6
  interface VendorLogoBadgeProps extends BoxProps {
6
7
  icon: IconType;
7
8
  size?: VendorLogoSize;
@@ -14,7 +15,7 @@ interface VendorLogoProps extends BoxProps {
14
15
  children?: ReactElement<VendorLogoBadgeProps>;
15
16
  }
16
17
  export declare const VendorLogo: {
17
- ({ src, vendorName, alt, className, size, children, }: VendorLogoProps): JSX.Element;
18
+ ({ src, vendorName, alt, className, size, children, ...rest }: VendorLogoProps): JSX.Element;
18
19
  Badge: ({ icon, size, className, ...rest }: VendorLogoBadgeProps) => JSX.Element;
19
20
  };
20
21
  export {};
@@ -35,13 +35,13 @@ const VendorLogoBadge = ({ icon, size = 10, className, ...rest }) => {
35
35
  } }, rest),
36
36
  react_1.default.createElement(Icon_1.Icon, { className: bem_1.bem(cn, { e: "icon" }), icon: icon })));
37
37
  };
38
- const VendorLogo = ({ src, vendorName, alt, className, size = 10, children, }) => {
38
+ const VendorLogo = ({ src, vendorName, alt, className, size = 10, children, ...rest }) => {
39
39
  const [loadSuccess, setLoadSuccess] = react_1.useState(!!src);
40
40
  const firstLetter = vendorName && vendorName.length > 0 ? vendorName[0] : "";
41
41
  react_1.useEffect(() => {
42
42
  setLoadSuccess(!!src);
43
43
  }, [src]);
44
- return (react_1.default.createElement(Box_1.Box, { className: classnames_1.default(`${bem_1.bem(cn)} w-${size} h-${size}`, className) },
44
+ return (react_1.default.createElement(Box_1.Box, Object.assign({ className: classnames_1.default(`${bem_1.bem(cn)} w-${size} h-${size}`, className) }, rest),
45
45
  loadSuccess ? (react_1.default.createElement("img", { className: bem_1.bem(cn, { e: "img" }), src: src, alt: alt || vendorName || "", onError: () => {
46
46
  setLoadSuccess(false);
47
47
  } })) : (react_1.default.createElement(Box_1.Box, { className: bem_1.bem(cn, { e: "placeholder" }), style: {