@datalayer/primer-addons 1.0.1 → 1.0.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.
package/README.md CHANGED
@@ -34,13 +34,13 @@ This project has been [shared in a discussion](https://github.com/primer/react/d
34
34
  Install the dependencies.
35
35
 
36
36
  ```bash
37
- yarn
37
+ npm i
38
38
  ```
39
39
 
40
40
  Start the storybook.
41
41
 
42
42
  ```bash
43
- npm storybook
43
+ npm run storybook
44
44
  ```
45
45
 
46
46
  Start the playground.
@@ -0,0 +1,7 @@
1
+ import { ComponentProps } from 'react';
2
+ import type { BackgroundProps, BorderProps, ColorProps, FlexboxProps, GridProps, LayoutProps, PositionProps, ShadowProps, SpaceProps, TypographyProps } from 'styled-system';
3
+ import { type SxProp } from './sx';
4
+ type StyledBoxProps = SxProp & SpaceProps & ColorProps & TypographyProps & LayoutProps & FlexboxProps & GridProps & BackgroundProps & BorderProps & PositionProps & ShadowProps;
5
+ export declare const Box: import("styled-components").StyledComponent<"div", any, StyledBoxProps, never>;
6
+ export type BoxProps = ComponentProps<typeof Box>;
7
+ export default Box;
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2021-2024 Datalayer, Inc.
3
+ *
4
+ * Datalayer License
5
+ */
6
+ import styled from 'styled-components';
7
+ import { background, border, color, flexbox, grid, layout, position, shadow, space, typography } from 'styled-system';
8
+ import sx from './sx';
9
+ export const Box = styled.div(space, color, typography, layout, flexbox, grid, background, border, position, shadow, sx);
10
+ export default Box;
@@ -0,0 +1,21 @@
1
+ import type { SystemCssProperties, SystemStyleObject } from '@styled-system/css';
2
+ import type { ColorProps, BorderColorProps, ShadowProps } from 'styled-system';
3
+ import merge from 'deepmerge';
4
+ type ThemeColorPaths = string;
5
+ type ThemeShadowPaths = string;
6
+ export type BetterCssProperties = {
7
+ [K in keyof SystemCssProperties]: K extends keyof ColorProps ? ThemeColorPaths | SystemCssProperties[K] : K extends keyof BorderColorProps ? ThemeColorPaths | SystemCssProperties[K] : K extends keyof ShadowProps ? ThemeShadowPaths | SystemCssProperties[K] : SystemCssProperties[K];
8
+ };
9
+ export type CSSCustomProperties = {
10
+ [key: `--${string}`]: string | number;
11
+ };
12
+ type CSSSelectorObject = {
13
+ [cssSelector: string]: SystemStyleObject | CSSCustomProperties;
14
+ };
15
+ export type BetterSystemStyleObject = BetterCssProperties | SystemStyleObject | CSSCustomProperties | CSSSelectorObject;
16
+ export interface SxProp {
17
+ sx?: BetterSystemStyleObject;
18
+ }
19
+ declare const sx: (props: SxProp) => import("@styled-system/css").CssFunctionReturnType;
20
+ export default sx;
21
+ export { merge };
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2021-2024 Datalayer, Inc.
3
+ *
4
+ * Datalayer License
5
+ */
6
+ import css from '@styled-system/css';
7
+ import merge from 'deepmerge';
8
+ const sx = (props) => css(props.sx);
9
+ export default sx;
10
+ export { merge };
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./components/box/Box";
1
2
  export * from "./components/card/Card";
2
3
  export * from "./components/content-loader/ContentLoader";
3
4
  export * from "./components/closeable-flash/CloseableFlash";
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./components/box/Box";
1
2
  export * from "./components/card/Card";
2
3
  export * from "./components/content-loader/ContentLoader";
3
4
  export * from "./components/closeable-flash/CloseableFlash";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/primer-addons",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "license": "BSD-3-Clause",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -27,32 +27,32 @@
27
27
  "@primer/octicons-react": "^19.15.1",
28
28
  "@primer/primitives": "^10.5.0",
29
29
  "@primer/react": "^37.19.0",
30
- "react": "18.3.1",
31
- "react-dom": "18.3.1",
30
+ "react": "^18.3.1 || ^19.0.0",
31
+ "react-dom": "^18.3.1 || ^19.0.0",
32
32
  "react-loading-skeleton": "^3.5.0",
33
33
  "styled-components": "^5.3.10"
34
34
  },
35
35
  "devDependencies": {
36
- "@storybook/addon-essentials": "^8.0.10",
37
- "@storybook/addon-interactions": "^8.0.10",
38
- "@storybook/addon-links": "^8.0.10",
39
- "@storybook/blocks": "^8.0.10",
40
- "@storybook/react": "^8.0.10",
41
- "@storybook/react-vite": "^8.0.10",
36
+ "@storybook/addon-essentials": "9.0.0-alpha.12",
37
+ "@storybook/addon-interactions": "9.0.0-alpha.10",
38
+ "@storybook/addon-links": "^9.0.15",
39
+ "@storybook/blocks": "9.0.0-alpha.17",
40
+ "@storybook/react": "^9.0.15",
41
+ "@storybook/react-vite": "^9.0.15",
42
42
  "@storybook/testing-library": "^0.2.2",
43
43
  "@types/react": "18.3.20",
44
44
  "@types/react-dom": "18.3.6",
45
45
  "@types/styled-components": "^5.1.34",
46
46
  "@typescript-eslint/eslint-plugin": "^8.29.1",
47
47
  "@typescript-eslint/parser": "^8.29.1",
48
- "@vitejs/plugin-react": "^4.2.1",
48
+ "@vitejs/plugin-react": "^4.5.2",
49
49
  "eslint": "^9.0.0",
50
50
  "eslint-plugin-react-hooks": "^5.2.0",
51
51
  "eslint-plugin-react-refresh": "^0.3.4",
52
52
  "eslint-plugin-storybook": "^0.6.12",
53
53
  "prop-types": "^15.8.1",
54
- "storybook": "^8.0.10",
54
+ "storybook": "^9.0.15",
55
55
  "typescript": "^5.8.3",
56
- "vite": "^6.2.6"
56
+ "vite": "^7.0.0"
57
57
  }
58
58
  }