playbook_ui 14.18.0.pre.rc.1 → 14.18.0.pre.rc.2

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +19 -45
  3. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +54 -0
  4. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +3 -0
  5. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
  6. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -1
  7. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +45 -0
  8. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +5 -1
  9. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +19 -1
  10. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  11. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -1
  12. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -1
  13. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +3 -1
  14. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +3 -1
  15. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  16. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +13 -5
  17. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +94 -0
  18. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +1 -0
  19. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
  20. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  21. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +8 -1
  22. data/dist/chunks/{_typeahead-BY6AFq1l.js → _typeahead-DUI-4yjJ.js} +2 -2
  23. data/dist/chunks/_weekday_stacked-q9YP0zaF.js +45 -0
  24. data/dist/chunks/{lib-BGzBzFZX.js → lib-BV_AF_eh.js} +3 -3
  25. data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-nsvkJU2J.js} +1 -1
  26. data/dist/chunks/vendor.js +1 -1
  27. data/dist/playbook-doc.js +1 -1
  28. data/dist/playbook-rails-react-bindings.js +1 -1
  29. data/dist/playbook-rails.js +1 -1
  30. data/dist/playbook.css +1 -1
  31. data/lib/playbook/version.rb +1 -1
  32. metadata +11 -6
  33. data/dist/chunks/_weekday_stacked-BwWArBYi.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8282ca482f5d5a4c19aa8a14d0589227d91b464faf6ee5f9e1034a5effd50e72
4
- data.tar.gz: 0f5904c39418d95cc938d81f598dc36bed48063192050337cb708057cd4bfa7b
3
+ metadata.gz: f118298ba3eff6f37e73425f3df2279f37bd949e9d564ce98901b5a1b5b3fb35
4
+ data.tar.gz: 754c735fe30192c978e730e38559c07cb7fc3ae56b2c90f6c9dacfadbc756223
5
5
  SHA512:
6
- metadata.gz: de9dd899e7c2086885016d8f6ab780cf23ce1ad5429858d7379426bf31ee8aaec35123e3ea0aa29f599afbf3695590a746853b073691709929ac12412da3e986
7
- data.tar.gz: c1e7da09113948ec469fd9fb76df9136c4867477d5eb80e126844bd57d26e0d12663079679e3ad3df66592d8a69ae8afbf6ef380f00aba77d2ad26025922d484
6
+ metadata.gz: 529e06dbff255e1a06c70ff69f0d3954b51dba098aaf40af4acff2bb1baec47620e2a147ca0b9a6c8b84ac3c00f70a2939b1098b295c8da40b3d67da5d7420a6
7
+ data.tar.gz: 626f48ab4b7549fcd6089f9a66ffc5bf75339eb3a32c60834752a443c8f4df9f5c3001822e896d7ebe7a7c7c66bd9e841a1de5cd80211b2e01e464a8f64524f4
@@ -1,5 +1,4 @@
1
-
2
- import React, { useState } from 'react'
1
+ import React from 'react'
3
2
  import classnames from 'classnames'
4
3
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
4
  import { globalProps } from '../utilities/globalProps'
@@ -7,16 +6,19 @@ import { globalProps } from '../utilities/globalProps'
7
6
  import Button from '../pb_button/_button'
8
7
  import Tooltip from '../pb_tooltip/_tooltip'
9
8
 
9
+ import usePBCopy from './usePBCopy'
10
+
10
11
  type CopyButtonProps = {
11
- aria?: { [key: string]: string },
12
- className?: string,
13
- data?: { [key: string]: string },
14
- id?: string,
15
- from?: string,
16
- text?: string,
17
- tooltipPlacement?: "top" | "right" | "bottom" | "left",
18
- tooltipText?: string,
19
- value?: string,
12
+ aria?: { [key: string]: string }
13
+ className?: string
14
+ data?: { [key: string]: string }
15
+ id?: string
16
+ from?: string
17
+ text?: string
18
+ tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left'
19
+ tooltipText?: string
20
+ value?: string
21
+ timeout?: number
20
22
  }
21
23
 
