@ilo-org/react 0.0.13 → 0.0.15

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 (36) hide show
  1. package/.storybook/manager-head.html +1 -6
  2. package/.storybook/preview.tsx +7 -0
  3. package/.turbo/turbo-build.log +90 -74
  4. package/.turbo/turbo-check.log +1 -1
  5. package/.turbo/turbo-test.log +13 -835
  6. package/CHANGELOG.md +41 -0
  7. package/README.md +183 -5
  8. package/package.json +7 -7
  9. package/src/components/ChoiceGroup/ChoiceGroup.args.ts +2 -1
  10. package/src/components/ChoiceGroup/ChoiceGroup.tsx +15 -3
  11. package/src/components/Fieldset/Fieldset.tsx +1 -1
  12. package/src/components/Radio/Radio.props.d.ts +5 -0
  13. package/src/components/Radio/Radio.tsx +3 -6
  14. package/src/components/SearchField/SearchField.tsx +7 -8
  15. package/src/components/Video/VideoPlayer.tsx +11 -2
  16. package/src/stories/Introduction.stories.mdx +252 -6
  17. package/src/stories/Welcome.stories.mdx +63 -0
  18. package/storybook-static/212.faba6ad0.iframe.bundle.js +7 -0
  19. package/storybook-static/{804.292f3e06.iframe.bundle.js.LICENSE.txt → 212.faba6ad0.iframe.bundle.js.LICENSE.txt} +0 -0
  20. package/storybook-static/212.faba6ad0.iframe.bundle.js.map +1 -0
  21. package/storybook-static/iframe.html +2 -2
  22. package/storybook-static/index.html +1 -1
  23. package/storybook-static/main.7bfb35c8.iframe.bundle.js +1 -0
  24. package/storybook-static/project.json +1 -1
  25. package/storybook-static/static/css/main.acddc31a.css +3 -0
  26. package/storybook-static/static/css/main.acddc31a.css.map +1 -0
  27. package/src/public/favicon.ico +0 -0
  28. package/src/public/index.html +0 -43
  29. package/src/public/logo192.png +0 -0
  30. package/src/public/logo512.png +0 -0
  31. package/src/public/manifest.json +0 -25
  32. package/src/public/robots.txt +0 -3
  33. package/storybook-static/804.292f3e06.iframe.bundle.js +0 -2
  34. package/storybook-static/main.2a251da6.iframe.bundle.js +0 -1
  35. package/storybook-static/static/css/main.0c4ad0ec.css +0 -3
  36. package/storybook-static/static/css/main.0c4ad0ec.css.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @ilo-org/react
2
2
 
3
+ ## 0.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - f7f448c65: Fixes to React radio button, SearchField, add ability to serve different langauge fonts
8
+ - f4b7bcb7f: Local nav fixes for mobile
9
+ - 0dfb90274: Patchfix for Feature card wide version
10
+ - Updated dependencies [f7f448c65]
11
+ - Updated dependencies [f4b7bcb7f]
12
+ - Updated dependencies [0dfb90274]
13
+ - @ilo-org/fonts@0.0.3
14
+ - @ilo-org/styles@0.1.11
15
+ - @ilo-org/themes@0.1.11
16
+ - @ilo-org/utils@0.0.7
17
+ - @ilo-org/icons-react@0.0.13
18
+
19
+ ## 0.0.14
20
+
21
+ ### Patch Changes
22
+
23
+ - 592c40ae9: Hover fix for data card and breadcrumb for hero
24
+ - 3005bb74c: Fixes to Video, Accordion, List, Checkbox, favicon
25
+ - b72b8aa9e: Update README; various bugfixes with Table, Footer, Notification, Video, RichText
26
+ - d7015e194: - Tag fixes for consistent font size
27
+ - Accordion transition, font size and height fixes
28
+ - Tooltip transition fix
29
+ - Cards padding and anchor the date on feature cards
30
+ - List fix font sizes on mobile
31
+ - Callout fix transition timing
32
+ - 6ba8ee615: Documentation for wingusit
33
+ - Updated dependencies [fdba39df6]
34
+ - Updated dependencies [592c40ae9]
35
+ - Updated dependencies [3005bb74c]
36
+ - Updated dependencies [b72b8aa9e]
37
+ - Updated dependencies [d7015e194]
38
+ - Updated dependencies [6ba8ee615]
39
+ - @ilo-org/styles@0.1.10
40
+ - @ilo-org/icons-react@0.0.12
41
+ - @ilo-org/themes@0.1.10
42
+ - @ilo-org/utils@0.0.6
43
+
3
44
  ## 0.0.13
