@spaced-out/ui-design-system 0.0.3-beta.0 → 0.0.3
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/.all-contributorsrc +36 -0
- package/.cspell/custom-words.txt +3 -0
- package/.storybook/preview.js +3 -1
- package/.storybook/public/images/contributions.png +0 -0
- package/.storybook/public/images/intro-cover.png +0 -0
- package/.storybook/public/images/usage.png +0 -0
- package/CHANGELOG.md +14 -0
- package/CONTRIBUTING.md +161 -0
- package/README.md +85 -131
- package/cspell.json +4 -1
- package/lib/components/Checkbox/CheckboxGroup.js +1 -1
- package/lib/components/Checkbox/CheckboxGroup.js.flow +1 -1
- package/lib/components/Checkbox/index.js +2 -2
- package/lib/components/Checkbox/index.js.flow +2 -2
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dialog/Dialog.js.flow +2 -2
- package/lib/components/Dialog/index.js +1 -1
- package/lib/components/Dialog/index.js.flow +2 -2
- package/lib/components/Icon/index.js +1 -1
- package/lib/components/Icon/index.js.flow +1 -1
- package/lib/components/Modal/Modal.js +4 -4
- package/lib/components/Modal/Modal.js.flow +5 -5
- package/lib/components/Modal/index.js +19 -1
- package/lib/components/Modal/index.js.flow +7 -2
- package/lib/components/Panel/Panel.js +3 -1
- package/lib/components/Panel/Panel.js.flow +2 -0
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/Panel/index.js.flow +2 -2
- package/lib/components/RadioButton/RadioGroup.js +1 -1
- package/lib/components/RadioButton/RadioGroup.js.flow +1 -1
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButton/index.js.flow +2 -2
- package/lib/components/Toggle/index.js +1 -1
- package/lib/components/Toggle/index.js.flow +1 -1
- package/lib/components/Truncate/Truncate.js +12 -6
- package/lib/components/Truncate/Truncate.js.flow +15 -3
- package/package.json +3 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectName": "ui-design-system",
|
|
3
|
+
"projectOwner": "Spaced-Out",
|
|
4
|
+
"repoType": "github",
|
|
5
|
+
"repoHost": "https://github.com",
|
|
6
|
+
"files": [
|
|
7
|
+
"README.md",
|
|
8
|
+
"src/stories/INTRODUCTION.stories.mdx"
|
|
9
|
+
],
|
|
10
|
+
"imageSize": 100,
|
|
11
|
+
"commit": false,
|
|
12
|
+
"commitConvention": "react",
|
|
13
|
+
"contributors": [
|
|
14
|
+
{
|
|
15
|
+
"login": "superrover",
|
|
16
|
+
"name": "Nishant Gaurav",
|
|
17
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/86281150?v=4",
|
|
18
|
+
"profile": "https://github.com/superrover",
|
|
19
|
+
"contributions": [
|
|
20
|
+
"code",
|
|
21
|
+
"doc"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"login": "Anant-Raj",
|
|
26
|
+
"name": "Anant Raj",
|
|
27
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/8904071?v=4",
|
|
28
|
+
"profile": "https://github.com/Anant-Raj",
|
|
29
|
+
"contributions": [
|
|
30
|
+
"code",
|
|
31
|
+
"doc"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"contributorsPerLine": 7
|
|
36
|
+
}
|
package/.cspell/custom-words.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
atleast
|
|
2
2
|
circlehollow
|
|
3
3
|
commitlint
|
|
4
|
+
contributorsrc
|
|
4
5
|
DEFAULTTEXT
|
|
5
6
|
dismissable
|
|
6
7
|
Fennimore
|
|
@@ -10,12 +11,14 @@ Gaurav
|
|
|
10
11
|
Lipsey
|
|
11
12
|
Neue
|
|
12
13
|
Nishant
|
|
14
|
+
OPACITYS
|
|
13
15
|
partialformat
|
|
14
16
|
premajor
|
|
15
17
|
preminor
|
|
16
18
|
prepatch
|
|
17
19
|
rgba
|
|
18
20
|
sbdocs
|
|
21
|
+
superrover
|
|
19
22
|
testid
|
|
20
23
|
tnum
|
|
21
24
|
transclude
|
package/.storybook/preview.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### 0.0.3 (2022-11-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* added new storybook pages ([2844a5e](https://github.com/Spaced-Out/ui-design-system/commit/2844a5e90cfa479268374bc8bfd4f46bc8458149))
|
|
11
|
+
|
|
12
|
+
### 0.0.3-beta.1 (2022-11-21)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* rename showBackdrop in modal to hideBackdrop and releated changes ([303c4d8](https://github.com/Spaced-Out/ui-design-system/commit/303c4d8c95aa75219cf5eca682ebdecf53c27e7c))
|
|
18
|
+
|
|
5
19
|
### 0.0.3-beta.0 (2022-11-21)
|
|
6
20
|
|
|
7
21
|
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Contribution Guidelines
|
|
4
|
+
|
|
5
|
+
Genesis Design System is created using:
|
|
6
|
+
|
|
7
|
+
- [Gulp](https://gulpjs.com/)
|
|
8
|
+
- [CSS Modules](https://github.com/css-modules/css-modules)
|
|
9
|
+
- [React](https://reactjs.org/)
|
|
10
|
+
|
|
11
|
+
It also features:
|
|
12
|
+
|
|
13
|
+
- [Style-Dictionary](https://www.style-dictionary-play.dev/) to help you create and style variables
|
|
14
|
+
- [Storybook](https://storybook.js.org/) to help you create and show off your components
|
|
15
|
+
- [Standard Version](https://github.com/conventional-changelog/standard-version) to manage changelog across releases
|
|
16
|
+
|
|
17
|
+
## Development
|
|
18
|
+
|
|
19
|
+
<br/>
|
|
20
|
+
|
|
21
|
+
### Environment Setup
|
|
22
|
+
|
|
23
|
+
- Clone the repository on Github.
|
|
24
|
+
|
|
25
|
+
- Run the environment locally:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
#clone repository
|
|
29
|
+
git clone git@github.com:Spaced-Out/ui-design-system.git
|
|
30
|
+
|
|
31
|
+
#change directory to the cloned repository
|
|
32
|
+
cd ui-design-system
|
|
33
|
+
|
|
34
|
+
#create new branch
|
|
35
|
+
git checkout -b [BRANCH_NAME]
|
|
36
|
+
|
|
37
|
+
#install dependencies
|
|
38
|
+
yarn install
|
|
39
|
+
|
|
40
|
+
#start development server
|
|
41
|
+
yarn storybook
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> The `storybook` server runs on port **6006** and url is opened automatically on successful dev build.
|
|
45
|
+
|
|
46
|
+
### Generating New Components
|
|
47
|
+
|
|
48
|
+
We've included a handy NodeJS util file under `scripts` called `create-component.js`. Instead of copy pasting components to create a new component,
|
|
49
|
+
you can instead run this command to generate all the files you need to start building out a new component. To use it:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
yarn generate YourComponentName
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> This will generate:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
/src
|
|
59
|
+
/components
|
|
60
|
+
/YourComponentName
|
|
61
|
+
YourComponentName.jsx
|
|
62
|
+
YourComponentName.stories.jsx
|
|
63
|
+
YourComponentName.module.css
|
|
64
|
+
YourComponentName.stories.module.css
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
> The default templates for each file can be modified under `scripts/templates`.
|
|
68
|
+
|
|
69
|
+
### Exports
|
|
70
|
+
|
|
71
|
+
Export Component as named export and Component Props/Types e.g. export Modal from `./src/components/Modal/index.js`.
|
|
72
|
+
|
|
73
|
+
### Imports
|
|
74
|
+
|
|
75
|
+
We use a third party plugin to sort out imports. We use
|
|
76
|
+
[eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort#sort-order)
|
|
77
|
+
|
|
78
|
+
### Adding Stories
|
|
79
|
+
|
|
80
|
+
A [story](https://storybook.js.org/docs/react/get-started/whats-a-story) captures the rendered state of a UI component. You can write multiple stories
|
|
81
|
+
per component. A component story must have `.stories.jsx` extension.
|
|
82
|
+
|
|
83
|
+
### Using Design Tokens
|
|
84
|
+
|
|
85
|
+
Check out our [**Design Tokens Page**](https://spaced-out.github.io/ui-design-system/?path=/docs/design-tokens--page) to use tokens.
|
|
86
|
+
|
|
87
|
+
### Testing Genesis Design System Locally
|
|
88
|
+
|
|
89
|
+
> In the `ui_design_system` directory's run:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
yarn build
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> In the `consumer's` directory's run:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
yarn add @spaced-out/ui-design-system@file:../../ui-design-system
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
> This would copy the genesis design system package to node modules locally and create an entry in the `consumer's` package.json
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
...
|
|
105
|
+
"dependencies": {
|
|
106
|
+
...
|
|
107
|
+
"@spaced-out/ui-design-system": "file:../../ui_design_system",
|
|
108
|
+
...
|
|
109
|
+
},
|
|
110
|
+
...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
which will install the local genesis design system library as a dependency in `consumer`.
|
|
114
|
+
|
|
115
|
+
For every change in `ui_design_system` that you want to propagate to `consumer` run:
|
|
116
|
+
|
|
117
|
+
> in `ui_design_system`
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
yarn build
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
> in `consumer`
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
yarn upgrade @spaced-out/ui-design-system@file:../../ui-design-system
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Commits
|
|
130
|
+
|
|
131
|
+
Each commit should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines
|
|
132
|
+
|
|
133
|
+
Most commonly used commit prefixes:
|
|
134
|
+
|
|
135
|
+
> `fix:` a commit of the type fix patches a bug in your codebase (this correlates with [PATCH](https://semver.org/#summary) in Semantic Versioning)
|
|
136
|
+
|
|
137
|
+
> `feat:` a commit of the type feat introduces a new feature to the codebase (this correlates with [MINOR](https://semver.org/#summary) in Semantic Versioning)
|
|
138
|
+
|
|
139
|
+
> `refactor:` Commits, that rewrite/restructure your code, however does not change any behavior
|
|
140
|
+
|
|
141
|
+
> `style:` Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
|
|
142
|
+
|
|
143
|
+
> `docs:` Commits, that affect documentation only
|
|
144
|
+
|
|
145
|
+
> `build:` Commits, that affect build components like build tool, ci pipeline, dependencies, project version, etc.
|
|
146
|
+
|
|
147
|
+
## Add yourself to the contributor list
|
|
148
|
+
|
|
149
|
+
To add yourself to the `all-contributors` table in the README and INTRODUCTION stories:
|
|
150
|
+
|
|
151
|
+
> Run the following commands from the root of the repo:
|
|
152
|
+
|
|
153
|
+
```sh
|
|
154
|
+
./node_modules/.bin/all-contributors add <username> <contribution>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> Then, you'll need to generate the updated `all-contributors` table by running
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
./node_modules/.bin/all-contributors generate
|
|
161
|
+
```
|
package/README.md
CHANGED
|
@@ -1,156 +1,84 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# Genesis Design System
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Genesis design system consists of a set of tools and protocols that unify design and development across surfaces (platforms) to deliver consistent
|
|
6
|
+
user experiences. The system utilizes workflow automation to streamline the design and development process. It's comprised of a number of React
|
|
7
|
+
web components that each play a unique role within the product development cycle.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The integration of these components are intended to grow and scale overtime to increasingly decrease workflow friction and optimize the product
|
|
10
|
+
development lifecycle.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
- [Storybook](https://storybook.js.org/) to help you create and show off your components
|
|
13
|
-
- [Standard Version](https://github.com/conventional-changelog/standard-version) to manage changelog across releases
|
|
14
|
-
|
|
15
|
-
### Commits
|
|
16
|
-
|
|
17
|
-
Each commit should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines
|
|
18
|
-
|
|
19
|
-
Most commonly used commit prefixes:
|
|
20
|
-
|
|
21
|
-
`fix:` a commit of the type fix patches a bug in your codebase (this correlates with [PATCH](https://semver.org/#summary) in Semantic Versioning)
|
|
22
|
-
|
|
23
|
-
`feat:` a commit of the type feat introduces a new feature to the codebase (this correlates with [MINOR](https://semver.org/#summary) in Semantic Versioning)
|
|
24
|
-
|
|
25
|
-
`refactor:` Commits, that rewrite/restructure your code, however does not change any behavior
|
|
26
|
-
|
|
27
|
-
`style:` Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
|
|
28
|
-
|
|
29
|
-
`docs:` Commits, that affect documentation only
|
|
30
|
-
|
|
31
|
-
`build:` Commits, that affect build components like build tool, ci pipeline, dependencies, project version, etc.
|
|
32
|
-
|
|
33
|
-
### Building
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
yarn build
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
To Build the style variables using style-dictionary run
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
yarn build:style-variables
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
It would put all the style variables created inside the styles folder. Our yarn build hook would essentially copy these variables to the build output target.
|
|
46
|
-
|
|
47
|
-
### Storybook
|
|
48
|
-
|
|
49
|
-
To run a live-reload Storybook server on your local machine:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
yarn storybook
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
To export your Storybook as static files:
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
yarn storybook:export
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
After merging PR in master, storybook gets updated at https://spaced-out.github.io/ui-design-system/
|
|
62
|
-
|
|
63
|
-
### Generating New Components
|
|
64
|
-
|
|
65
|
-
We've included a handy NodeJS util file under `scripts` called `create-component.js`. Instead of copy pasting components to create a new component, you can instead run this command to generate all the files you need to start building out a new component. To use it:
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
yarn generate YourComponentName
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
This will generate:
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
/src
|
|
75
|
-
/components
|
|
76
|
-
/YourComponentName
|
|
77
|
-
YourComponentName.jsx
|
|
78
|
-
YourComponentName.stories.jsx
|
|
79
|
-
YourComponentName.module.css
|
|
80
|
-
YourComponentName.stories.module.css
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
The default templates for each file can be modified under `scripts/templates`.
|
|
84
|
-
|
|
85
|
-
### Installing Sense UI Component Library in ui_server Locally
|
|
86
|
-
|
|
87
|
-
In the `ui_design_system` directory's run:
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
yarn build
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
In the `consumer's` directory's run:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
yarn add @spaced-out/ui-design-system@file:../../ui-design-system
|
|
97
|
-
```
|
|
12
|
+
## Usage
|
|
98
13
|
|
|
99
|
-
|
|
14
|
+
To install `@spaced-out/ui-design-system` in your project, you will need to run the
|
|
15
|
+
following command using [yarn](https://yarnpkg.com/):
|
|
100
16
|
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
"dependencies": {
|
|
104
|
-
...
|
|
105
|
-
"@spaced-out/ui-design-system": "file:../../ui_design_system",
|
|
106
|
-
...
|
|
107
|
-
},
|
|
108
|
-
...
|
|
17
|
+
```bash
|
|
18
|
+
yarn add @spaced-out/ui-design-system
|
|
109
19
|
```
|
|
110
20
|
|
|
111
|
-
|
|
21
|
+
Usage of the component (after the library installed as a dependency in project) will be:
|
|
112
22
|
|
|
113
|
-
|
|
23
|
+
```js
|
|
24
|
+
import React from 'react';
|
|
25
|
+
import {Button} from '@spaced-out/ui-design-system/lib/components/Button';
|
|
114
26
|
|
|
115
|
-
|
|
27
|
+
const App = () => (
|
|
28
|
+
<div className="app-container">
|
|
29
|
+
<Button>Hello world</Button>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
116
32
|
|
|
117
|
-
|
|
118
|
-
yarn build
|
|
33
|
+
export default App;
|
|
119
34
|
```
|
|
120
35
|
|
|
121
|
-
|
|
36
|
+
For more information about each component, check out
|
|
37
|
+
[Storybook](https://spaced-out.github.io/ui-design-system).
|
|
122
38
|
|
|
123
|
-
|
|
124
|
-
yarn upgrade @spaced-out/ui-design-system@file:../../ui-design-system
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Usage
|
|
39
|
+
**→ Fonts**
|
|
128
40
|
|
|
129
|
-
|
|
41
|
+
By default Genesis uses `'Centra No 2'` font. To add this font in your project you need to load this font. The recommended way to do it is by adding the following in your global css.
|
|
130
42
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
43
|
+
```css
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: 'Centra No 2';
|
|
46
|
+
src: url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-Book.woff2')
|
|
47
|
+
format('woff2'), url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-Book.woff')
|
|
48
|
+
format('woff');
|
|
49
|
+
font-weight: 300 400;
|
|
50
|
+
font-style: normal;
|
|
51
|
+
font-display: auto;
|
|
52
|
+
}
|
|
136
53
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
54
|
+
@font-face {
|
|
55
|
+
font-family: 'Centra No 2';
|
|
56
|
+
src: url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-BookItalic.woff2')
|
|
57
|
+
format('woff2'), url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-BookItalic.woff')
|
|
58
|
+
format('woff');
|
|
59
|
+
font-weight: 300 400;
|
|
60
|
+
font-style: italic;
|
|
61
|
+
font-display: auto;
|
|
62
|
+
}
|
|
143
63
|
|
|
144
|
-
|
|
64
|
+
@font-face {
|
|
65
|
+
font-family: 'Centra No 2';
|
|
66
|
+
src: url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-Medium.woff2')
|
|
67
|
+
format('woff2'), url('https://s3.us-west-2.amazonaws.com/assets.sensehq.com/type/CentraNo2-Medium.woff')
|
|
68
|
+
format('woff');
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
font-style: normal;
|
|
71
|
+
font-display: auto;
|
|
72
|
+
}
|
|
145
73
|
```
|
|
146
74
|
|
|
147
|
-
|
|
75
|
+
**→ Using Genesis Design Tokens**
|
|
148
76
|
|
|
149
|
-
Design tokens are exported `.css` and `.js`. You can consume them easily by
|
|
77
|
+
Design tokens are exported as `.css` and `.js`. You can consume them easily by
|
|
150
78
|
|
|
151
79
|
CSS use:
|
|
152
80
|
|
|
153
|
-
```
|
|
81
|
+
```js
|
|
154
82
|
@value (size2) from '@spaced-out/ui-design-system/lib/styles/variables/_size.css';
|
|
155
83
|
|
|
156
84
|
.example-container {
|
|
@@ -160,8 +88,34 @@ CSS use:
|
|
|
160
88
|
|
|
161
89
|
JS use:
|
|
162
90
|
|
|
163
|
-
```
|
|
91
|
+
```js
|
|
164
92
|
import size2 from "@spaced-out/ui-design-system/lib/styles/variables/_size.js";
|
|
165
93
|
import * as SIZES from "@spaced-out/ui-design-system/lib/styles/variables/_size.js";
|
|
166
|
-
|
|
167
94
|
```
|
|
95
|
+
|
|
96
|
+
## Documentation
|
|
97
|
+
|
|
98
|
+
- [Storybook](https://spaced-out.github.io/ui-design-system)
|
|
99
|
+
|
|
100
|
+
## Contributions
|
|
101
|
+
|
|
102
|
+
Check out our [**Contribution Guide**](https://spaced-out.github.io/ui-design-system/?path=/docs/contribution--page) to setup and contribute to Genesis.
|
|
103
|
+
|
|
104
|
+
## Maintainers ✨
|
|
105
|
+
|
|
106
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
107
|
+
<!-- prettier-ignore-start -->
|
|
108
|
+
<!-- markdownlint-disable -->
|
|
109
|
+
<table>
|
|
110
|
+
<tbody>
|
|
111
|
+
<tr>
|
|
112
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/superrover"><img src="https://avatars.githubusercontent.com/u/86281150?v=4?s=100" width="100px;" alt="Nishant Gaurav"/><br /><sub><b>Nishant Gaurav</b></sub></a><br /><a href="https://github.com/Spaced-Out/ui-design-system/commits?author=superrover" title="Code">💻</a> <a href="https://github.com/Spaced-Out/ui-design-system/commits?author=superrover" title="Documentation">📖</a></td>
|
|
113
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Anant-Raj"><img src="https://avatars.githubusercontent.com/u/8904071?v=4?s=100" width="100px;" alt="Anant Raj"/><br /><sub><b>Anant Raj</b></sub></a><br /><a href="https://github.com/Spaced-Out/ui-design-system/commits?author=Anant-Raj" title="Code">💻</a> <a href="https://github.com/Spaced-Out/ui-design-system/commits?author=Anant-Raj" title="Documentation">📖</a></td>
|
|
114
|
+
</tr>
|
|
115
|
+
</tbody>
|
|
116
|
+
</table>
|
|
117
|
+
|
|
118
|
+
<!-- markdownlint-restore -->
|
|
119
|
+
<!-- prettier-ignore-end -->
|
|
120
|
+
|
|
121
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
package/cspell.json
CHANGED
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
"storybook-static",
|
|
8
8
|
".vscode",
|
|
9
9
|
"CHANGELOG.md",
|
|
10
|
-
".storybook/public"
|
|
10
|
+
".storybook/public",
|
|
11
|
+
".all-contributorsrc",
|
|
12
|
+
"README.md",
|
|
13
|
+
"src/stories/INTRODUCTION.stories.mdx"
|
|
11
14
|
],
|
|
12
15
|
// Enable your dictionary by adding it to the list of `dictionaries`
|
|
13
16
|
"dictionaries": ["custom-words"],
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.CheckboxGroup = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
-
var _Text = require("../Text/Text
|
|
9
|
+
var _Text = require("../Text/Text");
|
|
10
10
|
var _CheckboxGroupModule = _interopRequireDefault(require("./CheckboxGroup.module.css"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import type {GroupAlign} from '../../types/common';
|
|
6
6
|
import classify from '../../utils/classify';
|
|
7
|
-
import {BodySmall} from '../Text/Text
|
|
7
|
+
import {BodySmall} from '../Text/Text';
|
|
8
8
|
|
|
9
9
|
import css from './CheckboxGroup.module.css';
|
|
10
10
|
|
|
@@ -15,5 +15,5 @@ Object.defineProperty(exports, "CheckboxGroup", {
|
|
|
15
15
|
return _CheckboxGroup.CheckboxGroup;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var _Checkbox = require("./Checkbox
|
|
19
|
-
var _CheckboxGroup = require("./CheckboxGroup
|
|
18
|
+
var _Checkbox = require("./Checkbox");
|
|
19
|
+
var _CheckboxGroup = require("./CheckboxGroup");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {Checkbox} from './Checkbox
|
|
3
|
-
export {CheckboxGroup} from './CheckboxGroup
|
|
2
|
+
export {Checkbox} from './Checkbox';
|
|
3
|
+
export {CheckboxGroup} from './CheckboxGroup';
|
|
@@ -101,7 +101,7 @@ const Dialog = _ref5 => {
|
|
|
101
101
|
let {
|
|
102
102
|
children,
|
|
103
103
|
isOpen = false,
|
|
104
|
-
|
|
104
|
+
hideBackdrop = false,
|
|
105
105
|
onClose,
|
|
106
106
|
tapOutsideToClose = false,
|
|
107
107
|
iconName = '',
|
|
@@ -111,7 +111,7 @@ const Dialog = _ref5 => {
|
|
|
111
111
|
return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
|
|
112
112
|
isOpen: isOpen,
|
|
113
113
|
onClose: onClose,
|
|
114
|
-
|
|
114
|
+
hideBackdrop: hideBackdrop,
|
|
115
115
|
tapOutsideToClose: tapOutsideToClose
|
|
116
116
|
}, restDialogProps, {
|
|
117
117
|
classNames: {
|
|
@@ -130,7 +130,7 @@ export const DialogFooter = ({children}: DialogFooterProps): React.Node => (
|
|
|
130
130
|
export const Dialog = ({
|
|
131
131
|
children,
|
|
132
132
|
isOpen = false,
|
|
133
|
-
|
|
133
|
+
hideBackdrop = false,
|
|
134
134
|
onClose,
|
|
135
135
|
tapOutsideToClose = false,
|
|
136
136
|
iconName = '',
|
|
@@ -140,7 +140,7 @@ export const Dialog = ({
|
|
|
140
140
|
<Modal
|
|
141
141
|
isOpen={isOpen}
|
|
142
142
|
onClose={onClose}
|
|
143
|
-
|
|
143
|
+
hideBackdrop={hideBackdrop}
|
|
144
144
|
tapOutsideToClose={tapOutsideToClose}
|
|
145
145
|
{...restDialogProps}
|
|
146
146
|
classNames={{
|
|
@@ -4,11 +4,11 @@ export type {
|
|
|
4
4
|
DialogFooterProps,
|
|
5
5
|
DialogHeaderProps,
|
|
6
6
|
DialogProps,
|
|
7
|
-
} from './Dialog
|
|
7
|
+
} from './Dialog';
|
|
8
8
|
export {
|
|
9
9
|
Dialog,
|
|
10
10
|
DIALOG_SEMANTIC,
|
|
11
11
|
DialogBody,
|
|
12
12
|
DialogFooter,
|
|
13
13
|
DialogHeader,
|
|
14
|
-
} from './Dialog
|
|
14
|
+
} from './Dialog';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
|
|
3
3
|
export type {CloseIconProps} from './ClickableIcon';
|
|
4
|
-
export {ClickableIcon, CloseIcon} from './ClickableIcon
|
|
4
|
+
export {ClickableIcon, CloseIcon} from './ClickableIcon';
|
|
5
5
|
export type {IconProps, IconSize, IconType} from './Icon';
|
|
6
6
|
export {Icon} from './Icon';
|
|
@@ -10,8 +10,8 @@ var _reactDomInteractions = require("@floating-ui/react-dom-interactions");
|
|
|
10
10
|
var _useMountTransition = _interopRequireDefault(require("../../hooks/useMountTransition"));
|
|
11
11
|
var _motion = require("../../styles/variables/_motion");
|
|
12
12
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
13
|
-
var _Button = require("../Button/Button
|
|
14
|
-
var _Truncate = require("../Truncate/Truncate
|
|
13
|
+
var _Button = require("../Button/Button");
|
|
14
|
+
var _Truncate = require("../Truncate/Truncate");
|
|
15
15
|
var _ModalModule = _interopRequireDefault(require("./Modal.module.css"));
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -68,7 +68,7 @@ const Modal = _ref4 => {
|
|
|
68
68
|
children,
|
|
69
69
|
isOpen = false,
|
|
70
70
|
onClose,
|
|
71
|
-
|
|
71
|
+
hideBackdrop = false,
|
|
72
72
|
removeWhenClosed = true,
|
|
73
73
|
tapOutsideToClose = true,
|
|
74
74
|
initialFocus = -1
|
|
@@ -146,7 +146,7 @@ const Modal = _ref4 => {
|
|
|
146
146
|
}, classNames?.container)
|
|
147
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
148
148
|
className: (0, _classify.default)(_ModalModule.default.backdrop, {
|
|
149
|
-
[_ModalModule.default.darkBackdrop]:
|
|
149
|
+
[_ModalModule.default.darkBackdrop]: !hideBackdrop
|
|
150
150
|
}, classNames?.backdrop),
|
|
151
151
|
onClick: onBackdropClick
|
|
152
152
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
import useMountTransition from '../../hooks/useMountTransition';
|
|
14
14
|
import {motionDurationNormal} from '../../styles/variables/_motion';
|
|
15
15
|
import classify from '../../utils/classify';
|
|
16
|
-
import {Button} from '../Button/Button
|
|
17
|
-
import {Truncate} from '../Truncate/Truncate
|
|
16
|
+
import {Button} from '../Button/Button';
|
|
17
|
+
import {Truncate} from '../Truncate/Truncate';
|
|
18
18
|
|
|
19
19
|
import css from './Modal.module.css';
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ export type ModalProps = {
|
|
|
30
30
|
children?: React.Node,
|
|
31
31
|
isOpen?: boolean,
|
|
32
32
|
onClose?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
33
|
-
|
|
33
|
+
hideBackdrop?: boolean,
|
|
34
34
|
removeWhenClosed?: boolean,
|
|
35
35
|
tapOutsideToClose?: boolean,
|
|
36
36
|
initialFocus?: number,
|
|
@@ -100,7 +100,7 @@ export const Modal = ({
|
|
|
100
100
|
children,
|
|
101
101
|
isOpen = false,
|
|
102
102
|
onClose,
|
|
103
|
-
|
|
103
|
+
hideBackdrop = false,
|
|
104
104
|
removeWhenClosed = true,
|
|
105
105
|
tapOutsideToClose = true,
|
|
106
106
|
initialFocus = -1,
|
|
@@ -195,7 +195,7 @@ export const Modal = ({
|
|
|
195
195
|
className={classify(
|
|
196
196
|
css.backdrop,
|
|
197
197
|
{
|
|
198
|
-
[css.darkBackdrop]:
|
|
198
|
+
[css.darkBackdrop]: !hideBackdrop,
|
|
199
199
|
},
|
|
200
200
|
classNames?.backdrop,
|
|
201
201
|
)}
|
|
@@ -9,4 +9,22 @@ Object.defineProperty(exports, "Modal", {
|
|
|
9
9
|
return _Modal.Modal;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
Object.defineProperty(exports, "ModalBody", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Modal.ModalBody;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ModalFooter", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _Modal.ModalFooter;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ModalHeader", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _Modal.ModalHeader;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _Modal = require("./Modal");
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export type {
|
|
3
|
-
|
|
2
|
+
export type {
|
|
3
|
+
ModalBodyProps,
|
|
4
|
+
ModalFooterProps,
|
|
5
|
+
ModalHeaderProps,
|
|
6
|
+
ModalProps,
|
|
7
|
+
} from './Modal';
|
|
8
|
+
export {Modal, ModalBody, ModalFooter, ModalHeader} from './Modal';
|
|
@@ -61,12 +61,14 @@ const Panel = _ref4 => {
|
|
|
61
61
|
size = 'medium',
|
|
62
62
|
anchor = 'left',
|
|
63
63
|
onClose,
|
|
64
|
+
hideBackdrop = true,
|
|
64
65
|
...restPanelProps
|
|
65
66
|
} = _ref4;
|
|
66
67
|
const isTransitioning = (0, _useMountTransition.default)(isOpen, parseInt(_motion.motionDurationNormal));
|
|
67
68
|
return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
|
|
68
69
|
isOpen: isOpen,
|
|
69
|
-
onClose: onClose
|
|
70
|
+
onClose: onClose,
|
|
71
|
+
hideBackdrop: hideBackdrop
|
|
70
72
|
}, restPanelProps, {
|
|
71
73
|
classNames: {
|
|
72
74
|
container: (0, _classify.default)(_PanelModule.default.panelContainer, {
|
|
@@ -80,6 +80,7 @@ export const Panel = ({
|
|
|
80
80
|
size = 'medium',
|
|
81
81
|
anchor = 'left',
|
|
82
82
|
onClose,
|
|
83
|
+
hideBackdrop = true,
|
|
83
84
|
...restPanelProps
|
|
84
85
|
}: PanelProps): React.Node => {
|
|
85
86
|
const isTransitioning = useMountTransition(
|
|
@@ -91,6 +92,7 @@ export const Panel = ({
|
|
|
91
92
|
<Modal
|
|
92
93
|
isOpen={isOpen}
|
|
93
94
|
onClose={onClose}
|
|
95
|
+
hideBackdrop={hideBackdrop}
|
|
94
96
|
{...restPanelProps}
|
|
95
97
|
classNames={{
|
|
96
98
|
container: classify(css.panelContainer, {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RadioGroup = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
9
|
-
var _Text = require("../Text/Text
|
|
9
|
+
var _Text = require("../Text/Text");
|
|
10
10
|
var _RadioGroupModule = _interopRequireDefault(require("./RadioGroup.module.css"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import type {GroupAlign} from '../../types/common';
|
|
6
6
|
import classify from '../../utils/classify';
|
|
7
|
-
import {BodySmall} from '../Text/Text
|
|
7
|
+
import {BodySmall} from '../Text/Text';
|
|
8
8
|
|
|
9
9
|
import css from './RadioGroup.module.css';
|
|
10
10
|
|
|
@@ -15,5 +15,5 @@ Object.defineProperty(exports, "RadioGroup", {
|
|
|
15
15
|
return _RadioGroup.RadioGroup;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var _RadioButton = require("./RadioButton
|
|
19
|
-
var _RadioGroup = require("./RadioGroup
|
|
18
|
+
var _RadioButton = require("./RadioButton");
|
|
19
|
+
var _RadioGroup = require("./RadioGroup");
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {RadioButton} from './RadioButton
|
|
3
|
-
export {RadioGroup} from './RadioGroup
|
|
2
|
+
export {RadioButton} from './RadioButton';
|
|
3
|
+
export {RadioGroup} from './RadioGroup';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
//@flow strict
|
|
2
|
-
export {Toggle} from './Toggle
|
|
2
|
+
export {Toggle} from './Toggle';
|
|
@@ -14,37 +14,43 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
14
14
|
const BaseTruncate = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
children,
|
|
17
|
-
line = 1
|
|
17
|
+
line = 1,
|
|
18
|
+
showFullTextOnHover = false
|
|
18
19
|
} = _ref;
|
|
19
20
|
return /*#__PURE__*/React.createElement("span", {
|
|
20
21
|
className: (0, _classify.classify)(_TruncateModule.default.truncateLineClamp),
|
|
21
22
|
style: {
|
|
22
23
|
WebkitLineClamp: `${line}`
|
|
23
|
-
}
|
|
24
|
+
},
|
|
25
|
+
title: showFullTextOnHover ? children : ''
|
|
24
26
|
}, children);
|
|
25
27
|
};
|
|
26
28
|
exports.BaseTruncate = BaseTruncate;
|
|
27
29
|
const Truncate = _ref2 => {
|
|
28
30
|
let {
|
|
29
31
|
children,
|
|
30
|
-
line = 1
|
|
32
|
+
line = 1,
|
|
33
|
+
showFullTextOnHover = false
|
|
31
34
|
} = _ref2;
|
|
32
35
|
const arrayChildren = React.Children.toArray(children);
|
|
33
36
|
if (arrayChildren.length) {
|
|
34
37
|
const child = arrayChildren[0];
|
|
35
38
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
36
39
|
const {
|
|
37
|
-
className
|
|
40
|
+
className,
|
|
41
|
+
children
|
|
38
42
|
} = child.props;
|
|
39
43
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
40
44
|
className: (0, _classify.classify)(_TruncateModule.default.truncateLineClamp, className),
|
|
41
45
|
style: {
|
|
42
46
|
WebkitLineClamp: `${line}`
|
|
43
|
-
}
|
|
47
|
+
},
|
|
48
|
+
title: showFullTextOnHover ? children : ''
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
51
|
return /*#__PURE__*/React.createElement(BaseTruncate, {
|
|
47
|
-
line: line
|
|
52
|
+
line: line,
|
|
53
|
+
showFullTextOnHover: showFullTextOnHover
|
|
48
54
|
}, children);
|
|
49
55
|
}
|
|
50
56
|
return null;
|
|
@@ -10,33 +10,45 @@ import css from './Truncate.module.css';
|
|
|
10
10
|
export type TruncateProps = {
|
|
11
11
|
children?: React.Node,
|
|
12
12
|
line?: number,
|
|
13
|
+
showFullTextOnHover?: boolean,
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export const BaseTruncate = ({
|
|
16
17
|
children,
|
|
17
18
|
line = 1,
|
|
19
|
+
showFullTextOnHover = false,
|
|
18
20
|
}: TruncateProps): React.Node => (
|
|
19
21
|
<span
|
|
20
22
|
className={classify(css.truncateLineClamp)}
|
|
21
23
|
style={{WebkitLineClamp: `${line}`}}
|
|
24
|
+
title={showFullTextOnHover ? children : ''}
|
|
22
25
|
>
|
|
23
26
|
{children}
|
|
24
27
|
</span>
|
|
25
28
|
);
|
|
26
29
|
|
|
27
|
-
export const Truncate = ({
|
|
30
|
+
export const Truncate = ({
|
|
31
|
+
children,
|
|
32
|
+
line = 1,
|
|
33
|
+
showFullTextOnHover = false,
|
|
34
|
+
}: TruncateProps): React.Node => {
|
|
28
35
|
const arrayChildren = React.Children.toArray(children);
|
|
29
36
|
if (arrayChildren.length) {
|
|
30
37
|
const child = arrayChildren[0];
|
|
31
38
|
if (React.isValidElement(child)) {
|
|
32
|
-
const {className} = child.props;
|
|
39
|
+
const {className, children} = child.props;
|
|
33
40
|
|
|
34
41
|
return React.cloneElement(child, {
|
|
35
42
|
className: classify(css.truncateLineClamp, className),
|
|
36
43
|
style: {WebkitLineClamp: `${line}`},
|
|
44
|
+
title: showFullTextOnHover ? children : '',
|
|
37
45
|
});
|
|
38
46
|
}
|
|
39
|
-
return
|
|
47
|
+
return (
|
|
48
|
+
<BaseTruncate line={line} showFullTextOnHover={showFullTextOnHover}>
|
|
49
|
+
{children}
|
|
50
|
+
</BaseTruncate>
|
|
51
|
+
);
|
|
40
52
|
}
|
|
41
53
|
return null;
|
|
42
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaced-out/ui-design-system",
|
|
3
|
-
"version": "0.0.3
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Sense UI components library",
|
|
6
6
|
"author": {
|
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
"standard-version": "^9.5.0",
|
|
101
101
|
"storybook-css-modules": "^1.0.8",
|
|
102
102
|
"storybook-vscode-component": "^1.0.8",
|
|
103
|
-
"style-dictionary": "^3.7.1"
|
|
103
|
+
"style-dictionary": "^3.7.1",
|
|
104
|
+
"all-contributors-cli": "^6.20.0"
|
|
104
105
|
},
|
|
105
106
|
"husky": {
|
|
106
107
|
"hooks": {
|