@planningcenter/chat-react-native 2.1.1 → 2.2.0-rc.1

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 (126) hide show
  1. package/build/components/conversation/message_form.d.ts.map +1 -1
  2. package/build/components/conversation/message_form.js +4 -4
  3. package/build/components/conversation/message_form.js.map +1 -1
  4. package/build/components/display/badge.d.ts +2 -9
  5. package/build/components/display/badge.d.ts.map +1 -1
  6. package/build/components/display/badge.js +8 -40
  7. package/build/components/display/badge.js.map +1 -1
  8. package/build/components/display/banner.d.ts +29 -0
  9. package/build/components/display/banner.d.ts.map +1 -0
  10. package/build/components/display/banner.js +16 -0
  11. package/build/components/display/banner.js.map +1 -0
  12. package/build/components/display/button.d.ts +1 -1
  13. package/build/components/display/button.d.ts.map +1 -1
  14. package/build/components/display/button.js +1 -1
  15. package/build/components/display/button.js.map +1 -1
  16. package/build/components/display/icon_button.d.ts +1 -1
  17. package/build/components/display/icon_button.d.ts.map +1 -1
  18. package/build/components/display/icon_button.js +1 -1
  19. package/build/components/display/icon_button.js.map +1 -1
  20. package/build/components/display/index.d.ts +1 -0
  21. package/build/components/display/index.d.ts.map +1 -1
  22. package/build/components/display/index.js +1 -0
  23. package/build/components/display/index.js.map +1 -1
  24. package/build/components/display/text_button.d.ts +1 -1
  25. package/build/components/display/text_button.d.ts.map +1 -1
  26. package/build/components/display/text_button.js +1 -1
  27. package/build/components/display/text_button.js.map +1 -1
  28. package/build/components/display/text_inline_button.d.ts +2 -2
  29. package/build/components/display/text_inline_button.d.ts.map +1 -1
  30. package/build/components/display/text_inline_button.js +3 -2
  31. package/build/components/display/text_inline_button.js.map +1 -1
  32. package/build/components/display/{button_color_utils.d.ts → utils/button_colors.d.ts} +1 -1
  33. package/build/components/display/utils/button_colors.d.ts.map +1 -0
  34. package/build/components/display/{button_color_utils.js → utils/button_colors.js} +2 -2
  35. package/build/components/display/utils/button_colors.js.map +1 -0
  36. package/build/components/display/utils/status_colors.d.ts +17 -0
  37. package/build/components/display/utils/status_colors.d.ts.map +1 -0
  38. package/build/components/display/utils/status_colors.js +49 -0
  39. package/build/components/display/utils/status_colors.js.map +1 -0
  40. package/build/components/primitive/banner_primitive.d.ts +38 -0
  41. package/build/components/primitive/banner_primitive.d.ts.map +1 -0
  42. package/build/components/primitive/banner_primitive.js +112 -0
  43. package/build/components/primitive/banner_primitive.js.map +1 -0
  44. package/build/contexts/api_provider.js +4 -3
  45. package/build/contexts/api_provider.js.map +1 -1
  46. package/build/contexts/chat_context.d.ts +2 -2
  47. package/build/contexts/chat_context.d.ts.map +1 -1
  48. package/build/contexts/chat_context.js +3 -15
  49. package/build/contexts/chat_context.js.map +1 -1
  50. package/build/hooks/use_api_client.d.ts +6 -0
  51. package/build/hooks/use_api_client.d.ts.map +1 -0
  52. package/build/hooks/use_api_client.js +18 -0
  53. package/build/hooks/use_api_client.js.map +1 -0
  54. package/build/hooks/use_conversation.d.ts +122 -0
  55. package/build/hooks/use_conversation.d.ts.map +1 -0
  56. package/build/hooks/use_conversation.js +103 -0
  57. package/build/hooks/use_conversation.js.map +1 -0
  58. package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
  59. package/build/hooks/use_conversation_jolt_events.js +3 -4
  60. package/build/hooks/use_conversation_jolt_events.js.map +1 -1
  61. package/build/hooks/use_font_scale.d.ts +1 -1
  62. package/build/hooks/use_font_scale.d.ts.map +1 -1
  63. package/build/hooks/use_font_scale.js +1 -1
  64. package/build/hooks/use_font_scale.js.map +1 -1
  65. package/build/hooks/use_jolt.d.ts +1 -1
  66. package/build/hooks/use_jolt.d.ts.map +1 -1
  67. package/build/hooks/use_jolt.js +6 -6
  68. package/build/hooks/use_jolt.js.map +1 -1
  69. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  70. package/build/hooks/use_suspense_api.js +3 -4
  71. package/build/hooks/use_suspense_api.js.map +1 -1
  72. package/build/navigation/header.d.ts +10 -0
  73. package/build/navigation/header.d.ts.map +1 -0
  74. package/build/navigation/header.js +16 -0
  75. package/build/navigation/header.js.map +1 -0
  76. package/build/navigation/index.d.ts +17 -4
  77. package/build/navigation/index.d.ts.map +1 -1
  78. package/build/navigation/index.js +18 -6
  79. package/build/navigation/index.js.map +1 -1
  80. package/build/screens/conversation_details_screen.d.ts +7 -0
  81. package/build/screens/conversation_details_screen.d.ts.map +1 -0
  82. package/build/screens/conversation_details_screen.js +155 -0
  83. package/build/screens/conversation_details_screen.js.map +1 -0
  84. package/build/screens/conversation_screen.d.ts +5 -3
  85. package/build/screens/conversation_screen.d.ts.map +1 -1
  86. package/build/screens/conversation_screen.js +43 -15
  87. package/build/screens/conversation_screen.js.map +1 -1
  88. package/build/screens/design_system_screen.d.ts.map +1 -1
  89. package/build/screens/design_system_screen.js +24 -1
  90. package/build/screens/design_system_screen.js.map +1 -1
  91. package/build/screens/message_actions_screen.d.ts.map +1 -1
  92. package/build/screens/message_actions_screen.js +7 -7
  93. package/build/screens/message_actions_screen.js.map +1 -1
  94. package/build/utils/client/request_helpers.d.ts +2 -1
  95. package/build/utils/client/request_helpers.d.ts.map +1 -1
  96. package/build/utils/client/request_helpers.js +17 -0
  97. package/build/utils/client/request_helpers.js.map +1 -1
  98. package/package.json +2 -2
  99. package/src/components/conversation/message_form.tsx +4 -4
  100. package/src/components/display/badge.tsx +9 -53
  101. package/src/components/display/banner.tsx +56 -0
  102. package/src/components/display/button.tsx +2 -2
  103. package/src/components/display/icon_button.tsx +2 -2
  104. package/src/components/display/index.ts +1 -0
  105. package/src/components/display/text_button.tsx +2 -2
  106. package/src/components/display/text_inline_button.tsx +4 -2
  107. package/src/components/display/{button_color_utils.ts → utils/button_colors.ts} +1 -1
  108. package/src/components/display/utils/status_colors.ts +85 -0
  109. package/src/components/primitive/banner_primitive.tsx +247 -0
  110. package/src/contexts/api_provider.tsx +5 -5
  111. package/src/contexts/chat_context.tsx +4 -21
  112. package/src/hooks/use_api_client.ts +29 -0
  113. package/src/hooks/use_conversation.ts +113 -0
  114. package/src/hooks/use_conversation_jolt_events.ts +3 -4
  115. package/src/hooks/use_font_scale.ts +3 -1
  116. package/src/hooks/use_jolt.ts +9 -9
  117. package/src/hooks/use_suspense_api.ts +3 -4
  118. package/src/navigation/header.tsx +24 -0
  119. package/src/navigation/index.tsx +20 -6
  120. package/src/screens/conversation_details_screen.tsx +205 -0
  121. package/src/screens/conversation_screen.tsx +65 -20
  122. package/src/screens/design_system_screen.tsx +56 -0
  123. package/src/screens/message_actions_screen.tsx +7 -7
  124. package/src/utils/client/request_helpers.ts +21 -1
  125. package/build/components/display/button_color_utils.d.ts.map +0 -1
  126. package/build/components/display/button_color_utils.js.map +0 -1
