@abgov/react-components 7.2.0-dev.23 → 7.2.0-dev.25

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 ADDED
@@ -0,0 +1,60 @@
1
+ # React UI Components
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@abgov/react-components?color=%230081a2&label=react-components&style=flat-square)](https://www.npmjs.com/package/@abgov/react-components)
4
+
5
+ React wrappers for the Government of Alberta Design System web components.
6
+
7
+ Supported React versions: 17, 18, and 19.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common @abgov/design-tokens
13
+ ```
14
+
15
+ ## Register the web components
16
+
17
+ Import the underlying web components once in your application entry point, such as
18
+ `src/main.tsx`:
19
+
20
+ ```typescript
21
+ import "@abgov/web-components";
22
+ ```
23
+
24
+ ## Add styles
25
+
26
+ Import the component styles and design tokens in your main stylesheet, such as
27
+ `src/index.css`:
28
+
29
+ ```css
30
+ @import "@abgov/web-components/index.css";
31
+ @import "@abgov/design-tokens/dist/tokens.css";
32
+ ```
33
+
34
+ ## Add icons
35
+
36
+ Add Ionicons to the `<head>` of `index.html`:
37
+
38
+ ```html
39
+ <script
40
+ type="module"
41
+ src="https://cdn.jsdelivr.net/npm/ionicons@latest/dist/ionicons/ionicons.esm.js"
42
+ ></script>
43
+ <script
44
+ nomodule
45
+ src="https://cdn.jsdelivr.net/npm/ionicons@latest/dist/ionicons/ionicons.js"
46
+ ></script>
47
+ ```
48
+
49
+ ## Use a component
50
+
51
+ ```tsx
52
+ import { GoabButton } from "@abgov/react-components";
53
+
54
+ export function App() {
55
+ return <GoabButton type="primary">Continue</GoabButton>;
56
+ }
57
+ ```
58
+
59
+ See the [developer setup guide](https://design.alberta.ca/get-started/developers/setup/) and
60
+ [Government of Alberta Design System](https://design.alberta.ca) for more information.
package/index.js CHANGED
@@ -3318,6 +3318,7 @@ function GoabHeroBannerActions({
3318
3318
  }
3319
3319
  function GoabIconButton({
3320
3320
  variant = "color",
3321
+ type = "default",
3321
3322
  size = "medium",
3322
3323
  theme = "outline",
3323
3324
  disabled,
@@ -3328,7 +3329,7 @@ function GoabIconButton({
3328
3329
  ...rest
3329
3330
  }) {
3330
3331
  const ref = react.useRef(null);
3331
- const _props = transformProps({ variant, size, theme, ...rest }, lowercase);
3332
+ const _props = transformProps({ variant, type, size, theme, ...rest }, lowercase);
3332
3333
  react.useEffect(() => {
3333
3334
  if (!ref.current) {
3334
3335
  return;