@instructure/ui-checkbox 10.26.1 → 11.0.1-snapshot-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 (44) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/es/Checkbox/CheckboxFacade/index.js +2 -2
  3. package/es/Checkbox/CheckboxFacade/props.js +1 -11
  4. package/es/Checkbox/ToggleFacade/index.js +2 -2
  5. package/es/Checkbox/ToggleFacade/props.js +1 -12
  6. package/es/Checkbox/index.js +6 -6
  7. package/es/Checkbox/props.js +1 -27
  8. package/es/CheckboxGroup/index.js +6 -6
  9. package/es/CheckboxGroup/props.js +1 -36
  10. package/lib/Checkbox/CheckboxFacade/index.js +1 -1
  11. package/lib/Checkbox/CheckboxFacade/props.js +1 -12
  12. package/lib/Checkbox/ToggleFacade/index.js +1 -1
  13. package/lib/Checkbox/ToggleFacade/props.js +1 -13
  14. package/lib/Checkbox/index.js +5 -5
  15. package/lib/Checkbox/props.js +1 -28
  16. package/lib/CheckboxGroup/index.js +5 -5
  17. package/lib/CheckboxGroup/props.js +1 -38
  18. package/package.json +19 -22
  19. package/src/Checkbox/CheckboxFacade/index.tsx +1 -2
  20. package/src/Checkbox/CheckboxFacade/props.ts +2 -18
  21. package/src/Checkbox/ToggleFacade/index.tsx +1 -2
  22. package/src/Checkbox/ToggleFacade/props.ts +2 -19
  23. package/src/Checkbox/index.tsx +2 -4
  24. package/src/Checkbox/props.ts +1 -32
  25. package/src/CheckboxGroup/index.tsx +2 -4
  26. package/src/CheckboxGroup/props.ts +2 -46
  27. package/tsconfig.build.json +0 -2
  28. package/tsconfig.build.tsbuildinfo +1 -1
  29. package/types/Checkbox/CheckboxFacade/index.d.ts +0 -9
  30. package/types/Checkbox/CheckboxFacade/index.d.ts.map +1 -1
  31. package/types/Checkbox/CheckboxFacade/props.d.ts +2 -3
  32. package/types/Checkbox/CheckboxFacade/props.d.ts.map +1 -1
  33. package/types/Checkbox/ToggleFacade/index.d.ts +0 -10
  34. package/types/Checkbox/ToggleFacade/index.d.ts.map +1 -1
  35. package/types/Checkbox/ToggleFacade/props.d.ts +2 -3
  36. package/types/Checkbox/ToggleFacade/props.d.ts.map +1 -1
  37. package/types/Checkbox/index.d.ts +0 -23
  38. package/types/Checkbox/index.d.ts.map +1 -1
  39. package/types/Checkbox/props.d.ts +2 -3
  40. package/types/Checkbox/props.d.ts.map +1 -1
  41. package/types/CheckboxGroup/index.d.ts +0 -13
  42. package/types/CheckboxGroup/index.d.ts.map +1 -1
  43. package/types/CheckboxGroup/props.d.ts +2 -3
  44. package/types/CheckboxGroup/props.d.ts.map +1 -1
@@ -22,12 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types'
26
-
27
- import type {
28
- PropValidators,
29
- CheckboxFacadeTheme
30
- } from '@instructure/shared-types'
25
+ import type { CheckboxFacadeTheme } from '@instructure/shared-types'
31
26
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
32
27
 
