@charcoal-ui/react 4.0.0-beta.4 → 4.0.0-beta.5

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 (122) hide show
  1. package/dist/_lib/useClassNames.d.ts +2 -2
  2. package/dist/_lib/useClassNames.d.ts.map +1 -1
  3. package/dist/components/Checkbox/CheckboxInput/index.d.ts +11 -0
  4. package/dist/components/Checkbox/CheckboxInput/index.d.ts.map +1 -0
  5. package/dist/components/Checkbox/CheckboxWithLabel.d.ts +9 -0
  6. package/dist/components/Checkbox/CheckboxWithLabel.d.ts.map +1 -0
  7. package/dist/components/Checkbox/index.d.ts +9 -7
  8. package/dist/components/Checkbox/index.d.ts.map +1 -1
  9. package/dist/components/Clickable/index.d.ts +10 -13
  10. package/dist/components/Clickable/index.d.ts.map +1 -1
  11. package/dist/components/DropdownSelector/index.d.ts.map +1 -1
  12. package/dist/components/FieldLabel/index.d.ts +1 -0
  13. package/dist/components/FieldLabel/index.d.ts.map +1 -1
  14. package/dist/components/IconButton/index.d.ts +7 -5
  15. package/dist/components/IconButton/index.d.ts.map +1 -1
  16. package/dist/components/LoadingSpinner/index.d.ts +1 -0
  17. package/dist/components/LoadingSpinner/index.d.ts.map +1 -1
  18. package/dist/components/Modal/Dialog/index.d.ts +6 -24
  19. package/dist/components/Modal/Dialog/index.d.ts.map +1 -1
  20. package/dist/components/Modal/ModalPlumbing.d.ts +10 -3
  21. package/dist/components/Modal/ModalPlumbing.d.ts.map +1 -1
  22. package/dist/components/Modal/index.d.ts +1 -1
  23. package/dist/components/Modal/index.d.ts.map +1 -1
  24. package/dist/components/Radio/index.d.ts +3 -5
  25. package/dist/components/Radio/index.d.ts.map +1 -1
  26. package/dist/components/SegmentedControl/index.d.ts +1 -0
  27. package/dist/components/SegmentedControl/index.d.ts.map +1 -1
  28. package/dist/components/Switch/SwitchInput/index.d.ts +9 -0
  29. package/dist/components/Switch/SwitchInput/index.d.ts.map +1 -0
  30. package/dist/components/Switch/SwitchWithLabel.d.ts +9 -0
  31. package/dist/components/Switch/SwitchWithLabel.d.ts.map +1 -0
  32. package/dist/components/Switch/index.d.ts +4 -15
  33. package/dist/components/Switch/index.d.ts.map +1 -1
  34. package/dist/components/TagItem/index.d.ts +14 -15
  35. package/dist/components/TagItem/index.d.ts.map +1 -1
  36. package/dist/components/TextArea/index.d.ts +28 -18
  37. package/dist/components/TextArea/index.d.ts.map +1 -1
  38. package/dist/components/TextField/index.d.ts +32 -19
  39. package/dist/components/TextField/index.d.ts.map +1 -1
  40. package/dist/index.cjs.js +390 -776
  41. package/dist/index.cjs.js.map +1 -1
  42. package/dist/index.css +732 -28
  43. package/dist/index.css.map +1 -1
  44. package/dist/index.d.ts +1 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.esm.js +415 -799
  47. package/dist/index.esm.js.map +1 -1
  48. package/dist/styled.d.ts +4 -4
  49. package/package.json +11 -10
  50. package/src/_lib/useClassNames.ts +3 -9
  51. package/src/components/Checkbox/CheckboxInput/__snapshots__/index.story.storyshot +77 -0
  52. package/src/components/Checkbox/CheckboxInput/index.css +111 -0
  53. package/src/components/{CheckboxInput → Checkbox/CheckboxInput}/index.story.tsx +16 -0
  54. package/src/components/Checkbox/CheckboxInput/index.tsx +47 -0
  55. package/src/components/Checkbox/CheckboxWithLabel.tsx +24 -0
  56. package/src/components/Checkbox/__snapshots__/index.story.storyshot +53 -134
  57. package/src/components/Checkbox/index.css +2 -2
  58. package/src/components/Checkbox/index.story.tsx +16 -11
  59. package/src/components/Checkbox/index.tsx +23 -15
  60. package/src/components/Clickable/__snapshots__/index.story.storyshot +2 -78
  61. package/src/components/Clickable/index.css +41 -0
  62. package/src/components/Clickable/index.story.tsx +1 -1
  63. package/src/components/Clickable/index.tsx +25 -85
  64. package/src/components/DropdownSelector/ListItem/__snapshots__/index.story.storyshot +10 -135
  65. package/src/components/DropdownSelector/__snapshots__/index.story.storyshot +308 -1014
  66. package/src/components/DropdownSelector/index.tsx +9 -38
  67. package/src/components/FieldLabel/index.css +35 -0
  68. package/src/components/FieldLabel/index.tsx +15 -105
  69. package/src/components/IconButton/__snapshots__/index.story.storyshot +12 -288
  70. package/src/components/IconButton/index.css +118 -0
  71. package/src/components/IconButton/index.story.tsx +2 -2
  72. package/src/components/IconButton/index.tsx +41 -118
  73. package/src/components/LoadingSpinner/__snapshots__/LoadingSpinnerIcon.story.storyshot +2 -17
  74. package/src/components/LoadingSpinner/__snapshots__/index.story.storyshot +40 -128
  75. package/src/components/LoadingSpinner/index.css +42 -0
  76. package/src/components/LoadingSpinner/index.tsx +26 -52
  77. package/src/components/Modal/Dialog/index.css +44 -0
  78. package/src/components/Modal/Dialog/index.tsx +13 -57
  79. package/src/components/Modal/ModalPlumbing.css +40 -0
  80. package/src/components/Modal/ModalPlumbing.tsx +22 -61
  81. package/src/components/Modal/__snapshots__/index.story.storyshot +459 -1881
  82. package/src/components/Modal/index.css +36 -0
  83. package/src/components/Modal/index.tsx +26 -73
  84. package/src/components/Radio/__snapshots__/index.story.storyshot +50 -775
  85. package/src/components/Radio/index.css +97 -0
  86. package/src/components/Radio/index.story.tsx +1 -10
  87. package/src/components/Radio/index.test.tsx +0 -1
  88. package/src/components/Radio/index.tsx +50 -161
  89. package/src/components/SegmentedControl/__snapshots__/index.story.storyshot +30 -260
  90. package/src/components/SegmentedControl/index.css +50 -0
  91. package/src/components/SegmentedControl/index.tsx +20 -89
  92. package/src/components/Switch/SwitchInput/index.css +82 -0
  93. package/src/components/Switch/SwitchInput/index.tsx +40 -0
  94. package/src/components/Switch/SwitchWithLabel.tsx +24 -0
  95. package/src/components/Switch/__snapshots__/index.story.storyshot +29 -532
  96. package/src/components/Switch/index.css +23 -0
  97. package/src/components/Switch/index.story.tsx +5 -0
  98. package/src/components/Switch/index.tsx +43 -140
  99. package/src/components/TagItem/__snapshots__/index.story.storyshot +153 -1130
  100. package/src/components/TagItem/index.css +140 -0
  101. package/src/components/TagItem/index.story.tsx +1 -1
  102. package/src/components/TagItem/index.tsx +76 -220
  103. package/src/components/TextArea/__snapshots__/TextArea.story.storyshot +203 -1357
  104. package/src/components/TextArea/index.tsx +68 -91
  105. package/src/components/TextField/__snapshots__/TextField.story.storyshot +274 -1614
  106. package/src/components/TextField/index.tsx +77 -105
  107. package/src/index.ts +0 -7
  108. package/src/type.d.ts +6 -0
  109. package/dist/components/CheckboxInput/index.d.ts +0 -9
  110. package/dist/components/CheckboxInput/index.d.ts.map +0 -1
  111. package/dist/components/MultiSelect/context.d.ts +0 -14
  112. package/dist/components/MultiSelect/context.d.ts.map +0 -1
  113. package/dist/components/MultiSelect/index.d.ts +0 -36
  114. package/dist/components/MultiSelect/index.d.ts.map +0 -1
  115. package/src/components/CheckboxInput/__snapshots__/index.story.storyshot +0 -109
  116. package/src/components/CheckboxInput/index.css +0 -77
  117. package/src/components/CheckboxInput/index.tsx +0 -53
  118. package/src/components/MultiSelect/__snapshots__/index.story.storyshot +0 -1054
  119. package/src/components/MultiSelect/context.ts +0 -23
  120. package/src/components/MultiSelect/index.story.tsx +0 -112
  121. package/src/components/MultiSelect/index.test.tsx +0 -263
  122. package/src/components/MultiSelect/index.tsx +0 -282
