@jobber/design 0.27.9 → 0.28.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/CHANGELOG.md +46 -0
- package/buildColors.js +15 -0
- package/buildFoundation.js +15 -0
- package/buildIconStyles.js +44 -0
- package/colors.js +138 -0
- package/foundation.css +33 -26
- package/foundation.js +7 -7
- package/foundation.scss +6 -6
- package/foundation_config/postcss-filter-rules/index.js +17 -0
- package/foundation_config/postcss.config.js +58 -0
- package/jobberStyle.js +244 -0
- package/npm-shrinkwrap.json +8594 -0
- package/package.json +18 -11
- package/rollup.config.js +41 -0
- package/src/Borders.mdx +65 -0
- package/src/Colors.mdx +295 -0
- package/src/Elevations.mdx +107 -0
- package/src/Radii.mdx +40 -0
- package/src/ResponsiveBreakpoints.mdx +48 -0
- package/src/Spacing.mdx +121 -0
- package/src/Typography.mdx +191 -0
- package/src/animation.mdx +82 -0
- package/src/borders.css +6 -0
- package/src/colors.css +178 -0
- package/src/elevations.css +12 -0
- package/src/foundation.css +11 -0
- package/src/icons/Colors.css +187 -0
- package/src/icons/Colors.css.d.ts +51 -0
- package/src/icons/Icon.css +102 -0
- package/src/icons/Icon.css.d.ts +37 -0
- package/src/icons/Sizes.css +14 -0
- package/src/icons/Sizes.css.d.ts +7 -0
- package/src/icons/getIcon.test.ts +73 -0
- package/src/icons/getIcon.ts +116 -0
- package/src/icons/iconMap.ts +430 -0
- package/src/icons/iconStyles.d.ts +262 -0
- package/src/icons/iconStyles.ts +269 -0
- package/src/index.ts +10 -0
- package/src/radii.css +6 -0
- package/src/responsiveBreakpoints.css +3 -0
- package/src/shadows.css +13 -0
- package/src/spacing.css +13 -0
- package/src/styles.css +9 -0
- package/src/timings.css +7 -0
- package/src/typography.css +53 -0
- package/tsconfig.json +70 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Design foundation for the Jobber Atlantis Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,37 +9,44 @@
|
|
|
9
9
|
"dist/*",
|
|
10
10
|
"*.css",
|
|
11
11
|
"foundation.*",
|
|
12
|
-
"icons/*"
|
|
12
|
+
"icons/*",
|
|
13
|
+
"src/*",
|
|
14
|
+
"foundation_config/*",
|
|
15
|
+
"tsconfig.json",
|
|
16
|
+
"*.js"
|
|
13
17
|
],
|
|
14
18
|
"scripts": {
|
|
15
19
|
"build": "npm run build:css && npm run build:css:icons && npm run build:colors && npm run build:cssTypes && npm run build:foundation && npm run build:iconCssStyle && npm run build:rollup",
|
|
16
20
|
"build:rollup": "rollup --config",
|
|
17
|
-
"build:css": "postcss src/foundation.css --output foundation.css
|
|
21
|
+
"build:css": "postcss src/foundation.css --config foundation_config --output foundation.css",
|
|
18
22
|
"build:css:icons": "postcss src/icons/*.css --dir icons/ --use postcss-import",
|
|
19
23
|
"build:ts": "tsc --project .",
|
|
20
24
|
"build:cssTypes": "tcm src/icons",
|
|
21
25
|
"build:colors": "node buildColors.js",
|
|
22
26
|
"build:foundation": "node buildFoundation.js && node jobberStyle.js && npm run build:foundationTypes && npm run build:addTypeLinterExceptions && npm run build:addFoundationLinterExceptions && npm run build:removeTempFiles",
|
|
23
|
-
"build:foundationTypes": "tsc --declaration --emitDeclarationOnly --allowJs foundation.js --outDir .",
|
|
27
|
+
"build:foundationTypes": "tsc --declaration --emitDeclarationOnly --allowJs foundation.js --outDir . --skipLibCheck",
|
|
24
28
|
"build:addTypeLinterExceptions": "(printf '/* tslint:disable */\n/* eslint-disable */\n/* This file is automatically generated and should not be edited. */\n'; cat foundation.d.ts) > foundation.d.ts.temp",
|
|
25
29
|
"build:addFoundationLinterExceptions": "(printf '/* tslint:disable */\n/* eslint-disable */\n/* This file is automatically generated and should not be edited. */\n'; cat foundation.js) > foundation.js.temp",
|
|
26
30
|
"build:removeTempFiles": "rm -f src/foundation.js && mv foundation.d.ts.temp foundation.d.ts && mv foundation.js.temp foundation.js",
|
|
27
31
|
"build:iconCssStyle": "node buildIconStyles.js && npm run build:iconCssStyleTypes",
|
|
28
|
-
"build:iconCssStyleTypes": "tsc --declaration --emitDeclarationOnly --allowJs src/icons/iconStyles.ts --outDir ./src/icons",
|
|
29
|
-
"clean": "rm -rf dist/* icons/* colors.js foundation
|
|
30
|
-
"prepare": "npm run clean
|
|
32
|
+
"build:iconCssStyleTypes": "tsc --declaration --emitDeclarationOnly --allowJs src/icons/iconStyles.ts --outDir ./src/icons --skipLibCheck",
|
|
33
|
+
"clean": "rm -rf dist/* icons/* colors.js foundation.* iconStyles.* tsconfig.tsbuildinfo ./src/icons/iconStyles.*",
|
|
34
|
+
"prepare": "npm run clean && npm run build",
|
|
35
|
+
"postinstall": "npm run prepare",
|
|
31
36
|
"ci:typescript-compile": "npm run build:ts"
|
|
32
37
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"@jobber/fonts": "^1.0.0"
|
|
35
40
|
},
|
|
36
|
-
"
|
|
41
|
+
"dependencies": {
|
|
37
42
|
"@types/classnames": "^2.2.10",
|
|
38
43
|
"autoprefixer": "^9.5.1",
|
|
44
|
+
"classnames": "^2.2.6",
|
|
39
45
|
"css-to-react-native-transform": "^2.0.0",
|
|
40
46
|
"postcss": "^7.0.36",
|
|
41
47
|
"postcss-calc": "7.0.2",
|
|
42
48
|
"postcss-cli": "^6.1.2",
|
|
49
|
+
"postcss-copy": "^7.1.0",
|
|
43
50
|
"postcss-custom-properties": "^8.0.10",
|
|
44
51
|
"postcss-import": "^12.0.1",
|
|
45
52
|
"postcss-preset-env": "^6.6.0",
|
|
@@ -54,5 +61,5 @@
|
|
|
54
61
|
"typed-css-modules": "^0.7.0",
|
|
55
62
|
"typescript": "^3.8.3"
|
|
56
63
|
},
|
|
57
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "3221cfb57c036d3cc651cb0eba3dd642554dc02b"
|
|
58
65
|
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable import/no-default-export */
|
|
2
|
+
import multiInput from "rollup-plugin-multi-input";
|
|
3
|
+
import typescript from "rollup-plugin-typescript2";
|
|
4
|
+
import postcss from "rollup-plugin-postcss";
|
|
5
|
+
import commonjs from "rollup-plugin-commonjs";
|
|
6
|
+
import copy from "rollup-plugin-copy";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
input: `src/index.ts`,
|
|
10
|
+
plugins: [
|
|
11
|
+
multiInput(),
|
|
12
|
+
typescript({
|
|
13
|
+
declarationDir: "dist",
|
|
14
|
+
}),
|
|
15
|
+
postcss({
|
|
16
|
+
modules: { generateScopedName: "[hash:base64]" },
|
|
17
|
+
plugins: [
|
|
18
|
+
require("postcss-import"),
|
|
19
|
+
require("autoprefixer"),
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
21
|
+
require("postcss-preset-env")({
|
|
22
|
+
stage: 1,
|
|
23
|
+
preserve: true,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
}),
|
|
27
|
+
commonjs({
|
|
28
|
+
ignore: [],
|
|
29
|
+
}),
|
|
30
|
+
copy({
|
|
31
|
+
targets: [{ src: "src/icons/*.css.d.ts", dest: "dist/icons" }],
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
output: [
|
|
35
|
+
{
|
|
36
|
+
dir: "dist",
|
|
37
|
+
format: "cjs",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
external: ["react", "classnames", "@jobber/fonts"],
|
|
41
|
+
};
|
package/src/Borders.mdx
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Borders
|
|
3
|
+
menu: Design
|
|
4
|
+
route: /borders
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Borders and Dividers
|
|
8
|
+
|
|
9
|
+
You may find that a visual indicator is helpful to segment elements in an
|
|
10
|
+
interface. We have elements to help you do so in a consistent way across
|
|
11
|
+
platforms: borders and dividers.
|
|
12
|
+
|
|
13
|
+
## Borders
|
|
14
|
+
|
|
15
|
+
### Border Widths
|
|
16
|
+
|
|
17
|
+
To add a border to an element, use the border-width variables in the component's
|
|
18
|
+
styling to ensure consistent border thickness throughout Jobber.
|
|
19
|
+
|
|
20
|
+
Border style should be `solid` unless a specific use case calls for some other
|
|
21
|
+
format, such as indicating a dropzone on the
|
|
22
|
+
[`InputFile` component](https://atlantis.getjobber.com/components/input-file).
|
|
23
|
+
|
|
24
|
+
export function Example({ of: size }) {
|
|
25
|
+
const style = {
|
|
26
|
+
width: "100%",
|
|
27
|
+
height: "var(--space-miniscule)",
|
|
28
|
+
borderBottomStyle: "solid",
|
|
29
|
+
borderBottomWidth: `var(--border-${size})`,
|
|
30
|
+
borderBottomColor: "var(--color-grey--lighter)",
|
|
31
|
+
};
|
|
32
|
+
return <div style={style} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
| Width | Visual |
|
|
36
|
+
| :------------------ | :------------------------ |
|
|
37
|
+
| `--border-base` | <Example of="base" /> |
|
|
38
|
+
| `--border-thick` | <Example of="thick" /> |
|
|
39
|
+
| `--border-thicker` | <Example of="thicker" /> |
|
|
40
|
+
| `--border-thickest` | <Example of="thickest" /> |
|
|
41
|
+
|
|
42
|
+
The `base` border width should be used for most use cases (see
|
|
43
|
+
[`Card`](https://atlantis.getjobber.com/components/card) and
|
|
44
|
+
[`List` items](https://atlantis.getjobber.com/components/list) for in-context
|
|
45
|
+
examples). You may want to consider thicker borders when the border conveys a
|
|
46
|
+
closing of already-divided sections, such as a
|
|
47
|
+
[`Table` footer](https://atlantis.getjobber.com/components/table).
|
|
48
|
+
|
|
49
|
+
### Border Colors
|
|
50
|
+
|
|
51
|
+
Borders should use `--color-border)` for most use cases.
|
|
52
|
+
[`List` sections](https://atlantis.getjobber.com/components/list#sectioned-list-items),
|
|
53
|
+
[`Table` headers](https://atlantis.getjobber.com/components/table) and other
|
|
54
|
+
scenarios where other bordered content is being further subsectioned should use
|
|
55
|
+
`--color-border--section)`.
|
|
56
|
+
|
|
57
|
+
For accessibility reasons, ensure that color usage is not the only way to
|
|
58
|
+
[convey meaning](https://webaim.org/articles/contrast/#sc141) in an interface.
|
|
59
|
+
|
|
60
|
+
## Dividers
|
|
61
|
+
|
|
62
|
+
The [`Divider` component](https://atlantis.getjobber.com/components/divider)
|
|
63
|
+
will help you segment sections of content without writing additional styling.
|
|
64
|
+
This component will render a horizontal rule that takes up the full available
|
|
65
|
+
width.
|
package/src/Colors.mdx
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Colors
|
|
3
|
+
menu: Design
|
|
4
|
+
route: /colors
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { ColorSwatches } from "@jobber/docx";
|
|
8
|
+
import { ColorSwatches as Swatch } from "@jobber/docz-tools";
|
|
9
|
+
|
|
10
|
+
import colors from "../colors";
|
|
11
|
+
|
|
12
|
+
# Colors
|
|
13
|
+
|
|
14
|
+
Color can provide a visual cue for users to navigate and understand an
|
|
15
|
+
interface.
|
|
16
|
+
|
|
17
|
+
Atlantis is built with a
|
|
18
|
+
[semantic layer](https://dev.to/ynab/a-semantic-color-system-the-theory-hk7)
|
|
19
|
+
overtop of a base palette. Use the semantic color values defined in the usage
|
|
20
|
+
guidelines whenever possible to ensure you are using colors for their intended
|
|
21
|
+
purpose.
|
|
22
|
+
|
|
23
|
+
## Accessibility
|
|
24
|
+
|
|
25
|
+
Color should never be the single means of conveying information in an interface.
|
|
26
|
+
Use labels, iconography, or hints for assistive technology alongside color to
|
|
27
|
+
ensure your content can be understood by everyone.
|
|
28
|
+
|
|
29
|
+
## Usage guidelines
|
|
30
|
+
|
|
31
|
+
### Typography
|
|
32
|
+
|
|
33
|
+
Typographic elements in Jobber should use consistent colors to ensure
|
|
34
|
+
readability.
|
|
35
|
+
|
|
36
|
+
#### Heading
|
|
37
|
+
|
|
38
|
+
<Swatch colors={[`--color-heading`]} />
|
|
39
|
+
|
|
40
|
+
Headings have a bold, high-contrast color to cement their hierarchy.
|
|
41
|
+
|
|
42
|
+
#### Text
|
|
43
|
+
|
|
44
|
+
<Swatch colors={[`--color-text`, "--color-text--secondary"]} />
|
|
45
|
+
|
|
46
|
+
A slightly softer color is used for body text for greater readability.
|
|
47
|
+
|
|
48
|
+
Text that is relevant but less important ("secondary") can be lower-contrast to
|
|
49
|
+
suggest its’ reduced importance. This color should only be used when there is
|
|
50
|
+
more important text content already present.
|
|
51
|
+
|
|
52
|
+
##### Text--Reverse
|
|
53
|
+
|
|
54
|
+
<Swatch
|
|
55
|
+
colors={[`--color-text--reverse`, "--color-text--reverse--secondary"]}
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
When used against a [reversed surface](#surface--reverse), reversed text should
|
|
59
|
+
be used to maintain readability.
|
|
60
|
+
|
|
61
|
+
Reverse text also has a secondary value following the same rules outlined for
|
|
62
|
+
standard secondary text.
|
|
63
|
+
|
|
64
|
+
### Interactions
|
|
65
|
+
|
|
66
|
+
Use these colors in buttons and form controls to communicate the presence and
|
|
67
|
+
meaning of interaction. In cases such as [Buttons](/components/button) where the
|
|
68
|
+
interactive color is functioning as a background color or the text color, the
|
|
69
|
+
alternative color should be `--color-white`\*.
|
|
70
|
+
|
|
71
|
+
_\*This is a known contrast issue in the case of Interactive/White, as we have
|
|
72
|
+
currently tied our interactive color to our brand color._
|
|
73
|
+
|
|
74
|
+
#### Interactive
|
|
75
|
+
|
|
76
|
+
<Swatch colors={[`--color-interactive`, "--color-interactive--hover"]} />
|
|
77
|
+
|
|
78
|
+
The default color used for interactive elements.
|
|
79
|
+
|
|
80
|
+
##### Interactive--Subtle
|
|
81
|
+
|
|
82
|
+
<Swatch
|
|
83
|
+
colors={[`--color-interactive--subtle`, "--color-interactive--subtle--hover"]}
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
Use for interactive elements that should be less visually pronounced, such as an
|
|
87
|
+
icon action in main navigation, or buttons to dismiss or cancel a workflow.
|
|
88
|
+
|
|
89
|
+
#### Destructive
|
|
90
|
+
|
|
91
|
+
<Swatch colors={[`--color-destructive`, "--color-destructive--hover"]} />
|
|
92
|
+
|
|
93
|
+
Use to signify that an interaction will destroy something in the users’ account
|
|
94
|
+
or workflow.
|
|
95
|
+
|
|
96
|
+
#### Disabled
|
|
97
|
+
|
|
98
|
+
<Swatch colors={[`--color-disabled`, "--color-disabled--secondary"]} />
|
|
99
|
+
|
|
100
|
+
Use to signify that an interactive element is disabled.
|
|
101
|
+
|
|
102
|
+
Use `secondary` when a disabled element needs more than one color to be readable
|
|
103
|
+
in a disabled state; for example, a button's background and label colors must be
|
|
104
|
+
different.
|
|
105
|
+
|
|
106
|
+
#### Focus
|
|
107
|
+
|
|
108
|
+
<div
|
|
109
|
+
style="width:100%;
|
|
110
|
+
height:var(--space-extravagant);
|
|
111
|
+
background-color:var(--color-surface);
|
|
112
|
+
box-shadow:var(--shadow-focus);"
|
|
113
|
+
></div>
|
|
114
|
+
|
|
115
|
+
`--color-focus`
|
|
116
|
+
|
|
117
|
+
Used by the `--shadow-focus` property to indicate that an element has received
|
|
118
|
+
focus. Avoid using `--color-focus` directly on UI elements.
|
|
119
|
+
|
|
120
|
+
### Status
|
|
121
|
+
|
|
122
|
+
Use these colors in labels, icons, filters, alerts, and other elements where
|
|
123
|
+
color can add meaning to the state of the system or an item in the system.
|
|
124
|
+
|
|
125
|
+
All status colors have a main color, a surface color, and an on-surface color.
|
|
126
|
+
The on-surface color should be used for an element when it sits inside of an
|
|
127
|
+
element with the status' surface color to maintain a cohesive tone and ensure
|
|
128
|
+
sufficient color contrast.
|
|
129
|
+
|
|
130
|
+
#### Critical
|
|
131
|
+
|
|
132
|
+
<Swatch
|
|
133
|
+
colors={[
|
|
134
|
+
"--color-critical",
|
|
135
|
+
"--color-critical--surface",
|
|
136
|
+
"--color-critical--onSurface",
|
|
137
|
+
]}
|
|
138
|
+
/>
|
|
139
|
+
|
|
140
|
+
Action required; user must see this status to be unblocked.
|
|
141
|
+
|
|
142
|
+
#### Warning
|
|
143
|
+
|
|
144
|
+
<Swatch
|
|
145
|
+
colors={[
|
|
146
|
+
"--color-warning",
|
|
147
|
+
"--color-warning--surface",
|
|
148
|
+
"--color-warning--onSurface",
|
|
149
|
+
]}
|
|
150
|
+
/>
|
|
151
|
+
|
|
152
|
+
Action _may_ be required as a consequence of current state.
|
|
153
|
+
|
|
154
|
+
#### Success
|
|
155
|
+
|
|
156
|
+
<Swatch
|
|
157
|
+
colors={[
|
|
158
|
+
"--color-success",
|
|
159
|
+
"--color-success--surface",
|
|
160
|
+
"--color-success--onSurface",
|
|
161
|
+
]}
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
No action required; an action has completed successfully.
|
|
165
|
+
|
|
166
|
+
#### Informative
|
|
167
|
+
|
|
168
|
+
<Swatch
|
|
169
|
+
colors={[
|
|
170
|
+
"--color-informative",
|
|
171
|
+
"--color-informative--surface",
|
|
172
|
+
"--color-informative--onSurface",
|
|
173
|
+
]}
|
|
174
|
+
/>
|
|
175
|
+
|
|
176
|
+
No action required; but helpful to know about.
|
|
177
|
+
|
|
178
|
+
#### Inactive
|
|
179
|
+
|
|
180
|
+
<Swatch
|
|
181
|
+
colors={[
|
|
182
|
+
"--color-inactive",
|
|
183
|
+
"--color-inactive--surface",
|
|
184
|
+
"--color-inactive--onSurface",
|
|
185
|
+
]}
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
No action required; not part of an active workflow.
|
|
189
|
+
|
|
190
|
+
### Surfaces
|
|
191
|
+
|
|
192
|
+
Surfaces are the background-colors of almost every element in Jobber. Overlays
|
|
193
|
+
act as supplementary surfaces that mask areas of the interface to adjust visual
|
|
194
|
+
focus.
|
|
195
|
+
|
|
196
|
+
#### Surface
|
|
197
|
+
|
|
198
|
+
<Swatch
|
|
199
|
+
colors={[
|
|
200
|
+
"--color-surface",
|
|
201
|
+
"--color-surface--hover",
|
|
202
|
+
"--color-surface--active",
|
|
203
|
+
]}
|
|
204
|
+
/>
|
|
205
|
+
|
|
206
|
+
Most elements in Jobber have a light surface to indicate their nearness to the
|
|
207
|
+
user; if interactive, they have a hover color and an active color to indicate
|
|
208
|
+
state.
|
|
209
|
+
|
|
210
|
+
#### Surface--Background
|
|
211
|
+
|
|
212
|
+
<Swatch colors={["--color-surface--background"]} />
|
|
213
|
+
|
|
214
|
+
A slightly darker surface gives a receded appearance relative to main surfaces.
|
|
215
|
+
|
|
216
|
+
#### Surface--Reverse
|
|
217
|
+
|
|
218
|
+
<Swatch colors={["--color-surface--reverse"]} />
|
|
219
|
+
|
|
220
|
+
Use a reversed surface when a strong contrast is needed with the rest of the
|
|
221
|
+
application.
|
|
222
|
+
|
|
223
|
+
#### Overlay
|
|
224
|
+
|
|
225
|
+
<Swatch colors={["--color-overlay"]} />
|
|
226
|
+
|
|
227
|
+
Use to mask an area of the interface to promote focus to a foreground action,
|
|
228
|
+
such as a [Modal](/components/modal)’s appearance. Overlay includes built-in
|
|
229
|
+
opacity values.
|
|
230
|
+
|
|
231
|
+
#### Overlay--Dimmed
|
|
232
|
+
|
|
233
|
+
<Swatch colors={["--color-overlay--dimmed"]} />
|
|
234
|
+
|
|
235
|
+
A transparent version of [Surface](#surface), this masks an area of the
|
|
236
|
+
interface to indicate inactivity (i.e. waiting for updates). Overlay--Dimmed
|
|
237
|
+
includes built-in opacity values.
|
|
238
|
+
|
|
239
|
+
### Borders
|
|
240
|
+
|
|
241
|
+
Defining the edges of elements on the same elevation plane, border colors are
|
|
242
|
+
the subtle maintainers of layout structure. Learn more about borders in our
|
|
243
|
+
[Borders guide.](/borders)
|
|
244
|
+
|
|
245
|
+
#### Border
|
|
246
|
+
|
|
247
|
+
<div
|
|
248
|
+
style="width:100%;
|
|
249
|
+
height:var(--space-extravagant);
|
|
250
|
+
background-color:var(--color-surface);
|
|
251
|
+
border: var(--border-base) solid var(--color-border)"
|
|
252
|
+
></div>
|
|
253
|
+
|
|
254
|
+
`--color-border`
|
|
255
|
+
|
|
256
|
+
Most borders should use `--color-border` for subtle definition.
|
|
257
|
+
|
|
258
|
+
#### Border--Section
|
|
259
|
+
|
|
260
|
+
<div
|
|
261
|
+
style="width:100%;
|
|
262
|
+
height:var(--space-extravagant);
|
|
263
|
+
background-color:var(--color-surface);
|
|
264
|
+
border: var(--border-base) solid var(--color-border--section)"
|
|
265
|
+
></div>
|
|
266
|
+
|
|
267
|
+
`--color-border--section`
|
|
268
|
+
|
|
269
|
+
Use `--color-border--section` where other bordered content is being further
|
|
270
|
+
sectioned, such as table headers or list sections.
|
|
271
|
+
|
|
272
|
+
### Brand
|
|
273
|
+
|
|
274
|
+
Use these colors to represent the Jobber brand visual language.
|
|
275
|
+
|
|
276
|
+
#### Brand
|
|
277
|
+
|
|
278
|
+
<Swatch colors={["--color-brand"]} />
|
|
279
|
+
|
|
280
|
+
The primary color associated with our brand, from website to ads to product; AKA
|
|
281
|
+
“Jobber Green”.
|
|
282
|
+
|
|
283
|
+
#### Brand--Highlight
|
|
284
|
+
|
|
285
|
+
<Swatch colors={["--color-brand--highlight"]} />
|
|
286
|
+
|
|
287
|
+
Use to highlight an element in a way that aligns with our website. Use with
|
|
288
|
+
caution, it’s _bright!_
|
|
289
|
+
|
|
290
|
+
<br />
|
|
291
|
+
<br />
|
|
292
|
+
|
|
293
|
+
## Swatch list
|
|
294
|
+
|
|
295
|
+
<ColorSwatches colors={colors.customProperties} />
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Elevation
|
|
3
|
+
menu: Design
|
|
4
|
+
route: /elevation
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Elevation
|
|
8
|
+
|
|
9
|
+
> Elevation is the relative distance between two surfaces along the z-axis.
|
|
10
|
+
> –[Material Design](https://material.io/design/environment/elevation.html)
|
|
11
|
+
|
|
12
|
+
In Atlantis, our web components use elevation to specify position on the z-axis,
|
|
13
|
+
with shadows separately responsible for conveying that depth. Our mobile
|
|
14
|
+
components combine these two concepts in keeping with Android and iOS patterns.
|
|
15
|
+
|
|
16
|
+
Generally speaking, the "higher" an element sits in the z-axis, the broader its'
|
|
17
|
+
shadow should spread, to reflect diffusion in the distance between the element
|
|
18
|
+
and the ground. As an element gets nearer to the ground, or "lower", the
|
|
19
|
+
shadow's spread should reduce and the shadow may appear darker.
|
|
20
|
+
|
|
21
|
+
We also include a _slight_ y-axis offset of elevation shadows to imply that the
|
|
22
|
+
light source is coming from an angle slightly over the head of a user looking
|
|
23
|
+
directly into the screen.
|
|
24
|
+
|
|
25
|
+
### Low
|
|
26
|
+
|
|
27
|
+
<Example of="low" />
|
|
28
|
+
|
|
29
|
+
A low element may have a slight elevation, but is not necessarily something that
|
|
30
|
+
will glide across the surface. A basic card on mobile that is not tappable would
|
|
31
|
+
be represented as having a "low" elevation.
|
|
32
|
+
|
|
33
|
+
### Base
|
|
34
|
+
|
|
35
|
+
<Example of="base" />
|
|
36
|
+
|
|
37
|
+
This shadow should be used for most instances of shadows to convey that an
|
|
38
|
+
element is floating overtop related elements, such as in
|
|
39
|
+
[Menu](/components/menu) or [Popover](/components/popover). An element with a
|
|
40
|
+
base elevation is likely interactive, and this level can indicate and invite the
|
|
41
|
+
use of gesture controls in a mobile app.
|
|
42
|
+
|
|
43
|
+
### High
|
|
44
|
+
|
|
45
|
+
<Example of="high" />
|
|
46
|
+
|
|
47
|
+
High elements should be elements that float overtop the entire interface,
|
|
48
|
+
typically with a fixed position. The "high" elevation indicates that the element
|
|
49
|
+
has broken the plane of the view. A good example for web would be
|
|
50
|
+
[Toast](/components/toast).
|
|
51
|
+
|
|
52
|
+
## Web
|
|
53
|
+
|
|
54
|
+
export function Value({ of: type }) {
|
|
55
|
+
const styles = getComputedStyle(document.documentElement);
|
|
56
|
+
const getValue = styles.getPropertyValue(`--elevation-${type}`);
|
|
57
|
+
return <React.Fragment>{getValue}</React.Fragment>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
### Z-index elevation
|
|
61
|
+
|
|
62
|
+
The following table lists Atlantis components that have a z-index specified.
|
|
63
|
+
|
|
64
|
+
These values can be referenced when you are building a view so that you can
|
|
65
|
+
ensure the elements you are using do not unintentionally overlap, if you end up
|
|
66
|
+
using z-index on non-Atlantis components.
|
|
67
|
+
|
|
68
|
+
| Component | Value |
|
|
69
|
+
| :--------------- | :--------------------- |
|
|
70
|
+
| Form field label | <Value of="base" /> |
|
|
71
|
+
| Menu | <Value of="menu" /> |
|
|
72
|
+
| Modal | <Value of="modal" /> |
|
|
73
|
+
| Tooltip | <Value of="tooltip" /> |
|
|
74
|
+
| Toast | <Value of="toast" /> |
|
|
75
|
+
|
|
76
|
+
export function Example({ of: shadow }) {
|
|
77
|
+
const style = {
|
|
78
|
+
width: "100%",
|
|
79
|
+
height: "var(--space-largest)",
|
|
80
|
+
backgroundColor: "var(--color-white)",
|
|
81
|
+
boxShadow: `var(--shadow-${shadow})`,
|
|
82
|
+
};
|
|
83
|
+
return <div style={style} />;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function Elevation({ of: shadow }) {
|
|
87
|
+
const element = document.createElement("div");
|
|
88
|
+
element.style.boxShadow = `var(--shadow-${shadow})`;
|
|
89
|
+
document.body.appendChild(element);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
### Shadow elevation
|
|
93
|
+
|
|
94
|
+
These are the box-shadows rendered to signify elevation on given UI elements;
|
|
95
|
+
they map to our low/base/high pattern.
|
|
96
|
+
|
|
97
|
+
| Name | Visual |
|
|
98
|
+
| :-------------- | :-------------------- |
|
|
99
|
+
| `--shadow-low` | <Example of="low" /> |
|
|
100
|
+
| `--shadow-base` | <Example of="base" /> |
|
|
101
|
+
| `--shadow-high` | <Example of="high" /> |
|
|
102
|
+
|
|
103
|
+
## Mobile
|
|
104
|
+
|
|
105
|
+
For mobile designs, the concept of elevation applies to both shadows and
|
|
106
|
+
hierarchy of the element along the z-index. Android accepts a single "elevation"
|
|
107
|
+
value, while iOS accepts more granular shadow values similar to CSS.
|
package/src/Radii.mdx
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Radius
|
|
3
|
+
menu: Design
|
|
4
|
+
route: /border-radius
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Border Radius
|
|
8
|
+
|
|
9
|
+
We favour a subtle rounding of corners wherever possible as a nod to the blunt
|
|
10
|
+
visual style of our marketing properties to afford a smoother transition from
|
|
11
|
+
the signup flow into the product. To achieve this appearance, use
|
|
12
|
+
`--radius-base`.
|
|
13
|
+
|
|
14
|
+
This base radius can be found in almost all of our components that have a
|
|
15
|
+
defined "edge": [Button](/components/button), [Card](/components/Card),
|
|
16
|
+
[InputText](/components/input-text), and [Menu](/components/menu) are all
|
|
17
|
+
examples of this in practice.
|
|
18
|
+
|
|
19
|
+
Larger rounded corners should be used sparingly, but are available for cases
|
|
20
|
+
where the user may expect a smoother corner, such as
|
|
21
|
+
[ProgressBar](/components/progress-bar). `--radius-circle` can be used for
|
|
22
|
+
circular elements like [Radio](/components/radio-group) options or the "pip" in
|
|
23
|
+
[Switch](/components/switch).
|
|
24
|
+
|
|
25
|
+
export function Example({ of: radius }) {
|
|
26
|
+
const style = {
|
|
27
|
+
width: "var(--space-large)",
|
|
28
|
+
height: "var(--space-large)",
|
|
29
|
+
backgroundColor: "var(--color-indigo)",
|
|
30
|
+
borderRadius: `var(--radius-${radius})`,
|
|
31
|
+
};
|
|
32
|
+
return <div style={style} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
| Radius | Visual |
|
|
36
|
+
| :---------------- | :---------------------- |
|
|
37
|
+
| `--radius-base` | <Example of="base" /> |
|
|
38
|
+
| `--radius-large` | <Example of="large" /> |
|
|
39
|
+
| `--radius-larger` | <Example of="larger" /> |
|
|
40
|
+
| `--radius-circle` | <Example of="circle" /> |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Breakpoints
|
|
3
|
+
menu: Design
|
|
4
|
+
route: /breakpoints
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
import { Button } from "@jobber/components/Button";
|
|
8
|
+
|
|
9
|
+
# Responsive Breakpoints
|
|
10
|
+
|
|
11
|
+
**To make most components responsive, you will want to use the
|
|
12
|
+
[useResizeObserver hook](/hooks/use-resize-observer) so that the component can
|
|
13
|
+
be responsive based on its container.**
|
|
14
|
+
|
|
15
|
+
However, there are times the component will not care about its container and
|
|
16
|
+
want to be responsive based on the browser size. For this you will want to use a
|
|
17
|
+
breakpoint in the CSS.
|
|
18
|
+
|
|
19
|
+
**Note** Components should be styled mobile first, meaning that it should be
|
|
20
|
+
styled for small screens and then scaled up. This means that the `--handhelds`
|
|
21
|
+
breakpoint should be rarely considered.
|
|
22
|
+
|
|
23
|
+
**Note** Media queries can be nested inside selectors. This will help with
|
|
24
|
+
clarity when reading.
|
|
25
|
+
|
|
26
|
+
| Breakpoint | Width |
|
|
27
|
+
| :----------------- | :---------- |
|
|
28
|
+
| `--handhelds` | `< 640px` |
|
|
29
|
+
| `--medium-screens` | `>= 640px` |
|
|
30
|
+
| `--wide-screens` | `>= 1024px` |
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
.foo {
|
|
36
|
+
...;
|
|
37
|
+
/** small screens first **/
|
|
38
|
+
padding: var(--space-base);
|
|
39
|
+
|
|
40
|
+
@media (--medium-screens) {
|
|
41
|
+
padding: var(--space-large);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (--wide-screens) {
|
|
45
|
+
padding: var(--space-extravagant);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|