@jobber/components-native 0.101.5 → 0.101.6

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 (67) hide show
  1. package/dist/docs/ActionItem/ActionItem.md +65 -0
  2. package/dist/docs/ActionItemGroup/ActionItemGroup.md +33 -0
  3. package/dist/docs/ActionLabel/ActionLabel.md +43 -0
  4. package/dist/docs/ActivityIndicator/ActivityIndicator.md +116 -0
  5. package/dist/docs/Animation/Animation.md +71 -0
  6. package/dist/docs/AtlantisThemeContext/AtlantisThemeContext.md +256 -0
  7. package/dist/docs/AutoLink/AutoLink.md +47 -0
  8. package/dist/docs/Banner/Banner.md +390 -0
  9. package/dist/docs/Borders/Borders.md +45 -0
  10. package/dist/docs/BottomSheet/BottomSheet.md +67 -0
  11. package/dist/docs/Button/Button.md +918 -0
  12. package/dist/docs/ButtonGroup/ButtonGroup.md +89 -0
  13. package/dist/docs/Card/Card.md +270 -0
  14. package/dist/docs/Checkbox/Checkbox.md +69 -0
  15. package/dist/docs/Chip/Chip.md +371 -0
  16. package/dist/docs/Colors/Colors.md +217 -0
  17. package/dist/docs/Content/Content.md +67 -0
  18. package/dist/docs/ContentOverlay/ContentOverlay.md +64 -0
  19. package/dist/docs/Disclosure/Disclosure.md +161 -0
  20. package/dist/docs/Divider/Divider.md +84 -0
  21. package/dist/docs/Elevations/Elevations.md +76 -0
  22. package/dist/docs/EmptyState/EmptyState.md +72 -0
  23. package/dist/docs/Flex/Flex.md +37 -0
  24. package/dist/docs/Form/Form.md +126 -0
  25. package/dist/docs/FormField/FormField.md +57 -0
  26. package/dist/docs/FormatFile/FormatFile.md +56 -0
  27. package/dist/docs/Glimmer/Glimmer.md +143 -0
  28. package/dist/docs/Heading/Heading.md +132 -0
  29. package/dist/docs/Icon/Icon.md +585 -0
  30. package/dist/docs/IconButton/IconButton.md +25 -0
  31. package/dist/docs/InputCurrency/InputCurrency.md +61 -0
  32. package/dist/docs/InputDate/InputDate.md +133 -0
  33. package/dist/docs/InputEmail/InputEmail.md +69 -0
  34. package/dist/docs/InputFieldWrapper/InputFieldWrapper.md +70 -0
  35. package/dist/docs/InputNumber/InputNumber.md +72 -0
  36. package/dist/docs/InputPassword/InputPassword.md +61 -0
  37. package/dist/docs/InputPressable/InputPressable.md +64 -0
  38. package/dist/docs/InputSearch/InputSearch.md +49 -0
  39. package/dist/docs/InputText/InputText.md +324 -0
  40. package/dist/docs/InputTime/InputTime.md +54 -0
  41. package/dist/docs/Opacity/Opacity.md +12 -0
  42. package/dist/docs/ProgressBar/ProgressBar.md +39 -0
  43. package/dist/docs/Radii/Radii.md +23 -0
  44. package/dist/docs/ResponsiveBreakpoint/ResponsiveBreakpoint.md +74 -0
  45. package/dist/docs/Select/Select.md +213 -0
  46. package/dist/docs/Spacing/Spacing.md +103 -0
  47. package/dist/docs/StatusLabel/StatusLabel.md +119 -0
  48. package/dist/docs/Switch/Switch.md +54 -0
  49. package/dist/docs/Text/Text.md +368 -0
  50. package/dist/docs/TextList/TextList.md +29 -0
  51. package/dist/docs/ThumbnailList/ThumbnailList.md +16 -0
  52. package/dist/docs/Toast/Toast.md +71 -0
  53. package/dist/docs/Typography/Typography.md +170 -0
  54. package/dist/docs/choosing-components/choosing-components.md +76 -0
  55. package/dist/docs/customizing-components/customizing-components.md +167 -0
  56. package/dist/docs/disabled-states/disabled-states.md +86 -0
  57. package/dist/docs/empty-states/empty-states.md +126 -0
  58. package/dist/docs/errors/errors.md +114 -0
  59. package/dist/docs/index.md +64 -0
  60. package/dist/docs/interaction/interaction.md +109 -0
  61. package/dist/docs/page-layouts/page-layouts.md +323 -0
  62. package/dist/docs/scaffolding/scaffolding.md +109 -0
  63. package/dist/docs/settings/settings.md +58 -0
  64. package/dist/docs/usage-guidelines/usage-guidelines.md +177 -0
  65. package/dist/package.json +8 -4
  66. package/dist/tsconfig.build.tsbuildinfo +1 -1
  67. package/package.json +8 -4
