@ansible/ansible-ui-framework 0.0.286 → 0.0.288

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/README.md +78 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,89 @@
1
1
  # Ansible UI Framework
2
2
 
3
- Framework for building consistent responsive web applications using [PatternFly](https://www.patternfly.org).
3
+ [NPM Package](https://www.npmjs.com/package/@ansible/ansible-ui-framework)
4
+
5
+ A framework for building responsive web applications using [PatternFly](https://www.patternfly.org).
4
6
 
5
7
  Developed by the Ansible UI developers.
6
8
 
9
+ While PatternFly provides the building blocks and guidance on building applications,
10
+ PatternFly does not manage state for the developer.
11
+
12
+ This framework adds state management and abstractions for common patterns of application development.
13
+
14
+ The framework:
15
+
16
+ - does not use any state libraries other than the built in react context state management.
17
+ - does not assume any specific translation libraries, but does provide a hook for internal translations.
18
+ - does not assume any specific navigation libraries, but does provide a hook for internal navigation.
19
+
20
+ There is an [Ansible UI Framework Demo](https://github.com/jamestalton/ansible-ui-framework-demo) repo showing an example of using the framework.
21
+
7
22
  ## Getting Started
8
23
 
9
- ### [NPM Package](https://www.npmjs.com/package/@ansible/ansible-ui-framework)
24
+ ### Install the NPM package
10
25
 
11
26
  ```
12
27
  npm install @ansible/ansible-ui-framework
13
28
  ```
29
+
30
+ ### Add PageFramework to your application
31
+
32
+ Near the top of your application add the `<PageFramework>` component.
33
+
34
+ The `PageFramework` component bundles up all the context providers in the Ansible UI framework in a convienent component for framework consumers. Examples of internal context providers are translations, navigation, settings, alerts, and dialogs.
35
+
36
+ ```tsx
37
+ <PageFramework navigate={navigate}>...</PageFramework>
38
+ ```
39
+
40
+ ### Use PageLayout in your pages
41
+
42
+ The `PageLayout` is used at the start of each page. It provides a consistent layout of page elements. It enables responsive layout based on the size of the window.
43
+
44
+ ```tsx
45
+ (
46
+ <Page>
47
+ <PageLayout>
48
+ <PageHeader {...}/>
49
+ ...
50
+ </PageLayout>
51
+ </Page>
52
+ )
53
+ ```
54
+
55
+ ### Use PageHeader at the top of your pages
56
+
57
+ The `PageHeader` is used at the top of each page. It provides a consistent layout of header elements. It supports responsive layout based on the size of the window.
58
+
59
+ ```tsx
60
+ (
61
+ <Page>
62
+ <PageLayout>
63
+ <PageHeader
64
+ breadcrumbs={breadcrumbs}
65
+ title="Page title"
66
+ titleHelp="Page title popover description."
67
+ description="Page description"
68
+ headerActions={actions}
69
+ />
70
+ ...
71
+ </PageLayout>
72
+ </Page>
73
+ ```
74
+
75
+ #### Adding a page with a table
76
+
77
+ The `PageTable` handles the logic for tables on a page. It supports responsive layout based on the size of the window.
78
+
79
+ ```tsx
80
+ <PageTable<User>
81
+ toolbarFilters={toolbarFilters}
82
+ toolbarActions={toolbarActions}
83
+ tableColumns={tableColumns}
84
+ rowActions={rowActions}
85
+ {...view}
86
+ />
87
+ ```
88
+
89
+ See the [Table Guide](https://github.com/ansible/ansible-ui/blob/main/framework/docs/tables.md) for details.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "Framework for building consistent responsive web applications using PatternFly.",
4
- "version": "0.0.286",
4
+ "version": "0.0.288",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "repository": {