@jobber/design 0.63.0 → 0.64.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.
Files changed (42) hide show
  1. package/README.md +29 -15
  2. package/dist/{icons/iconMap.d.ts → assets/icon.map.d.ts} +166 -165
  3. package/{foundation.native.d.ts → dist/assets/tokens.all.colors.d.ts} +55 -143
  4. package/{foundation.android.d.ts → dist/assets/tokens.android.d.ts} +175 -175
  5. package/dist/assets/tokens.color.d.ts +80 -0
  6. package/dist/assets/tokens.dark.d.ts +79 -0
  7. package/{foundation.ios.d.ts → dist/assets/tokens.ios.d.ts} +175 -175
  8. package/dist/assets/tokens.semantic.d.ts +46 -0
  9. package/{foundation.d.ts → dist/assets/tokens.web.d.ts} +178 -171
  10. package/dist/color.css +79 -0
  11. package/dist/colors.cjs +79 -0
  12. package/dist/colors.mjs +79 -0
  13. package/dist/dark.mode.css +115 -0
  14. package/dist/dark.theme.css +78 -0
  15. package/dist/foundation.css +369 -0
  16. package/dist/icon.map.js +562 -0
  17. package/dist/iconStyles/iconColors.d.ts +148 -0
  18. package/dist/iconStyles/iconSizes.d.ts +16 -0
  19. package/dist/iconStyles/iconStyles.mobile.d.ts +1 -0
  20. package/dist/iconStyles/iconStyles.web.d.ts +2 -0
  21. package/dist/index.cjs +2462 -0
  22. package/dist/index.d.ts +50 -3
  23. package/dist/index.mjs +2447 -0
  24. package/dist/semantic.css +45 -0
  25. package/package.json +60 -41
  26. package/rollup.config.mjs +19 -0
  27. package/dist/icons/Icon.css.d.ts +0 -40
  28. package/dist/icons/IconColors.css.d.ts +0 -52
  29. package/dist/icons/Sizes.css.d.ts +0 -7
  30. package/dist/icons/getIcon.d.ts +0 -31
  31. package/dist/icons/getIcon.test.d.ts +0 -1
  32. package/dist/icons/iconStyles.d.ts +0 -278
  33. package/dist/index.js +0 -1305
  34. package/foundation.android.js +0 -352
  35. package/foundation.css +0 -440
  36. package/foundation.ios.js +0 -352
  37. package/foundation.js +0 -317
  38. package/foundation.native.js +0 -352
  39. package/foundation.scss +0 -319
  40. package/icons/Icon.css +0 -125
  41. package/icons/IconColors.css +0 -193
  42. package/icons/Sizes.css +0 -16
package/README.md CHANGED
@@ -12,7 +12,10 @@ npm install @jobber/design
12
12
  ## Usage
13
13
 
14
14
  `@jobber/design` ships `foundation.css`. It also provides utilities for getting
15
- icons svg path.
15
+ an icon svg path, and icon styles as a JS object for use in a React `style`
16
+ attribute. We also ship a dark mode as both individual tokens (dark.theme.css)
17
+ and a full theme file (dark.mode.css). We ship our semantic styles as well
18
+ `semantic.css`
16
19
 
17
20
  ### CSS
18
21
 
@@ -31,7 +34,8 @@ Import the `@jobber/design` stylesheet into your own css
31
34
 
32
35
  For web, if `design/foundation.css` is already included you do not need to
33
36
  import it for every css file. For React Native, you need to import
34
- `design/foundation.css` in every css files that needs it.
37
+ `design/foundation` in every css files that needs it. Soon, this manual approach
38
+ will be replaced by a ThemeProvider.
35
39
 
36
40
  #### icons
37
41
 
@@ -40,10 +44,11 @@ Import the `getIcon` utility into your JavaScript/Typescript file
40
44
  ```tsx
41
45
  import { getIcon } from "@jobber/design";
42
46
 
43
- const { svgClassNames, paths, viewBox } = getIcon({
47
+ const { svgStyle, paths, viewBox } = getIcon({
44
48
  name: "dashboard",
45
49
  color: "green",
46
50
  size: "large",
51
+ platform: "web",
47
52
  });
48
53
  ```