22
24
  const CopyButton = (props: CopyButtonProps) => {
@@ -27,62 +29,34 @@ const CopyButton = (props: CopyButtonProps) => {
27
29
  from = '',
28
30
  id,
29
31
  text= 'Copy',
32
+ timeout = 1000,
30
33
  tooltipPlacement= 'bottom',
31
34
  tooltipText = 'Copied!',
32
35
  value = '',
33
36
  } = props
34
37
 
35
- const [copied, setCopied] = useState(false)
38
+ const [copied, copy] = usePBCopy({ value, from, timeout })
36
39
 
37
40
  const ariaProps = buildAriaProps(aria)
38
41
  const dataProps = buildDataProps(data)
39
42
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
40
43
 
41
- const copy = () => {
42
- if (!from && !value) {
43
- return
44
- }
45
-
46
- if (value) {
47
- navigator.clipboard.writeText(value)
48
- } else if (from) {
49
- const copyElement = document.getElementById(from);
50
- let copyText = copyElement?.innerText
51
-
52
- if (copyElement instanceof HTMLTextAreaElement || copyElement instanceof HTMLInputElement) {
53
- copyText = copyElement.value;
54
- }
55
-
56
- if (copyText) {
57
- navigator.clipboard.writeText(copyText)
58
- }
59
- }
60
-
61
- setCopied(true)
62
-
63
- setTimeout(() => {
64
- setCopied(false)
65
- }, 1000);
66
- }
67
-
68
44
  return (
69
- <div
70
- {...ariaProps}
45
+ <div {...ariaProps}
71
46
  {...dataProps}
72
47
  className={classes}
73
48
  id={id}
74
49
  >
75
- <Tooltip
50
+ <Tooltip
76
51
  forceOpenTooltip={copied}
77
52
  placement={tooltipPlacement}
78
53
  showTooltip={false}
79
54
  text={tooltipText}
80
55
  >
81
- <Button
82
- icon='copy'
56
+ <Button icon="copy"
83
57
  onClick={copy}
84
58
  >
85
- { text }
59
+ {text}
86
60
  </Button>
87
61
  </Tooltip>
88
62
  </div>
@@ -0,0 +1,54 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import usePBCopy from '../../pb_copy_button/usePBCopy'
3
+ import Body from '../../pb_body/_body'
4
+ import Textarea from '../../pb_textarea/_textarea'
5
+ import Tooltip from '../../pb_tooltip/_tooltip'
6
+
7
+ const CopyButtonHook = ({...props}) => {
8
+ // This is how you can use the copy button hook to copy text to the clipboard
9
+ // eslint-disable-next-line no-unused-vars
10
+ const [copied, copyToClipboard] = usePBCopy({ from: 'hookbody' })
11
+ // I added a tooltip so it looks better in the ui
12
+ const [showTooltip, setShowTooltip] = useState(false)
13
+
14
+ const handleCopy = () => {
15
+ copyToClipboard()
16
+ setShowTooltip(true)
17
+ setTimeout(() => setShowTooltip(false), 1500)
18
+ }
19
+
20
+ useEffect(() => {
21
+ const el = document.getElementById('hookbody')
22
+ if (!el) return
23
+
24
+ el.addEventListener('click', handleCopy)
25
+ return () => {
26
+ el.removeEventListener('click', handleCopy)
27
+ }
28
+ }, [copyToClipboard])
29
+
30
+ return (
31
+ <div>
32
+ <Tooltip
33
+ delay={{ close: 1000 }}
34
+ forceOpenTooltip={showTooltip}
35
+ placement="top"
36
+ showTooltip={false}
37
+ text="Copied!"
38
+ >
39
+ <Body
40
+ cursor="pointer"
41
+ id="hookbody"
42
+ text="I'm a custom copy hook! Click this body to copy this text!"
43
+ />
44
+ </Tooltip>
45
+
46
+ <Textarea
47
+ {...props}
48
+ placeholder="Paste here"
49
+ />
50
+ </div>
51
+ )
52
+ }
53
+
54
+ export default CopyButtonHook
@@ -0,0 +1,3 @@
1
+ We provide a `usePBCopy` hook that you can import to your project. This hook will return a function that you can call to copy the text to the clipboard.
2
+
3
+ `usePBCopy({ from: 'your_id' })` will grab the `innerText` from `your_id` element, or `value` if it is an input element.
@@ -6,3 +6,4 @@ examples:
6
6
  react:
7
7
  - copy_button_default: Default
8
8
  - copy_button_from: Copy From
9
+ - copy_button_hook: Copy Hook
@@ -1,2 +1,3 @@
1
1
  export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
- export { default as CopyButtonFrom } from './_copy_button_from.jsx'
2
+ export { default as CopyButtonFrom } from './_copy_button_from.jsx'
3
+ export { default as CopyButtonHook } from './_copy_button_hook.jsx'
@@ -0,0 +1,45 @@
1
+ import { useState, useRef, useEffect } from 'react'
2
+
3
+ type UsePBCopyProps = {
4
+ value?: string
5
+ from?: string
6
+ timeout?: number
7
+ }
8
+
9
+ export default function usePBCopy({
10
+ value = '',
11
+ from = '',
12
+ timeout = 0,
13
+ }: UsePBCopyProps) {
14
+ const [copied, setCopied] = useState(false)
15
+ const timerRef = useRef<number>()
16
+
17
+ const copy = () => {
18
+ if (!value && !from) return
19
+
20
+ if (value) {
21
+ navigator.clipboard.writeText(value)
22
+ } else {
23
+ const el = document.getElementById(from)
24
+ let text = el?.innerText
25
+ if (el instanceof HTMLTextAreaElement || el instanceof HTMLInputElement) {
26
+ text = el.value
27
+ }
28
+ if (text) navigator.clipboard.writeText(text)
29
+ }
30
+
31
+ setCopied(true)
32
+ window.clearTimeout(timerRef.current)
33
+ timerRef.current = window.setTimeout(() => {
34
+ setCopied(false)
35
+ }, timeout)
36
+ }
37
+
38
+ useEffect(() => {
39
+ return () => {
40
+ window.clearTimeout(timerRef.current)
41
+ }
42
+ }, [])
43
+
44
+ return [copied, copy] as const
45
+ }
@@ -97,7 +97,7 @@
97
97
  }
98
98
  }
