@sebgroup/green-core 1.10.0 → 1.12.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 +79 -22
- package/components/context-menu/context-menu.d.ts +1 -0
- package/components/context-menu/context-menu.styles.d.ts +2 -0
- package/components/grid/grid.d.ts +99 -0
- package/components/grid/grid.style.css.d.ts +2 -0
- package/components/index.d.ts +1 -0
- package/index.js +824 -25
- package/package.json +1 -4
- package/primitives/menu/menu-item.d.ts +1 -0
- package/tokens.style.d.ts +2 -0
- package/transitional-styles.js +26 -28
- package/green-jest-config.cjs +0 -24
- package/setup-jest.js +0 -34
package/README.md
CHANGED
|
@@ -1,33 +1,90 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<a href="https://seb.io">
|
|
3
|
+
<img src="https://github.com/sebgroup/green/assets/11420341/2fc122ba-54fc-4f22-b96d-d405079d6e50">
|
|
4
|
+
</a>
|
|
5
|
+
<br/>
|
|
6
|
+
<br/>
|
|
7
|
+
Green Design System
|
|
8
|
+
</h1>
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
<p align="center">Green is an open-source design system built by SEB.<p>
|
|
11
|
+
<p align="center"><a href="https://github.com/sebgroup/green/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache2.0-005FAC"/></a> <a href="https://semver.org/"><img src="https://img.shields.io/badge/semantic%20versioning-006D31"/></a> <a href="https://nx.dev/"><img src="https://img.shields.io/badge/maintained%20with-nx-006D31"/></a> <a href="https://github.com/sebgroup/green/blob/main/CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-006D31"/></a></p>
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
yarn install @sebgroup/green-core
|
|
13
|
+
## Getting started
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
If you are new to Green, checkout [@sebgroup/green-core](https://github.com/sebgroup/green/tree/main/libs/core).
|
|
16
|
+
|
|
17
|
+
We also provide components for the following technologies:
|
|
18
|
+
|
|
19
|
+
- [React](https://github.com/sebgroup/green/tree/main/libs/react)
|
|
20
|
+
- [Angular](https://github.com/sebgroup/green/tree/main/libs/angular)
|
|
21
|
+
|
|
22
|
+
If you're trying to find something specific, here's a full list of packages that we support!
|
|
23
|
+
|
|
24
|
+
| Package name | Description |
|
|
25
|
+
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
26
|
+
| [@sebgroup/green-core](https://github.com/sebgroup/green/tree/main/libs/core) | Webcomponent library built with [Lit](https://lit.dev) |
|
|
27
|
+
| [@sebgroup/green-react](https://github.com/sebgroup/green/tree/main/libs/react) | React component library |
|
|
28
|
+
| [@sebgroup/green-angular](https://github.com/sebgroup/green/tree/main/libs/angular) | Angular component library |
|
|
29
|
+
| [@sebgroup/chlorophyll](https://github.com/sebgroup/green/tree/main/libs/chlorophyll) | Styling framework |
|
|
30
|
+
| [@sebgroup/green-tokens](https://github.com/sebgroup/green/tree/main/libs/tokens) | Design Tokens package |
|
|
31
|
+
| [@sebgroup/green-charts](https://github.com/sebgroup/green/tree/main/libs/charts) | An SEB wrapper of [Billboard.js](https://naver.github.io/billboard.js/) |
|
|
32
|
+
| [@sebgroup/green-react-charts](https://github.com/sebgroup/green/tree/main/libs/react-charts) | A React version of the charts wrapper |
|
|
33
|
+
| [@sebgroup/green-angular-charts](https://github.com/sebgroup/green/tree/main/libs/angular-charts) | An Angular version of the charts wrapper |
|
|
34
|
+
|
|
35
|
+
## 📋 Table of content
|
|
36
|
+
|
|
37
|
+
- [Documentation](https://github.com/sebgroup/green/tree/main?tab=readme-ov-file#documentation)
|
|
38
|
+
- [Working from SEB](https://github.com/sebgroup/green/tree/main?tab=readme-ov-file#working-from-seb)
|
|
39
|
+
- [Contribute](https://github.com/sebgroup/green/tree/main?tab=readme-ov-file#contribute)
|
|
40
|
+
- [Working locally with this repo](https://github.com/sebgroup/green/tree/main?tab=readme-ov-file#working-locally-with-this-repo)
|
|
41
|
+
|
|
42
|
+
## 📚 Documentation
|
|
43
|
+
|
|
44
|
+
Documentation currently resides in a few different locations:
|
|
45
|
+
|
|
46
|
+
- [User Interface Guidelines (Design Library)](https://designlibrary.sebgroup.com/)
|
|
47
|
+
- [Storybook (@sebgroup/chlorophyll)](https://sebgroup.github.io/green/latest/chlorophyll/)
|
|
48
|
+
- [Storybook (@sebgroup/green-core)](https://sebgroup.github.io/green/latest/core/)
|
|
49
|
+
- [Storybook (@sebgroup/green-react)](https://sebgroup.github.io/green/latest/react/)
|
|
50
|
+
- [Storybook (@sebgroup/green-angular)](https://sebgroup.github.io/green/latest/angular/)
|
|
51
|
+
|
|
52
|
+
## 🏦 Working from SEB
|
|
15
53
|
|
|
16
|
-
|
|
54
|
+
Working from SEB and on SEB machines you need to setup things in a specific way for everything to work smooth. Checkout our [Developer Guidelines](https://github.sebank.se/pages/seb-common/Developer-garden/detail_pages/green.html) over at Developer Garden.
|
|
17
55
|
|
|
18
|
-
|
|
19
|
-
import { GdsButton } from '@sebgroup/green-core'
|
|
20
|
-
import { transitionalStyles } from '@sebgroup/green-core/transitional-styles'
|
|
56
|
+
## 🎉 Contribute
|
|
21
57
|
|
|
22
|
-
|
|
23
|
-
|
|
58
|
+
We're always looking for contributors to help us fix bugs, build new features, or help us improve the project documentation. If you're interested, definitely check out our [Contributing Guide](https://github.com/sebgroup/green/blob/main/CONTRIBUTING.md)! 👀
|
|
59
|
+
|
|
60
|
+
## 🔨 Working locally with this repo
|
|
61
|
+
|
|
62
|
+
### Start Storybook locally
|
|
63
|
+
|
|
64
|
+
To start Storybooks locally on your machine you run the following command:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx nx run [PROJECT]:storybook
|
|
24
68
|
```
|
|
25
69
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
70
|
+
Where you replace `[PROJECT]` with a folder name from `green\libs`.
|
|
71
|
+
|
|
72
|
+
So to start Storybook for each component library run:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx nx run chlorophyll:storybook
|
|
76
|
+
npx nx run react:storybook
|
|
77
|
+
npx nx run angular:storybook
|
|
29
78
|
```
|
|
30
79
|
|
|
31
|
-
|
|
80
|
+
If you install nx globally you can omit the npx above.
|
|
32
81
|
|
|
33
|
-
|
|
82
|
+
```bash
|
|
83
|
+
# Install nx globally
|
|
84
|
+
npm install nx -g
|
|
85
|
+
|
|
86
|
+
# And start the storybooks
|
|
87
|
+
nx run chlorophyll:storybook
|
|
88
|
+
nx run react:storybook
|
|
89
|
+
nx run angular:storybook
|
|
90
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { CSSResult, LitElement } from 'lit';
|
|
2
|
+
declare type GridSizes = 'none' | 'xs' | 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl';
|
|
3
|
+
/**
|
|
4
|
+
* @element gds-grid
|
|
5
|
+
* The `gds-grid` is a custom element that provides a flexible grid system. It uses CSS grid layout to arrange its child elements into columns. This component is highly customizable and responsive, allowing you to specify the number of `columns`, `gap`, `padding`, and fluidity for different devices with automated column size based on the content using the `auto-columns` attribute.
|
|
6
|
+
*
|
|
7
|
+
* @status beta
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class GdsGrid extends LitElement {
|
|
11
|
+
static styles: (CSSResult | CSSResult[])[];
|
|
12
|
+
static shadowRootOptions: ShadowRootInit;
|
|
13
|
+
/**
|
|
14
|
+
* @property {string} columns - The number of columns for the grid. This can be a single value that applies to all breakpoints, or a string of three space-separated tokens in the format "l:desktop m:tablet s:mobile", each token specifying the number of columns for that device type respectively.
|
|
15
|
+
* @example
|
|
16
|
+
* ```html
|
|
17
|
+
* <gds-grid columns="2"></gds-grid> <!-- applies to all breakpoints -->
|
|
18
|
+
* <gds-grid columns="l:8 m:4 s:2"></gds-grid> <!-- different values for each breakpoint -->
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
columns?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* @property {string} `gap` - Defines the gap size between grid items. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <gds-grid gap="m"></gds-grid> <!-- applies to all breakpoints -->
|
|
27
|
+
* <gds-grid gap="l:m m:s s:xs"></gds-grid> <!-- different values for each breakpoint -->
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
gap?: GridSizes;
|
|
31
|
+
/**
|
|
32
|
+
* @property {string} `row-gap` - Defines the gap size between grid items in vertical axis. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <gds-grid row-gap="m"></gds-grid> <!-- applies to all breakpoints -->
|
|
36
|
+
* <gds-grid row-gap="l:m m:s s:xs"></gds-grid> <!-- different values for each breakpoint -->
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
rowGap?: GridSizes;
|
|
40
|
+
/**
|
|
41
|
+
* @property {string} padding - Defines the padding size around the grid. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. Sizes can be 'none', 'xs', 's', 'm', 'l', 'xl', '2xl', '3xl'.
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <gds-grid padding="m"></gds-grid> <!-- applies to all breakpoints -->
|
|
45
|
+
* <gds-grid padding="l:m m:s s:xs"></gds-grid> <!-- different values for each breakpoint -->
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
padding?: GridSizes;
|
|
49
|
+
/**
|
|
50
|
+
* @property {string} auto-columns - Defines the minimum column width in pixels. Accepts a single value for all breakpoints or a "l:desktop m:tablet s:mobile" format. If set, the grid adjusts column size based on content and available width, even without other attributes.
|
|
51
|
+
* @example
|
|
52
|
+
* ```html
|
|
53
|
+
* <gds-grid auto-columns="200"></gds-grid> <!-- applies to all breakpoints -->
|
|
54
|
+
* <gds-grid auto-columns="l:200 m:100 s:80"></gds-grid> <!-- different values for each breakpoint -->
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
autoColumns?: GridSizes;
|
|
58
|
+
/**
|
|
59
|
+
* Lifecycle method called when the element is connected to the DOM.
|
|
60
|
+
* It updates the column, gap, and padding variables.
|
|
61
|
+
*/
|
|
62
|
+
connectedCallback(): void;
|
|
63
|
+
/**
|
|
64
|
+
* State variable that holds the CSS variables for column, gap, and padding.
|
|
65
|
+
*/
|
|
66
|
+
private _gridVariables;
|
|
67
|
+
/**
|
|
68
|
+
* Watcher for the 'columns' property.
|
|
69
|
+
* It updates the column CSS variables when the 'columns' property changes.
|
|
70
|
+
*/
|
|
71
|
+
private _updateColumnVariables;
|
|
72
|
+
/**
|
|
73
|
+
* Watcher for the 'gap' property.
|
|
74
|
+
* It updates the gap CSS variables when the 'gap' property changes.
|
|
75
|
+
*/
|
|
76
|
+
private _updateGapVariables;
|
|
77
|
+
/**
|
|
78
|
+
* Watcher for the 'row-gap' property.
|
|
79
|
+
* It updates the row-gap CSS variables when the 'row-gap' property changes.
|
|
80
|
+
*/
|
|
81
|
+
private _updateRowGapVariables;
|
|
82
|
+
/**
|
|
83
|
+
* Watcher for the 'padding' property.
|
|
84
|
+
* It updates the padding CSS variables when the 'padding' property changes.
|
|
85
|
+
*/
|
|
86
|
+
private _updatePaddingVariables;
|
|
87
|
+
/**
|
|
88
|
+
* Watcher for the 'autoColumns' property.
|
|
89
|
+
* It updates the min-width for each column on a "--_col-width" variable.
|
|
90
|
+
*/
|
|
91
|
+
private _updateAutoColumnsVariables;
|
|
92
|
+
/**
|
|
93
|
+
* Watcher for the '_gridVariables' property.
|
|
94
|
+
* It updates the CSS stylesheet when the '_gridVariables' property changes.
|
|
95
|
+
*/
|
|
96
|
+
private _updateGridCss;
|
|
97
|
+
render(): any;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
package/components/index.d.ts
CHANGED