box-ui-elements 23.4.0-beta.5 → 23.4.0-beta.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.
Files changed (39) hide show
  1. package/DEVELOPING.md +13 -29
  2. package/cypress.config.ts +1 -1
  3. package/dist/explorer.css +1 -1
  4. package/dist/explorer.js +1 -1
  5. package/dist/preview.css +1 -1
  6. package/dist/preview.js +1 -1
  7. package/dist/sidebar.js +1 -1
  8. package/es/components/context-menu/ContextMenu.stories.js +3 -3
  9. package/es/components/context-menu/ContextMenu.stories.js.map +1 -1
  10. package/es/components/context-menu/ContextMenuExample.scss +4 -0
  11. package/es/components/context-menu/ContextMenuWithSubmenuExample.js +43 -0
  12. package/es/components/context-menu/ContextMenuWithSubmenuExample.js.map +1 -0
  13. package/es/components/selector-dropdown/SelectorDropdown.stories.js +2 -2
  14. package/es/components/selector-dropdown/SelectorDropdown.stories.js.flow +2 -2
  15. package/es/components/selector-dropdown/SelectorDropdown.stories.js.map +1 -1
  16. package/es/components/selector-dropdown/SelectorDropdownExample.js +126 -0
  17. package/es/components/selector-dropdown/SelectorDropdownExample.js.map +1 -0
  18. package/es/elements/content-preview/preview-header/FileInfo.scss +4 -0
  19. package/es/elements/content-sidebar/BoxAISidebarContent.js +6 -1
  20. package/es/elements/content-sidebar/BoxAISidebarContent.js.map +1 -1
  21. package/es/src/components/context-menu/ContextMenu.stories.d.ts +1 -1
  22. package/es/src/components/context-menu/ContextMenuWithSubmenuExample.d.ts +9 -0
  23. package/es/src/components/selector-dropdown/SelectorDropdownExample.d.ts +3 -0
  24. package/es/src/elements/content-sidebar/BoxAISidebarContent.d.ts +2 -0
  25. package/es/types.d.ts +0 -1
  26. package/eslint.config.js +0 -1
  27. package/i18n/pl-PL.js +2 -2
  28. package/i18n/pl-PL.properties +2 -2
  29. package/package.json +9 -16
  30. package/src/components/context-menu/ContextMenu.stories.tsx +3 -3
  31. package/src/components/context-menu/ContextMenuExample.scss +4 -0
  32. package/src/components/context-menu/ContextMenuWithSubmenuExample.tsx +61 -0
  33. package/src/components/progress-bar/README.md +1 -11
  34. package/src/components/selector-dropdown/SelectorDropdown.stories.js +2 -2
  35. package/src/components/selector-dropdown/SelectorDropdownExample.tsx +140 -0
  36. package/src/elements/content-preview/preview-header/FileInfo.scss +4 -0
  37. package/src/elements/content-sidebar/BoxAISidebarContent.tsx +13 -2
  38. package/src/elements/content-sidebar/__tests__/BoxAISidebar.test.tsx +21 -0
  39. package/types.ts +0 -1
package/DEVELOPING.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Development Setup
2
2
 
3
- Our development setup assumes a LINUX/BSD environemnt.
3
+ Our development setup assumes a LINUX/BSD environment.
4
4
 
5
5
  ## Project Setup
6
6
 
@@ -12,23 +12,20 @@ Our development setup assumes a LINUX/BSD environemnt.
12
12
  6. Add the upstream repo to your remotes `git remote add upstream git@github.com:box/box-ui-elements.git`.
13
13
  7. Verify your remotes are properly set up `git remote -v`. You should pull updates from the `upstream` box repo and push changes to your fork `origin`.
14
14
 
15
- ## Examples Page (aka the Style Guide)
15
+ ## Storybook
16
16
 