@@ -6,6 +6,7 @@ import {
6
6
  Avatar,
7
7
  AvatarGroup,
8
8
  Badge,
9
+ Banner,
9
10
  Button,
10
11
  Heading,
11
12
  Icon,
@@ -23,6 +24,7 @@ import {
23
24
  platformPressedOpacityStyle,
24
25
  platformFontWeightMedium,
25
26
  } from '../utils'
27
+ import BannerPrimitive from '../components/primitive/banner_primitive'
26
28
 
27
29
  // =================================
28
30
  // ====== Docs Utils ===============
@@ -756,6 +758,47 @@ function StatusComponentsSection({ isLast }: SectionProps) {
756
758
  <Badge variant="metaSubtle" productLogoName="services" label="Team" />
757
759
  </Row>
758
760
  </Group>
761
+ <Group
762
+ title="Banner"
763
+ description="Banners that can convey a status with color and an optional icon. They render a description and optional heading. A `Banner.Link` can be used by wrapping it in `Banner.Text` and passing it to `description`. Target products can change colors via theming."
764
+ >
765
+ <Column>
766
+ <Banner
767
+ appearance="neutral"
768
+ showIcon={false}
769
+ description="Et sint Quis non excepturi enim et conseq atur porro est galisum labore ea volupt."
770
+ />
771
+ <Banner
772
+ appearance="info"
773
+ heading="Banner heading"
774
+ description="Et sint Quis non excepturi enim et conseq atur porro est galisum labore ea volupt."
775
+ />
776
+ <Banner
777
+ appearance="success"
778
+ heading="Banner heading"
779
+ description={
780
+ <BannerPrimitive.Text>
781
+ Et sint Quis non excepturi{' '}
782
+ <BannerPrimitive.Link onPress={buttonPress}>
783
+ enim et conseq atur porro est
784
+ </BannerPrimitive.Link>{' '}
785
+ galisum labore ea volupt.
786
+ </BannerPrimitive.Text>
787
+ }
788
+ />
789
+ <Banner
790
+ appearance="warning"
791
+ iconName="general.shieldExclamation"
792
+ heading="13 members under age 13"
793
+ description="Et sint Quis non excepturi enim et conseq atur porro est galisum labore ea volupt."
794
+ />
795
+ <Banner
796
+ appearance="error"
797
+ heading="Banner heading"
798
+ description="Et sint Quis non excepturi enim et conseq atur porro est galisum labore ea volupt."
799
+ />
800
+ </Column>
801
+ </Group>
759
802
  </CollapsableSection>
760
803
  )
761
804
  }