99
99
 
100
- & > [class^=pb_phone_number_input]:not(:first-child) {
100
+ & > [class^=pb_phone_number_input]:not(:first-child), [class^=pb_passphrase]:not(:first-child) {
101
101
  .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .text_input {
102
102
  border-bottom-left-radius: 0;
103
103
  border-top-left-radius: 0;
@@ -243,4 +243,8 @@
243
243
  padding-left: calc(var(--iti-flag-width) + 1px);
244
244
  }
245
245
  }
246
+
247
+ &:has(> [class^="pb_select"]):has(> .pb_passphrase) [class^="pb_select"] {
248
+ align-self: baseline;
249
+ }
246
250
  }
@@ -1,12 +1,16 @@
1
- import React from 'react'
1
+ import React, {useState} from 'react'
2
2
 
3
3
  import FormGroup from '../_form_group'
4
4
  import PhoneNumberInput from '../../pb_phone_number_input/_phone_number_input'
5
5
  import Select from '../../pb_select/_select'
6
6
  import TextInput from '../../pb_text_input/_text_input'
7
7
  import Flex from '../../pb_flex/_flex'
8
+ import Passphrase from '../../pb_passphrase/_passphrase'
8
9
 
9
10
  const FormGroupSelect = (props) => {
11
+ const [input, setInput] = useState("");
12
+ const handleChange = (e) => setInput(e.target.value);
13
+
10
14
  const options = [
11
15
  { value: 'Country' },
12
16
  { value: 'Pop' },
@@ -63,6 +67,20 @@ const FormGroupSelect = (props) => {
63
67
  {...props}
64
68
  />
65
69
  </FormGroup>
70
+ <FormGroup>
71
+ <Select
72
+ blankSelection="Phone"
73
+ options={phoneOptions}
74
+ {...props}
75
+ />
76
+ <Passphrase
77
+ id="my-passphrase"
78
+ label=""
79
+ onChange={handleChange}
80
+ value={input}
81
+ {...props}
82
+ />
83
+ </FormGroup>
66
84
  </Flex>
67
85
  )
68
86
  }
@@ -84,8 +84,8 @@ const Table = (props: TableProps): React.ReactElement => {
84
84
  'single-line': singleLine,
85
85
  'no-hover': disableHover,
86
86
  'sticky-header': sticky,
87
- 'sticky-left-column': stickyLeftColumn,
88
- 'sticky-right-column': stickyRightColumn,
87
+ 'sticky-left-column': stickyLeftColumn.length,
88
+ 'sticky-right-column': stickyRightColumn.length,
89
89
  'striped': striped,
90
90
  'header-borderless': headerStyle === 'borderless',
91
91
  'header-floating': headerStyle === 'floating',
@@ -1,3 +1,5 @@
1
1
  The `collapsibleContent` can display any content, including nested Table Rows.
2
2
 
3
- Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
3
+ Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
4
+
5
+ **NOTE**: We advise against using the `disableHover` Table prop when nesting Table Rows within a Table.
@@ -1,3 +1,5 @@
1
1
  The `collapsible_content` can display any content, including nested Table Rows.
2
2
 
3
- Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
3
+ Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
4
+
5
+ **NOTE**: We advise against using the `disable_hover` Table prop when nesting Table Rows within a Table.
@@ -1 +1,3 @@
1
- The `collapsibleContent` can also be used to display nested Tables within each Row.
1
+ The `collapsibleContent` can also be used to display nested Tables within each Row.
2
+
3
+ **NOTE**: We advise against using the `disableHover` Table prop when nesting Tables within a Table.
@@ -1 +1,3 @@
1
- The `collapsible_content` can also be used to display nested Tables within each Row.
1
+ The `collapsible_content` can also be used to display nested Tables within each Row.
2
+
3
+ **NOTE**: We advise against using the `disable_hover` Table prop when nesting Tables within a Table.
@@ -48,4 +48,4 @@
48
48
  .border-active {
49
49
  border-bottom: 1px;
50
50
  }
51
- }
51
+ }
@@ -25,7 +25,7 @@ type TextInputProps = {
25
25
  name: string,
26
26
  label: string,
27
27
  mask?: 'currency' | 'zipCode' | 'postalCode' | 'ssn',
28
- onChange: (e: React.FormEvent<HTMLInputElement>) => void,
28
+ onChange: (e: React.FormEvent<HTMLInputElement>, sanitizedValue?: string) => void,
29
29
  placeholder: string,
30
30
  required?: boolean,
31
31
  type: string,
@@ -102,10 +102,16 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
102
102
 
103
103
  let cursorPosition = e.target.selectionStart;
104
104
  const isAtEnd = cursorPosition === inputValue.length;
105
-
105
+
106
106
  const formattedValue = INPUTMASKS[mask].format(inputValue)
107
+
108
+ let sanitizedValue = formattedValue;
109
+ if (INPUTMASKS[mask].sanitize) {
110
+ sanitizedValue = INPUTMASKS[mask].sanitize(formattedValue)
111
+ }
112
+
107
113
  e.target.value = formattedValue
108
-
114
+
109
115
  // Keep cursor position
110
116
  if (!isAtEnd) {
111
117
  // Account for extra characters (e.g., commas added/removed in currency)
@@ -116,9 +122,11 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
116
122
  }
117
123
  e.target.selectionStart = e.target.selectionEnd = cursorPosition
118
124
  }
