@amsterdam/design-system-react 0.1.5 → 0.1.7

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  The `@amsterdam/design-system-react` package contains React implementations of various components. You can use this package in React apps.
6
6
 
7
- The design tokens used in these components are published in a separate npm package, so don't forget to install and include `@amsterdam/design-system-tokens` too.
7
+ The design tokens and css used in these components are published in separate npm packages, so don't forget to install and include `@amsterdam/design-system-tokens` and `@amsterdam/design-system-css` too.
8
8
 
9
9
  <!-- TODO: make this easier? -->
10
10
 
@@ -20,7 +20,7 @@ Make sure you specify the exact version as dependency, so you can schedule to up
20
20
 
21
21
  Install the packages you need, for instance:
22
22
 
23
- `npm install @amsterdam/design-system-react @amsterdam/design-system-tokens @amsterdam/design-system-assets`
23
+ `npm install @amsterdam/design-system-react @amsterdam/design-system-tokens @amsterdam/design-system-assets @amsterdam/design-system-css`
24
24
 
25
25
  Import the packages you need.
26
26
 
@@ -29,6 +29,7 @@ import { Paragraph } from "@amsterdam/design-system-react";
29
29
 
30
30
  import "@amsterdam/design-system-tokens/dist/root.css";
31
31
  import "@amsterdam/design-system-assets/font/index.css";
32
+ import "@amsterdam/design-system-css/dist/index.css";
32
33
 
33
34
  function App() {
34
35
  return <Paragraph>Hello world</Paragraph>;
@@ -36,19 +37,3 @@ function App() {
36
37
 
37
38
  export default App;
38
39
  ```
39
-
40
- ## Unstyled components
41
-
42
- If you need unstyled React components (if you completely want to restyle them yourself, or you can't use style injection in your project because of a strict CSP for example), you can import these as well.
43
-
44
- For example, to import an unstyled Paragraph component:
45
-
46
- ```javascript
47
- import { Paragraph } from "@amsterdam/design-system-react/unstyled";
48
- ```
49
-
50
- If you do want to style unstyled React components using our css, you can add the component css from our `@amsterdam/design-system-css` package, like so:
51
-
52
- ```javascript
53
- import "@amsterdam/design-system-css/dist/paragraph/paragraph.css";
54
- ```
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import React, { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export interface AlertProps extends PropsWithChildren<HTMLAttributes<HTMLDivElement>> {
7
+ title?: string;
8
+ severity?: undefined | 'error' | 'success';
9
+ closeable?: boolean;
10
+ icon?: boolean;
11
+ onClose?: () => void;
12
+ }
13
+ export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,2 @@
1
+ export { Alert } from './Alert';
2
+ export type { AlertProps } from './Alert';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license EUPL-1.2+
3
+ * Copyright (c) 2023 Gemeente Amsterdam
4
+ */
5
+ import { HTMLAttributes, PropsWithChildren } from 'react';
6
+ export type Ratio = 'extra-tall' | 'tall' | 'square' | 'wide' | 'extra-wide';
7
+ export interface AspectRatioProps extends PropsWithChildren<HTMLAttributes<HTMLDivElement>> {
8
+ ratio?: Ratio;
9
+ }
10
+ export declare const AspectRatio: import("react").ForwardRefExoticComponent<AspectRatioProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,2 @@
1
+ export { AspectRatio } from './AspectRatio';
2
+ export type { AspectRatioProps, Ratio } from './AspectRatio';