@@ -818,6 +861,16 @@ function Row({ children, style }: RowProps) {
818
861
  return <View style={[styles.row, style]}>{children}</View>
819
862
  }
820
863
 
864
+ interface ColumnProps {
865
+ children: React.ReactNode
866
+ style?: ViewStyle
867
+ }
868
+
869
+ function Column({ children, style }: ColumnProps) {
870
+ const styles = useStyles()
871
+ return <View style={[styles.column, style]}>{children}</View>
872
+ }
873
+
821
874
  function TextGroup({ children }: { children: React.ReactNode }) {
822
875
  const styles = useStyles()
823
876
  return <View style={styles.textGroup}>{children}</View>
@@ -893,6 +946,9 @@ const useStyles = () => {
893
946
  justifyContent: 'center',
894
947
  flexWrap: 'wrap',
895
948
  },
949
+ column: {
950
+ gap: space(2),
951
+ },
896
952
  textRow: {
897
953
  gap: space(1.5),
898
954
  },
@@ -2,13 +2,13 @@ import { PlatformPressable } from '@react-navigation/elements'
2
2
  import { StaticScreenProps, useNavigation } from '@react-navigation/native'
3
3
  import { NativeStackNavigationOptions } from '@react-navigation/native-stack'
4
4
  import { InfiniteData, useMutation, useQueryClient } from '@tanstack/react-query'
5
- import React, { useCallback, useContext } from 'react'
5
+ import React, { useCallback } from 'react'
6
6
  import { Alert, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'
7
7
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
8
8
  import { Text, TextButton } from '../components'
9
9
  import { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'
10
- import { ChatContext } from '../contexts'
11
10
  import { useTheme } from '../hooks'
11
+ import { useApiClient } from '../hooks/use_api_client'
12
12
  import { getMessagesRequestArgs, useConversationMessages } from '../hooks/use_conversation_messages'
13
13
  import { ApiCollection, ApiResource, MessageResource } from '../types'
14
14
  import { ReactionCountResource } from '../types/resources/reaction'
@@ -31,7 +31,7 @@ export function MessageActionsScreen({ route }: ReactionScreenProps) {
31
31
  const navigation = useNavigation()
32
32
  const { conversation_id, message_id } = route.params
33
33
 
34
- const { client } = useContext(ChatContext)
34
+ const apiClient = useApiClient()
35
35
  const queryClient = useQueryClient()
36
36
  const styles = useStyles()
37
37
 
@@ -68,7 +68,7 @@ export function MessageActionsScreen({ route }: ReactionScreenProps) {
68
68
  Object.entries(requestParams.data.fields).map(([k, v]) => [k, v.join(',')])
69
69
  )
70
70
 
71
- return client.post({
71
+ return apiClient.chat.post({
72
72
  url,
73
73
  data: {
74
74
  ...requestParams.data,
@@ -80,14 +80,14 @@ export function MessageActionsScreen({ route }: ReactionScreenProps) {
80
80
  },
81
81
  })
82
82
  },
83
- [client, conversation_id, message_id]
83
+ [apiClient, conversation_id, message_id]
84
84
  )
85
85
 
86
86
  const deleteMessage = useCallback(() => {
87
87
  const url = `/me/conversations/${conversation_id}/messages/${message_id}/`
88
88
 
89
- return client.delete({ url })
90
- }, [client, conversation_id, message_id])
89
+ return apiClient.chat.delete({ url })
90
+ }, [apiClient, conversation_id, message_id])
91
91
 
92
92
  const { mutate: handleReaction, isPending } = useMutation({
93
93
  mutationFn: handleReactionPress,
@@ -2,7 +2,7 @@ import _ from 'lodash'
2
2
  import URI from 'urijs'
3
3
  import { transformRequestData } from './transform_request_data'
4
4
  import transformResponse from './transform_response'
5
- import { Accumulator, RequestData } from './types'
5
+ import { Accumulator, GetRequest, PostRequest, RequestData } from './types'
6
6
 
7
7
  export type MakeRequestArgs = {
8
8
  action: 'GET' | 'POST' | 'PATCH' | 'DELETE'
@@ -112,3 +112,23 @@ export const throwErrorIfQueryParams = url => {
112
112
 
113
113
  return Promise.resolve()
114
114
  }
115
+
116
+ export const transformGetToPost = (args: GetRequest): PostRequest => {
117
+ const { data, ...rest } = args
118
+ const { fields, include } = data
119
+ const fieldsArray = Object.entries(fields).map(([key, value]) => {
120
+ if (Array.isArray(value)) {
121
+ return [key, value.join(',')]
122
+ }
123
+
124
+ return [key, value]
125
+ })
126
+
127
+ return {
128
+ ...rest,
129
+ data: {
130
+ fields: Object.fromEntries(fieldsArray),
131
+ include,
132
+ },
133
+ }
134
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"button_color_utils.d.ts","sourceRoot":"","sources":["../../../src/components/display/button_color_utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,CAAA;AACjG,YAAY,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,CAAA;AAMhE,QAAA,MAAM,kBAAkB;;;CAGd,CAAA;AAEV,KAAK,qBAAqB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAA;AAEzF,QAAA,MAAM,uBAAuB;;;;CAGnB,CAAA;AAEV,KAAK,yBAAyB,GAC5B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAA;AAExE,QAAA,MAAM,oBAAoB;;;;CAGhB,CAAA;AAEV,KAAK,sBAAsB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAA;AAE9F,QAAA,MAAM,yBAAyB;;;;;CAGrB,CAAA;AAEV,KAAK,0BAA0B,GAC7B,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAA;AAM5E,KAAK,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAA;AAClE,iBAAS,uBAAuB,IAAI,oBAAoB,CAQvD;AAED,KAAK,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAA;AAC1E,iBAAS,2BAA2B,IAAI,wBAAwB,CAS/D;AAED,KAAK,gBAAgB,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AACxE,iBAAS,mBAAmB,IAAI,gBAAgB,CAc/C;AAMD,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,qBAAqB,GAAG,yBAAyB,CAAA;CAC9D;AACD,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,eAAe,qDAGtE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"button_color_utils.js","sourceRoot":"","sources":["../../../src/components/display/button_color_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,CAAA;AAGjG,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,kBAAkB,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,aAAa;CAClB,CAAA;AAIV,MAAM,uBAAuB,GAAG;IAC9B,GAAG,kBAAkB;IACrB,OAAO,EAAE,SAAS;CACV,CAAA;AAKV,MAAM,oBAAoB,GAAG;IAC3B,GAAG,kBAAkB;IACrB,QAAQ,EAAE,UAAU;CACZ,CAAA;AAIV,MAAM,yBAAyB,GAAG;IAChC,GAAG,oBAAoB;IACvB,GAAG,uBAAuB;CAClB,CAAA;AAUV,SAAS,uBAAuB;IAC9B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,MAAM,EAAE,MAAM,CAAC,0BAA0B;QACzC,QAAQ,EAAE,MAAM,CAAC,wBAAwB;KAC1C,CAAA;AACH,CAAC;AAGD,SAAS,2BAA2B;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,0BAA0B;QACzC,QAAQ,EAAE,MAAM,CAAC,wBAAwB;QACzC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,yBAAyB;KAC1C,CAAA;AACH,CAAC;AAGD,SAAS,mBAAmB;IAC1B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,CAAA;IAClE,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,WAAW,CAAA;IAE9D,OAAO;QACL,WAAW,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;QACjD,MAAM,EAAE,CAAC,MAAM,CAAC,0BAA0B,EAAE,MAAM,CAAC,0BAA0B,CAAC;QAC9E,QAAQ,EAAE;YACR,MAAM,CAAC,mCAAmC;YAC1C,MAAM,CAAC,mCAAmC;SAC3C;KACF,CAAA;AACH,CAAC;AAWD,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAmB;IACrE,IAAI,QAAQ,IAAI,OAAO;QAAE,OAAO,UAAU,CAAA;IAC1C,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { useTheme } from '../../hooks'\n\n// =================================\n// ====== Exports ==================\n// =================================\n\nexport { getColorKey, useButtonColorOptionMap, useGradientColorMap, useIconButtonColorOptionMap }\nexport type { ButtonAppearanceUnion, IconButtonAppearanceUnion }\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst BUTTON_APPEARANCES = {\n danger: 'danger',\n interaction: 'interaction',\n} as const\n\ntype ButtonAppearanceUnion = (typeof BUTTON_APPEARANCES)[keyof typeof BUTTON_APPEARANCES]\n\nconst ICON_BUTTON_APPEARANCES = {\n ...BUTTON_APPEARANCES,\n neutral: 'neutral',\n} as const\n\ntype IconButtonAppearanceUnion =\n (typeof ICON_BUTTON_APPEARANCES)[keyof typeof ICON_BUTTON_APPEARANCES]\n\nconst BUTTON_COLOR_OPTIONS = {\n ...BUTTON_APPEARANCES,\n disabled: 'disabled',\n} as const\n\ntype ButtonColorOptionUnion = (typeof BUTTON_COLOR_OPTIONS)[keyof typeof BUTTON_COLOR_OPTIONS]\n\nconst ICON_BUTTON_COLOR_OPTIONS = {\n ...BUTTON_COLOR_OPTIONS,\n ...ICON_BUTTON_APPEARANCES,\n} as const\n\ntype IconButtonColorOptionUnion =\n (typeof ICON_BUTTON_COLOR_OPTIONS)[keyof typeof ICON_BUTTON_COLOR_OPTIONS]\n\n// =================================\n// ====== Hooks ====================\n// =================================\n\ntype ButtonColorOptionMap = Record<ButtonColorOptionUnion, string>\nfunction useButtonColorOptionMap(): ButtonColorOptionMap {\n const { colors } = useTheme()\n\n return {\n interaction: colors.interaction,\n danger: colors.fillColorStatusErrorMedium,\n disabled: colors.textColorDefaultDisabled,\n }\n}\n\ntype IconButtonColorOptionMap = Record<IconButtonColorOptionUnion, string>\nfunction useIconButtonColorOptionMap(): IconButtonColorOptionMap {\n const { colors } = useTheme()\n\n return {\n danger: colors.fillColorStatusErrorMedium,\n disabled: colors.textColorDefaultDisabled,\n interaction: colors.interaction,\n neutral: colors.iconColorDefaultSecondary,\n }\n}\n\ntype GradientColorMap = Record<ButtonColorOptionUnion, [string, string]>\nfunction useGradientColorMap(): GradientColorMap {\n const { colors } = useTheme()\n\n const defaultColorStart = colors.buttonStart || colors.interaction\n const defaultColorEnd = colors.buttonEnd || colors.interaction\n\n return {\n interaction: [defaultColorStart, defaultColorEnd],\n danger: [colors.fillColorStatusErrorMedium, colors.fillColorStatusErrorMedium],\n disabled: [\n colors.fillColorButtonNeutralSolidDisabled,\n colors.fillColorButtonNeutralSolidDisabled,\n ],\n }\n}\n\n// =================================\n// ====== Functions ================\n// =================================\n\ninterface GetColorKeyArgs {\n disabled: boolean | null\n loading?: boolean\n appearance: ButtonAppearanceUnion | IconButtonAppearanceUnion\n}\nfunction getColorKey({ disabled, loading, appearance }: GetColorKeyArgs) {\n if (disabled || loading) return 'disabled'\n return appearance\n}\n"]}