@instructure/ui-toggle-details 8.8.1-snapshot.3 → 8.9.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.
- package/CHANGELOG.md +6 -0
- package/es/ToggleDetails/index.js +38 -72
- package/es/ToggleDetails/props.js +76 -0
- package/es/ToggleGroup/index.js +3 -67
- package/es/ToggleGroup/props.js +90 -0
- package/lib/ToggleDetails/index.js +38 -73
- package/lib/ToggleDetails/props.js +88 -0
- package/lib/ToggleGroup/index.js +3 -70
- package/lib/ToggleGroup/props.js +102 -0
- package/package.json +22 -23
- package/src/ToggleDetails/index.tsx +16 -64
- package/src/ToggleDetails/props.ts +112 -0
- package/src/ToggleDetails/styles.ts +1 -1
- package/src/ToggleGroup/index.tsx +6 -59
- package/src/ToggleGroup/props.ts +124 -0
- package/src/index.ts +2 -2
- package/types/ToggleDetails/index.d.ts +27 -45
- package/types/ToggleDetails/index.d.ts.map +1 -1
- package/types/ToggleDetails/props.d.ts +27 -0
- package/types/ToggleDetails/props.d.ts.map +1 -0
- package/types/ToggleDetails/styles.d.ts +1 -1
- package/types/ToggleGroup/index.d.ts +41 -65
- package/types/ToggleGroup/index.d.ts.map +1 -1
- package/types/ToggleGroup/props.d.ts +25 -0
- package/types/ToggleGroup/props.d.ts.map +1 -0
- package/types/index.d.ts +2 -2
- package/LICENSE.md +0 -27
- package/es/ToggleDetails/types.js +0 -1
- package/es/ToggleGroup/types.js +0 -1
- package/lib/ToggleDetails/types.js +0 -1
- package/lib/ToggleGroup/types.js +0 -1
- package/src/ToggleDetails/types.ts +0 -42
- package/src/ToggleGroup/types.ts +0 -41
- package/types/ToggleDetails/types.d.ts +0 -19
- package/types/ToggleDetails/types.d.ts.map +0 -1
- package/types/ToggleGroup/types.d.ts +0 -17
- package/types/ToggleGroup/types.d.ts.map +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import { controllable } from '@instructure/ui-prop-types'
|
|
29
|
+
|
|
30
|
+
import { AsElementType, PropValidators } from '@instructure/shared-types'
|
|
31
|
+
|
|
32
|
+
type ToggleGroupOwnProps = {
|
|
33
|
+
children: React.ReactNode
|
|
34
|
+
summary: React.ReactNode
|
|
35
|
+
toggleLabel: React.ReactNode | ((...args: any[]) => any)
|
|
36
|
+
as?: AsElementType
|
|
37
|
+
elementRef?: (...args: any[]) => any
|
|
38
|
+
size?: 'small' | 'medium' | 'large'
|
|
39
|
+
expanded?: any // TODO: controllable(PropTypes.bool, 'onToggle', 'defaultExpanded')
|
|
40
|
+
defaultExpanded?: boolean
|
|
41
|
+
onToggle?: (...args: any[]) => any
|
|
42
|
+
icon?: React.ReactNode | ((...args: any[]) => any)
|
|
43
|
+
iconExpanded?: React.ReactNode | ((...args: any[]) => any)
|
|
44
|
+
transition?: boolean
|
|
45
|
+
border?: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type PropKeys = keyof ToggleGroupOwnProps
|
|
49
|
+
|
|
50
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
51
|
+
|
|
52
|
+
type ToggleGroupProps = ToggleGroupOwnProps
|
|
53
|
+
|
|
54
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
55
|
+
/**
|
|
56
|
+
* the content to show and hide
|
|
57
|
+
*/
|
|
58
|
+
children: PropTypes.node.isRequired,
|
|
59
|
+
/**
|
|
60
|
+
* the content area next to the toggle button
|
|
61
|
+
*/
|
|
62
|
+
summary: PropTypes.node.isRequired,
|
|
63
|
+
/**
|
|
64
|
+
* provides a screenreader label for the toggle button
|
|
65
|
+
* (takes `expanded` as an argument if a function)
|
|
66
|
+
*/
|
|
67
|
+
toggleLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
68
|
+
/**
|
|
69
|
+
* the element type to render as
|
|
70
|
+
*/
|
|
71
|
+
as: PropTypes.elementType,
|
|
72
|
+
/**
|
|
73
|
+
* provides a reference to the underlying html root element
|
|
74
|
+
*/
|
|
75
|
+
elementRef: PropTypes.func,
|
|
76
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
77
|
+
/**
|
|
78
|
+
* Whether the content is expanded or hidden
|
|
79
|
+
*/
|
|
80
|
+
expanded: controllable(PropTypes.bool, 'onToggle', 'defaultExpanded'),
|
|
81
|
+
/**
|
|
82
|
+
* Whether the content is initially expanded or hidden (uncontrolled)
|
|
83
|
+
*/
|
|
84
|
+
defaultExpanded: PropTypes.bool,
|
|
85
|
+
/**
|
|
86
|
+
* Fired when the content display is toggled
|
|
87
|
+
*/
|
|
88
|
+
onToggle: PropTypes.func,
|
|
89
|
+
/**
|
|
90
|
+
* The icon displayed in the toggle button when the content is hidden
|
|
91
|
+
*/
|
|
92
|
+
icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
93
|
+
/**
|
|
94
|
+
* The icon displayed in the toggle button when the content is showing
|
|
95
|
+
*/
|
|
96
|
+
iconExpanded: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
97
|
+
/**
|
|
98
|
+
* Transition content into view
|
|
99
|
+
*/
|
|
100
|
+
transition: PropTypes.bool,
|
|
101
|
+
/**
|
|
102
|
+
* Toggle the border around the component
|
|
103
|
+
*/
|
|
104
|
+
border: PropTypes.bool
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const allowedProps: AllowedPropKeys = [
|
|
108
|
+
'children',
|
|
109
|
+
'summary',
|
|
110
|
+
'toggleLabel',
|
|
111
|
+
'as',
|
|
112
|
+
'elementRef',
|
|
113
|
+
'size',
|
|
114
|
+
'expanded',
|
|
115
|
+
'defaultExpanded',
|
|
116
|
+
'onToggle',
|
|
117
|
+
'icon',
|
|
118
|
+
'iconExpanded',
|
|
119
|
+
'transition',
|
|
120
|
+
'border'
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
export type { ToggleGroupProps }
|
|
124
|
+
export { propTypes, allowedProps }
|
package/src/index.ts
CHANGED
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
export { ToggleDetails } from './ToggleDetails'
|
|
26
26
|
export { ToggleGroup } from './ToggleGroup'
|
|
27
27
|
|
|
28
|
-
export type { ToggleDetailsProps } from './ToggleDetails/
|
|
29
|
-
export type { ToggleGroupProps } from './ToggleGroup/
|
|
28
|
+
export type { ToggleDetailsProps } from './ToggleDetails/props'
|
|
29
|
+
export type { ToggleGroupProps } from './ToggleGroup/props'
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
|
|
5
4
|
import { jsx } from '@instructure/emotion';
|
|
6
|
-
import { ToggleDetailsProps } from './
|
|
5
|
+
import type { ToggleDetailsProps } from './props';
|
|
7
6
|
/**
|
|
8
7
|
---
|
|
9
8
|
category: components
|
|
@@ -11,48 +10,32 @@ category: components
|
|
|
11
10
|
**/
|
|
12
11
|
declare class ToggleDetails extends Component<ToggleDetailsProps> {
|
|
13
12
|
static readonly componentId = "ToggleDetails";
|
|
14
|
-
static
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* Icon position at the start or end of the summary text
|
|
41
|
-
*/
|
|
42
|
-
iconPosition: PropTypes.Requireable<string>;
|
|
43
|
-
/**
|
|
44
|
-
* should the summary fill the width of its container
|
|
45
|
-
*/
|
|
46
|
-
fluidWidth: PropTypes.Requireable<boolean>;
|
|
47
|
-
/**
|
|
48
|
-
* The toggleable content passed inside the ToggleDetails component
|
|
49
|
-
*/
|
|
50
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
51
|
-
/**
|
|
52
|
-
* Choose a size for the expand/collapse icon
|
|
53
|
-
*/
|
|
54
|
-
size: PropTypes.Requireable<string>;
|
|
55
|
-
};
|
|
13
|
+
static allowedProps: readonly (keyof {
|
|
14
|
+
variant?: "default" | "filled" | undefined;
|
|
15
|
+
summary: import("react").ReactNode;
|
|
16
|
+
expanded?: any;
|
|
17
|
+
defaultExpanded?: boolean | undefined;
|
|
18
|
+
onToggle?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
icon?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
iconExpanded?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
iconPosition?: "start" | "end" | undefined;
|
|
22
|
+
fluidWidth?: boolean | undefined;
|
|
23
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
24
|
+
children?: import("react").ReactNode;
|
|
25
|
+
})[];
|
|
26
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
27
|
+
variant?: "default" | "filled" | undefined;
|
|
28
|
+
summary: import("react").ReactNode;
|
|
29
|
+
expanded?: any;
|
|
30
|
+
defaultExpanded?: boolean | undefined;
|
|
31
|
+
onToggle?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
icon?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
iconExpanded?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
iconPosition?: "start" | "end" | undefined;
|
|
35
|
+
fluidWidth?: boolean | undefined;
|
|
36
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
37
|
+
children?: import("react").ReactNode;
|
|
38
|
+
}>;
|
|
56
39
|
static defaultProps: {
|
|
57
40
|
variant: string;
|
|
58
41
|
size: string;
|
|
@@ -63,7 +46,6 @@ declare class ToggleDetails extends Component<ToggleDetailsProps> {
|
|
|
63
46
|
defaultExpanded: boolean;
|
|
64
47
|
onToggle: (event: any, expanded: any) => void;
|
|
65
48
|
children: null;
|
|
66
|
-
expanded: undefined;
|
|
67
49
|
};
|
|
68
50
|
get focused(): boolean;
|
|
69
51
|
focus(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,kBAAkB,EAA2B,MAAM,SAAS,CAAA;AAG1E;;;;GAIG;AACH,cAEM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACvD,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAC7C,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;MAWlB;IAED,IAAI,OAAO,YAGV;IAED,KAAK;IAKL,iBAAiB;IAIjB,kBAAkB;IAKlB,YAAY,mBAA8B;IAG1C,aAAa,CAAC,QAAQ,KAAA;IAatB,YAAY,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA;IA4ClC,UAAU,CAAC,QAAQ,KAAA;IAYnB,aAAa,CAAC,QAAQ,KAAA,EAAE,YAAY,KAAA;IAUpC,aAAa;IAKb,YAAY,sCAIX;IAED,MAAM;CAiBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropValidators } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
declare type ToggleDetailsOwnProps = {
|
|
5
|
+
variant?: 'default' | 'filled';
|
|
6
|
+
summary: React.ReactNode;
|
|
7
|
+
expanded?: any;
|
|
8
|
+
defaultExpanded?: boolean;
|
|
9
|
+
onToggle?: (...args: any[]) => any;
|
|
10
|
+
icon?: (...args: any[]) => any;
|
|
11
|
+
iconExpanded?: (...args: any[]) => any;
|
|
12
|
+
iconPosition?: 'start' | 'end';
|
|
13
|
+
fluidWidth?: boolean;
|
|
14
|
+
size?: 'small' | 'medium' | 'large';
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare type PropKeys = keyof ToggleDetailsOwnProps;
|
|
18
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
19
|
+
declare type ToggleDetailsProps = ToggleDetailsOwnProps & WithStyleProps;
|
|
20
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
21
|
+
declare const allowedProps: AllowedPropKeys;
|
|
22
|
+
export type { ToggleDetailsProps };
|
|
23
|
+
export { propTypes, allowedProps };
|
|
24
|
+
export declare type ToggleDetailsStyleProps = {
|
|
25
|
+
animate: boolean;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ToggleDetails/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACtC,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,qBAAqB,CAAA;AAE3C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,kBAAkB,GAAG,qBAAqB,GAAG,cAAc,CAAA;AAEhE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAuCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAYnB,CAAA;AAED,YAAY,EAAE,kBAAkB,EAAE,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA;AAElC,oBAAY,uBAAuB,GAAG;IACpC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { Component } from 'react';
|
|
3
2
|
import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
|
|
4
|
-
import { ToggleGroupProps } from './
|
|
3
|
+
import type { ToggleGroupProps } from './props';
|
|
5
4
|
/**
|
|
6
5
|
---
|
|
7
6
|
category: components
|
|
@@ -9,69 +8,46 @@ category: components
|
|
|
9
8
|
**/
|
|
10
9
|
declare class ToggleGroup extends Component<ToggleGroupProps> {
|
|
11
10
|
static readonly componentId = "ToggleGroup";
|
|
12
|
-
static
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
defaultExpanded: PropTypes.Requireable<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* Fired when the content display is toggled
|
|
45
|
-
*/
|
|
46
|
-
onToggle: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
/**
|
|
48
|
-
* The icon displayed in the toggle button when the content is hidden
|
|
49
|
-
*/
|
|
50
|
-
icon: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
51
|
-
/**
|
|
52
|
-
* The icon displayed in the toggle button when the content is showing
|
|
53
|
-
*/
|
|
54
|
-
iconExpanded: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
55
|
-
/**
|
|
56
|
-
* Transition content into view
|
|
57
|
-
*/
|
|
58
|
-
transition: PropTypes.Requireable<boolean>;
|
|
59
|
-
/**
|
|
60
|
-
* Toggle the border around the component
|
|
61
|
-
*/
|
|
62
|
-
border: PropTypes.Requireable<boolean>;
|
|
63
|
-
};
|
|
11
|
+
static allowedProps: readonly (keyof {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
summary: React.ReactNode;
|
|
14
|
+
toggleLabel: React.ReactNode | ((...args: any[]) => any);
|
|
15
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
16
|
+
elementRef?: ((...args: any[]) => any) | undefined;
|
|
17
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
18
|
+
expanded?: any;
|
|
19
|
+
defaultExpanded?: boolean | undefined;
|
|
20
|
+
onToggle?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
icon?: React.ReactNode | ((...args: any[]) => any);
|
|
22
|
+
iconExpanded?: React.ReactNode | ((...args: any[]) => any);
|
|
23
|
+
transition?: boolean | undefined;
|
|
24
|
+
border?: boolean | undefined;
|
|
25
|
+
})[];
|
|
26
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
summary: React.ReactNode;
|
|
29
|
+
toggleLabel: React.ReactNode | ((...args: any[]) => any);
|
|
30
|
+
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
31
|
+
elementRef?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
33
|
+
expanded?: any;
|
|
34
|
+
defaultExpanded?: boolean | undefined;
|
|
35
|
+
onToggle?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
icon?: React.ReactNode | ((...args: any[]) => any);
|
|
37
|
+
iconExpanded?: React.ReactNode | ((...args: any[]) => any);
|
|
38
|
+
transition?: boolean | undefined;
|
|
39
|
+
border?: boolean | undefined;
|
|
40
|
+
}>;
|
|
64
41
|
static defaultProps: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
border: boolean;
|
|
42
|
+
readonly size: "medium";
|
|
43
|
+
readonly icon: typeof IconArrowOpenEndSolid;
|
|
44
|
+
readonly iconExpanded: typeof IconArrowOpenDownSolid;
|
|
45
|
+
readonly defaultExpanded: false;
|
|
46
|
+
readonly onToggle: (event: any, expanded: any) => void;
|
|
47
|
+
readonly transition: true;
|
|
48
|
+
readonly as: "span";
|
|
49
|
+
readonly elementRef: (el: any) => void;
|
|
50
|
+
readonly border: true;
|
|
75
51
|
};
|
|
76
52
|
_button: null;
|
|
77
53
|
_shouldTransition: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/index.tsx"],"names":[],"mappings":"AAwBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAaxC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;MAYT;IAEV,OAAO,OAAO;IACd,iBAAiB,UAAQ;IAEzB,IAAI,OAAO,YAEV;IAED,KAAK;IAKL,iBAAiB;IAKjB,UAAU,CAAC,QAAQ,KAAA;IAOnB,YAAY,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA;IAyBlC,aAAa,CAAC,YAAY,KAAA;IAkB1B,MAAM;CAyCP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AsElementType, PropValidators } from '@instructure/shared-types';
|
|
3
|
+
declare type ToggleGroupOwnProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
summary: React.ReactNode;
|
|
6
|
+
toggleLabel: React.ReactNode | ((...args: any[]) => any);
|
|
7
|
+
as?: AsElementType;
|
|
8
|
+
elementRef?: (...args: any[]) => any;
|
|
9
|
+
size?: 'small' | 'medium' | 'large';
|
|
10
|
+
expanded?: any;
|
|
11
|
+
defaultExpanded?: boolean;
|
|
12
|
+
onToggle?: (...args: any[]) => any;
|
|
13
|
+
icon?: React.ReactNode | ((...args: any[]) => any);
|
|
14
|
+
iconExpanded?: React.ReactNode | ((...args: any[]) => any);
|
|
15
|
+
transition?: boolean;
|
|
16
|
+
border?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare type PropKeys = keyof ToggleGroupOwnProps;
|
|
19
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
20
|
+
declare type ToggleGroupProps = ToggleGroupOwnProps;
|
|
21
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
22
|
+
declare const allowedProps: AllowedPropKeys;
|
|
23
|
+
export type { ToggleGroupProps };
|
|
24
|
+
export { propTypes, allowedProps };
|
|
25
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/ToggleGroup/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAEzE,aAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAClD,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,gBAAgB,GAAG,mBAAmB,CAAA;AAE3C,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAmDvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAcnB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ToggleDetails } from './ToggleDetails';
|
|
2
2
|
export { ToggleGroup } from './ToggleGroup';
|
|
3
|
-
export type { ToggleDetailsProps } from './ToggleDetails/
|
|
4
|
-
export type { ToggleGroupProps } from './ToggleGroup/
|
|
3
|
+
export type { ToggleDetailsProps } from './ToggleDetails/props';
|
|
4
|
+
export type { ToggleGroupProps } from './ToggleGroup/props';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|