49
54
 
@@ -54,15 +59,13 @@ You can also get the type definitions for `IconNames`, `IconColorNames`, and
54
59
  import type { IconNames, IconColorNames, IconSizes } from "@jobber/design";
55
60
  ```
56
61
 
57
- If you need the actual css files for icons, you can import them from
62
+ If you need the actual js style files for icons, you can import them from
58
63
  `@jobber/design/icons`. You may not need these files for the web but they might
59
64
  be required for React Native
60
65
 
61
66
  ```css
62
67
  @import "@jobber/design/foundation.css";
63
- @import "@jobber/design/icons/Icon";
64
- @import "@jobber/design/icons/Sizes";
65
- @import "@jobber/design/icons/Colors";
68
+ @import {iconStyles, iconSizes, iconColors} from "@jobber/design";
66
69
  ```
67
70
 
68
71
  ### PostCSS
@@ -73,7 +76,7 @@ Inject `@jobber/foundation` into your css with `postcss`
73
76
  module.exports = {
74
77
  plugins: [
75
78
  require("postcss-preset-env")({
76
- importFrom: ["@jobber/design"],
79
+ importFrom: ["@jobber/design/dist/foundation.css"],
77
80
  }),
78
81
  ],
79
82
  };
@@ -85,15 +88,13 @@ To use `tokens` with React Native, add the following to the file containing your
85
88
  project's global styling:
86
89
 
87
90
  ```ts
88
- // Import from `foundation.native` instead of `foundation` because foundation
89
- // would resolve the typescript for the web foundation instead of the React Native version.
90
- import { tokens as mobileFoundationBase } from "@jobber/design/foundation.native";
91
+ import { tokens, androidTokens, iosTokens } from "@jobber/design";
91
92
  import { Platform } from "react-native";
92
93
 