@@ -1,29 +1,34 @@
1
1
  import Checkbox from '.'
2
2
  import { Meta, StoryObj } from '@storybook/react'
3
3
  import { useCallback, useState } from 'react'
4
- import { action } from '@storybook/addon-actions'
5
4
 
6
5
  export default {
7
6
  title: 'Checkbox',
8
7
  component: Checkbox,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
9
11
  } as Meta<typeof Checkbox>
10
12
 
11
13
  export const Default: StoryObj<typeof Checkbox> = {
14
+ argTypes: {
15
+ checked: { type: 'boolean' },
16
+ children: { type: 'string' },
17
+ disabled: { type: 'boolean' },
18
+ invalid: { type: 'boolean' },
19
+ readOnly: { type: 'boolean' },
20
+ },
12
21
  render: function Render(props) {
13
22
  const [checked, setChecked] = useState(props.checked)
14
23
  const handleChange = useCallback((isSelected: boolean) => {
15
24
  setChecked(isSelected)
16
- action('change')(isSelected)
17
25
  }, [])
18
26
 
19
27
  return (
20
28
  <Checkbox
21
29
  {...props}
22
30
  checked={checked ?? props.checked}
23
- onBlur={action('blur')}
24
- onClick={action('click')}
25
31
  onChange={handleChange}
26
- onFocus={action('focus')}
27
32
  />
28
33
  )
29
34
  },
@@ -31,27 +36,27 @@ export const Default: StoryObj<typeof Checkbox> = {
31
36
 
32
37
  export const Label: StoryObj<typeof Checkbox> = {
33
38
  render: () => {
34
- return <Checkbox>Accelerate creativity.</Checkbox>
39
+ return <Checkbox>Checkbox</Checkbox>
35
40
  },
36
41
  }
37
42
 
38
43
  export const Checked: StoryObj<typeof Checkbox> = {
39
44
  render: () => {
40
- return <Checkbox checked>Accelerate creativity.</Checkbox>
45
+ return <Checkbox checked>Checked</Checkbox>
41
46
  },
42
47
  }
43
48
 
44
49
  export const Disabled: StoryObj<typeof Checkbox> = {
45
50
  render: () => {
46
- return <Checkbox disabled>Accelerate creativity.</Checkbox>
51
+ return <Checkbox disabled>Disabled</Checkbox>
47
52
  },
48
53
  }
49
54
 
50
55
  export const ReadOnly: StoryObj<typeof Checkbox> = {
51
56
  render: () => {
52
57
  return (
53
- <Checkbox name="labelled" readOnly>
54
- Accelerate creativity.
58
+ <Checkbox checked name="labelled" readOnly>
59
+ ReadOnly
55
60
  </Checkbox>
56
61
  )
57
62
  },
@@ -61,7 +66,7 @@ export const Invalid: StoryObj<typeof Checkbox> = {
61
66
  render: () => {
62
67
  return (
63
68
  <Checkbox name="labelled" invalid>
64
- Accelerate creativity.
69
+ Invalid
65
70
  </Checkbox>
66
71
  )
67
72
  },
@@ -1,29 +1,37 @@
1
1
  import './index.css'
2
2
 
3
- import React, { forwardRef, memo } from 'react'
3
+ import { forwardRef, memo } from 'react'
4
4
  import { useId } from '@react-aria/utils'
5
- import CheckboxInput, { CheckboxInputProps } from '../CheckboxInput'
6
- import { useClassNames } from '../../_lib/useClassNames'
5
+ import CheckboxInput, { CheckboxInputProps } from './CheckboxInput'
6
+ import { CheckboxWithLabel } from './CheckboxWithLabel'
7
7
 
8
- export type CheckboxProps = CheckboxInputProps & {
9
- children?: React.ReactNode
10
- }
8
+ export type CheckboxProps = CheckboxInputProps
11
9
 
12
- const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
13
- function CheckboxInner({ disabled, className, id, children, ...props }, ref) {
14
- const classNames = useClassNames('charcoal-checkbox__label', className)
10
+ const Checkbox = forwardRef<HTMLInputElement, CheckboxInputProps>(
11
+ function Checkbox({ disabled, className, id, children, ...props }, ref) {
15
12
  const htmlId = useId(id)
13
+ const noChildren = children === undefined
16
14
  const input = (
17
- <CheckboxInput {...props} id={htmlId} disabled={disabled} ref={ref} />
15
+ <CheckboxInput
16
+ {...props}
17
+ className={noChildren ? className : undefined}
18
+ disabled={disabled}
19
+ id={htmlId}
20
+ ref={ref}
21
+ />
18
22
  )
19
- if (children === undefined) {
23
+ if (noChildren) {
20
24
  return input
21
25
  }
22
26
  return (
23
- <label htmlFor={htmlId} aria-disabled={disabled} className={classNames}>
24
- {input}
25
- <div className="charcoal-checkbox__text">{children}</div>
26
- </label>
27
+ <CheckboxWithLabel
28
+ className={className}
29
+ disabled={disabled}
30
+ id={htmlId}
31
+ input={input}
32
+ >
33
+ {children}
34
+ </CheckboxWithLabel>
27
35
  )
28
36
  }
29
37
  )
@@ -1,49 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`Storybook Tests Clickable Button 1`] = `
4
- .c0 {
5
- cursor: pointer;
6
- -webkit-appearance: none;
7
- -moz-appearance: none;
8
- appearance: none;
9
- background: transparent;
10
- padding: 0;
11
- border-style: none;
12
- outline: none;
13
- color: inherit;
14
- text-rendering: inherit;
15
- -webkit-letter-spacing: inherit;
16
- -moz-letter-spacing: inherit;
17
- -ms-letter-spacing: inherit;
18
- letter-spacing: inherit;
19
- word-spacing: inherit;
20
- -webkit-text-decoration: none;
21
- text-decoration: none;
22
- font: inherit;
23
- margin: 0;
24
- overflow: visible;
25
- text-transform: none;
26
- }
27
-
28
- .c0:disabled,
29
- .c0[aria-disabled]:not([aria-disabled=false]) {
30
- cursor: default;
31
- }
32
-
33
- .c0:focus {
34
- outline: none;
35
- }
36
-
37
- .c0::-moz-focus-inner {
38
- border-style: none;
39
- padding: 0;
40
- }
41
-
42
4
  <div
43
5
  data-dark={false}
44
6
  >
45
7
  <button
46
- className="c0"
8
+ className="charcoal-clickable"
47
9
  onClick={[Function]}
48
10
  >
49
11
  button
@@ -52,49 +14,11 @@ exports[`Storybook Tests Clickable Button 1`] = `
52
14
  `;
53
15
 
54
16
  exports[`Storybook Tests Clickable Link 1`] = `
55
- .c0 {
56
- cursor: pointer;
57
- -webkit-appearance: none;
58
- -moz-appearance: none;
59
- appearance: none;
60
- background: transparent;
61
- padding: 0;
62
- border-style: none;
63
- outline: none;
64
- color: inherit;
65
- text-rendering: inherit;
66
- -webkit-letter-spacing: inherit;
67
- -moz-letter-spacing: inherit;
68
- -ms-letter-spacing: inherit;
69
- letter-spacing: inherit;
70
- word-spacing: inherit;
71
- -webkit-text-decoration: none;
72
- text-decoration: none;
73
- font: inherit;
74
- margin: 0;
75
- overflow: visible;
76
- text-transform: none;
77
- }
78
-
79
- .c0:disabled,
80
- .c0[aria-disabled]:not([aria-disabled=false]) {
81
- cursor: default;
82
- }
83
-
84
- .c0:focus {
85
- outline: none;
86
- }
87
-
88
- .c0::-moz-focus-inner {
89
- border-style: none;
90
- padding: 0;
91
- }
92
-
93
17
  <div
94
18
  data-dark={false}
95
19
  >
96
20
  <a
97
- className="c0"
21
+ className="charcoal-clickable"
98
22
  href="#"
99
23
  onClick={[Function]}
100
24
  >
@@ -0,0 +1,41 @@
1
+ .charcoal-clickable {
2
+ cursor: pointer;
3
+
4
+ /* Reset button appearance */
5
+ appearance: none;
6
+ background: transparent;
7
+ padding: 0;
8
+ border-style: none;
9
+ outline: none;
10
+ color: inherit;
11
+ text-rendering: inherit;
12
+ letter-spacing: inherit;
13
+ word-spacing: inherit;
14
+ text-decoration: none;
15
+
16
+ /* Change the font styles in all browsers. */
17
+ font: inherit;
18
+
19
+ /* Remove the margin in Firefox and Safari. */
20
+ margin: 0;
21
+
22
+ /* Show the overflow in Edge. */
23
+ overflow: visible;
24
+
25
+ /* Remove the inheritance of text transform in Firefox. */
26
+ text-transform: none;
27
+ }
28
+
29
+ .charcoal-clickable:disabled,
30
+ .charcoal-clickable[aria-disabled]:not([aria-disabled='false']) {
31
+ cursor: default;
32
+ }
33
+
34
+ .charcoal-clickable:focus {
35
+ outline: none;
36
+ }
37
+
38
+ .charcoal-clickable::-moz-focus-inner {
39
+ border-style: none;
40
+ padding: 0;
41
+ }
@@ -13,7 +13,7 @@ export const Button: StoryObj = {
13
13
 
14
14
  export const Link: StoryObj = {
15
15
  render: () => (
16
- <Clickable to="#" onClick={action('click')}>
16
+ <Clickable as="a" href="#" onClick={action('click')}>
17
17
  link
18
18
  </Clickable>
19
19
  ),
@@ -1,91 +1,31 @@
1
- import * as React from 'react'
2
- import styled from 'styled-components'
3
- import {
4
- LinkProps,
5
- useComponentAbstraction,
6
- } from '../../core/ComponentAbstraction'
7
- import { disabledSelector } from '@charcoal-ui/utils'
1
+ import React, { useMemo, forwardRef } from 'react'
2
+ import { useClassNames } from '../../_lib/useClassNames'
3
+ import './index.css'
8
4
 
9
- interface BaseProps {
5
+ export type ClickableProps<T extends React.ElementType = 'button'> = {
10
6
  /**
11
- * クリックの無効化
7
+ * The component used for root element.
8
+ * @type T extends React.ElementType = 'button'
12
9
  */
13
- disabled?: boolean
14
- }
15
-
16
- interface LinkBaseProps {
10
+ as?: T
17
11
  /**
18
- * リンクのURL。指定するとbuttonタグではなくaタグとして描画される
12
+ * The as property of the component specified by the Button component's as attribute.
19
13
  */
20
- to: string
21
- }
22
-
23
- export type ClickableProps =
24
- | (BaseProps & Omit<React.ComponentPropsWithoutRef<'button'>, 'disabled'>)
25
- | (BaseProps & LinkBaseProps & Omit<LinkProps, 'to'>)
26
- export type ClickableElement = HTMLButtonElement & HTMLAnchorElement
27
-
28
- const Clickable = React.forwardRef<ClickableElement, ClickableProps>(
29
- function Clickable(props, ref) {
30
- const { Link } = useComponentAbstraction()
31
- const isLink = 'to' in props
32
- const as = isLink ? Link : 'button'
33
- const ariaDisabled = isLink && props.disabled === true ? true : undefined
34
- let rest = props
35
- if (isLink) {
36
- const { disabled, ..._rest } = props
37
- rest = _rest
38
- }
39
- return (
40
- <StyledClickableDiv
41
- {...rest}
42
- ref={ref}
43
- as={as}
44
- aria-disabled={ariaDisabled}
45
- />
46
- )
47
- }
48
- )
14
+ componentAs?: React.ComponentPropsWithRef<T>['as']
15
+ } & Omit<React.ComponentPropsWithRef<T>, 'as'>
16
+
17
+ const Clickable = forwardRef(function Clickable<T extends React.ElementType>(
18
+ { componentAs, as, ...props }: ClickableProps<T>,
19
+ ref: React.ForwardedRef<HTMLButtonElement>
20
+ ) {
21
+ const className = useClassNames('charcoal-clickable', props.className)
22
+
23
+ const Component = useMemo(() => as ?? 'button', [as])
24
+
25
+ return (
26
+ <Component {...props} ref={ref} className={className} as={componentAs} />
27
+ )
28
+ }) as <T extends React.ElementType = 'button'>(
29
+ p: ClickableProps<T>
30
+ ) => JSX.Element
49
31
  export default Clickable
50
-
51
- const StyledClickableDiv = styled.div`
52
- cursor: pointer;
53
-
54
- ${disabledSelector} {
55
- cursor: default;
56
- }
57
-
58
- /* Reset button appearance */
59
- appearance: none;
60
- background: transparent;
61
- padding: 0;
62
- border-style: none;
63
- outline: none;
64
- color: inherit;
65
- text-rendering: inherit;
66
- letter-spacing: inherit;
67
- word-spacing: inherit;
68
- text-decoration: none;
69
-
70
- &:focus {
71
- outline: none;
72
- }
73
-
74
- /* Change the font styles in all browsers. */
75
- font: inherit;
76
-
77
- /* Remove the margin in Firefox and Safari. */
78
- margin: 0;
79
-
80
- /* Show the overflow in Edge. */
81
- overflow: visible;
82
-
83
- /* Remove the inheritance of text transform in Firefox. */
84
- text-transform: none;
85
-
86
- /* Remove the inner border and padding in Firefox. */
87
- &::-moz-focus-inner {
88
- border-style: none;
89
- padding: 0;
90
- }
91
- `
@@ -35,115 +35,6 @@ exports[`Storybook Tests DropdownSelector/ListItem Basic 1`] = `
35
35
  background-color: var(--charcoal-surface3);
36
36
  }
37
37
 
38
- .c3 {
39
- display: inline-grid;
40
- grid-template-columns: auto 1fr;
41
- -webkit-align-items: center;
42
- -webkit-box-align: center;
43
- -ms-flex-align: center;
44
- align-items: center;
45
- cursor: pointer;
46
- outline: 0;
47
- }
48
-
49
- .c3:disabled,
50
- .c3[aria-disabled]:not([aria-disabled='false']) {
51
- opacity: 0.32;
52
- cursor: default;
53
- }
54
-
55
- .c4 {
56
- -webkit-appearance: none;
57
- -moz-appearance: none;
58
- appearance: none;
59
- display: -webkit-inline-box;
60
- display: -webkit-inline-flex;
61
- display: -ms-inline-flexbox;
62
- display: inline-flex;
63
- position: relative;
64
- box-sizing: border-box;
65
- width: 28px;
66
- border: 2px solid transparent;
67
- -webkit-transition-property: background-color,box-shadow;
68
- transition-property: background-color,box-shadow;
69
- -webkit-transition-duration: 0.2s;
70
- transition-duration: 0.2s;
71
- cursor: inherit;
72
- outline: none;
73
- border-radius: 16px;
74
- height: 16px;
75
- margin: 0;
76
- background-color: var(--charcoal-text4);
77
- }
78
-
79
- .c4:hover {
80
- background-color: var(--charcoal-text4-hover);
81
- }
82
-
83
- .c4:active {
84
- background-color: var(--charcoal-text4-press);
85
- }
86
-
87
- .c4:focus {
88
- outline: none;
89
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
90
- }
91
-
92
- .c4:focus:not(:focus-visible) {
93
- box-shadow: none;
94
- }
95
-
96
- .c4:focus-visible {
97
- box-shadow: 0 0 0 4px rgba(0,150,250,0.32);
98
- }
99
-
100
- .c4::after {
101
- content: '';
102
- position: absolute;
103
- display: block;
104
- top: 0;
105
- left: 0;
106
- width: 12px;
107
- height: 12px;
108
- -webkit-transform: translateX(0);
109
- -ms-transform: translateX(0);
110
- transform: translateX(0);
111
- -webkit-transition: -webkit-transform 0.2s;
112
- -webkit-transition: transform 0.2s;
113
- transition: transform 0.2s;
114
- border-radius: 1024px;
115
- background-color: var(--charcoal-text5);
116
- }
117
-
118
- .c4::after:hover {
119
- background-color: var(--charcoal-text5-hover);
120
- }
121
-
122
- .c4::after:active {
123
- background-color: var(--charcoal-text5-press);
124
- }
125
-
126
- .c4:checked {
127
- background-color: var(--charcoal-brand);
128
- }
129
-
130
- .c4:checked:hover {
131
- background-color: var(--charcoal-brand-hover);
132
- }
133
-
134
- .c4:checked:active {
135
- background-color: var(--charcoal-brand-press);
136
- }
137
-
138
- .c4:checked::after {
139
- -webkit-transform: translateX(12px);
140
- -ms-transform: translateX(12px);
141
- transform: translateX(12px);
142
- -webkit-transition: -webkit-transform 0.2s;
143
- -webkit-transition: transform 0.2s;
144
- transition: transform 0.2s;
145
- }
146
-
147
38
  .c2 {
148
39
  color: red;
149
40
  }
@@ -212,32 +103,16 @@ exports[`Storybook Tests DropdownSelector/ListItem Basic 1`] = `
212
103
  }
213
104
  }
214
105
  >
215
- <label
216
- className="c3"
217
- >
218
- <input
219
- aria-label="hello"
220
- checked={false}
221
- className="c4"
222
- disabled={false}
223
- name="hello"
224
- onChange={[Function]}
225
- onClick={[Function]}
226
- onDragStart={[Function]}
227
- onKeyDown={[Function]}
228
- onKeyUp={[Function]}
229
- onMouseDown={[Function]}
230
- onMouseEnter={[Function]}
231
- onMouseLeave={[Function]}
232
- onMouseUp={[Function]}
233
- onTouchCancel={[Function]}
234
- onTouchEnd={[Function]}
235
- onTouchMove={[Function]}
236
- onTouchStart={[Function]}
237
- role="switch"
238
- type="checkbox"
239
- />
240
- </label>
106
+ <input
107
+ checked={false}
108
+ className="charcoal-switch-input"
109
+ id="test-id"
110
+ label="hello"
111
+ name="hello"
112
+ onChange={[Function]}
113
+ role="switch"
114
+ type="checkbox"
115
+ />
241
116
  </div>
242
117
  </div>
243
118
  </li>