125
+
126
+ onChange(e, sanitizedValue);
127
+ } else {
128
+ onChange(e)
119
129
  }
120
-
121
- onChange(e)
122
130
  }
123
131
 
124
132
  const childInput = children ? children.type === "input" : undefined
@@ -0,0 +1,94 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import TextInput from '../../pb_text_input/_text_input'
4
+
5
+ const TextInputSanitize = (props) => {
6
+ const ref = React.createRef()
7
+
8
+ const [currency, setCurrency] = useState('')
9
+ const [sanitizedCurrency, setSanitizedCurrency] = useState('')
10
+ const handleOnChangeSanitizeCurrency = ({ target }, sanitizedValue) => {
11
+ setCurrency(target.value)
12
+ setSanitizedCurrency(sanitizedValue);
13
+ }
14
+
15
+ const [creditCard, setCreditCard] = useState('')
16
+ const [sanitizedCreditCard, setSanitizedCreditCard] = useState('')
17
+ const handleOnChangeSanitizeCC = ({ target }, sanitizedValue) => {
18
+ setCreditCard(target.value)
19
+ setSanitizedCreditCard(sanitizedValue);
20
+ }
21
+
22
+ const [ssn, setSSN] = useState('')
23
+ const [sanitizedSSN, setSanitizedSSN] = useState('')
24
+ const handleOnChangeSanitizeSSN = ({ target }, sanitizedValue) => {
25
+ setSSN(target.value)
26
+ setSanitizedSSN(sanitizedValue);
27
+ }
28
+
29
+ return (
30
+ <div>
31
+ <TextInput
32
+ label="Currency"
33
+ mask="currency"
34
+ onChange={handleOnChangeSanitizeCurrency}
35
+ placeholder="Enter Amount"
36
+ ref={ref}
37
+ value={currency}
38
+ {...props}
39
+ />
40
+
41
+ {currency !== "" && (
42
+ <React.Fragment>{`The masked value is: ${currency}`}</React.Fragment>
43
+ )}
44
+ <br />
45
+ {sanitizedCurrency !== "" && (
46
+ <React.Fragment>{`The sanitized value is: ${sanitizedCurrency}`}</React.Fragment>
47
+ )}
48
+
49
+ <br />
50
+ <br />
51
+
52
+ <TextInput
53
+ label="Credit Card"
54
+ mask="creditCard"
55
+ onChange={handleOnChangeSanitizeCC}
56
+ placeholder="Enter Card"
57
+ ref={ref}
58
+ value={creditCard}
59
+ {...props}
60
+ />
61
+
62
+ {creditCard !== "" && (
63
+ <React.Fragment>{`The masked value is: ${creditCard}`}</React.Fragment>
64
+ )}
65
+ <br />
66
+ {sanitizedCreditCard !== "" && (
67
+ <React.Fragment>{`The sanitized value is: ${sanitizedCreditCard}`}</React.Fragment>
68
+ )}
69
+
70
+ <br />
71
+ <br />
72
+
73
+ <TextInput
74
+ label="SSN"
75
+ mask="ssn"
76
+ onChange={handleOnChangeSanitizeSSN}
77
+ placeholder="Enter Amount"
78
+ ref={ref}
79
+ value={ssn}
80
+ {...props}
81
+ />
82
+
83
+ {ssn !== "" && (
84
+ <React.Fragment>{`The masked value is: ${ssn}`}</React.Fragment>
85
+ )}
86
+ <br />
87
+ {sanitizedSSN !== "" && (
88
+ <React.Fragment>{`The sanitized value is: ${sanitizedSSN}`}</React.Fragment>
89
+ )}
90
+ </div>
91
+ )
92
+ }
93
+
94
+ export default TextInputSanitize
@@ -0,0 +1 @@
1
+ When utilizing the Mask prop, you can retrieve the sanitized value of your input through an event handler that targets `sanitizedValue`.
@@ -18,6 +18,8 @@ examples:
18
18
  - text_input_inline: Inline
