@coopdigital/react 0.52.3 → 0.54.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 (171) hide show
  1. package/README.md +3 -3
  2. package/dist/components/AlertBanner/AlertBanner.d.ts +3 -1
  3. package/dist/components/AlertBanner/AlertBanner.js +1 -1
  4. package/dist/components/Button/Button.d.ts +1 -1
  5. package/dist/components/Button/Button.js +4 -3
  6. package/dist/components/Card/Card.d.ts +15 -5
  7. package/dist/components/Card/Card.js +8 -7
  8. package/dist/components/DatePicker/DatePicker.js +3 -3
  9. package/dist/components/Expandable/Expandable.d.ts +16 -2
  10. package/dist/components/Expandable/Expandable.js +13 -8
  11. package/dist/components/Field/Field.d.ts +15 -5
  12. package/dist/components/Field/Field.js +4 -4
  13. package/dist/components/Fieldset/Fieldset.d.ts +15 -5
  14. package/dist/components/Fieldset/Fieldset.js +4 -4
  15. package/dist/components/Pill/Pill.d.ts +3 -1
  16. package/dist/components/Pill/Pill.js +2 -2
  17. package/dist/components/Popover/Popover.d.ts +12 -4
  18. package/dist/components/Popover/Popover.js +5 -5
  19. package/dist/components/Searchbox/Searchbox.d.ts +20 -4
  20. package/dist/components/Searchbox/Searchbox.js +42 -28
  21. package/dist/components/Select/Select.d.ts +6 -2
  22. package/dist/components/Select/Select.js +2 -2
  23. package/dist/components/Signpost/Signpost.js +1 -1
  24. package/dist/components/Squircle/Squircle.js +1 -1
  25. package/dist/hooks/useSlots.d.ts +2 -1
  26. package/dist/hooks/useSlots.js +8 -3
  27. package/dist/types/colors.d.ts +1 -2
  28. package/dist/types/index.d.ts +1 -0
  29. package/dist/utils/index.d.ts +1 -0
  30. package/dist/utils/index.js +4 -1
  31. package/package.json +20 -17
  32. package/src/components/AlertBanner/AlertBanner.tsx +1 -1
  33. package/src/components/Button/Button.tsx +9 -13
  34. package/src/components/Card/Card.tsx +8 -11
  35. package/src/components/DatePicker/DatePicker.tsx +2 -2
  36. package/src/components/Expandable/Expandable.tsx +26 -9
  37. package/src/components/Field/Field.tsx +4 -9
  38. package/src/components/Fieldset/Fieldset.tsx +4 -9
  39. package/src/components/Pill/Pill.tsx +2 -2
  40. package/src/components/Popover/Popover.tsx +4 -7
  41. package/src/components/Searchbox/Searchbox.tsx +66 -56
  42. package/src/components/Select/Select.tsx +2 -3
  43. package/src/components/Signpost/Signpost.tsx +1 -1
  44. package/src/components/Squircle/Squircle.tsx +1 -1
  45. package/src/hooks/useSlots.ts +12 -4
  46. package/src/types/colors.ts +1 -3
  47. package/src/types/index.ts +1 -0
  48. package/src/utils/index.ts +4 -0
  49. /package/dist/components/{Icon → icons}/AddIcon.d.ts +0 -0
  50. /package/dist/components/{Icon → icons}/AddIcon.js +0 -0
  51. /package/dist/components/{Icon → icons}/ArrowDownIcon.d.ts +0 -0
  52. /package/dist/components/{Icon → icons}/ArrowDownIcon.js +0 -0
  53. /package/dist/components/{Icon → icons}/ArrowLeftIcon.d.ts +0 -0
  54. /package/dist/components/{Icon → icons}/ArrowLeftIcon.js +0 -0
  55. /package/dist/components/{Icon → icons}/ArrowRightIcon.d.ts +0 -0
  56. /package/dist/components/{Icon → icons}/ArrowRightIcon.js +0 -0
  57. /package/dist/components/{Icon → icons}/ArrowUpIcon.d.ts +0 -0
  58. /package/dist/components/{Icon → icons}/ArrowUpIcon.js +0 -0
  59. /package/dist/components/{Icon → icons}/AvatarAltIcon.d.ts +0 -0
  60. /package/dist/components/{Icon → icons}/AvatarAltIcon.js +0 -0
  61. /package/dist/components/{Icon → icons}/AvatarIcon.d.ts +0 -0
  62. /package/dist/components/{Icon → icons}/AvatarIcon.js +0 -0
  63. /package/dist/components/{Icon → icons}/BasketIcon.d.ts +0 -0
  64. /package/dist/components/{Icon → icons}/BasketIcon.js +0 -0
  65. /package/dist/components/{Icon → icons}/CalendarIcon.d.ts +0 -0
  66. /package/dist/components/{Icon → icons}/CalendarIcon.js +0 -0
  67. /package/dist/components/{Icon → icons}/ChevronDownIcon.d.ts +0 -0
  68. /package/dist/components/{Icon → icons}/ChevronDownIcon.js +0 -0
  69. /package/dist/components/{Icon → icons}/ChevronLeftIcon.d.ts +0 -0
  70. /package/dist/components/{Icon → icons}/ChevronLeftIcon.js +0 -0
  71. /package/dist/components/{Icon → icons}/ChevronRightIcon.d.ts +0 -0
  72. /package/dist/components/{Icon → icons}/ChevronRightIcon.js +0 -0
  73. /package/dist/components/{Icon → icons}/ChevronUpIcon.d.ts +0 -0
  74. /package/dist/components/{Icon → icons}/ChevronUpIcon.js +0 -0
  75. /package/dist/components/{Icon → icons}/ClockIcon.d.ts +0 -0
  76. /package/dist/components/{Icon → icons}/ClockIcon.js +0 -0
  77. /package/dist/components/{Icon → icons}/CloseAltIcon.d.ts +0 -0
  78. /package/dist/components/{Icon → icons}/CloseAltIcon.js +0 -0
  79. /package/dist/components/{Icon → icons}/CloseIcon.d.ts +0 -0
  80. /package/dist/components/{Icon → icons}/CloseIcon.js +0 -0
  81. /package/dist/components/{Icon → icons}/CoopCardIcon.d.ts +0 -0
  82. /package/dist/components/{Icon → icons}/CoopCardIcon.js +0 -0
  83. /package/dist/components/{Icon → icons}/CoopIcon.d.ts +0 -0
  84. /package/dist/components/{Icon → icons}/CoopIcon.js +0 -0
  85. /package/dist/components/{Icon → icons}/CoopLocationIcon.d.ts +0 -0
  86. /package/dist/components/{Icon → icons}/CoopLocationIcon.js +0 -0
  87. /package/dist/components/{Icon → icons}/DownloadIcon.d.ts +0 -0
  88. /package/dist/components/{Icon → icons}/DownloadIcon.js +0 -0
  89. /package/dist/components/{Icon → icons}/HomeIcon.d.ts +0 -0
  90. /package/dist/components/{Icon → icons}/HomeIcon.js +0 -0
  91. /package/dist/components/{Icon → icons}/InformationIcon.d.ts +0 -0
  92. /package/dist/components/{Icon → icons}/InformationIcon.js +0 -0
  93. /package/dist/components/{Icon → icons}/LoadingIcon.d.ts +0 -0
  94. /package/dist/components/{Icon → icons}/LoadingIcon.js +0 -0
  95. /package/dist/components/{Icon → icons}/LocationIcon.d.ts +0 -0
  96. /package/dist/components/{Icon → icons}/LocationIcon.js +0 -0
  97. /package/dist/components/{Icon → icons}/MailIcon.d.ts +0 -0
  98. /package/dist/components/{Icon → icons}/MailIcon.js +0 -0
  99. /package/dist/components/{Icon → icons}/MenuIcon.d.ts +0 -0
  100. /package/dist/components/{Icon → icons}/MenuIcon.js +0 -0
  101. /package/dist/components/{Icon → icons}/MessageIcon.d.ts +0 -0
  102. /package/dist/components/{Icon → icons}/MessageIcon.js +0 -0
  103. /package/dist/components/{Icon → icons}/MinusIcon.d.ts +0 -0
  104. /package/dist/components/{Icon → icons}/MinusIcon.js +0 -0
  105. /package/dist/components/{Icon → icons}/OpenNewIcon.d.ts +0 -0
  106. /package/dist/components/{Icon → icons}/OpenNewIcon.js +0 -0
  107. /package/dist/components/{Icon → icons}/PencilIcon.d.ts +0 -0
  108. /package/dist/components/{Icon → icons}/PencilIcon.js +0 -0
  109. /package/dist/components/{Icon → icons}/PhoneIcon.d.ts +0 -0
  110. /package/dist/components/{Icon → icons}/PhoneIcon.js +0 -0
  111. /package/dist/components/{Icon → icons}/QuestionIcon.d.ts +0 -0
  112. /package/dist/components/{Icon → icons}/QuestionIcon.js +0 -0
  113. /package/dist/components/{Icon → icons}/ScooterIcon.d.ts +0 -0
  114. /package/dist/components/{Icon → icons}/ScooterIcon.js +0 -0
  115. /package/dist/components/{Icon → icons}/SearchIcon.d.ts +0 -0
  116. /package/dist/components/{Icon → icons}/SearchIcon.js +0 -0
  117. /package/dist/components/{Icon → icons}/SettingsIcon.d.ts +0 -0
  118. /package/dist/components/{Icon → icons}/SettingsIcon.js +0 -0
  119. /package/dist/components/{Icon → icons}/TickAltIcon.d.ts +0 -0
  120. /package/dist/components/{Icon → icons}/TickAltIcon.js +0 -0
  121. /package/dist/components/{Icon → icons}/TickIcon.d.ts +0 -0
  122. /package/dist/components/{Icon → icons}/TickIcon.js +0 -0
  123. /package/dist/components/{Icon → icons}/VanIcon.d.ts +0 -0
  124. /package/dist/components/{Icon → icons}/VanIcon.js +0 -0
  125. /package/dist/components/{Icon → icons}/WarningIcon.d.ts +0 -0
  126. /package/dist/components/{Icon → icons}/WarningIcon.js +0 -0
  127. /package/dist/components/{Icon → icons}/WriteIcon.d.ts +0 -0
  128. /package/dist/components/{Icon → icons}/WriteIcon.js +0 -0
  129. /package/dist/components/{Icon → icons}/index.d.ts +0 -0
  130. /package/dist/components/{Icon → icons}/index.js +0 -0
  131. /package/src/components/{Icon → icons}/AddIcon.tsx +0 -0
  132. /package/src/components/{Icon → icons}/ArrowDownIcon.tsx +0 -0
  133. /package/src/components/{Icon → icons}/ArrowLeftIcon.tsx +0 -0
  134. /package/src/components/{Icon → icons}/ArrowRightIcon.tsx +0 -0
  135. /package/src/components/{Icon → icons}/ArrowUpIcon.tsx +0 -0
  136. /package/src/components/{Icon → icons}/AvatarAltIcon.tsx +0 -0
  137. /package/src/components/{Icon → icons}/AvatarIcon.tsx +0 -0
  138. /package/src/components/{Icon → icons}/BasketIcon.tsx +0 -0
  139. /package/src/components/{Icon → icons}/CalendarIcon.tsx +0 -0
  140. /package/src/components/{Icon → icons}/ChevronDownIcon.tsx +0 -0
  141. /package/src/components/{Icon → icons}/ChevronLeftIcon.tsx +0 -0
  142. /package/src/components/{Icon → icons}/ChevronRightIcon.tsx +0 -0
  143. /package/src/components/{Icon → icons}/ChevronUpIcon.tsx +0 -0
  144. /package/src/components/{Icon → icons}/ClockIcon.tsx +0 -0
  145. /package/src/components/{Icon → icons}/CloseAltIcon.tsx +0 -0
  146. /package/src/components/{Icon → icons}/CloseIcon.tsx +0 -0
  147. /package/src/components/{Icon → icons}/CoopCardIcon.tsx +0 -0
  148. /package/src/components/{Icon → icons}/CoopIcon.tsx +0 -0
  149. /package/src/components/{Icon → icons}/CoopLocationIcon.tsx +0 -0
  150. /package/src/components/{Icon → icons}/DownloadIcon.tsx +0 -0
  151. /package/src/components/{Icon → icons}/HomeIcon.tsx +0 -0
  152. /package/src/components/{Icon → icons}/InformationIcon.tsx +0 -0
  153. /package/src/components/{Icon → icons}/LoadingIcon.tsx +0 -0
  154. /package/src/components/{Icon → icons}/LocationIcon.tsx +0 -0
  155. /package/src/components/{Icon → icons}/MailIcon.tsx +0 -0
  156. /package/src/components/{Icon → icons}/MenuIcon.tsx +0 -0
  157. /package/src/components/{Icon → icons}/MessageIcon.tsx +0 -0
  158. /package/src/components/{Icon → icons}/MinusIcon.tsx +0 -0
  159. /package/src/components/{Icon → icons}/OpenNewIcon.tsx +0 -0
  160. /package/src/components/{Icon → icons}/PencilIcon.tsx +0 -0
  161. /package/src/components/{Icon → icons}/PhoneIcon.tsx +0 -0
  162. /package/src/components/{Icon → icons}/QuestionIcon.tsx +0 -0
  163. /package/src/components/{Icon → icons}/ScooterIcon.tsx +0 -0
  164. /package/src/components/{Icon → icons}/SearchIcon.tsx +0 -0
  165. /package/src/components/{Icon → icons}/SettingsIcon.tsx +0 -0
  166. /package/src/components/{Icon → icons}/TickAltIcon.tsx +0 -0
  167. /package/src/components/{Icon → icons}/TickIcon.tsx +0 -0
  168. /package/src/components/{Icon → icons}/VanIcon.tsx +0 -0
  169. /package/src/components/{Icon → icons}/WarningIcon.tsx +0 -0
  170. /package/src/components/{Icon → icons}/WriteIcon.tsx +0 -0
  171. /package/src/components/{Icon → icons}/index.ts +0 -0