33
28
  type CheckboxFacadeOwnProps = {
@@ -54,17 +49,6 @@ type CheckboxFacadeProps = CheckboxFacadeOwnProps &
54
49
  WithStyleProps<CheckboxFacadeTheme, CheckboxFacadeStyle>
55
50
 
56
51
  type CheckboxFacadeStyle = ComponentStyle<'checkboxFacade' | 'facade' | 'label'>
57
-
58
- const propTypes: PropValidators<PropKeys> = {
59
- children: PropTypes.node.isRequired,
60
- checked: PropTypes.bool,
61
- focused: PropTypes.bool,
62
- hovered: PropTypes.bool,
63
- size: PropTypes.oneOf(['small', 'medium', 'large']),
64
- indeterminate: PropTypes.bool,
65
- invalid: PropTypes.bool
66
- }
67
-
68
52
  const allowedProps: AllowedPropKeys = [
69
53
  'children',
70
54
  'checked',
@@ -75,4 +59,4 @@ const allowedProps: AllowedPropKeys = [
75
59
  ]
76
60
 
77
61
  export type { CheckboxFacadeProps, CheckboxFacadeStyle }
78
- export { propTypes, allowedProps }
62
+ export { allowedProps }
@@ -31,7 +31,7 @@ import { withStyle } from '@instructure/emotion'
31
31
  import generateStyle from './styles'
32
32
  import generateComponentTheme from './theme'
33
33
 
34
- import { propTypes, allowedProps } from './props'
34
+ import { allowedProps } from './props'
35
35
  import type { ToggleFacadeProps } from './props'
36
36
 
37
37
  /**
@@ -43,7 +43,6 @@ parent: Checkbox
43
43
  class ToggleFacade extends Component<ToggleFacadeProps> {
44
44
  static readonly componentId = 'ToggleFacade'
45
45
 
46
- static propTypes = propTypes
47
46
  static allowedProps = allowedProps
48
47
  static defaultProps = {
49
48
  checked: false,
@@ -23,12 +23,7 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
- import type {
29
- PropValidators,
30
- ToggleFacadeTheme
31
- } from '@instructure/shared-types'
26
+ import type { ToggleFacadeTheme } from '@instructure/shared-types'
32
27
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
33
28
 
34
29
  type ToggleFacadeOwnProps = {
@@ -55,18 +50,6 @@ type ToggleFacadeProps = ToggleFacadeOwnProps &
55
50
  type ToggleFacadeStyle = ComponentStyle<
56
51
  'toggleFacade' | 'facade' | 'icon' | 'iconToggle' | 'iconSVG' | 'label'
57
52
  >
58
-
59
- const propTypes: PropValidators<PropKeys> = {
60
- children: PropTypes.node.isRequired,
61
- checked: PropTypes.bool,
62
- disabled: PropTypes.bool,
63
- readOnly: PropTypes.bool,
64
- focused: PropTypes.bool,
65
- size: PropTypes.oneOf(['small', 'medium', 'large']),
66
- labelPlacement: PropTypes.oneOf(['top', 'start', 'end']),
67
- invalid: PropTypes.bool
68
- }
69
-
70
53
  const allowedProps: AllowedPropKeys = [
71
54
  'children',
72
55
  'checked',
@@ -78,4 +61,4 @@ const allowedProps: AllowedPropKeys = [
78
61
  ]
79
62
 
80
63
  export type { ToggleFacadeProps, ToggleFacadeStyle }
81
- export { propTypes, allowedProps }
64
+ export { allowedProps }
@@ -31,7 +31,6 @@ import { logError as error } from '@instructure/console'
31
31
  import { isActiveElement } from '@instructure/ui-dom-utils'
32
32
  import { omitProps, withDeterministicId } from '@instructure/ui-react-utils'
33
33
  import { View } from '@instructure/ui-view'
34
- import { testable } from '@instructure/ui-testable'
35
34
 
36
35
  import { withStyle } from '@instructure/emotion'
37
36
 
@@ -41,7 +40,7 @@ import { ToggleFacade } from './ToggleFacade'
41
40
  import generateStyle from './styles'
42
41
  import generateComponentTheme from './theme'
43
42
 
44
- import { propTypes, allowedProps } from './props'
43
+ import { allowedProps } from './props'
45
44
  import type { CheckboxProps, CheckboxState } from './props'
46
45
 
47
46
  import type {
@@ -58,11 +57,9 @@ tags: toggle, switch
58
57
 
59
58
  @withDeterministicId()
60
59
  @withStyle(generateStyle, generateComponentTheme)
61
- @testable()
62
60
  class Checkbox extends Component<CheckboxProps, CheckboxState> {
63
61
  static readonly componentId = 'Checkbox'
64
62
 
65
- static propTypes = propTypes
66
63
  static allowedProps = allowedProps
67
64
  static defaultProps = {
68
65
  size: 'medium',
@@ -323,6 +320,7 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
323
320
  /* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */
324
321
  onMouseOut={createChainedFunction(onMouseOut, this.handleMouseOut)}
325
322
  ref={this.handleRef}
323
+ data-cid="Checkbox"
326
324
  >
327
325
  <div css={styles?.container}>
328
326
  <input
@@ -22,16 +22,10 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types'
26
-
27
- import { FormPropTypes } from '@instructure/ui-form-field'
28
- import { controllable } from '@instructure/ui-prop-types'
29
-
30
25
  import type { FormMessage } from '@instructure/ui-form-field'
31
26
  import type {
32
27
  CheckboxFacadeTheme,
33
28
  OtherHTMLAttributes,
34
- PropValidators,
35
29
  ToggleFacadeTheme
36
30
  } from '@instructure/shared-types'
37
31
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
@@ -104,31 +98,6 @@ type CheckboxStyle = ComponentStyle<
104
98
  | 'indentedError'
105
99
  | 'indentedToggleError'
106
100
  >
107
-
108
- const propTypes: PropValidators<PropKeys> = {
109
- label: PropTypes.node.isRequired,
110
- id: PropTypes.string,
111
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
112
- messages: PropTypes.arrayOf(FormPropTypes.message),
113
- defaultChecked: PropTypes.bool,
114
- checked: controllable(PropTypes.bool, 'onChange', 'defaultChecked'),
115
- onChange: PropTypes.func,
116
- onKeyDown: PropTypes.func,
117
- onFocus: PropTypes.func,
118
- onBlur: PropTypes.func,
119
- onMouseOver: PropTypes.func,
120
- onMouseOut: PropTypes.func,
121
- disabled: PropTypes.bool,
122
- readOnly: PropTypes.bool,
123
- indeterminate: PropTypes.bool,
124
- size: PropTypes.oneOf(['small', 'medium', 'large']),
125
- variant: PropTypes.oneOf(['simple', 'toggle']),
126
- inline: PropTypes.bool,
127
- labelPlacement: PropTypes.oneOf(['top', 'start', 'end']),
128
- isRequired: PropTypes.bool,
129
- inputRef: PropTypes.func
130
- }
131
-
132
101
  const allowedProps: AllowedPropKeys = [
133
102
  'label',
134
103
  'id',
@@ -160,4 +129,4 @@ type CheckboxState = {
160
129
  }
161
130
 
162
131
  export type { CheckboxProps, CheckboxStyle, CheckboxState }
163
- export { propTypes, allowedProps }
132
+ export { allowedProps }
@@ -32,11 +32,10 @@ import {
32
32
  omitProps,
33
33
  withDeterministicId
34
34
  } from '@instructure/ui-react-utils'
35
- import { testable } from '@instructure/ui-testable'
36
35
 
37
36
  import { Checkbox } from '../Checkbox'
38
37
 
39
- import { propTypes, allowedProps } from './props'
38
+ import { allowedProps } from './props'
40
39
  import type {
41
40
  CheckboxGroupProps,
42
41
  CheckboxGroupState,
@@ -50,11 +49,9 @@ category: components
50
49
  **/
51
50
 
52
51
  @withDeterministicId()
53
- @testable()
54
52
  class CheckboxGroup extends Component<CheckboxGroupProps, CheckboxGroupState> {
55
53
  static readonly componentId = 'CheckboxGroup'
56
54
 
57
- static propTypes = propTypes
58
55
  static allowedProps = allowedProps
59
56
  static defaultProps = {
60
57
  disabled: false,
@@ -148,6 +145,7 @@ class CheckboxGroup extends Component<CheckboxGroupProps, CheckboxGroupState> {
148
145
  vAlign="top"
149
146
  messagesId={this._messagesId}
150
147
  elementRef={this.handleRef}
148
+ data-cid="CheckboxGroup"
151
149
  >
152
150
  {this.renderChildren()}
153
151
  </FormFieldGroup>
@@ -23,19 +23,8 @@
23
23
  */
24
24
 
25
25
  import { type InputHTMLAttributes } from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
- import { FormPropTypes } from '@instructure/ui-form-field'
29
- import {
30
- controllable,
31
- Children as ChildrenPropTypes
32
- } from '@instructure/ui-prop-types'
33
-
34
26
  import type { FormMessage } from '@instructure/ui-form-field'
35
- import type {
36
- OtherHTMLAttributes,
37
- PropValidators
38
- } from '@instructure/shared-types'
27
+ import type { OtherHTMLAttributes } from '@instructure/shared-types'
39
28
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
40
29
 
41
30
  import { Checkbox } from '../Checkbox'
@@ -67,39 +56,6 @@ type CheckboxGroupProps = CheckboxGroupOwnProps &
67
56
  InputHTMLAttributes<CheckboxGroupOwnProps & Element>
68
57
  > &
69
58
  WithDeterministicIdProps
70
-
71
- const propTypes: PropValidators<PropKeys> = {
72
- name: PropTypes.string.isRequired,
73
- description: PropTypes.node.isRequired,
74
- /**
75
- * value to set on initial render
76
- */
77
- defaultValue: PropTypes.array,
78
- /**
79
- * the selected values (must be accompanied by an `onChange` prop)
80
- */
81
- value: controllable(PropTypes.array),
82
- /**
83
- * when used with the `value` prop, the component will not control its own state
84
- */
85
- onChange: PropTypes.func,
86
- disabled: PropTypes.bool,
87
- readOnly: PropTypes.bool,
88
- /**
89
- * object with shape: `{
90
- text: PropTypes.node,
91
- type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
92
- }`
93
- */
94
- messages: PropTypes.arrayOf(FormPropTypes.message),
95
- /**
96
- * children of type `Checkbox`
97
- */
98
- children: ChildrenPropTypes.oneOf([Checkbox]),
99
- size: PropTypes.oneOf(['small', 'medium', 'large']),
100
- layout: PropTypes.oneOf(['stacked', 'columns', 'inline'])
101
- }
102
-
103
59
  const allowedProps: AllowedPropKeys = [
104
60
  'name',
105
61
  'description',
@@ -118,4 +74,4 @@ type CheckboxGroupState = {
118
74
  value: (string | number)[]
119
75
  }
120
76
  export type { CheckboxGroupProps, CheckboxGroupState, CheckboxChild }
121
- export { propTypes, allowedProps }
77
+ export { allowedProps }
@@ -13,10 +13,8 @@
13
13
  { "path": "../ui-dom-utils/tsconfig.build.json" },
14
14
  { "path": "../ui-form-field/tsconfig.build.json" },
15
15
  { "path": "../ui-icons/tsconfig.build.json" },
16
- { "path": "../ui-prop-types/tsconfig.build.json" },
17
16
  { "path": "../ui-react-utils/tsconfig.build.json" },
18
17
  { "path": "../ui-svg-images/tsconfig.build.json" },
19
- { "path": "../ui-testable/tsconfig.build.json" },
20
18
  { "path": "../ui-utils/tsconfig.build.json" },
21
19
  { "path": "../ui-view/tsconfig.build.json" },
22
20
  { "path": "../uid/tsconfig.build.json" },