@jobber/components-native 0.71.2-TAYLORmax-6e14b32.19 → 0.71.2-improve-di-796b148.24

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components-native",
3
- "version": "0.71.2-TAYLORmax-6e14b32.19+6e14b32d",
3
+ "version": "0.71.2-improve-di-796b148.24+796b148d",
4
4
  "license": "MIT",
5
5
  "description": "React Native implementation of Atlantis",
6
6
  "repository": {
@@ -82,5 +82,5 @@
82
82
  "react-native-safe-area-context": "^4.5.2",
83
83
  "react-native-svg": ">=12.0.0"
84
84
  },
85
- "gitHead": "6e14b32d5a326475566187872f9e4e695ec3c0f8"
85
+ "gitHead": "796b148d464e0e5d1fa64edd033e0e12c2a2ded3"
86
86
  }
@@ -5,7 +5,7 @@ import { capitalize } from "../../../utils/intl";
5
5
  import { Text } from "../../../Text";
6
6
  import { Icon } from "../../../Icon";
7
7
  export function BottomSheetOption({ text, icon, iconColor, textAlign, destructive, textTransform = "capitalize", onPress, }) {
8
- const destructiveColor = "critical";
8
+ const destructiveColor = "destructive";
9
9
  const textVariation = destructive ? destructiveColor : "subdued";
10
10
  return (React.createElement(TouchableOpacity, { style: styles.bottomSheetOption, onPress: onPress, accessibilityLabel: text },
11
11
  icon && (React.createElement(View, { style: styles.icon },
@@ -7,7 +7,7 @@ import { Flex } from "../../../Flex";
7
7
  import { Typography } from "../../../Typography";
8
8
  import { Icon } from "../../../Icon";
9
9
  export function MenuOption({ label, icon, iconColor = "heading", textAlign, destructive, textTransform = "capitalize", onPress, setOpen, }) {
10
- const destructiveColor = "critical";
10
+ const destructiveColor = "destructive";
11
11
  const textVariation = destructive ? destructiveColor : "heading";
12
12
  return (React.createElement(View, { testID: "ATL-MENU-OPTIONS" },
13
13
  React.createElement(Pressable, { style: ({ pressed }) => [
@@ -16,9 +16,9 @@ export const TEXT_MAX_SCALED_FONT_SIZES = {
16
16
  text: MAX_TEXT_FONT_SIZE_SCALE,
17
17
  textSupporting: tokens["typography--fontSize-base"],
18
18
  };
19
- export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, selectable, }) {
19
+ export function Text({ level = "text", variation = "base", emphasis, allowFontScaling = true, adjustsFontSizeToFit = false, maxLines = "unlimited", align, children, reverseTheme = false, strikeThrough = false, italic = false, hideFromScreenReader = false, maxFontScaleSize, underline, selectable, }) {
20
20
  const accessibilityRole = "text";
21
- return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
21
+ return (React.createElement(Typography, Object.assign({ color: variation, fontFamily: "base", fontStyle: italic ? "italic" : "regular", fontWeight: getFontWeight({ level, emphasis }), maxFontScaleSize: maxFontScaleSize || TEXT_MAX_SCALED_FONT_SIZES[level], selectable: selectable, underline: underline }, Object.assign(Object.assign({}, levelStyles[level]), { allowFontScaling,
22
22
  align,
23
23
  adjustsFontSizeToFit,
24
24
  accessibilityRole,
@@ -15,7 +15,8 @@ const maxNumberOfLines = {
15
15
  unlimited: undefined,
16
16
  };
17
17
  export const Typography = React.memo(InternalTypography);
18
- function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing, reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, selectable = true, }) {
18
+ // eslint-disable-next-line max-statements
19
+ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, color, align, size = "default", children, maxLines = "unlimited", allowFontScaling = true, maxFontScaleSize, adjustsFontSizeToFit = false, lineHeight, letterSpacing, reverseTheme = false, hideFromScreenReader = false, accessibilityRole = "text", strikeThrough = false, underline, selectable = true, }) {
19
20
  const sizeAndHeight = getSizeAndHeightStyle(size, lineHeight);
20
21
  const style = [
21
22
  getFontStyle(fontFamily, fontStyle, fontWeight),
@@ -30,6 +31,10 @@ function InternalTypography({ fontFamily, fontStyle, fontWeight, transform, colo
30
31
  if (fontStyle === "italic") {
31
32
  style.push(styles.italic);
32
33
  }
34
+ if (underline) {
35
+ const underlineTextStyle = { textDecorationStyle: underline };
36
+ style.push(underlineTextStyle, styles.underline);
37
+ }
33
38
  const numberOfLinesForNativeText = maxNumberOfLines[maxLines];
34
39
  const text = getTransformedText(children, transform);
35
40
  const accessibilityProps = hideFromScreenReader
@@ -65,7 +65,14 @@ const fonts = Platform.select({
65
65
  */
66
66
  export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic: {
67
67
  fontStyle: "italic",
68
- }, startAlign: {
68
+ }, underline: {
69
+ textDecorationColor: tokens["color-text--secondary"],
70
+ textDecorationLine: "underline",
71
+ },
72
+ /**
73
+ * Alignments
74
+ */
75
+ startAlign: {
69
76
  textAlign: "left",
70
77
  }, endAlign: {
71
78
  textAlign: "right",
@@ -73,9 +80,12 @@ export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic
73
80
  textAlign: "center",
74
81
  }, justifyAlign: {
75
82
  textAlign: "justify",
76
- }, blue: {
77
- color: tokens["color-heading"],
78
- }, blueDark: {
83
+ },
84
+ /**
85
+ * Colors
86
+ */
87
+ // Base colors for backwards compatibility
88
+ blueDark: {
79
89
  color: tokens["color-blue--dark"],
80
90
  }, white: {
81
91
  color: tokens["color-white"],
@@ -121,10 +131,10 @@ export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic
121
131
  color: tokens["color-indigo--dark"],
122
132
  }, navy: {
123
133
  color: tokens["color-navy"],
124
- }, heading: {
134
+ },
135
+ // Typography
136
+ heading: {
125
137
  color: tokens["color-heading"],
126
- }, headingReverse: {
127
- color: tokens["color-text--reverse"],
128
138
  }, text: {
129
139
  color: tokens["color-text"],
130
140
  }, textSecondary: {
@@ -133,47 +143,160 @@ export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic
133
143
  color: tokens["color-text--reverse"],
134
144
  }, textReverseSecondary: {
135
145
  color: tokens["color-text--reverse--secondary"],
136
- }, success: {
137
- color: tokens["color-success--onSurface"],
138
- }, error: {
146
+ },
147
+ // Statuses
148
+ inactive: {
149
+ color: tokens["color-inactive"],
150
+ }, inactiveSurface: {
151
+ color: tokens["color-inactive--surface"],
152
+ }, inactiveOnSurface: {
153
+ color: tokens["color-inactive--onSurface"],
154
+ }, critical: {
139
155
  color: tokens["color-critical"],
140
- }, base: {
141
- color: tokens["color-text"],
142
- }, subdued: {
143
- color: tokens["color-text--secondary"],
144
- }, warn: {
156
+ }, criticalSurface: {
157
+ color: tokens["color-critical--surface"],
158
+ }, criticalOnSurface: {
159
+ color: tokens["color-critical--onSurface"],
160
+ }, warning: {
161
+ color: tokens["color-warning"],
162
+ }, warningSurface: {
163
+ color: tokens["color-warning--surface"],
164
+ }, warningOnSurface: {
145
165
  color: tokens["color-warning--onSurface"],
146
- }, info: {
166
+ }, informative: {
167
+ color: tokens["color-informative"],
168
+ }, informativeSurface: {
169
+ color: tokens["color-informative--surface"],
170
+ }, informativeOnSurface: {
147
171
  color: tokens["color-informative--onSurface"],
148
- }, critical: {
172
+ },
173
+ // To be uncommented once success in Deprecated is removed
174
+ // success: {
175
+ // color: tokens["color-success"],
176
+ // },
177
+ successSurface: {
178
+ color: tokens["color-success--surface"],
179
+ }, successOnSurface: {
180
+ color: tokens["color-success--onSurface"],
181
+ },
182
+ // Interactions
183
+ interactive: {
184
+ color: tokens["color-interactive"],
185
+ }, interactiveHover: {
186
+ color: tokens["color-interactive--hover"],
187
+ }, interactiveSubtle: {
188
+ color: tokens["color-interactive--subtle"],
189
+ }, interactiveSubtleHover: {
190
+ color: tokens["color-interactive--subtle--hover"],
191
+ }, destructive: {
192
+ color: tokens["color-destructive"],
193
+ }, destructiveHover: {
194
+ color: tokens["color-destructive--hover"],
195
+ }, disabled: {
196
+ color: tokens["color-disabled"],
197
+ }, disabledSecondary: {
198
+ color: tokens["color-disabled--secondary"],
199
+ },
200
+ // Workflow
201
+ request: {
202
+ color: tokens["color-request"],
203
+ }, requestSurface: {
204
+ color: tokens["color-request--surface"],
205
+ }, requestOnSurface: {
206
+ color: tokens["color-request--onSurface"],
207
+ }, quote: {
208
+ color: tokens["color-quote"],
209
+ }, quoteSurface: {
210
+ color: tokens["color-quote--surface"],
211
+ }, quoteOnSurface: {
212
+ color: tokens["color-quote--onSurface"],
213
+ }, job: {
214
+ color: tokens["color-job"],
215
+ }, jobSurface: {
216
+ color: tokens["color-job--surface"],
217
+ }, jobOnSurface: {
218
+ color: tokens["color-job--onSurface"],
219
+ }, visit: {
220
+ color: tokens["color-visit"],
221
+ }, visitSurface: {
222
+ color: tokens["color-visit--surface"],
223
+ }, visitOnSurface: {
224
+ color: tokens["color-visit--onSurface"],
225
+ }, task: {
226
+ color: tokens["color-task"],
227
+ }, taskSurface: {
228
+ color: tokens["color-task--surface"],
229
+ }, taskOnSurface: {
230
+ color: tokens["color-task--onSurface"],
231
+ }, event: {
232
+ color: tokens["color-event"],
233
+ }, eventSurface: {
234
+ color: tokens["color-event--surface"],
235
+ }, eventOnSurface: {
236
+ color: tokens["color-event--onSurface"],
237
+ }, invoice: {
238
+ color: tokens["color-invoice"],
239
+ }, invoiceSurface: {
240
+ color: tokens["color-invoice--surface"],
241
+ }, invoiceOnSurface: {
242
+ color: tokens["color-invoice--onSurface"],
243
+ }, payments: {
244
+ color: tokens["color-payments"],
245
+ }, paymentsSurface: {
246
+ color: tokens["color-payments--surface"],
247
+ }, paymentsOnSurface: {
248
+ color: tokens["color-payments--onSurface"],
249
+ }, client: {
250
+ color: tokens["color-client"],
251
+ },
252
+ // Miscellaneous
253
+ icon: {
254
+ color: tokens["color-icon"],
255
+ }, brand: {
256
+ color: tokens["color-brand"],
257
+ },
258
+ // Deprecated
259
+ blue: {
260
+ color: tokens["color-heading"],
261
+ }, base: {
262
+ color: tokens["color-text"],
263
+ }, baseReverse: {
264
+ color: tokens["color-text--reverse"],
265
+ }, headingReverse: {
266
+ color: tokens["color-text--reverse"],
267
+ }, error: {
149
268
  color: tokens["color-critical"],
150
- }, successReverse: {
151
- color: tokens["color-success"],
152
269
  }, errorReverse: {
153
270
  color: tokens["color-critical"],
154
- }, baseReverse: {
155
- color: tokens["color-text--reverse"],
156
- }, subduedReverse: {
157
- color: tokens["color-text--reverse--secondary"],
271
+ }, success: {
272
+ color: tokens["color-success--onSurface"],
273
+ }, successReverse: {
274
+ color: tokens["color-success"],
275
+ }, warn: {
276
+ color: tokens["color-warning--onSurface"],
158
277
  }, warnReverse: {
159
278
  color: tokens["color-warning"],
279
+ }, subdued: {
280
+ color: tokens["color-text--secondary"],
281
+ }, subduedReverse: {
282
+ color: tokens["color-text--reverse--secondary"],
283
+ }, info: {
284
+ color: tokens["color-informative--onSurface"],
160
285
  }, infoReverse: {
161
286
  color: tokens["color-informative"],
162
287
  }, criticalReverse: {
163
288
  color: tokens["color-critical"],
164
- }, interactive: {
165
- color: tokens["color-interactive"],
166
- }, destructive: {
167
- color: tokens["color-destructive"],
168
289
  }, learning: {
169
290
  color: tokens["color-informative"],
170
291
  }, subtle: {
171
292
  color: tokens["color-interactive--subtle"],
172
293
  }, onPrimary: {
173
294
  color: tokens["color-surface"],
174
- }, disabled: {
175
- color: tokens["color-disabled"],
176
- }, smallestSize: {
295
+ },
296
+ /**
297
+ * Sizes
298
+ */
299
+ smallestSize: {
177
300
  fontSize: tokens["typography--fontSize-smallest"],
178
301
  lineHeight: minusculeLineHeight,
179
302
  }, smallerSize: {
@@ -200,7 +323,11 @@ export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic
200
323
  }, extravagantSize: {
201
324
  fontSize: tokens["typography--fontSize-extravagant"],
202
325
  lineHeight: extravagantLineHeight,
203
- }, extravagantLineHeight: {
326
+ },
327
+ /**
328
+ * Line Heights
329
+ */
330
+ extravagantLineHeight: {
204
331
  lineHeight: extravagantLineHeight,
205
332
  }, jumboLineHeight: {
206
333
  lineHeight: jumboLineHeight,
@@ -214,7 +341,11 @@ export const typographyTokens = Object.assign(Object.assign({}, fonts), { italic
214
341
  lineHeight: baseLineHeight,
215
342
  }, tightLineHeight: {
216
343
  lineHeight: tightLineHeight,
217
- }, baseLetterSpacing: {
344
+ },
345
+ /**
346
+ * Letter Spacings
347
+ */
348
+ baseLetterSpacing: {
218
349
  letterSpacing: tokens["typography--letterSpacing-base"],
219
350
  }, looseLetterSpacing: {
220
351
  letterSpacing: tokens["typography--letterSpacing-loose"],