@instructure/ui-toggle-details 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.
@@ -23,13 +23,9 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
- import { controllable } from '@instructure/ui-prop-types'
29
26
 
30
27
  import type {
31
28
  OtherHTMLAttributes,
32
- PropValidators,
33
29
  ToggleDetailsTheme
34
30
  } from '@instructure/shared-types'
35
31
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
@@ -100,21 +96,6 @@ type ToggleDetailsStyle = ComponentStyle<
100
96
  type ToggleDetailsStyleProps = {
101
97
  animate: boolean
102
98
  }
103
-
104
- const propTypes: PropValidators<PropKeys> = {
105
- variant: PropTypes.oneOf(['default', 'filled']),
106
- summary: PropTypes.node.isRequired,
107
- expanded: controllable(PropTypes.bool, 'onToggle', 'defaultExpanded'),
108
- defaultExpanded: PropTypes.bool,
109
- onToggle: PropTypes.func,
110
- icon: PropTypes.func,
111
- iconExpanded: PropTypes.func,
112
- iconPosition: PropTypes.oneOf(['start', 'end']),
113
- fluidWidth: PropTypes.bool,
114
- children: PropTypes.node,
115
- size: PropTypes.oneOf(['small', 'medium', 'large'])
116
- }
117
-
118
99
  const allowedProps: AllowedPropKeys = [
119
100
  'variant',
120
101
  'summary',
@@ -130,4 +111,4 @@ const allowedProps: AllowedPropKeys = [
130
111
  ]
131
112
 
132
113
  export type { ToggleDetailsProps, ToggleDetailsStyleProps, ToggleDetailsStyle }
133
- export { propTypes, allowedProps }
114
+ export { allowedProps }
@@ -41,9 +41,8 @@ import {
41
41
  IconArrowOpenEndSolid,
42
42
  IconArrowOpenDownSolid
43
43
  } from '@instructure/ui-icons'
44
- import { testable } from '@instructure/ui-testable'
45
44
  import type { ToggleGroupProps } from './props'
46
- import { allowedProps, propTypes } from './props'
45
+ import { allowedProps } from './props'
47
46
 
48
47
  import { withStyle } from '@instructure/emotion'
49
48
 
@@ -56,12 +55,10 @@ category: components
56
55
  ---
57
56
  **/
58
57
  @withStyle(generateStyle, generateComponentTheme)
59
- @testable()
60
58
  class ToggleGroup extends Component<ToggleGroupProps> {
61
59
  static readonly componentId = 'ToggleGroup'
62
60
 
63
61
  static allowedProps = allowedProps
64
- static propTypes = propTypes
65
62
 
66
63
  static defaultProps = {
67
64
  size: 'medium',
@@ -175,6 +172,7 @@ class ToggleGroup extends Component<ToggleGroupProps> {
175
172
  borderRadius="medium"
176
173
  background="primary"
177
174
  borderColor={styles?.borderColor}
175
+ data-cid="ToggleGroup"
178
176
  >
179
177
  <Flex
180
178
  padding={
@@ -23,14 +23,10 @@
23
23
  */
24
24
 
25
25
  import React from 'react'
26
- import PropTypes from 'prop-types'
27
-
28
- import { controllable } from '@instructure/ui-prop-types'
29
26
 
30
27
  import {
31
28
  AsElementType,
32
29
  OtherHTMLAttributes,
33
- PropValidators,
34
30
  Renderable,
35
31
  ToggleGroupTheme
36
32
  } from '@instructure/shared-types'
@@ -99,23 +95,6 @@ type ToggleGroupStyle = { borderColor: string }
99
95
  type ToggleGroupProps = ToggleGroupOwnProps &
100
96
  OtherHTMLAttributes<ToggleGroupOwnProps> &
101
97
  WithStyleProps<ToggleGroupTheme, ToggleGroupStyle>
102
-
103
- const propTypes: PropValidators<PropKeys> = {
104
- children: PropTypes.node.isRequired,
105
- summary: PropTypes.node.isRequired,
106
- toggleLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
107
- as: PropTypes.elementType,
108
- elementRef: PropTypes.func,
109
- size: PropTypes.oneOf(['small', 'medium', 'large']),
110
- expanded: controllable(PropTypes.bool, 'onToggle', 'defaultExpanded'),
111
- defaultExpanded: PropTypes.bool,
112
- onToggle: PropTypes.func,
113
- icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
114
- iconExpanded: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
115
- transition: PropTypes.bool,
116
- border: PropTypes.bool
117
- }
118
-
119
98
  const allowedProps: AllowedPropKeys = [
120
99
  'children',
121
100
  'summary',
@@ -133,4 +112,4 @@ const allowedProps: AllowedPropKeys = [
133
112
  ]
134
113
 
135
114
  export type { ToggleGroupProps, ToggleGroupStyle }
136
- export { propTypes, allowedProps }
115
+ export { allowedProps }
@@ -18,9 +18,7 @@
18
18
  { "path": "../ui-flex/tsconfig.build.json" },
19
19
  { "path": "../ui-icons/tsconfig.build.json" },
20
20
  { "path": "../ui-motion/tsconfig.build.json" },
21
- { "path": "../ui-prop-types/tsconfig.build.json" },
22
21
  { "path": "../ui-react-utils/tsconfig.build.json" },
23
- { "path": "../ui-testable/tsconfig.build.json" },
24
22
  { "path": "../ui-utils/tsconfig.build.json" },
25
23
  { "path": "../ui-view/tsconfig.build.json" },
26
24
  { "path": "../uid/tsconfig.build.json" }