19
19
  - text_input_no_label: No Label
20
20
  - text_input_mask: Mask
21
+ - text_input_sanitize: Sanitized Masked Input
22
+
21
23
 
22
24
  swift:
23
25
  - text_input_default_swift: Default
@@ -6,3 +6,4 @@ export { default as TextInputAddOn } from './_text_input_add_on.jsx'
6
6
  export { default as TextInputInline } from './_text_input_inline.jsx'
7
7
  export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
8
8
  export { default as TextInputMask } from './_text_input_mask.jsx'
9
+ export { default as TextInputSanitize } from './_text_input_sanitize.jsx'
@@ -3,6 +3,7 @@ type InputMask = {
3
3
  formatDefaultValue: (value: string) => string
4
4
  pattern: string
5
5
  placeholder: string
6
+ sanitize?: (value: string) => string;
6
7
  }
7
8
 
8
9
  type InputMaskDictionary = {
@@ -73,35 +74,41 @@ export const INPUTMASKS: InputMaskDictionary = {
73
74
  // eslint-disable-next-line no-useless-escape
74
75
  pattern: '^\\$\\d{1,3}(?:,\\d{3})*(?:\\.\\d{2})?$',
75
76
  placeholder: '$0.00',
77
+ sanitize: (value: string) => value.replace(/[$,]/g, ''),
76
78
  },
77
79
  zipCode: {
78
80
  format: formatBasicPostal,
79
81
  formatDefaultValue: formatBasicPostal,
80
82
  pattern: '\\d{5}',
81
83
  placeholder: '12345',
84
+ sanitize: (value: string) => value,
82
85
  },
83
86
  postalCode: {
84
87
  format: formatExtendedPostal,
85
88
  formatDefaultValue: formatExtendedPostal,
86
89
  pattern: '\\d{5}-\\d{4}',
87
90
  placeholder: '12345-6789',
91
+ sanitize: (value: string) => value.replace(/-/g, ''),
88
92
  },
89
93
  ssn: {
90
94
  format: formatSSN,
91
95
  formatDefaultValue: formatSSN,
92
96
  pattern: '\\d{3}-\\d{2}-\\d{4}',
93
97
  placeholder: '123-45-6789',
98
+ sanitize: (value: string) => value.replace(/-/g, ''),
94
99
  },
95
100
  creditCard: {
96
101
  format: formatCreditCard,
97
102
  formatDefaultValue: formatCreditCard,
98
103
  pattern: '\\d{4} \\d{4} \\d{4} \\d{4}',
99
104
  placeholder: '1234 5678 9012 3456',
105
+ sanitize: (value: string) => value.replace(/\s/g, ''),
100
106
  },
101
107
  cvv: {
102
108
  format: formatCVV,
103
109
  formatDefaultValue: formatCVV,
104
110
  pattern: '\\d{3,4}',
105
111
  placeholder: '123',
112
+ sanitize: (value: string) => value,
106
113
  },
107
- }
114
+ }