@@ -1,22 +1,20 @@
1
1
  "use client"
2
2
 
3
- import type { InputHTMLAttributes, JSX, Ref } from "react"
3
+ import type { FormHTMLAttributes, JSX, Ref } from "react"
4
4
 
5
5
  import clsx from "clsx"
6
6
  import React, { useCallback, useState } from "react"
7
7
 
8
8
  import { useId } from "../../hooks/useId"
9
+ import { useSlots } from "../../hooks/useSlots"
9
10
  import { StandardSizes } from "../../types"
11
+ import { hasUserBorder } from "../../utils"
10
12
  import { Button, type ButtonProps } from "../Button"
11
13
  import Field from "../Field"
12
- import { Label as FieldLabel } from "../FieldMarkers/Label"
13
- import { SearchIcon } from "../Icon"
14
+ import { SearchIcon } from "../icons"
14
15
  import TextInput, { TextInputProps } from "../TextInput"
15
16
 
16
- export interface SearchboxProps extends Omit<
17
- InputHTMLAttributes<HTMLInputElement>,
18
- "size" | "type"
19
- > {
17
+ export interface SearchboxProps extends FormHTMLAttributes<HTMLFormElement> {
20
18
  /** **(Optional)** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
21
19
  action?: string
22
20
  /** **(Optional)** Specify props to forward to the Button element. Use `label` to set Button text. */
@@ -40,46 +38,40 @@ export interface SearchboxProps extends Omit<
40
38
  /** **(Optional)** Specify the Searchbox size. */
41
39
  size?: StandardSizes
42
40
  /** **(Optional)** Specify the Searchbox variant. */
43
- variant?:
44
- | "green"
45
- | "blue"
46
- | "white"
47
- | "grey"
48
- | "green-ghost"
49
- | "blue-ghost"
50
- | "white-ghost"
51
- | "grey-ghost"
41
+ variant?: "solid" | "ghost"
52
42
  }
53
43
 
54
- const defaultButtonProps: SearchboxProps["button"] = {
55
- label: React.createElement(SearchIcon, { alt: "Search", stroke: "currentColor", strokeWidth: 2 }),
56
- loadingText: "",
44
+ const componentSlots = {
45
+ SearchboxButton: null,
46
+ SearchboxInput: null,
57
47
  }
58
48
 
49
+ const defaultButtonText = React.createElement(SearchIcon, {
50
+ alt: "Search",
51
+ stroke: "currentColor",
52
+ strokeWidth: 2,
53
+ })
54
+
59
55
  export const Searchbox = ({
60
56
  action,
61
- "aria-placeholder": ariaPlaceholder,
62
- autoCapitalize = "off",
63
- autoComplete = "off",
64
- button = defaultButtonProps,
57
+ children,
65
58
  className,
66
-
67
59
  id,
68
60
  label,
69
61
  labelVisible = false,
70
- name = "query",
71
62
  onSubmit,
72
- placeholder,
73
63
  ref,
74
64
  size = "md",
75
- variant = "green",
65
+ variant = "solid",
76
66
  ...props
77
67
  }: SearchboxProps): JSX.Element => {
68
+ const slots = useSlots(componentSlots, children)
69
+
78
70
  const [isPending, setIsPending] = useState(false)
79
71
  const uid = useId(id)
80
72
 
81
73
  const handleSubmit = useCallback(
82
- async (event: React.FormEvent<HTMLFormElement>) => {
74
+ async (event: React.SubmitEvent<HTMLFormElement>) => {
83
75
  event.preventDefault()
84
76
 
85
77
  if (isPending || !onSubmit) return
@@ -95,51 +87,69 @@ export const Searchbox = ({
95
87
  [onSubmit, isPending]
96
88
  )
97
89
 
90
+ let borderClass = ""
91
+ if (!hasUserBorder(className)) {
92
+ borderClass = variant === "ghost" ? "border-teal" : "border-grey"
93
+ }
94
+
98
95
  const formProps = {
99
96
  action: action ?? undefined,
100
- className: clsx("coop-searchbox", className),
97
+ className: clsx("coop-searchbox", borderClass, className),
101
98
  "data-size": size && size !== "md" ? size : undefined,
102
- "data-variant": variant.length && variant !== "green" ? variant : undefined,
103
- id: uid,
99
+ "data-variant": variant.length && variant !== "solid" ? variant : undefined,
100
+ id: uid + "-form",
104
101
  onSubmit: onSubmit ? handleSubmit : undefined,
102
+ ...props,
105
103
  }
106
104
 
107
- const buttonProps: ButtonProps = {
108
- className: button?.className,
109
- isLoading: isPending,
110
- loadingText: button?.loadingText ?? "",
111
- size,
112
- variant,
113
- }
105
+ slots.SearchboxButton = React.cloneElement(
106
+ slots.SearchboxButton as React.ReactElement<ButtonProps>,
107
+ {
108
+ isLoading: isPending,
109
+ size,
110
+ }
111
+ )
114
112
 
115
- const inputProps: TextInputProps = {
116
- "aria-placeholder": placeholder ?? ariaPlaceholder ?? undefined,
117
- autoCapitalize,
118
- autoComplete,
119
- id: uid + "--input",
120
- name,
121
- placeholder,
122
- size,
123
- type: "search",
124
- ...props,
125
- }
113
+ slots.SearchboxInput = React.cloneElement(
114
+ slots.SearchboxInput as React.ReactElement<TextInputProps>,
115
+ {
116
+ autoCapitalize: "off",
117
+ id: uid,
118
+ size,
119
+ }
120
+ )
126
121
 
127
122
  const labelProps = {
128
- htmlFor: uid + "--input",
123
+ htmlFor: uid,
129
124
  isVisible: labelVisible,
130
125
  }
131
126
 
132
127
  return (
133
128
  <form {...formProps} ref={ref}>
134
- {label && <FieldLabel {...labelProps}>{label}</FieldLabel>}
135
- <div className="coop-searchbox--inner">
136
- <Field>
137
- <TextInput {...inputProps} />
138
- </Field>
139
- <Button {...buttonProps}>{button.label}</Button>
129
+ {label && <Field.Label {...labelProps}>{label}</Field.Label>}
130
+ <div className={clsx("coop-searchbox--inner")}>
131
+ <Field>{slots.SearchboxInput}</Field>
132
+ {slots.SearchboxButton}
140
133
  </div>
141
134
  </form>
142
135
  )
143
136
  }
144
137
 
138
+ const SearchboxButton = ({ children, ...props }: ButtonProps) => {
139
+ const buttonProps = {
140
+ children: children ?? defaultButtonText,
141
+ ...props,
142
+ }
143
+
144
+ return <Button {...buttonProps} />
145
+ }
146
+
147
+ const SearchboxInput = (props: TextInputProps) => <TextInput {...props} />
148
+
149
+ Searchbox.Button = SearchboxButton
150
+ Searchbox.Input = SearchboxInput
151
+
152
+ SearchboxButton.config = { name: "SearchboxButton" }
153
+ SearchboxInput.config = { isField: true, name: "SearchboxInput" }
154
+
145
155
  export default Searchbox
@@ -80,8 +80,6 @@ const SelectOptionGroup = ({ children, ...props }: SelectOptionGroupProps): JSX.
80
80
  return <optgroup {...props}>{children}</optgroup>
81
81
  }
82
82
 
83
- SelectOptionGroup.displayName = "Select.OptionGroup"
84
-
85
83
  const SelectOption = ({ children, className, ...props }: SelectOptionProps): JSX.Element => {
86
84
  return (
87
85
  <option className={clsx("coop-select--option", className)} {...props}>
@@ -90,7 +88,8 @@ const SelectOption = ({ children, className, ...props }: SelectOptionProps): JSX
90
88
  )
91
89
  }
92
90
 
93
- SelectOption.displayName = "Select.Option"
91
+ SelectOption.config = { name: "SelectOption" }
92
+ SelectOptionGroup.config = { name: "SelectOptionGroup" }
94
93
 
95
94
  Select.OptionGroup = SelectOptionGroup
96
95
  Select.Option = SelectOption
@@ -3,7 +3,7 @@ import type { ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react"
3
3
  import clsx from "clsx"
4
4
  import React from "react"
5
5
 
6
- import { ChevronRightIcon } from "../Icon"
6
+ import { ChevronRightIcon } from "../icons"
7
7
  import { Image, ImageProps } from "../Image"
8
8
 
9
9
  export interface SignpostProps extends HTMLAttributes<HTMLDivElement> {
@@ -22,7 +22,7 @@ export const Squircle = ({
22
22
  ...props
23
23
  }: SquircleProps): JSX.Element => {
24
24
  const componentProps = {
25
- className: clsx("coop-squircle", !hasUserBg(className) && "bg-offer-red", className),
25
+ className: clsx("coop-squircle", !hasUserBg(className) && "bg-offer", className),
26
26
  "data-size": size.length && size !== "lg" ? size : undefined,
27
27
  ...props,
28
28
  }
@@ -1,4 +1,5 @@
1
1
  import React from "react"
2
+ import { ReactNodeWithConfig } from "src/types"
2
3
 
3
4
  type Slots<T> = Record<keyof T, React.ReactNode>
4
5
 
@@ -6,10 +7,17 @@ export function isKey<T extends object>(x: T, k: PropertyKey): k is keyof T {
6
7
  return k in x
7
8
  }
8
9
 
9
- export function getSlotName(node: React.ReactNode): string | false {
10
- return React.isValidElement(node) && node.type && typeof node.type !== "string"
11
- ? node.type.name
12
- : false
10
+ export function getSlotName(node: ReactNodeWithConfig): string | false {
11
+ if (
12
+ React.isValidElement(node) &&
13
+ node.type &&
14
+ typeof node.type !== "string" &&
15
+ typeof node.type !== "symbol"
16
+ ) {
17
+ return node.type?.config?.name ?? node.type.name
18
+ }
19
+
20
+ return false
13
21
  }
14
22
 
15
23
  export function useSlots<T>(
@@ -30,12 +30,10 @@ export type Lights =
30
30
  | "light-purple"
31
31
  | "light-red"
32
32
 
33
- export type Greys = "dark-grey" | "mid-dark-grey" | "mid-grey" | "mid-light-grey" | "light-grey"
34
-
35
33
  export type White = "white"
36
34
  export type Black = "black"
37
35
  export type None = "none"
38
36
  export type BrandBlue = "brand-blue"
39
- export type OfferRed = "offer-red"
37
+ export type OfferRed = "offer"
40
38
  export type Green = "green"
41
39
  export type Blue = "blue"
@@ -15,4 +15,5 @@ export interface ComponentConfig {
15
15
  fieldSuffix?: string
16
16
  isField?: boolean
17
17
  isInline?: boolean
18
+ name?: string
18
19
  }
@@ -5,6 +5,10 @@ export const hasUserBg = (userClasses?: string) => {
5
5
  return typeof userClasses === "string" && userClasses?.includes("bg-") ? true : false
6
6
  }
7
7
 
8
+ export const hasUserBorder = (userClasses?: string) => {
9
+ return typeof userClasses === "string" && userClasses?.includes("border-") ? true : false
10
+ }
11
+
8
12
  export const bgClassToColor = (userClasses: string) => {
9
13
  return /bg-([^\s]+)/.exec(userClasses)?.[1] ?? null
10
14
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes