@datalayer/primer-addons 0.2.2 → 0.2.3

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,6 +1,5 @@
1
1
  import React from "react";
2
2
  import { BoxProps } from "@primer/react";
3
- import { Icon } from "@primer/octicons-react";
4
3
  export type CardProps = Omit<BoxProps, 'border'> & {
5
4
  rounded?: 'small' | 'medium' | 'large' | 'full' | number;
6
5
  border?: boolean;
@@ -9,7 +8,7 @@ export type CardProps = Omit<BoxProps, 'border'> & {
9
8
  export type CardHeaderProps = {
10
9
  title?: string;
11
10
  description?: string;
12
- leadingIcon?: Icon;
11
+ leadingIcon?: React.ElementType;
13
12
  action?: React.ReactNode;
14
13
  };
15
14
  export type CardImageProps = {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, StyledOcticon, Text } from "@primer/react";
2
+ import { Box, Octicon, Text } from "@primer/react";
3
3
  const roundedVals = {
4
4
  small: "3px",
5
5
  medium: "6px",
@@ -35,7 +35,7 @@ export const Card = (props) => {
35
35
  };
36
36
  Card.Header = (props) => {
37
37
  const { title, description, leadingIcon, action } = props;
38
- return _jsxs(Box, { display: "flex", alignItems: "center", sx: { p: 3 }, children: [leadingIcon && _jsx(Box, { sx: { mr: 3 }, children: _jsx(StyledOcticon, { size: "medium", icon: leadingIcon }) }), _jsxs(Box, { sx: { flexGrow: 1 }, children: [_jsx(Text, { display: "block", children: title }), _jsx(Text, { display: "block", color: "fg.muted", children: description })] }), action && _jsx(Box, { children: action })] });
38
+ return _jsxs(Box, { display: "flex", alignItems: "center", sx: { p: 3 }, children: [leadingIcon && _jsx(Box, { sx: { mr: 3 }, children: _jsx(Octicon, { size: "medium", icon: leadingIcon }) }), _jsxs(Box, { sx: { flexGrow: 1 }, children: [_jsx(Text, { display: "block", children: title }), _jsx(Text, { display: "block", color: "fg.muted", children: description })] }), action && _jsx(Box, { children: action })] });
39
39
  };
40
40
  Card.Image = ({ url, image, svg, height }) => {
41
41
  return (_jsxs(Box, { display: "block", width: "100%", height: `${height}px`, backgroundImage: `url(${url})`, sx: {
@@ -1,8 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import { FlashProps } from "@primer/react";
3
- import { Icon } from "@primer/octicons-react";
4
3
  export type CloseableFlashProps = FlashProps & {
5
- leadingIcon?: Icon;
4
+ leadingIcon?: React.ElementType;
6
5
  onClose?: () => void;
7
6
  };
8
7
  export declare const CloseableFlash: FC<CloseableFlashProps>;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
- import { Box, Flash, StyledOcticon, Text } from "@primer/react";
3
+ import { Box, Flash, Octicon, Text } from "@primer/react";
4
4
  import { XIcon } from "@primer/octicons-react";
5
5
  export const CloseableFlash = (props) => {
6
6
  const { leadingIcon, variant, onClose, ...otherProps } = props;
@@ -14,5 +14,5 @@ export const CloseableFlash = (props) => {
14
14
  if (!isVisible) {
15
15
  return null;
16
16
  }
17
- return (_jsx(Flash, { variant: variant, ...otherProps, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Box, { sx: { flexGrow: 1 }, children: [leadingIcon && _jsx(StyledOcticon, { icon: leadingIcon }), _jsx(Text, { color: `${variant === "default" ? "accent" : (variant === "warning" ? "attention" : variant)}.fg`, children: props.children })] }), _jsx(Box, { onClick: handleClose, sx: { cursor: "pointer" }, children: _jsx(XIcon, { size: 20 }) })] }) }));
17
+ return (_jsx(Flash, { variant: variant, ...otherProps, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Box, { sx: { flexGrow: 1 }, children: [leadingIcon && _jsx(Octicon, { icon: leadingIcon }), _jsx(Text, { color: `${variant === "default" ? "accent" : (variant === "warning" ? "attention" : variant)}.fg`, children: props.children })] }), _jsx(Box, { onClick: handleClose, sx: { cursor: "pointer" }, children: _jsx(XIcon, { size: 20 }) })] }) }));
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/primer-addons",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "license": "BSD-3-Clause",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -23,11 +23,9 @@
23
23
  },
24
24
  "homepage": "https://primer-addons.datalayer.tech",
25
25
  "dependencies": {
26
- "@datalayer/icons-react": "0.2.2",
27
- "@primer/brand-primitives": "0.29.1",
26
+ "@datalayer/icons-react": "0.2.3",
28
27
  "@primer/octicons-react": "19.6.0",
29
- "@primer/react": "0.0.0-20230912151940",
30
- "@primer/react-brand": "0.29.1",
28
+ "@primer/react": "36.6.0",
31
29
  "react": "18.2.0",
32
30
  "react-dom": "18.2.0",
33
31
  "react-loading-skeleton": "3.3.1",
@@ -55,5 +53,5 @@
55
53
  "typescript": "^5.0.2",
56
54
  "vite": "^4.3.2"
57
55
  },
58
- "packageManager": "yarn@3.5.0+sha256.e4fc5f94867cd0b492fb0a644f14e7b47c4387bc75d46b56e86db6d0f1a6cb97"
56
+ "packageManager": "yarn@3.5.0"
59
57
  }