@@ -0,0 +1,65 @@
1
+ # Action Item
2
+
3
+ ActionItem allows for consistent presentation of text content that can be
4
+ actioned on. It can use icons to provide additional visual context about the
5
+ text content.
6
+
7
+ ## Design & usage guidelines
8
+
9
+ The ActionItem will provide a familiar pattern for enhancing text content with
10
+ icons and providing actions.
11
+
12
+ ActionItem is commonly used [in a Card](../Card/Card.md), where it can be
13
+ grouped with other ActionItems or other elements as needed.
14
+
15
+ If the action appears directly related to the title, or otherwise is not
16
+ well-suited to be centered in the ActionItem, you can
17
+ [align the action](/storybook/mobile/?path=/story/components-layouts-and-structure-actionitem--action-alignment)
18
+ as needed.
19
+
20
+ ## Content guidelines
21
+
22
+ ActionItem provides a pre-styled `title`, which can be used to consistently
23
+ title the element. You can use the
24
+ [title](/storybook/mobile/?path=/story/components-layouts-and-structure-actionitem--title-only)
25
+ and not pass any children. This is useful when you have empty states that
26
+ require the user's attention.
27
+
28
+ When an `onPress` is provided, the entire ActionItem is tappable for easy
29
+ interactivity. If a child of the ActionItem has an `onPress`, tapping directly
30
+ on that child will trigger the child item's `onPress`.
31
+
32
+ Child content can be whatever you need but typically consists of
33
+ [Text](../Text/Text.md).
34
+
35
+ ## Related components
36
+
37
+ To group multiple ActionItems together with dividers between them, use
38
+ [ActionItemGroup](../ActionItemGroup/ActionItemGroup.md).
39
+
40
+ ActionItem is commonly consumed by [Card](../Card/Card.md). In most cases, it
41
+ will also render at least one [Icon](../Icon/Icon.md).
42
+
43
+ ## Accessibility
44
+
45
+ The Icons in ActionItem should not be announced to assistive technology. The
46
+ entire contents of the ActionItem should be read as one element.
47
+
48
+ ## Mockup
49
+
50
+
51
+ ## Props
52
+
53
+ ### Mobile
54
+
55
+ | Prop | Type | Required | Default | Description |
56
+ |------|------|----------|---------|-------------|
57
+ | `actionIcon` | `ActionIconNames` | No | `edit` | Action icon to display |
58
+ | `actionIconAlignment` | `"flex-start" | "flex-end" | "center"` | No | `center` | Alignment of action icon |
59
+ | `actionIconColour` | `ActionIconColour` | No | `interactive` | Colour of the action icon |
60
+ | `children` | `ReactNode` | No | — | Content to display. |
61
+ | `icon` | `IconNames` | No | — | Name of the icon to display before content |
62
+ | `iconColor` | `"task" | "text" | "warning" | "icon" | "white" | "grey" | "greyBlue" | "greyBlueDark" | "greyBlueLighter" | "blue" | "lightBlue" | "green" | "yellow" | "red" | "navy" | "orange" | ... 33 more ... | "brandHighlight"` | No | — | Colour of the icon displayed before content |
63
+ | `onPress` | `() => void` | No | — | Press handler |
64
+ | `testID` | `string` | No | `actionItem` | |
65
+ | `title` | `string` | No | — | Title of the Action Item |
@@ -0,0 +1,33 @@
1
+ # Action Item Group
2
+
3
+ ActionItemGroup is a layout wrapper allowing for quick and easy grouping of
4
+ [ActionItems](../ActionItem/ActionItem.md). It can also house other content alongside
5
+ an ActionItem if needed.
6
+
7
+ ## Design & usage guidelines
8
+
9
+ The ActionItemGroup makes it easy to consistently display several ActionItems
10
+ alongside each other with dividers to segment each item.
11
+
12
+ ## Content guidelines
13
+
14
+ You'll mostly be passing ActionItems into ActionItemGroup, but as shown it can
15
+ handle other content types if needed.
16
+
17
+ In forms in particular, you may find the need to add other elements into the
18
+ group. You may need to use [Content](../Content/Content.md) or write some styling
19
+ to get things aligned. In the Mixed Components
20
+ [example](/storybook/mobile/?path=/story/components-layouts-and-structure-actionitemgroup--mixed-components)
21
+ you can see Content being used to layout [Text](../Text/Text.md) and
22
+ [Typography](../Typography/Typography.md) alongside some
23
+ [ActionItems](../ActionItem/ActionItem.md).
24
+
25
+ ## Related components
26
+
27
+ If you only need one [ActionItem](../ActionItem/ActionItem.md), you can use that on
28
+ its own without this wrapper.
29
+
30
+ ## Accessibility
31
+
32
+ ActionItemGroup is just a layout wrapper and does not communicate anything to
33
+ screen-readers - that's the job of its children.
@@ -0,0 +1,43 @@
1
+ # Action Label
2
+
3
+ The ActionLabel is a base component that is widely used in areas that have an
4
+ `onPress` action, like a button.
5
+
6
+ The aim is to reduce the number of inconsistencies when a designer or an
7
+ engineer decides to build a pressable component that has text on it. This makes
8
+ it easier to maintain consistency in how we visually present tappable actions.
9
+
10
+ ## Design & usage guidelines
11
+
12
+ ActionLabel supports similar semantic variations as Button:
13
+
14
+ * default (equivalent to "work")
15
+ * learning
16
+ * destructive
17
+ * subtle
18
+
19
+ with an additional variation of `onPrimary` which should be used when the
20
+ ActionLabel is consumed by a primary Button or other dark surface.
21
+
22
+ #### Disable pattern
23
+
24
+ \*\*As a best practice, do not design with disabled button states. \*\*
25
+
26
+ This has negative impacts on accessibility as well as an increase in complexity
27
+ for users to understand why the interface is disabled and how to resolve it.
28
+
29
+ With that said, if you can't design a flow without a disabled state, you can add
30
+ a `disabled` prop to the ActionLabel component.
31
+
32
+
33
+ ## Props
34
+
35
+ ### Mobile
36
+
37
+ | Prop | Type | Required | Default | Description |
38
+ |------|------|----------|---------|-------------|
39
+ | `align` | `TextAlign` | No | `center` | Alignment of action label |
40
+ | `children` | `ReactNode` | No | — | Text to display. Supports nesting text elements. |
41
+ | `disabled` | `boolean` | No | `false` | Set the display text to disabled color |
42
+ | `type` | `ActionLabelType` | No | `default` | Changes the appearance to match the style of where it's getting used |
43
+ | `variation` | `ActionLabelVariation` | No | `interactive` | The text color |
@@ -0,0 +1,116 @@
1
+ # Activity Indicator
2
+
3
+ ActivityIndicator is used to indicate the loading of content where the actual
4
+ amount of loading time or progress is unknown.
5
+
6
+ ## Related components
7
+
8
+ To indicate loading content in web applications, refer to
9
+ [Spinner](/components/Spinner).
10
+
11
+ ActivityIndicator uses the core component
12
+ [ActivityIndicator](https://reactnative.dev/docs/activityIndicator) from
13
+ `react-native`.
14
+
15
+ ## Mockup
16
+
17
+
18
+ ## Props
19
+
20
+ ### Mobile
21
+
22
+ | Prop | Type | Required | Default | Description |
23
+ |------|------|----------|---------|-------------|
24
+ | `accessibilityActions` | `readonly Readonly<{ name: string; label?: string; }>[]` | No | — | Provides an array of custom actions available for accessibility. |
25
+ | `accessibilityElementsHidden` | `boolean` | No | — | A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden ... |
26
+ | `accessibilityHint` | `string` | No | — | An accessibility hint helps users understand what will happen when they perform an action on the accessibility elemen... |
27
+ | `accessibilityIgnoresInvertColors` | `boolean` | No | — | https://reactnative.dev/docs/accessibility#accessibilityignoresinvertcolorsios @platform ios |
28
+ | `accessibilityLabel` | `string` | No | — | Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label i... |
29
+ | `accessibilityLabelledBy` | `string | string[]` | No | — | Identifies the element that labels the element it is applied to. When the assistive technology focuses on the compone... |
30
+ | `accessibilityLanguage` | `string` | No | — | By using the accessibilityLanguage property, the screen reader will understand which language to use while reading th... |
31
+ | `accessibilityLargeContentTitle` | `string` | No | — | When `accessibilityShowsLargeContentViewer` is set, this string will be used as title for the large content viewer. h... |
32
+ | `accessibilityLiveRegion` | `"none" | "polite" | "assertive"` | No | — | Indicates to accessibility services whether the user should be notified when this view changes. Works for Android API... |
33
+ | `accessibilityRespondsToUserInteraction` | `boolean` | No | — | Blocks the user from interacting with the component through keyboard while still allowing screen reader to interact w... |
34
+ | `accessibilityRole` | `AccessibilityRole` | No | — | Accessibility Role tells a person using either VoiceOver on iOS or TalkBack on Android the type of element that is fo... |
35
+ | `accessibilityShowsLargeContentViewer` | `boolean` | No | — | A Boolean value that indicates whether or not to show the item in the large content viewer. Available on iOS 13.0+ ht... |
36
+ | `accessibilityState` | `AccessibilityState` | No | — | Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element curr... |
37
+ | `accessibilityValue` | `AccessibilityValue` | No | — | Represents the current value of a component. It can be a textual description of a component's value, or for range-bas... |
38
+ | `accessibilityViewIsModal` | `boolean` | No | — | A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receive... |
39
+ | `accessible` | `boolean` | No | — | When true, indicates that the view is an accessibility element. By default, all the touchable elements are accessible. |
40
+ | `animating` | `boolean` | No | — | Whether to show the indicator (true, the default) or hide it (false). |
41
+ | `aria-busy` | `boolean` | No | — | alias for accessibilityState see https://reactnative.dev/docs/accessibility#accessibilitystate |
42
+ | `aria-checked` | `boolean | "mixed"` | No | — | |
43
+ | `aria-disabled` | `boolean` | No | — | |
44
+ | `aria-expanded` | `boolean` | No | — | |
45
+ | `aria-hidden` | `boolean` | No | — | A value indicating whether the accessibility elements contained within this accessibility element are hidden. |
46
+ | `aria-label` | `string` | No | — | Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel https://github.com/facebook/react-... |
47
+ | `aria-labelledby` | `string` | No | — | Identifies the element that labels the element it is applied to. When the assistive technology focuses on the compone... |
48
+ | `aria-live` | `"polite" | "assertive" | "off"` | No | — | Indicates to accessibility services whether the user should be notified when this view changes. Works for Android API... |
49
+ | `aria-modal` | `boolean` | No | — | |
50
+ | `aria-selected` | `boolean` | No | — | |
51
+ | `aria-valuemax` | `number` | No | — | |
52
+ | `aria-valuemin` | `number` | No | — | |
53
+ | `aria-valuenow` | `number` | No | — | |
54
+ | `aria-valuetext` | `string` | No | — | |
55
+ | `collapsable` | `boolean` | No | — | Views that are only used to layout their children or otherwise don't draw anything may be automatically removed from ... |
56
+ | `collapsableChildren` | `boolean` | No | — | Setting to false prevents direct children of the view from being removed from the native view hierarchy, similar to t... |
57
+ | `color` | `ColorValue` | No | — | The foreground color of the spinner (default is gray). |
58
+ | `focusable` | `boolean` | No | — | Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. |
59
+ | `hasTVPreferredFocus` | `boolean` | No | — | *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view. @platform ios @de... |
60
+ | `hidesWhenStopped` | `boolean` | No | — | Whether the indicator should hide when not animating (true by default). |
61
+ | `hitSlop` | `number | Insets` | No | — | This defines how far a touch event can start away from the view. Typical interface guidelines recommend touch targets... |
62
+ | `id` | `string` | No | — | Used to reference react managed views from native code. |
63
+ | `importantForAccessibility` | `"auto" | "yes" | "no" | "no-hide-descendants"` | No | — | [Android] Controlling if a view fires accessibility events and if it is reported to accessibility services. |
64
+ | `isTVSelectable` | `boolean` | No | — | *(Apple TV only)* When set to true, this view will be focusable and navigable using the Apple TV remote. @platform ios |
65
+ | `nativeID` | `string` | No | — | Used to reference react managed views from native code. |
66
+ | `needsOffscreenAlphaCompositing` | `boolean` | No | — | Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors a... |
67
+ | `onAccessibilityAction` | `(event: AccessibilityActionEvent) => void` | No | — | When `accessible` is true, the system will try to invoke this function when the user performs an accessibility custom... |
68
+ | `onAccessibilityEscape` | `() => void` | No | — | When accessible is true, the system will invoke this function when the user performs the escape gesture (scrub with t... |
69
+ | `onAccessibilityTap` | `() => void` | No | — | When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gestu... |
70
+ | `onBlur` | `(e: BlurEvent) => void` | No | — | Callback that is called when the view is blurred. Note: This will only be called if the view is focusable. |
71
+ | `onFocus` | `(e: FocusEvent) => void` | No | — | Callback that is called when the view is focused. Note: This will only be called if the view is focusable. |
72
+ | `onLayout` | `(event: LayoutChangeEvent) => void` | No | — | Invoked on mount and layout changes with {nativeEvent: { layout: {x, y, width, height}}}. |
73
+ | `onMagicTap` | `() => void` | No | — | When accessible is true, the system will invoke this function when the user performs the magic tap gesture. @platform... |
74
+ | `onMoveShouldSetResponder` | `(event: GestureResponderEvent) => boolean` | No | — | Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsive... |
75
+ | `onMoveShouldSetResponderCapture` | `(event: GestureResponderEvent) => boolean` | No | — | onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, where the deepest node is ... |
76
+ | `onPointerCancel` | `(event: PointerEvent) => void` | No | — | |
77
+ | `onPointerCancelCapture` | `(event: PointerEvent) => void` | No | — | |
78
+ | `onPointerDown` | `(event: PointerEvent) => void` | No | — | |
79
+ | `onPointerDownCapture` | `(event: PointerEvent) => void` | No | — | |
80
+ | `onPointerEnter` | `(event: PointerEvent) => void` | No | — | |
81
+ | `onPointerEnterCapture` | `(event: PointerEvent) => void` | No | — | |
82
+ | `onPointerLeave` | `(event: PointerEvent) => void` | No | — | |
83
+ | `onPointerLeaveCapture` | `(event: PointerEvent) => void` | No | — | |
84
+ | `onPointerMove` | `(event: PointerEvent) => void` | No | — | |
85
+ | `onPointerMoveCapture` | `(event: PointerEvent) => void` | No | — | |
86
+ | `onPointerUp` | `(event: PointerEvent) => void` | No | — | |
87
+ | `onPointerUpCapture` | `(event: PointerEvent) => void` | No | — | |
88
+ | `onResponderEnd` | `(event: GestureResponderEvent) => void` | No | — | If the View returns true and attempts to become the responder, one of the following will happen: |
89
+ | `onResponderGrant` | `(event: GestureResponderEvent) => void` | No | — | The View is now responding for touch events. This is the time to highlight and show the user what is happening |
90
+ | `onResponderMove` | `(event: GestureResponderEvent) => void` | No | — | The user is moving their finger |
91
+ | `onResponderReject` | `(event: GestureResponderEvent) => void` | No | — | Something else is the responder right now and will not release it |
92
+ | `onResponderRelease` | `(event: GestureResponderEvent) => void` | No | — | Fired at the end of the touch, ie "touchUp" |
93
+ | `onResponderStart` | `(event: GestureResponderEvent) => void` | No | — | |
94
+ | `onResponderTerminate` | `(event: GestureResponderEvent) => void` | No | — | The responder has been taken from the View. Might be taken by other views after a call to onResponderTerminationReque... |
95
+ | `onResponderTerminationRequest` | `(event: GestureResponderEvent) => boolean` | No | — | Something else wants to become responder. Should this view release the responder? Returning true allows release |
96
+ | `onStartShouldSetResponder` | `(event: GestureResponderEvent) => boolean` | No | — | Does this view want to become responder on the start of a touch? |
97
+ | `onStartShouldSetResponderCapture` | `(event: GestureResponderEvent) => boolean` | No | — | onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, where the deepest node is ... |
98
+ | `onTouchCancel` | `(event: GestureResponderEvent) => void` | No | — | |
99
+ | `onTouchEnd` | `(event: GestureResponderEvent) => void` | No | — | |
100
+ | `onTouchEndCapture` | `(event: GestureResponderEvent) => void` | No | — | |
101
+ | `onTouchMove` | `(event: GestureResponderEvent) => void` | No | — | |
102
+ | `onTouchStart` | `(event: GestureResponderEvent) => void` | No | — | |
103
+ | `pointerEvents` | `"box-none" | "none" | "box-only" | "auto"` | No | — | In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class:... |
104
+ | `removeClippedSubviews` | `boolean` | No | — | This is a special performance property exposed by RCTView and is useful for scrolling content when there are many sub... |
105
+ | `renderToHardwareTextureAndroid` | `boolean` | No | — | Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. On Andro... |
106
+ | `role` | `Role` | No | — | Indicates to accessibility services to treat UI component like a specific role. |
107
+ | `screenReaderFocusable` | `boolean` | No | — | Enables the view to be screen reader focusable, not keyboard focusable. @platform android |
108
+ | `shouldRasterizeIOS` | `boolean` | No | — | Whether this view should be rendered as a bitmap before compositing. On iOS, this is useful for animations and inter... |
109
+ | `size` | `number | "small" | "large"` | No | — | Size of the indicator. Small has a height of 20, large has a height of 36. enum('small', 'large') |
110
+ | `style` | `StyleProp<ViewStyle>` | No | — | |
111
+ | `tabIndex` | `0 | -1` | No | — | Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware ke... |
112
+ | `testID` | `string` | No | — | Used to locate this view in end-to-end tests. |
113
+ | `tvParallaxMagnification` | `number` | No | — | *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out ... |
114
+ | `tvParallaxShiftDistanceX` | `number` | No | — | *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out ... |
115
+ | `tvParallaxShiftDistanceY` | `number` | No | — | *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out ... |
116
+ | `tvParallaxTiltAngle` | `number` | No | — | *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out ... |
@@ -0,0 +1,71 @@
1
+ # Animation
2
+
3
+ ## Patterns
4
+
5
+ Animations in Jobber fall under categories based on their purpose:
6
+
7
+ ### Reveal
8
+
9
+ Reveals are used to show and hide information on the screen. For example,
10
+ toasts, modals, sidebars appearing and disappearing on the screen.
11
+
12
+ ### State change
13
+
14
+ State changes are used to inform the user that a context change is taking place.
15
+ This is used when the object has changed state due to user interaction (e.g.
16
+ hover and focus states).
17
+
18
+ ### Emphasis
19
+
20
+ Emphasis is used to bring attention to something on already on the screen. For
21
+ example, when you want to guide users to a particular part of the interface for
22
+ onboarding or learning purposes.
23
+
24
+ ### Delighter
25
+
26
+ Delighters can be used occasionally to create surprise and delight, and can give
27
+ personality to our brand. These can be used to reinforce success in an important
28
+ milestones in a user's journey.
29
+
30
+ ## Timing
31
+
32
+ Use judgement when determining the appropriate timing durations for animations.
33
+ This will depend on the size of the element and the distance it covers.
34
+ Animations for larger elements or longer distances should be longer than smaller
35
+ elements or shorter distances.
36
+
37
+ | Name | Examples of use | Value |
38
+ | :----------------- | :------------------------------------------------------ | ------ |
39
+ | `--timing-quick` | smaller elements exiting, small elements, state changes | 100ms |
40
+ | `--timing-base` | larger elements exiting, small elements, state changes | 200ms |
41
+ | `--timing-slow` | modals, side panels | 300ms |
42
+ | `--timing-slower` | large elements traversing across large area | 400ms |
43
+ | `--timing-slowest` | page transitions | 500ms |
44
+ | `--timing-loading` | candy-stripe loading | 1000ms |
45
+
46
+ ## Easing
47
+
48
+ Animations are linear by default, but this lends an uncanny robotic feeling to
49
+ the motion of an element. Easing creates a more natural, pleasing transition
50
+ between animation states to mimic the acceleration and deceleration of objects
51
+ in the real world.
52
+
53
+ ### Ease in
54
+
55
+ Starts slow and speeds up. Use for exiting elements that don’t fade out.
56
+
57
+ ### Ease out
58
+
59
+ Starts fast and slows down. Use for entering elements. For example, opening a
60
+ toast, modal, or menu.
61
+
62
+ ### Ease both
63
+
64
+ Combines features of ease in and out curves. Use for moving from point to point,
65
+ or for when the element disappears from the screen, but the user can return to
66
+ the previous place at any time. For example, opening and closing a side drawer,
67
+ side nav, or accordion.
68
+
69
+ ### Linear
70
+
71
+ Use for color and opacity changes (things that don’t move).
@@ -0,0 +1,256 @@
1
+ # AtlantisThemeContext
2
+
3
+ Provides a way to control the theme of Atlantis components and the design
4
+ tokens.
5
+
6
+ ## Design & usage guidelines
7
+
8
+ Both the web and mobile components have the exact same API, except for one minor
9
+ difference in how you update the theme.
10
+
11
+ Each platform provides a `useAtlantisTheme` hook that you may use to access the
12
+ `theme` and `tokens` in your components.
13
+
14
+ On mobile, this hook also returns a `setTheme` function which you'll use to
15
+ update the theme for the nearest `AtlantisThemeContextProvider` ancestor.
16
+ Typically there will only be a single provider at the root, controlling the
17
+ theme for the entire app.
18
+
19
+ On web, you'll need to import the `updateTheme` function and call it with the
20
+ new theme. This is a separate function because it synchronizes the theme update
21
+ across all providers under various React trees. Synchronizing across providers
22
+ is necessary for cases where an island-based architecture is used.
23
+
24
+ ### Usage for web
25
+
26
+ ```tsx
27
+ import {
28
+ AtlantisThemeContextProvider,
29
+ updateTheme,
30
+ useAtlantisTheme,
31
+ } from "@jobber/components/AtlantisThemeContext";
32
+
33
+ function App() {
34
+ return (
35
+ <AtlantisThemeContextProvider>
36
+ <ThemedComponent />
37
+ </AtlantisThemeContextProvider>
38
+ );
39
+ }
40
+
41
+ function ThemedComponent() {
42
+ const { theme, tokens } = useAtlantisTheme();
43
+ return (
44
+ <Content>
45
+ <div
46
+ style={{
47
+ background: tokens["surface-background"],
48
+ padding: tokens["space-base"],
49
+ }}
50
+ >
51
+ <Content>
52
+ <Text>The current theme is: {theme}.</Text>
53
+ <Text>
54
+ The javascript tokens can be accessed via the tokens object.
55
+ </Text>
56
+ <Text>The theme can be changed using `updateTheme`</Text>
57
+ <Button
58
+ onClick={() => updateTheme("light")}
59
+ label="The theme can be changed to light"
60
+ />
61
+ <Button
62
+ onClick={() => updateTheme("dark")}
63
+ label="The theme can be changed to dark"
64
+ />
65
+ </Content>
66
+ </div>
67
+ </Content>
68
+ );
69
+ }
70
+ ```
71
+
72
+ ### Usage for mobile
73
+
74
+ ```tsx
75
+ import {
76
+ AtlantisThemeContextProvider,
77
+ useAtlantisTheme,
78
+ } from "@jobber/components/AtlantisThemeContext";
79
+
80
+ function App() {
81
+ return (
82
+ <AtlantisThemeContextProvider>
83
+ <ThemedComponent />
84
+ </AtlantisThemeContextProvider>
85
+ );
86
+ }
87
+
88
+ function ThemedComponent() {
89
+ const { theme, tokens, setTheme } = useAtlantisTheme();
90
+ return (
91
+ <Content>
92
+ <View
93
+ style={{
94
+ background: tokens["surface-background"],
95
+ padding: tokens["space-base"],
96
+ }}
97
+ >
98
+ <Content>
99
+ <Text>The current theme is: {theme}.</Text>
100
+ <Text>
101
+ The javascript tokens can be accessed via the tokens object.
102
+ </Text>
103
+ <Text>The theme can be changed using `setTheme`</Text>
104
+ <Button
105
+ onPress={() => setTheme("light")}
106
+ label="The theme can be changed to light"
107
+ />
108
+ <Button
109
+ onPress={() => setTheme("dark")}
110
+ label="The theme can be changed to dark"
111
+ />
112
+ </Content>
113
+ </View>
114
+ </Content>
115
+ );
116
+ }
117
+ ```
118
+
119
+ ### Forcing a theme for an AtlantisThemeContextProvider
120
+
121
+ In some scenarios you may want to force a theme for specific components
122
+ regardless of the main application theme. This can be done by setting the
123
+ `dangerouslyOverrideTheme` prop to `<themeToSet>` on the
124
+ `AtlantisThemeContextProvider`.
125
+
126
+ Note: If you're using `buildThemedStyles`, any `useStyles` calls must be done
127
+ within a *child component* of the `AtlantisThemeContextProvider`, not in the
128
+ same component that renders the provider. Same goes for `useAtlantisTheme`.
129
+
130
+ ```tsx
131
+ import {
132
+ AtlantisThemeContextProvider,
133
+ updateTheme,
134
+ useAtlantisTheme,
135
+ } from "@jobber/components/AtlantisThemeContext";
136
+
137
+ function App() {
138
+ return (
139
+ <AtlantisThemeContextProvider>
140
+ <ThemedComponent />
141
+ <AtlantisThemeContextProvider dangerouslyOverrideTheme="dark">
142
+ <Text>These components will always be dark themed</Text>
143
+ <ThemedComponent />
144
+ </AtlantisThemeContextProvider>
145
+ </AtlantisThemeContextProvider>
146
+ );
147
+ }
148
+
149
+ function ThemedComponent() {
150
+ const { theme, tokens } = useAtlantisTheme();
151
+ return (
152
+ <Content>
153
+ <div
154
+ style={{
155
+ background: tokens["surface-background"],
156
+ padding: tokens["space-base"],
157
+ }}
158
+ >
159
+ <Content>
160
+ <Text>The current theme is: {theme}. </Text>
161
+ <Text>
162
+ The javascript tokens can be accessed via the tokens object.
163
+ </Text>
164
+ <Text>The theme can be changed using `updateTheme`</Text>
165
+ <Button
166
+ onClick={() => updateTheme("light")}
167
+ label="The theme can be changed to light"
168
+ />
169
+ <Button
170
+ onClick={() => updateTheme("dark")}
171
+ label="The theme can be changed to dark"
172
+ />
173
+ </Content>
174
+ </div>
175
+ </Content>
176
+ );
177
+ }
178
+ ```
179
+
180
+ ### Overriding theme tokens (Web Only)
181
+
182
+ If you need to override theme tokens, you can do so by supplying the
183
+ `dangerouslyOverrideTokens` prop to the `AtlantisThemeContextProvider`. You can
184
+ also supply custom tokens which are exposed as CSS variables to any elements
185
+ under this `AtlantisThemeContextProvider`. All overridden tokens are also
186
+ accessible via the `overrideTokens` object from the `useAtlantisTheme` hook.
187
+
188
+ This capability allows you to create custom theme providers.
189
+
190
+ ```tsx
191
+ import {
192
+ AtlantisThemeContextProvider,
193
+ updateTheme,
194
+ useAtlantisTheme,
195
+ } from "@jobber/components/AtlantisThemeContext";
196
+
197
+ function App() {
198
+ return (
199
+ <AtlantisThemeContextProvider
200
+ dangerouslyOverrideTokens={{
201
+ "color-text": "fuchsia",
202
+ }}
203
+ >
204
+ <Text>This text will be fuchsia!</Text>
205
+ </AtlantisThemeContextProvider>
206
+ );
207
+ }
208
+ ```
209
+
210
+ ### Creating themed styles with buildThemedStyles (Mobile Only)
211
+
212
+ The `buildThemedStyles` utility is available to help create themed StyleSheets
213
+ that automatically update when the theme changes.
214
+
215
+ ```tsx
216
+ // In the .style.ts file
217
+ import { buildThemedStyles } from "@jobber/components-native";
218
+
219
+ const useStyles = buildThemedStyles(tokens => ({
220
+ container: {
221
+ backgroundColor: tokens["color-surface"],
222
+ padding: tokens["space-base"],
223
+ borderRadius: tokens["radius-base"],
224
+ },
225
+ text: {
226
+ color: tokens["color-text"],
227
+ fontSize: tokens["font-size-base"],
228
+ },
229
+ }));
230
+
231
+ // In the component file
232
+ function ThemedComponent() {
233
+ const styles = useStyles();
234
+ return (
235
+ <View style={styles.container}>
236
+ <Text style={styles.text}>Themed content</Text>
237
+ </View>
238
+ );
239
+ }
240
+ ```
241
+
242
+ Key features:
243
+
244
+ * Automatically updates styles when the theme changes
245
+ * Works with React Native's StyleSheet system
246
+ * Memoized so that the StyleSheet is only re-created when the theme changes
247
+
248
+
249
+ ## Props
250
+
251
+ ### Mobile
252
+
253
+ | Prop | Type | Required | Default | Description |
254
+ |------|------|----------|---------|-------------|
255
+ | `children` | `ReactNode` | Yes | — | The children to render. |
256
+ | `dangerouslyOverrideTheme` | `Theme` | No | — | Force the theme for this provider to always be the same as the provided theme. Useful for sections that should remain... |
@@ -0,0 +1,47 @@
1
+ # Auto Link
2
+
3
+ The AutoLink component is a base component that utilizes the
4
+ [autolinker](https://github.com/gregjacobs/Autolinker.js/) package to find urls,
5
+ phone numbers and emails within a chunk of text. When these linkable items are
6
+ found, they are converted to links that can be interacted with.
7
+
8
+ This component makes use of the Text component to display both the plain text
9
+ and the links discovered.
10
+
11
+ In the event a phone number is pressed, after completing the call the user will
12
+ be returned to the app. The same applies when using the detected email.
13
+
14
+ ## Design & usage guidelines
15
+
16
+ The AutoLink will detect linkable items within text and allow the user to
17
+ interact with them. You can use flags to determine if you want to ignore certain
18
+ types of links, such as ignoring phone numbers.
19
+
20
+ This is intended for scenarios where you do not know if the text to display will
21
+ contain links within it. A common use case for this would be when dealing with
22
+ user input.
23
+
24
+
25
+ ## Developer notes
26
+
27
+ There is an [Autolink](https://github.com/joshswan/react-native-autolink)
28
+ package written by a third party that was investigated to accomplish what this
29
+ component does. Though we were able to provide our own rendering function to
30
+ display our own text instead of RN Text, this still required re-writing a good
31
+ chunk of functionality and still importing the base library to get the proper
32
+ types. Also contained extra things we didn't need. This package was used as
33
+ inspiration into dealing with this problem and building our own.
34
+
35
+
36
+ ## Props
37
+
38
+ ### Mobile
39
+
40
+ | Prop | Type | Required | Default | Description |
41
+ |------|------|----------|---------|-------------|
42
+ | `bottomTabsVisible` | `boolean` | No | `true` | Determines the placement of the toast that gets shown onLongPress |
43
+ | `children` | `string` | No | `` | Text to display. |
44
+ | `email` | `boolean` | No | — | Flag for linking emails in text |
45
+ | `phone` | `boolean` | No | — | Flag for linking phone numbers in text |
46
+ | `selectable` | `boolean` | No | `true` | Lets the user select text, to use the native copy and paste functionality. |
47
+ | `urls` | `boolean` | No | — | Flag for linking urls in text |