17
- A published version of the style guide can be seen at https://opensource.box.com/box-ui-elements/. The style guide uses **_live_** demo data within the UI Elements. Due to security restrictions this data is read-only. You can run a local version of the style guide as follows:
17
+ We use Storybook (https://storybook.js.org/). A published version of our Storybook is available at https://opensource.box.com/box-ui-elements/.
18
18
 
19
- 1. Start the style guide server via `yarn start`.
20
- 2. Navigate to `http://localhost:6060/` to see the UI Elements in action. If testing on a different machine or VM, you can instead use the IP address shown on your terminal window.
21
-
22
- **_NOTE:_** _This note applies to testing top level UI Elements only and not the lower level components. If you want to use your own live data for the style guide, then start the style guide server using [your own developer auth token](https://developer.box.com/docs/authenticate-with-developer-token) and a file or folder ID via_
19
+ ## Local Development
23
20
 
24
- - `TOKEN=<YOUR_TOKEN> FILEID=<YOUR_FILE_ID> yarn start` or
25
- - `TOKEN=<YOUR_TOKEN> FOLDERID=<YOUR_FOLDER_ID> yarn start`
21
+ 1. Start your local Storybook instance via `yarn start`.
22
+ 2. Navigate to `http://localhost:6060/` to see the UI Elements in action. If testing on a different machine or VM, you can instead use the IP address shown on your terminal window.
26
23
 
27
24
  ## Testing UI Elements in a Parent Project
28
25
 
29
26
  ### Webpack Setup
30
27
 
31
- `box-ui-elements` must use the same `react` and `react-dom` instances as the parent application for React hooks to work properly. Application repositories must add the following webpack `resolve` alias configuration to satify this requirement:
28
+ `box-ui-elements` must use the same `react` and `react-dom` instances as the parent application for React hooks to work properly. Application repositories must add the following webpack `resolve` alias configuration to satisfy this requirement:
32
29
 
33
30
  ```js
34
31
  // webpack.config.js
@@ -44,7 +41,7 @@ A published version of the style guide can be seen at https://opensource.box.com
44
41
  }
45
42
  ```
46
43
 
47
- This will ensure that `box-ui-elements` does not use it's own `react` and `react-dom` modules when linked. Improper setup is the primary reason for "**Invalid Hook**" errors due to React version mismatch.
44
+ This will ensure that `box-ui-elements` does not use its own `react` and `react-dom` modules when linked. Improper setup is the primary reason for "**Invalid Hook**" errors due to React version mismatch.
48
45
 
49
46
  We also recommend using `yarn resolutions` to fix the version of `react` and `react-dom` in your application:
50
47
 
@@ -71,9 +68,8 @@ To test the Box UI Elements with your own project use local Yarn linking.
71
68
 
72
69
  ## Common Script Commands
73
70
 
74
- - `yarn start` to launch a local style guide examples server. Uses demo live data for Elements.
71
+ - `yarn start` to launch a local Storybook server. Uses demo live data for Elements.
75
72
  - `yarn start:npm` to symlink Elements via `yarn link` to a parent project.
76
- - `yarn start:dev` to launch a local webpack dev server. Uses your own data for Elements.
77
73
  - `yarn lint` to lint js and css.
78
74
  - `yarn lint:js --fix` to lint js and fix issues.
79
75
  - `yarn lint:css --fix` to lint styles and fix issues.
@@ -102,27 +98,15 @@ For more information, please see https://flow.org/en/docs/react/components/#toc-
102
98
  Install the following plugins in your preferred editor
103
99
 
104
100
  - Editor Config (standardizes basic editor configuration)
105
- - ESLint (Javascript linting)
101
+ - ESLint (JavaScript linting)
106
102
  - Stylelint (CSS linting)
107
- - Prettier (Javscript formatting)
103
+ - Prettier (JavaScript formatting)
108
104
  - Sass (Stylesheets)
109
105
  - Babel (Transpiler)
110
106
 
111
- ## Testing Embedded UI Elements With Your Data
112
-
113
- Under most circumstances you should be using the style guide as mentioned earlier. This section is primarily for testing the Box UI Elements embedded in a custom HTML page with your own box data and auth token. For this, launch a local webpack dev server via `yarn start:dev` and navigate to `http://localhost:8080/`. HTML test files for local development are located inside the [test folder](http://localhost:8080/test).
114
-
115
- 1. Open a test file, such as http://localhost:8080/test/sidebar.html
116
- 2. When prompted, enter a file id and developer token.
117
- 1. Developer tokens can be created at https://app.box.com/developers/console.
118
- 2. Select `Custom App` and choose `Oauth 2.0 with JWT (Server Authentication)`.
119
- 3. Select `View Your App` > `Configuration` > `CORS Domains` and add `http://localhost:8080` to the domain whitelist. Save the configuration.
120
- 4. The developer token will be regenerated once the configuration is saved. Copy the token and paste into the prompt in the localhost test page. The token will be valid for an hour; return to the app configuration page to generate a new token.
121
- 5. For additional information about developing on the Box Platform, see the [Platform docs](https://developer.box.com/docs/box-ui-elements#section-using-the-box-ui-elements).
122
-
123
107
  ## Unit Testing
124
108
 
125
- ### `jest` and `enzyme`
109
+ ### `Jest` and `Enzyme`
126
110
 
127
111
  The project uses the `jest` testing framework and `enzyme` for component testing.
128
112
 
@@ -131,7 +115,7 @@ Please refer to the relevant documentation pages for tutorials and troubleshooti
131
115
  - Jest: https://jestjs.io
132
116
  - Enzyme: https://airbnb.io/enzyme/
133
117
 
134
- ### Testing Hooks with `enzyme`
118
+ ### Testing Hooks with `Enzyme`
135
119
 
136
120
  Most hooks can be tested with `shallow` rendering except for lifecycle hooks such as `useEffect` and `useLayoutEffect`.
137
121
 
package/cypress.config.ts CHANGED
@@ -10,7 +10,7 @@ export default defineConfig({
10
10
  viewportHeight: 1260,
11
11
  viewportWidth: 1600,
12
12
  e2e: {
13
- baseUrl: 'http://localhost:6061',
13
+ baseUrl: 'http://localhost:6060',
14
14
  specPattern: 'test/integration/**/*.cy.{js,jsx,ts,tsx}',
15
15
  supportFile: 'test/support/index.js',
16
16
  },