4
45
 
5
46
  ### Patch Changes
package/README.md CHANGED
@@ -1,11 +1,189 @@
1
1
  # ILO Design System - React Package
2
2
 
3
- ## Status: Proof of Concept
3
+ This package provides the implementation of the Design System using [React](https://reactjs.org). It also includes a [Storybook](https://storybook.js.org/) project for documentation and development of the components in the system. It has dependencies on the following other @ilo-org packages:
4
4
 
5
- This package provides the implementation of the Design System using [React](https://reactjs.org/). It also includes a [Storybook](https://storybook.js.org/) project for documentation and development of React components.
5
+ - [@ilo-org/themes](./packages/themes)
6
+ - [@ilo-org/fonts](./packages/fonts)
7
+ - [@ilo-org/styles](./packages/styles)
8
+ - [@ilo-org/utils](./packages/utils)
9
+ - [@ilo-org/icons](./packages/icons)
10
+ - [@ilo-org/icons-react](./packages/icons-react)
6
11
 
7
- This is just a POC, so the package doesn't expose components or include a build step. Only the Storybook project is implemented.
12
+ ## Installation and PNPM Commands
8
13
 
9
- ## Styling
14
+ To install
10
15
 
11
- Use the `styles` package to manage styling for React components
16
+ ```bash
17
+ npm i @ilo-org/react
18
+ ```
19
+
20
+ To start storybook
21
+
22
+ ```bash
23
+ pnpm storybook
24
+ ```
25
+
26
+ To build storybook
27
+
28
+ ```bash
29
+ pnpm build:storybook
30
+ ```
31
+
32
+ To test formatting
33
+
34
+ ```bash
35
+ pnpm format
36
+ ```
37
+
38
+ To test formatting and fix errors
39
+
40
+ ```bash
41
+ pnpm format:fix
42
+ ```
43
+
44
+ To lint
45
+
46
+ ```bash
47
+ pnpm lint
48
+ ```
49
+
50
+ To test formatting and fix errors
51
+
52
+ ```bash
53
+ pnpm lint:fix
54
+ ```
55
+
56
+ ## Questions and Feedback
57
+
58
+ (TBD)
59
+
60
+ ## Accessibility Standards
61
+
62
+ (TBD)
63
+
64
+ ## Contributing
65
+
66
+ ILO Design System is an open-source project and we welcome your contributions! Before submitting a pull request, please take a moment to review the following guidelines.
67
+
68
+ ### Branches
69
+
70
+ | Branch | Purpose |
71
+ | --------- | ---------------------------------- |
72
+ | `main` | The latest version of all packages |
73
+ | `develop` | The next release of all packages |
74
+
75
+ ### Contribution workflow
76
+
77
+ 1. Fork and clone the repo
78
+ 2. Create a new branch from the `develop` branch
79
+ 3. Make your changes and [add a changeset](#versioning) identifying the changes and affected packages
80
+ 4. Push your branch to the forked version of the repo
81
+ 5. Open a pull request back to the `develop` branch of the main repo
82
+
83
+ ### Versioning
84
+
85
+ The project uses [changesets](https://github.com/changesets/changesets) to manage package versioning. All pull requests that will affect the project's semantic versioning must include a changest.
86
+
87
+ See more information on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
88
+
89
+ ### Conventions
90
+
91
+ Contributions should respect the following conventions for branch names, commit messages and pull request descriptions
92
+
93
+ #### Commits
94
+
95
+ Commits should follow [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#commit).
96
+
97
+ ```
98
+ <type>(<scope>): <subject>
99
+ ```
100
+
101
+ Examples:
102
+
103
+ ```
104
+ fix(react): change button color on hover
105
+ feat(twig): add button component
106
+ ci(github): add release workflow
107
+ perf(react): improve modal animations
108
+ ```
109
+
110
+ #### Types
111
+
112
+ - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
113
+ - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
114
+ - docs: Documentation only changes
115
+ - feat: A new feature
116
+ - fix: A bug fix
117
+ - perf: A code change that improves performance
118
+ - refactor: A code change that neither fixes a bug nor adds a feature
119
+ - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
120
+ - test: Adding missing tests or correcting existing tests
121
+
122
+ #### Scopes
123
+
124
+ This should be a package name or an aspect of the project's configuration.
125
+
126
+ ### Branches
127
+
128
+ Branch names should broadly mirror the same convention as commits.
129
+
130
+ Examples:
131
+
132
+ ```
133
+ feat/react/modal-wrapper
134
+ fix/twig/modal-wrapper
135
+ ```
136
+
137
+ ### Pull requests
138
+
139
+ Pull requests should include a descriptive name and detailed explanation of what merging the pull request will accomplish. Authors should make sure to reference Github issues that the the pull request will fix or affect.
140
+
141
+ ## Building the project
142
+
143
+ Use [nvm](https://github.com/nvm-sh/nvm) to make sure you have the correct version of node installed.
144
+
145
+ ```bash
146
+ nvm use
147
+ ```
148
+
149
+ Install [pnpm](https://pnpm.io/).
150
+
151
+ ```bash
152
+ npm i -g pnpm
153
+ ```
154
+
155
+ Install dependencies
156
+
157
+ ```bash
158
+ pnpm recursive install
159
+ ```
160
+
161
+ Build all packages.
162
+
163
+ ```bash
164
+ pnpm build:all
165
+ ```
166
+
167
+ Start React storybook
168
+
169
+ ```bash
170
+ pnpm start:react-storybook
171
+ ```
172
+
173
+ Start Twig storybook
174
+
175
+ ```bash
176
+ pnpm start:twig-storybook
177
+ ```
178
+
179
+ Check types
180
+
181
+ ```bash
182
+ pnpm check:types
183
+ ```
184
+
185
+ Run all tests
186
+
187
+ ```bash
188
+ pnpm test:all
189
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ilo-org/react",
3
3
  "description": "React components for the ILO's Design System",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "author": "@justintemps",
6
6
  "license": "Apache-2.0",
7
7
  "main": "lib/index.js",
@@ -24,11 +24,11 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@ilo-org/brand-assets": "0.0.1",
27
- "@ilo-org/fonts": "0.0.2",
28
- "@ilo-org/icons-react": "0.0.11",
29
- "@ilo-org/styles": "0.1.9",
30
- "@ilo-org/themes": "0.1.9",
31
- "@ilo-org/utils": "0.0.5",
27
+ "@ilo-org/fonts": "0.0.3",
28
+ "@ilo-org/icons-react": "0.0.13",
29
+ "@ilo-org/styles": "0.1.11",
30
+ "@ilo-org/themes": "0.1.11",
31
+ "@ilo-org/utils": "0.0.7",
32
32
  "classnames": "^2.3.1",
33
33
  "dom-helpers": "^5.2.1",
34
34
  "global": "^4.4.0",
@@ -111,5 +111,5 @@
111
111
  "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
112
112
  "lint:fix": "pnpm lint -- --fix"
113
113
  },
114
- "readme": "# ILO Design System - React Package\n\n## Status: Proof of Concept\n\nThis package provides the implementation of the Design System using [React](https://reactjs.org/). It also includes a [Storybook](https://storybook.js.org/) project for documentation and development of React components.\n\nThis is just a POC, so the package doesn't expose components or include a build step. Only the Storybook project is implemented.\n\n## Styling\n\nUse the `styles` package to manage styling for React components\n"
114
+ "readme": "# ILO Design System - React Package\n\nThis package provides the implementation of the Design System using [React](https://reactjs.org). It also includes a [Storybook](https://storybook.js.org/) project for documentation and development of the components in the system. It has dependencies on the following other @ilo-org packages:\n\n- [@ilo-org/themes](./packages/themes)\n- [@ilo-org/fonts](./packages/fonts)\n- [@ilo-org/styles](./packages/styles)\n- [@ilo-org/utils](./packages/utils)\n- [@ilo-org/icons](./packages/icons)\n- [@ilo-org/icons-react](./packages/icons-react)\n\n## Installation and PNPM Commands\n\nTo install\n\n```bash\nnpm i @ilo-org/react\n```\n\nTo start storybook\n\n```bash\npnpm storybook\n```\n\nTo build storybook\n\n```bash\npnpm build:storybook\n```\n\nTo test formatting\n\n```bash\npnpm format\n```\n\nTo test formatting and fix errors\n\n```bash\npnpm format:fix\n```\n\nTo lint\n\n```bash\npnpm lint\n```\n\nTo test formatting and fix errors\n\n```bash\npnpm lint:fix\n```\n\n## Questions and Feedback\n\n(TBD)\n\n## Accessibility Standards\n\n(TBD)\n\n## Contributing\n\nILO Design System is an open-source project and we welcome your contributions! Before submitting a pull request, please take a moment to review the following guidelines.\n\n### Branches\n\n| Branch | Purpose |\n| --------- | ---------------------------------- |\n| `main` | The latest version of all packages |\n| `develop` | The next release of all packages |\n\n### Contribution workflow\n\n1. Fork and clone the repo\n2. Create a new branch from the `develop` branch\n3. Make your changes and [add a changeset](#versioning) identifying the changes and affected packages\n4. Push your branch to the forked version of the repo\n5. Open a pull request back to the `develop` branch of the main repo\n\n### Versioning\n\nThe project uses [changesets](https://github.com/changesets/changesets) to manage package versioning. All pull requests that will affect the project's semantic versioning must include a changest.\n\nSee more information on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)\n\n### Conventions\n\nContributions should respect the following conventions for branch names, commit messages and pull request descriptions\n\n#### Commits\n\nCommits should follow [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#commit).\n\n```\n<type>(<scope>): <subject>\n```\n\nExamples:\n\n```\nfix(react): change button color on hover\nfeat(twig): add button component\nci(github): add release workflow\nperf(react): improve modal animations\n```\n\n#### Types\n\n- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\n- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)\n- docs: Documentation only changes\n- feat: A new feature\n- fix: A bug fix\n- perf: A code change that improves performance\n- refactor: A code change that neither fixes a bug nor adds a feature\n- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\n- test: Adding missing tests or correcting existing tests\n\n#### Scopes\n\nThis should be a package name or an aspect of the project's configuration.\n\n### Branches\n\nBranch names should broadly mirror the same convention as commits.\n\nExamples:\n\n```\nfeat/react/modal-wrapper\nfix/twig/modal-wrapper\n```\n\n### Pull requests\n\nPull requests should include a descriptive name and detailed explanation of what merging the pull request will accomplish. Authors should make sure to reference Github issues that the the pull request will fix or affect.\n\n## Building the project\n\nUse [nvm](https://github.com/nvm-sh/nvm) to make sure you have the correct version of node installed.\n\n```bash\nnvm use\n```\n\nInstall [pnpm](https://pnpm.io/).\n\n```bash\nnpm i -g pnpm\n```\n\nInstall dependencies\n\n```bash\npnpm recursive install\n```\n\nBuild all packages.\n\n```bash\npnpm build:all\n```\n\nStart React storybook\n\n```bash\npnpm start:react-storybook\n```\n\nStart Twig storybook\n\n```bash\npnpm start:twig-storybook\n```\n\nCheck types\n\n```bash\npnpm check:types\n```\n\nRun all tests\n\n```bash\npnpm test:all\n```\n"
115
115
  }
@@ -4,7 +4,7 @@ import RadioArgs from "../Radio/Radio.args";
4
4
 
5
5
  const checkboxfields = [];
6
6
  const radiofields = [];
7
- const radioid = `radio${Math.random() * (1000 - 1) + 1}`;
7
+ const radioid = `radio${Math.floor(Math.random() * (1000 - 1) + 1)}`;
8
8
 
9
9
  for (let i = 0; i < 5; i++) {
10
10
  const checkboxargs = { ...CheckboxArgs.basic };
@@ -17,6 +17,7 @@ for (let i = 0; i < 5; i++) {
17
17
  radiofields.push(radioargs);
18
18
  radiofields[i].label = `Radio ${i}`;
19
19
  radiofields[i].name = radioid;
20
+ radiofields[i].id = `${radioid}${i}`;
20
21
  radiofields[i].type = "radio";
21
22
  }
22
23
 
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
1
+ import { FC, useState } from "react";
2
2
  import { ChoiceGroupProps } from "./ChoiceGroup.props";
3
3
  import { Checkbox } from "../Checkbox";
4
4
  import { Fieldset } from "../Fieldset";
@@ -16,6 +16,12 @@ const ChoiceGroup: FC<ChoiceGroupProps> = ({
16
16
  // whatever type the first item has we expect from the other items
17
17
  const sanitzeditems = items.filter((item: any) => item !== items[0].type);
18
18
 
19
+ const [radio, setRadio] = useState(false);
20
+
21
+ const radioChangeHandler = (e: any) => {
22
+ setRadio(e.target.value);
23
+ };
24
+
19
25
  return (
20
26
  <Fieldset
21
27
  className={`ilo--choice-group ${className ? className : ""}`}
@@ -26,12 +32,18 @@ const ChoiceGroup: FC<ChoiceGroupProps> = ({
26
32
  grouptooltip={grouptooltip}
27
33
  >
28
34
  {sanitzeditems.map((item: any, i: any) => {
29
- console.log(item);
30
35
  if (item?.type === "checkbox") {
31
36
  return <Checkbox {...(item as any)} key={i} />;
32
37
  }
33
38
  if (item?.type === "radio") {
34
- return <Radio {...(item as any)} key={i} />;
39
+ return (
40
+ <Radio
41
+ {...(item as any)}
42
+ callback={radioChangeHandler}
43
+ selected={radio}
44
+ key={i}
45
+ />
46
+ );
35
47
  }
36
48
  })}
37
49
  ;
@@ -55,7 +55,7 @@ const Fieldset: FC<FieldsetProps> = ({
55
55
  {child.props.label && (
56
56
  <label
57
57
  className={`${baseClass}--label`}
58
- htmlFor={child.props.id}
58
+ htmlFor={child.props.id ? child.props.id : child.props.name}
59
59
  >
60
60
  {child.props.label}
61
61
  {child.props.tooltip && (
@@ -44,6 +44,11 @@ export interface RadioProps {
44
44
  */
45
45
  required?: boolean;
46
46
 
47
+ /**
48
+ * Which radio button has been selected?
49
+ */
50
+ selected?: string | boolean;
51
+
47
52
  /**
48
53
  * Does this Radio have a tooltip?
49
54
  */
@@ -1,4 +1,4 @@
1
- import { FC, useState } from "react";
1
+ import { FC } from "react";
2
2
  import classNames from "classnames";
3
3
  import useGlobalSettings from "../../hooks/useGlobalSettings";
4
4
  import { RadioProps } from "./Radio.props";
@@ -13,6 +13,7 @@ const Radio: FC<RadioProps> = ({
13
13
  label,
14
14
  name,
15
15
  required,
16
+ selected,
16
17
  tooltip,
17
18
  value,
18
19
  }) => {
@@ -24,14 +25,10 @@ const Radio: FC<RadioProps> = ({
24
25
  [`error`]: error,
25
26
  });
26
27
 
27
- const [checked, setChecked] = useState(false);
28
-
29
28
  /**
30
29
  * On change, if there is a callback, call it
31
30
  */
32
31
  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
33
- setChecked(e.target.checked);
34
-
35
32
  if (callback) {
36
33
  callback(e);
37
34
  }
@@ -54,7 +51,7 @@ const Radio: FC<RadioProps> = ({
54
51
  required={required as any}
55
52
  type={"radio"}
56
53
  className={RadioClasses}
57
- checked={checked}
54
+ checked={selected == value}
58
55
  value={value}
59
56
  />
60
57
  </FormElement>
@@ -22,14 +22,18 @@ const SearchField: FC<SearchFieldProps> = ({
22
22
  /**
23
23
  * On click, if there is a callback, call it
24
24
  */
25
- const handleClick = (e: React.MouseEvent<Element, MouseEvent>) => {
25
+ const handleSubmit = (e: React.SyntheticEvent) => {
26
26
  if (callback) {
27
27
  callback(e);
28
28
  }
29
29
  };
30
30
 
31
31
  return (
32
- <form className={SearchFieldClasses} action={action}>
32
+ <form
33
+ className={SearchFieldClasses}
34
+ action={action}
35
+ onSubmit={(e) => handleSubmit(e)}
36
+ >
33
37
  <Input
34
38
  id={input.id}
35
39
  name={input.name}
@@ -42,12 +46,7 @@ const SearchField: FC<SearchFieldProps> = ({
42
46
  type={input.type}
43
47
  className={`${prefix}--input`}
44
48
  />
45
- <input
46
- className={buttonClass}
47
- disabled={input.disabled}
48
- type="submit"
49
- onClick={(e) => handleClick(e)}
50
- />
49
+ <input className={buttonClass} disabled={input.disabled} type="submit" />
51
50
  </form>
52
51
  );
53
52
  };
@@ -50,6 +50,11 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
50
50
  */
51
51
  const videoElement = createRef();
52
52
 
53
+ /**
54
+ * Ref for the video container
55
+ */
56
+ const videoContainer = createRef();
57
+
53
58
  const youtubeparams = {
54
59
  controls: 0,
55
60
  modestbranding: 1,
@@ -68,7 +73,7 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
68
73
  const toggleFullscreen = () => {
69
74
  /* This is a known issue with ReactPlayer */
70
75
  /* @ts-ignore */
71
- screenfull.request(findDOMNode(videoElement.current));
76
+ screenfull.request(findDOMNode(videoContainer.current));
72
77
  };
73
78
 
74
79
  /**
@@ -162,7 +167,10 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
162
167
  };
163
168
 
164
169
  return (
165
- <div className={`${baseClass}--container`}>
170
+ <div
171
+ className={`${baseClass}--container`}
172
+ ref={videoContainer as React.RefObject<HTMLDivElement>}
173
+ >
166
174
  <ReactPlayer
167
175
  className={playerClasses}
168
176
  config={playerconfig as any}
@@ -173,6 +181,7 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
173
181
  url={src as any}
174
182
  width="100%"
175
183
  height="100%"
184
+ progressInterval={30}
176
185
  volume={volume}
177
186
  onProgress={handleProgress}
178
187
  onDuration={handleDuration}