93
- const tokens: typeof mobileFoundationBase = Platform.select({
94
- ios: () => require("@jobber/design/foundation.ios").tokens,
95
- android: () => require("@jobber/design/foundation.android").tokens,
96
- default: () => require("@jobber/design/foundation.native").tokens,
94
+ export const tokens: typeof AndroidTokens = Platform.select({
95
+ ios: () => iosTokens,
96
+ android: () => androidTokens,
97
+ default: () => androidTokens,
97
98
  })();
98
99
 
99
100
  export const GlobalStyling = {
@@ -101,3 +102,16 @@ export const GlobalStyling = {
101
102
  ...otherStyles,
102
103
  };
103
104
  ```
105
+
106
+ ## Adding a new set of tokens
107
+
108
+ 1. Adding a new token file under `src/tokens` that follows the same format as
109
+ above and in the other files (platformOverrides is a special file and should
110
+ not be copied).
111
+ 1. Importing your new token file in `allTokens.ts` and adding it to the tokenMap
112
+ in the same file.
113
+ 1. At this point, your token contents should start showing up in all the built
114
+ output via `npm run build` in the design package (or just `npm install` from
115
+ the root of the project)
116
+
117
+ ## For How The Platform Works see HOWTHISWORKS.md
@@ -1,165 +1,166 @@
1
- export declare const iconMap: {
2
- icons: {
3
- add: string[];
4
- addNote: string[];
5
- addTag: string[];
6
- address: string[];
7
- afterDate: string[];
8
- alert: string[];
9
- angieslist: string[];
10
- apple: string[];
11
- apps: string[];
12
- archive: string[];
13
- arrowDown: string[];
14
- arrowLeft: string[];
15
- arrowRight: string[];
16
- arrowUp: string[];
17
- automate: string[];
18
- availability: string[];
19
- backArrow: string[];
20
- badInvoice: string[];
21
- batch: string[];
22
- beforeDate: string[];
23
- calendar: string[];
24
- camera: string[];
25
- chat: string[];
26
- checkbox: string[];
27
- checkmark: string[];
28
- chemical: string[];
29
- clearFilters: string[];
30
- clients: string[];
31
- clockIn: string[];
32
- clockOut: string[];
33
- cog: string[];
34
- company: string[];
35
- compose: string[];
36
- condition: string[];
37
- copy: string[];
38
- cross: string[];
39
- customize: string[];
40
- dashboard: string[];
41
- directions: string[];
42
- download: string[];
43
- drag: string[];
44
- dropdown: string[];
45
- edit: string[];
46
- email: string[];
47
- embed: string[];
48
- engine: string[];
49
- event: string[];
50
- excel: string[];
51
- expense: string[];
52
- export: string[];
53
- eye: string[];
54
- eyeCrossed: string[];
55
- facebook: string[];
56
- file: string[];
57
- filter: string[];
58
- fuel: string[];
59
- future: string[];
60
- gift: string[];
61
- google: string[];
62
- googlePlay: string[];
63
- grid: string[];
64
- happyFace: string[];
65
- help: string[];
66
- home: string[];
67
- image: string[];
68
- import: string[];
69
- instagram: string[];
70
- invoice: string[];
71
- invoiceLater: string[];
72
- job: string[];
73
- jobForms: string[];
74
- jobOnHold: string[];
75
- knot: string[];
76
- link: string[];
77
- linkedIn: string[];
78
- list: string[];
79
- loadingCheck: string[];
80
- "lock-1": string[];
81
- lock: string[];
82
- logout: string[];
83
- markSent: string[];
84
- marketing: string[];
85
- menu: string[];
86
- minus: string[];
87
- minus2: string[];
88
- money: string[];
89
- more: string[];
90
- moveMarker: string[];
91
- moveVisits: string[];
92
- note: string[];
93
- offline: string[];
94
- onlineBooking: string[];
95
- paidInvoice: string[];
96
- paperclip: string[];
97
- payment: string[];
98
- pdf: string[];
99
- percent: string[];
100
- person: string[];
101
- phone: string[];
102
- pinned: string[];
103
- plus: string[];
104
- plus2: string[];
105
- presentation: string[];
106
- printer: string[];
107
- property: string[];
108
- quickbooks: string[];
109
- quote: string[];
110
- recurring: string[];
111
- redo: string[];
112
- reminder: string[];
113
- reports: string[];
114
- request: string[];
115
- runningTimer: string[];
116
- schedule: string[];
117
- search: string[];
118
- sendInvoice: string[];
119
- sendMessage: string[];
120
- share: string[];
121
- signature: string[];
122
- sliderCenter: string[];
123
- sliderStart: string[];
124
- sms: string[];
125
- sms2: string[];
126
- sneaker: string[];
127
- sort: string[];
128
- sparkles: string[];
129
- star: string[];
130
- starFill: string[];
131
- starHalf: string[];
132
- starburst: string[];
133
- sun: string[];
134
- sync: string[];
135
- syncAlert: string[];
136
- tableColumns: string[];
137
- tag: string[];
138
- task: string[];
139
- textBox: string[];
140
- textField: string[];
141
- thumbsUp: string[];
142
- timeline: string[];
143
- timer: string[];
144
- today: string[];
145
- transfer: string[];
146
- trash: string[];
147
- twitter: string[];
148
- unPinned: string[];
149
- unscheduled: string[];
150
- updateStatus: string[];
151
- upload: string[];
152
- user: string[];
153
- userSwitch: string[];
154
- userUnassigned: string[];
155
- vcard: string[];
156
- video: string[];
157
- visit: string[];
158
- wallet: string[];
159
- word: string[];
160
- work: string[];
161
- xero: string[];
162
- yelp: string[];
163
- youtube: string[];
164
- };
165
- };
1
+ declare const _default: {
2
+ icons: {
3
+ add: string[];
4
+ addNote: string[];
5
+ addTag: string[];
6
+ address: string[];
7
+ afterDate: string[];
8
+ alert: string[];
9
+ angieslist: string[];
10
+ apple: string[];
11
+ apps: string[];
12
+ archive: string[];
13
+ arrowDown: string[];
14
+ arrowLeft: string[];
15
+ arrowRight: string[];
16
+ arrowUp: string[];
17
+ automate: string[];
18
+ availability: string[];
19
+ backArrow: string[];
20
+ badInvoice: string[];
21
+ batch: string[];
22
+ beforeDate: string[];
23
+ calendar: string[];
24
+ camera: string[];
25
+ chat: string[];
26
+ checkbox: string[];
27
+ checkmark: string[];
28
+ chemical: string[];
29
+ clearFilters: string[];
30
+ clients: string[];
31
+ clockIn: string[];
32
+ clockOut: string[];
33
+ cog: string[];
34
+ company: string[];
35
+ compose: string[];
36
+ condition: string[];
37
+ copy: string[];
38
+ cross: string[];
39
+ customize: string[];
40
+ dashboard: string[];
41
+ directions: string[];
42
+ download: string[];
43
+ drag: string[];
44
+ dropdown: string[];
45
+ edit: string[];
46
+ email: string[];
47
+ embed: string[];
48
+ engine: string[];
49
+ event: string[];
50
+ excel: string[];
51
+ expense: string[];
52
+ export: string[];
53
+ eye: string[];
54
+ eyeCrossed: string[];
55
+ facebook: string[];
56
+ file: string[];
57
+ filter: string[];
58
+ fuel: string[];
59
+ future: string[];
60
+ gift: string[];
61
+ google: string[];
62
+ googlePlay: string[];
63
+ grid: string[];
64
+ happyFace: string[];
65
+ help: string[];
66
+ home: string[];
67
+ image: string[];
68
+ import: string[];
69
+ instagram: string[];
70
+ invoice: string[];
71
+ invoiceLater: string[];
72
+ job: string[];
73
+ jobForms: string[];
74
+ jobOnHold: string[];
75
+ knot: string[];
76
+ link: string[];
77
+ linkedIn: string[];
78
+ list: string[];
79
+ loadingCheck: string[];
80
+ "lock-1": string[];
81
+ lock: string[];
82
+ logout: string[];
83
+ markSent: string[];
84
+ marketing: string[];
85
+ menu: string[];
86
+ minus: string[];
87
+ minus2: string[];
88
+ money: string[];
89
+ more: string[];
90
+ moveMarker: string[];
91
+ moveVisits: string[];
92
+ note: string[];
93
+ offline: string[];
94
+ onlineBooking: string[];
95
+ paidInvoice: string[];
96
+ paperclip: string[];
97
+ payment: string[];
98
+ pdf: string[];
99
+ percent: string[];
100
+ person: string[];
101
+ phone: string[];
102
+ pinned: string[];
103
+ plus: string[];
104
+ plus2: string[];
105
+ presentation: string[];
106
+ printer: string[];
107
+ property: string[];
108
+ quickbooks: string[];
109
+ quote: string[];
110
+ recurring: string[];
111
+ redo: string[];
112
+ reminder: string[];
113
+ reports: string[];
114
+ request: string[];
115
+ runningTimer: string[];
116
+ schedule: string[];
117
+ search: string[];
118
+ sendInvoice: string[];
119
+ sendMessage: string[];
120
+ share: string[];
121
+ signature: string[];
122
+ sliderCenter: string[];
123
+ sliderStart: string[];
124
+ sms: string[];
125
+ sms2: string[];
126
+ sneaker: string[];
127
+ sort: string[];
128
+ sparkles: string[];
129
+ star: string[];
130
+ starFill: string[];
131
+ starHalf: string[];
132
+ starburst: string[];
133
+ sun: string[];
134
+ sync: string[];
135
+ syncAlert: string[];
136
+ tableColumns: string[];
137
+ tag: string[];
138
+ task: string[];
139
+ textBox: string[];
140
+ textField: string[];
141
+ thumbsUp: string[];
142
+ timeline: string[];
143
+ timer: string[];
144
+ today: string[];
145
+ transfer: string[];
146
+ trash: string[];
147
+ twitter: string[];
148
+ unPinned: string[];
149
+ unscheduled: string[];
150
+ updateStatus: string[];
151
+ upload: string[];
152
+ user: string[];
153
+ userSwitch: string[];
154
+ userUnassigned: string[];
155
+ vcard: string[];
156
+ video: string[];
157
+ visit: string[];
158
+ wallet: string[];
159
+ word: string[];
160
+ work: string[];
161
+ xero: string[];
162
+ yelp: string[];
163
+ youtube: string[];
164
+ };
165
+ };
166
+ export default _default;