@genesislcap/foundation-ui 14.178.0 → 14.180.0
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 +114 -12
- package/dist/custom-elements.json +1063 -1063
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
[](https://lerna.js.org/)
|
|
2
|
+
[](https://www.typescriptlang.org/)
|
|
3
|
+
|
|
1
4
|
# Genesis Foundation UI
|
|
2
5
|
|
|
3
|
-
This
|
|
6
|
+
This package contains our core foundation UI component library + FAST components. These base components are abstracted from
|
|
4
7
|
their style. Apps shouldn't have a dependency on this unless they have very good reason to. Instead, they should depend
|
|
5
8
|
on the design system variant that takes this foundation and applies styling etc.
|
|
6
9
|
|
|
7
|
-
See [
|
|
10
|
+
- See [Zero Design System](../foundation-ds/foundation-zero/README.md).
|
|
11
|
+
- See [Rapid Design System](../foundation-ds/foundation-rapid/README.md).
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
## [API Docs](./docs/api/index.md)
|
|
14
|
+
|
|
15
|
+
## [Module Federation Details](https://webpack.js.org/concepts/module-federation):
|
|
10
16
|
|
|
11
17
|
| Remote Name | Port |
|
|
12
18
|
| --------------------- | ----- |
|
|
13
19
|
| foundationUi | 4010 |
|
|
14
20
|
|
|
15
|
-
[](https://lerna.js.org/)
|
|
16
|
-
[](https://www.typescriptlang.org/)
|
|
17
|
-
|
|
18
|
-
|
|
19
21
|
## Installation
|
|
20
22
|
|
|
21
23
|
To enable this module in your application, follow the steps below.
|
|
@@ -24,21 +26,121 @@ To enable this module in your application, follow the steps below.
|
|
|
24
26
|
|
|
25
27
|
```json
|
|
26
28
|
{
|
|
27
|
-
...
|
|
28
29
|
"dependencies": {
|
|
29
|
-
...
|
|
30
30
|
"@genesislcap/foundation-ui": "latest"
|
|
31
|
-
...
|
|
32
31
|
},
|
|
33
|
-
...
|
|
34
32
|
}
|
|
35
33
|
```
|
|
36
34
|
|
|
37
|
-
##
|
|
35
|
+
## Setting Up the Design System
|
|
36
|
+
|
|
37
|
+
The setup involves providing and registering Design System components from `foundation-ui` or other places. Here's how you can do it:
|
|
38
|
+
|
|
39
|
+
### Providing the Design System & Registering All Components
|
|
40
|
+
|
|
41
|
+
Tipically, in the `components.ts` file (or your entry-point for app-level setups), you provide the design system using `provideDesignSystem` and register components against that design system. Here's an example:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { baseComponents, provideDesignSystem } from '@genesislcap/foundation-ui';
|
|
45
|
+
|
|
46
|
+
provideDesignSystem().register(baseComponents);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
In the example above, `baseComponents` is a collection of components that are part of the same Design System. You can also register additional components if needed (even from other Design Systems, which will be prefixed with `foundation-` in this case).
|
|
50
|
+
|
|
51
|
+
### Registering Specific Components
|
|
52
|
+
|
|
53
|
+
If you want to register specific components, you can do so by importing them from the design system and registering them. Here's an example:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { foundationButton, foundationDesignSystemProvider, provideDesignSystem } from '@genesislcap/foundation-ui';
|
|
57
|
+
|
|
58
|
+
provideDesignSystem().register(
|
|
59
|
+
/**
|
|
60
|
+
* Design system provider element used to declaratively apply zero config to every dom node in the host tree.
|
|
61
|
+
*/
|
|
62
|
+
foundationDesignSystemProvider(),
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Button component
|
|
66
|
+
*/
|
|
67
|
+
foundationButton()
|
|
68
|
+
);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
In the example above, `foundation-button` will be the only component registered in the Foundation Design System. YOu can also register multiple components at once:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { foundationButton, foundationCard, foundationDesignSystemProvider, foundationModal, provideDesignSystem } from '@genesislcap/foundation-ui';
|
|
75
|
+
|
|
76
|
+
provideDesignSystem().register(
|
|
77
|
+
/**
|
|
78
|
+
* Design system provider element used to declaratively apply zero config to every dom node in the host tree.
|
|
79
|
+
*/
|
|
80
|
+
foundationDesignSystemProvider(),
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Components that will be registered in the Foundation Design System
|
|
84
|
+
*/
|
|
85
|
+
foundationButton(),
|
|
86
|
+
foundationCard(),
|
|
87
|
+
foundationModal()
|
|
88
|
+
);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Registering Third-Party Components
|
|
92
|
+
|
|
93
|
+
We provide a few "third-party" components that are not part of the Design System package. These can be registered in the same way as the other Design System components. Here's an example:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
|
|
97
|
+
import { baseComponents, provideDesignSystem } from '@genesislcap/foundation-ui';
|
|
98
|
+
import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
|
|
99
|
+
import { gridComponents } from '@genesislcap/grid-pro';
|
|
100
|
+
|
|
101
|
+
provideDesignSystem().register(
|
|
102
|
+
baseComponents,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Third-party components
|
|
106
|
+
*/
|
|
107
|
+
foundationLayoutComponents,
|
|
108
|
+
g2plotChartsComponents,
|
|
109
|
+
gridComponents
|
|
110
|
+
);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The example above registers Foundation UI components from the Foundation Design System, Foundation Layout, G2Plot Charts, and Grid Pro.
|
|
114
|
+
|
|
115
|
+
## Extra - Multiple Design Systems
|
|
116
|
+
|
|
117
|
+
You can also provide multiple design systems in your application. Here's an example:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { baseComponents, provideDesignSystem } from '@genesislcap/foundation-ui';
|
|
121
|
+
import { baseComponents as rapidBaseComponents, provideDesignSystem as provideRapidDesignSystem } from '@genesislcap/foundation-rapid';
|
|
122
|
+
import { baseComponents as zeroBaseComponents, provideDesignSystem as provideZeroDesignSystem } from '@genesislcap/foundation-zero';
|
|
123
|
+
|
|
124
|
+
provideDesignSystem().register(baseComponents);
|
|
125
|
+
provideRapidDesignSystem().register(rapidBaseComponents);
|
|
126
|
+
provideZeroDesignSystem().register(zeroBaseComponents);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
In the example above, we provide three different design systems: the base design system, the rapid design system, and the zero design system.
|
|
130
|
+
|
|
131
|
+
With those in place you can now use the components from the different design systems in your application:
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<foundation-button>Base Button</foundation-button>
|
|
135
|
+
<rapid-button>Rapid Button</rapid-button>
|
|
136
|
+
<zero-button>Zero Button</zero-button>
|
|
137
|
+
```
|
|
138
|
+
|
|
38
139
|
|
|
39
140
|
## License
|
|
40
141
|
|
|
41
142
|
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
|
|
42
143
|
|
|
43
144
|
### Licensed components
|
|
145
|
+
|
|
44
146
|
Genesis low-code platform
|