@ohos-ports/instructure-ui-toggle-details 11.7.5-beta.1
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 +1323 -0
- package/LICENSE.md +28 -0
- package/README.md +42 -0
- package/es/ToggleDetails/v1/index.js +177 -0
- package/es/ToggleDetails/v1/props.js +26 -0
- package/es/ToggleDetails/v1/styles.js +196 -0
- package/es/ToggleDetails/v1/theme.js +75 -0
- package/es/ToggleDetails/v2/index.js +181 -0
- package/es/ToggleDetails/v2/props.js +26 -0
- package/es/ToggleDetails/v2/styles.js +188 -0
- package/es/ToggleGroup/v1/index.js +172 -0
- package/es/ToggleGroup/v1/props.js +26 -0
- package/es/ToggleGroup/v1/styles.js +40 -0
- package/es/ToggleGroup/v1/theme.js +41 -0
- package/es/ToggleGroup/v2/index.js +178 -0
- package/es/ToggleGroup/v2/props.js +26 -0
- package/es/ToggleGroup/v2/styles.js +40 -0
- package/es/exports/a.js +26 -0
- package/es/exports/b.js +26 -0
- package/lib/ToggleDetails/v1/index.js +184 -0
- package/lib/ToggleDetails/v1/props.js +31 -0
- package/lib/ToggleDetails/v1/styles.js +202 -0
- package/lib/ToggleDetails/v1/theme.js +81 -0
- package/lib/ToggleDetails/v2/index.js +187 -0
- package/lib/ToggleDetails/v2/props.js +31 -0
- package/lib/ToggleDetails/v2/styles.js +194 -0
- package/lib/ToggleGroup/v1/index.js +180 -0
- package/lib/ToggleGroup/v1/props.js +31 -0
- package/lib/ToggleGroup/v1/styles.js +46 -0
- package/lib/ToggleGroup/v1/theme.js +47 -0
- package/lib/ToggleGroup/v2/index.js +185 -0
- package/lib/ToggleGroup/v2/props.js +31 -0
- package/lib/ToggleGroup/v2/styles.js +46 -0
- package/lib/exports/a.js +19 -0
- package/lib/exports/b.js +19 -0
- package/lib/package.json +1 -0
- package/package.json +94 -0
- package/src/ToggleDetails/v1/README.md +233 -0
- package/src/ToggleDetails/v1/index.tsx +204 -0
- package/src/ToggleDetails/v1/props.ts +114 -0
- package/src/ToggleDetails/v1/styles.ts +190 -0
- package/src/ToggleDetails/v1/theme.ts +80 -0
- package/src/ToggleDetails/v2/README.md +233 -0
- package/src/ToggleDetails/v2/index.tsx +206 -0
- package/src/ToggleDetails/v2/props.ts +115 -0
- package/src/ToggleDetails/v2/styles.ts +188 -0
- package/src/ToggleGroup/v1/README.md +93 -0
- package/src/ToggleGroup/v1/index.tsx +206 -0
- package/src/ToggleGroup/v1/props.ts +115 -0
- package/src/ToggleGroup/v1/styles.ts +47 -0
- package/src/ToggleGroup/v1/theme.ts +43 -0
- package/src/ToggleGroup/v2/README.md +93 -0
- package/src/ToggleGroup/v2/index.tsx +214 -0
- package/src/ToggleGroup/v2/props.ts +115 -0
- package/src/ToggleGroup/v2/styles.ts +47 -0
- package/src/exports/a.ts +29 -0
- package/src/exports/b.ts +29 -0
- package/tsconfig.build.json +26 -0
- package/tsconfig.json +4 -0
- package/types/ToggleDetails/v1/index.d.ts +56 -0
- package/types/ToggleDetails/v1/index.d.ts.map +1 -0
- package/types/ToggleDetails/v1/props.d.ts +55 -0
- package/types/ToggleDetails/v1/props.d.ts.map +1 -0
- package/types/ToggleDetails/v1/styles.d.ts +15 -0
- package/types/ToggleDetails/v1/styles.d.ts.map +1 -0
- package/types/ToggleDetails/v1/theme.d.ts +10 -0
- package/types/ToggleDetails/v1/theme.d.ts.map +1 -0
- package/types/ToggleDetails/v2/index.d.ts +55 -0
- package/types/ToggleDetails/v2/index.d.ts.map +1 -0
- package/types/ToggleDetails/v2/props.d.ts +56 -0
- package/types/ToggleDetails/v2/props.d.ts.map +1 -0
- package/types/ToggleDetails/v2/styles.d.ts +16 -0
- package/types/ToggleDetails/v2/styles.d.ts.map +1 -0
- package/types/ToggleGroup/v1/index.d.ts +55 -0
- package/types/ToggleGroup/v1/index.d.ts.map +1 -0
- package/types/ToggleGroup/v1/props.d.ts +65 -0
- package/types/ToggleGroup/v1/props.d.ts.map +1 -0
- package/types/ToggleGroup/v1/styles.d.ts +15 -0
- package/types/ToggleGroup/v1/styles.d.ts.map +1 -0
- package/types/ToggleGroup/v1/theme.d.ts +10 -0
- package/types/ToggleGroup/v1/theme.d.ts.map +1 -0
- package/types/ToggleGroup/v2/index.d.ts +54 -0
- package/types/ToggleGroup/v2/index.d.ts.map +1 -0
- package/types/ToggleGroup/v2/props.d.ts +66 -0
- package/types/ToggleGroup/v2/props.d.ts.map +1 -0
- package/types/ToggleGroup/v2/styles.d.ts +15 -0
- package/types/ToggleGroup/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +5 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +5 -0
- package/types/exports/b.d.ts.map +1 -0
package/src/exports/a.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export { ToggleDetails } from '../ToggleDetails/v1/index.js'
|
|
26
|
+
export { ToggleGroup } from '../ToggleGroup/v1/index.js'
|
|
27
|
+
|
|
28
|
+
export type { ToggleDetailsProps } from '../ToggleDetails/v1/props'
|
|
29
|
+
export type { ToggleGroupProps } from '../ToggleGroup/v1/props'
|
package/src/exports/b.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
export { ToggleDetails } from '../ToggleDetails/v2/index.js'
|
|
26
|
+
export { ToggleGroup } from '../ToggleGroup/v2/index.js'
|
|
27
|
+
|
|
28
|
+
export type { ToggleDetailsProps } from '../ToggleDetails/v2/props'
|
|
29
|
+
export type { ToggleGroupProps } from '../ToggleGroup/v2/props'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.build.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "./types",
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"composite": true
|
|
7
|
+
},
|
|
8
|
+
"include": ["src"],
|
|
9
|
+
"references": [
|
|
10
|
+
{ "path": "../ui-axe-check/tsconfig.build.json" },
|
|
11
|
+
{ "path": "../ui-babel-preset/tsconfig.build.json" },
|
|
12
|
+
{ "path": "../ui-themes/tsconfig.build.json" },
|
|
13
|
+
{ "path": "../emotion/tsconfig.build.json" },
|
|
14
|
+
{ "path": "../shared-types/tsconfig.build.json" },
|
|
15
|
+
{ "path": "../ui-buttons/tsconfig.build.json" },
|
|
16
|
+
{ "path": "../ui-dom-utils/tsconfig.build.json" },
|
|
17
|
+
{ "path": "../ui-expandable/tsconfig.build.json" },
|
|
18
|
+
{ "path": "../ui-flex/tsconfig.build.json" },
|
|
19
|
+
{ "path": "../ui-icons/tsconfig.build.json" },
|
|
20
|
+
{ "path": "../ui-motion/tsconfig.build.json" },
|
|
21
|
+
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
22
|
+
{ "path": "../ui-utils/tsconfig.build.json" },
|
|
23
|
+
{ "path": "../ui-view/tsconfig.build.json" },
|
|
24
|
+
{ "path": "../uid/tsconfig.build.json" }
|
|
25
|
+
]
|
|
26
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
|
|
3
|
+
import type { ToggleDetailsProps } from './props';
|
|
4
|
+
import type { ExpandableToggleProps } from '@instructure/ui-expandable';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/v11_6';
|
|
6
|
+
/**
|
|
7
|
+
---
|
|
8
|
+
category: components
|
|
9
|
+
---
|
|
10
|
+
**/
|
|
11
|
+
declare class ToggleDetails extends Component<ToggleDetailsProps> {
|
|
12
|
+
static displayName: string;
|
|
13
|
+
static readonly componentId = "ToggleDetails";
|
|
14
|
+
static allowedProps: readonly (keyof {
|
|
15
|
+
variant?: "default" | "filled";
|
|
16
|
+
summary: React.ReactNode;
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
onToggle?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
20
|
+
icon?: (...args: any[]) => React.ReactElement;
|
|
21
|
+
iconExpanded?: (...args: any[]) => React.ReactElement;
|
|
22
|
+
iconPosition?: "start" | "end";
|
|
23
|
+
fluidWidth?: boolean;
|
|
24
|
+
size?: "small" | "medium" | "large";
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
})[];
|
|
27
|
+
static defaultProps: {
|
|
28
|
+
variant: string;
|
|
29
|
+
size: string;
|
|
30
|
+
fluidWidth: boolean;
|
|
31
|
+
icon: typeof IconArrowOpenEndSolid;
|
|
32
|
+
iconExpanded: typeof IconArrowOpenDownSolid;
|
|
33
|
+
iconPosition: string;
|
|
34
|
+
defaultExpanded: boolean;
|
|
35
|
+
children: null;
|
|
36
|
+
};
|
|
37
|
+
_buttonNode: HTMLElement | null;
|
|
38
|
+
ref: import("react").RefObject<HTMLDivElement>;
|
|
39
|
+
setButtonRef: (node: Element | null) => void;
|
|
40
|
+
get focused(): boolean;
|
|
41
|
+
focus(): void;
|
|
42
|
+
componentDidMount(): void;
|
|
43
|
+
componentDidUpdate(): void;
|
|
44
|
+
renderSummary(expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
46
|
+
renderIcon(expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
47
|
+
renderDetails(expanded: boolean, detailsProps: {
|
|
48
|
+
id: string;
|
|
49
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
50
|
+
renderContent(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
handleToggle: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
52
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
53
|
+
}
|
|
54
|
+
export default ToggleDetails;
|
|
55
|
+
export { ToggleDetails };
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAE5C,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D;;;;GAIG;AACH,cACM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACvD,MAAM,CAAC,WAAW,SAAkB;IACpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAC7C,MAAM,CAAC,YAAY;;;;;;gBAFT,GAAG;wBAIV,GAAG;;;;;SAF4B;IAElC,MAAM,CAAC,YAAY;;;;;;;;;MASlB;IAED,WAAW,EAAE,WAAW,GAAG,IAAI,CAAO;IACtC,GAAG,4CAA8B;IAGjC,YAAY,GAAI,MAAM,OAAO,GAAG,IAAI,UAEnC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,kBAAkB;IAIlB,aAAa,CAAC,QAAQ,EAAE,OAAO;IAY/B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IA4CnB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAU5B,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAU7D,aAAa;IAIb,YAAY,GACV,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EACnE,UAAU,OAAO,UAKlB;IAED,MAAM;CAqBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OtherHTMLAttributes, ToggleDetailsTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
|
+
import type { ViewProps } from '@instructure/ui-view/v11_6';
|
|
5
|
+
type ToggleDetailsOwnProps = {
|
|
6
|
+
variant?: 'default' | 'filled';
|
|
7
|
+
/**
|
|
8
|
+
* The summary that displays and can be interacted with
|
|
9
|
+
*/
|
|
10
|
+
summary: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the content is expanded or hidden
|
|
13
|
+
*/
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the content is initially expanded or hidden (uncontrolled)
|
|
17
|
+
*/
|
|
18
|
+
defaultExpanded?: boolean;
|
|
19
|
+
onToggle?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The icon to display next to the summary text when content is hidden
|
|
22
|
+
*/
|
|
23
|
+
icon?: (...args: any[]) => React.ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* The icon to display when content is expanded
|
|
26
|
+
*/
|
|
27
|
+
iconExpanded?: (...args: any[]) => React.ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Icon position at the start or end of the summary text
|
|
30
|
+
*/
|
|
31
|
+
iconPosition?: 'start' | 'end';
|
|
32
|
+
/**
|
|
33
|
+
* should the summary fill the width of its container
|
|
34
|
+
*/
|
|
35
|
+
fluidWidth?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Choose a size for the expand/collapse icon
|
|
38
|
+
*/
|
|
39
|
+
size?: 'small' | 'medium' | 'large';
|
|
40
|
+
/**
|
|
41
|
+
* The toggleable content passed inside the ToggleDetails component
|
|
42
|
+
*/
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
type PropKeys = keyof ToggleDetailsOwnProps;
|
|
46
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
47
|
+
type ToggleDetailsProps = ToggleDetailsOwnProps & WithStyleProps<ToggleDetailsTheme, ToggleDetailsStyle> & OtherHTMLAttributes<ToggleDetailsOwnProps>;
|
|
48
|
+
type ToggleDetailsStyle = ComponentStyle<'toggleDetails' | 'summary' | 'summaryText' | 'toggle' | 'icon' | 'details' | 'content'>;
|
|
49
|
+
type ToggleDetailsStyleProps = {
|
|
50
|
+
animate: boolean;
|
|
51
|
+
};
|
|
52
|
+
declare const allowedProps: AllowedPropKeys;
|
|
53
|
+
export type { ToggleDetailsProps, ToggleDetailsStyleProps, ToggleDetailsStyle };
|
|
54
|
+
export { allowedProps };
|
|
55
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v1/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAE3D,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EACnE,QAAQ,EAAE,OAAO,KACd,IAAI,CAAA;IACT;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,YAAY,CAAA;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,YAAY,CAAA;IACrD;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,qBAAqB,CAAA;AAE3C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,kBAAkB,GAAG,qBAAqB,GAC7C,cAAc,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,GACtD,mBAAmB,CAAC,qBAAqB,CAAC,CAAA;AAE5C,KAAK,kBAAkB,GAAG,cAAc,CACpC,eAAe,GACf,SAAS,GACT,aAAa,GACb,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,CACZ,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,eAYnB,CAAA;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToggleDetailsTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { ToggleDetailsProps, ToggleDetailsStyleProps, ToggleDetailsStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
11
|
+
* @return {Object} The final style object, which will be used in the component
|
|
12
|
+
*/
|
|
13
|
+
declare const generateStyle: (componentTheme: ToggleDetailsTheme, props: ToggleDetailsProps, _state: ToggleDetailsStyleProps) => ToggleDetailsStyle;
|
|
14
|
+
export default generateStyle;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v1/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAOhB;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,kBAAkB,EAClC,OAAO,kBAAkB,EACzB,QAAQ,uBAAuB,KAC9B,kBAuIF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
|
+
import { ToggleDetailsTheme } from '@instructure/shared-types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
5
|
+
* @param {Object} theme The actual theme object.
|
|
6
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
7
|
+
*/
|
|
8
|
+
declare const generateComponentTheme: (theme: Theme) => ToggleDetailsTheme;
|
|
9
|
+
export default generateComponentTheme;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAsB,MAAM,wBAAwB,CAAA;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,KAAK,KAAG,kBA6C9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ToggleDetailsProps } from './props';
|
|
3
|
+
import type { ExpandableToggleProps } from '@instructure/ui-expandable/latest';
|
|
4
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
5
|
+
/**
|
|
6
|
+
---
|
|
7
|
+
category: components
|
|
8
|
+
---
|
|
9
|
+
**/
|
|
10
|
+
declare class ToggleDetails extends Component<ToggleDetailsProps> {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
static readonly componentId = "ToggleDetails";
|
|
13
|
+
static allowedProps: readonly (keyof {
|
|
14
|
+
variant?: "default" | "filled";
|
|
15
|
+
summary: React.ReactNode;
|
|
16
|
+
expanded?: boolean;
|
|
17
|
+
defaultExpanded?: boolean;
|
|
18
|
+
onToggle?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
19
|
+
icon?: (...args: any[]) => React.ReactElement;
|
|
20
|
+
iconExpanded?: (...args: any[]) => React.ReactElement;
|
|
21
|
+
iconPosition?: "start" | "end";
|
|
22
|
+
fluidWidth?: boolean;
|
|
23
|
+
size?: "small" | "medium" | "large";
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
})[];
|
|
26
|
+
static defaultProps: {
|
|
27
|
+
variant: string;
|
|
28
|
+
size: string;
|
|
29
|
+
fluidWidth: boolean;
|
|
30
|
+
icon: import("react").ComponentType<import("@instructure/ui-icons").InstUIIconProps>;
|
|
31
|
+
iconExpanded: import("react").ComponentType<import("@instructure/ui-icons").InstUIIconProps>;
|
|
32
|
+
iconPosition: string;
|
|
33
|
+
defaultExpanded: boolean;
|
|
34
|
+
children: null;
|
|
35
|
+
};
|
|
36
|
+
_buttonNode: HTMLElement | null;
|
|
37
|
+
ref: import("react").RefObject<HTMLDivElement>;
|
|
38
|
+
setButtonRef: (node: Element | null) => void;
|
|
39
|
+
get focused(): boolean;
|
|
40
|
+
focus(): void;
|
|
41
|
+
componentDidMount(): void;
|
|
42
|
+
componentDidUpdate(): void;
|
|
43
|
+
renderSummary(expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
44
|
+
renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
45
|
+
renderIcon(expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
46
|
+
renderDetails(expanded: boolean, detailsProps: {
|
|
47
|
+
id: string;
|
|
48
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
49
|
+
renderContent(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
handleToggle: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
51
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
52
|
+
}
|
|
53
|
+
export default ToggleDetails;
|
|
54
|
+
export { ToggleDetails };
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAY5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D;;;;GAIG;AACH,cACM,aAAc,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IACvD,MAAM,CAAC,WAAW,SAAkB;IACpC,MAAM,CAAC,QAAQ,CAAC,WAAW,mBAAkB;IAC7C,MAAM,CAAC,YAAY;;;;;;gBAAL,GAAG;wBAMf,GAAE;;;;;SAN8B;IAElC,MAAM,CAAC,YAAY;;;;;;;;;MASlB;IAED,WAAW,EAAE,WAAW,GAAG,IAAI,CAAO;IACtC,GAAG,4CAA8B;IAGjC,YAAY,GAAI,MAAM,OAAO,GAAG,IAAI,UAEnC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,kBAAkB;IAIlB,aAAa,CAAC,QAAQ,EAAE,OAAO;IAY/B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IA4CnB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAa5B,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAU7D,aAAa;IAIb,YAAY,GACV,OAAO,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EACnE,UAAU,OAAO,UAKlB;IAED,MAAM;CAqBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
|
+
import type { NewComponentTypes } from '@instructure/ui-themes';
|
|
5
|
+
import type { ViewProps } from '@instructure/ui-view/latest';
|
|
6
|
+
type ToggleDetailsOwnProps = {
|
|
7
|
+
variant?: 'default' | 'filled';
|
|
8
|
+
/**
|
|
9
|
+
* The summary that displays and can be interacted with
|
|
10
|
+
*/
|
|
11
|
+
summary: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the content is expanded or hidden
|
|
14
|
+
*/
|
|
15
|
+
expanded?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the content is initially expanded or hidden (uncontrolled)
|
|
18
|
+
*/
|
|
19
|
+
defaultExpanded?: boolean;
|
|
20
|
+
onToggle?: (event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>, expanded: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* The icon to display next to the summary text when content is hidden
|
|
23
|
+
*/
|
|
24
|
+
icon?: (...args: any[]) => React.ReactElement;
|
|
25
|
+
/**
|
|
26
|
+
* The icon to display when content is expanded
|
|
27
|
+
*/
|
|
28
|
+
iconExpanded?: (...args: any[]) => React.ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* Icon position at the start or end of the summary text
|
|
31
|
+
*/
|
|
32
|
+
iconPosition?: 'start' | 'end';
|
|
33
|
+
/**
|
|
34
|
+
* should the summary fill the width of its container
|
|
35
|
+
*/
|
|
36
|
+
fluidWidth?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Choose a size for the expand/collapse icon
|
|
39
|
+
*/
|
|
40
|
+
size?: 'small' | 'medium' | 'large';
|
|
41
|
+
/**
|
|
42
|
+
* The toggleable content passed inside the ToggleDetails component
|
|
43
|
+
*/
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
};
|
|
46
|
+
type PropKeys = keyof ToggleDetailsOwnProps;
|
|
47
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
48
|
+
type ToggleDetailsProps = ToggleDetailsOwnProps & WithStyleProps<ReturnType<NewComponentTypes['ToggleDetails']>, ToggleDetailsStyle> & OtherHTMLAttributes<ToggleDetailsOwnProps>;
|
|
49
|
+
type ToggleDetailsStyle = ComponentStyle<'toggleDetails' | 'summary' | 'summaryText' | 'toggle' | 'icon' | 'details' | 'content'>;
|
|
50
|
+
type ToggleDetailsStyleProps = {
|
|
51
|
+
animate: boolean;
|
|
52
|
+
};
|
|
53
|
+
declare const allowedProps: AllowedPropKeys;
|
|
54
|
+
export type { ToggleDetailsProps, ToggleDetailsStyleProps, ToggleDetailsStyle };
|
|
55
|
+
export { allowedProps };
|
|
56
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v2/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAE5D,KAAK,qBAAqB,GAAG;IAC3B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EACnE,QAAQ,EAAE,OAAO,KACd,IAAI,CAAA;IACT;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,YAAY,CAAA;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,YAAY,CAAA;IACrD;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,qBAAqB,CAAA;AAE3C,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,kBAAkB,GAAG,qBAAqB,GAC7C,cAAc,CACZ,UAAU,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,EAC9C,kBAAkB,CACnB,GACD,mBAAmB,CAAC,qBAAqB,CAAC,CAAA;AAE5C,KAAK,kBAAkB,GAAG,cAAc,CACpC,eAAe,GACf,SAAS,GACT,aAAa,GACb,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,CACZ,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AACD,QAAA,MAAM,YAAY,EAAE,eAYnB,CAAA;AAED,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes';
|
|
2
|
+
import type { ToggleDetailsProps, ToggleDetailsStyleProps, ToggleDetailsStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} sharedTokens the shared tokens of the component
|
|
11
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
12
|
+
* @return {Object} The final style object, which will be used in the component
|
|
13
|
+
*/
|
|
14
|
+
declare const generateStyle: (componentTheme: ReturnType<NewComponentTypes["ToggleDetails"]>, props: ToggleDetailsProps, sharedTokens: SharedTokens, _state: ToggleDetailsStyleProps) => ToggleDetailsStyle;
|
|
15
|
+
export default generateStyle;
|
|
16
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ToggleDetails/v2/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAOhB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,UAAU,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC,EAC9D,OAAO,kBAAkB,EACzB,cAAc,YAAY,EAC1B,QAAQ,uBAAuB,KAC9B,kBAmIF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ExpandableToggleProps } from '@instructure/ui-expandable';
|
|
3
|
+
import { IconArrowOpenEndSolid, IconArrowOpenDownSolid } from '@instructure/ui-icons';
|
|
4
|
+
import type { ToggleGroupProps } from './props';
|
|
5
|
+
/**
|
|
6
|
+
---
|
|
7
|
+
category: components
|
|
8
|
+
---
|
|
9
|
+
**/
|
|
10
|
+
declare class ToggleGroup extends Component<ToggleGroupProps> {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
static readonly componentId = "ToggleGroup";
|
|
13
|
+
static allowedProps: readonly (keyof {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
summary: React.ReactNode;
|
|
16
|
+
toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
|
|
17
|
+
as?: import("@instructure/shared-types").AsElementType;
|
|
18
|
+
elementRef?: (element: Element | null) => void;
|
|
19
|
+
size?: "small" | "medium" | "large";
|
|
20
|
+
expanded?: boolean;
|
|
21
|
+
defaultExpanded?: boolean;
|
|
22
|
+
onToggle?: (event: React.MouseEvent, expanded: boolean) => void;
|
|
23
|
+
icon?: import("@instructure/shared-types").Renderable;
|
|
24
|
+
iconExpanded?: import("@instructure/shared-types").Renderable;
|
|
25
|
+
transition?: boolean;
|
|
26
|
+
border?: boolean;
|
|
27
|
+
})[];
|
|
28
|
+
static defaultProps: {
|
|
29
|
+
readonly size: "medium";
|
|
30
|
+
readonly icon: typeof IconArrowOpenEndSolid;
|
|
31
|
+
readonly iconExpanded: typeof IconArrowOpenDownSolid;
|
|
32
|
+
readonly defaultExpanded: false;
|
|
33
|
+
readonly transition: true;
|
|
34
|
+
readonly as: "span";
|
|
35
|
+
readonly border: true;
|
|
36
|
+
};
|
|
37
|
+
ref: Element | null;
|
|
38
|
+
_button: HTMLElement | null;
|
|
39
|
+
_shouldTransition: boolean;
|
|
40
|
+
handleRef: (el: Element | null) => void;
|
|
41
|
+
handleButtonRef: (el: Element | null) => void;
|
|
42
|
+
get focused(): boolean;
|
|
43
|
+
focus(): void;
|
|
44
|
+
componentDidMount(): void;
|
|
45
|
+
componentDidUpdate(): void;
|
|
46
|
+
renderIcon(expanded: boolean): any;
|
|
47
|
+
renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
48
|
+
renderDetails(detailsProps: {
|
|
49
|
+
id: string;
|
|
50
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
52
|
+
}
|
|
53
|
+
export default ToggleGroup;
|
|
54
|
+
export { ToggleGroup };
|
|
55
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ToggleGroup/v1/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAIvE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAQ/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,WAAW,SAAgB;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;;;;;;MAQT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAO;IAClC,iBAAiB,UAAQ;IAEzB,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAQ9B;IAED,eAAe,GAAI,IAAI,OAAO,GAAG,IAAI,UAEpC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,kBAAkB;IAIlB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAK5B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IAyBnB,aAAa,CAAC,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAoB1C,MAAM;CA2CP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AsElementType, OtherHTMLAttributes, Renderable, ToggleGroupTheme } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps } from '@instructure/emotion';
|
|
4
|
+
type ToggleGroupOwnProps = {
|
|
5
|
+
/**
|
|
6
|
+
* the content to show and hide
|
|
7
|
+
*/
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* the content area next to the toggle button
|
|
11
|
+
*/
|
|
12
|
+
summary: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* provides a screenreader label for the toggle button
|
|
15
|
+
* (takes `expanded` as an argument if a function)
|
|
16
|
+
*/
|
|
17
|
+
toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
|
|
18
|
+
/**
|
|
19
|
+
* the element type to render as
|
|
20
|
+
*/
|
|
21
|
+
as?: AsElementType;
|
|
22
|
+
/**
|
|
23
|
+
* provides a reference to the underlying html root element
|
|
24
|
+
*/
|
|
25
|
+
elementRef?: (element: Element | null) => void;
|
|
26
|
+
size?: 'small' | 'medium' | 'large';
|
|
27
|
+
/**
|
|
28
|
+
* Whether the content is expanded or hidden
|
|
29
|
+
*/
|
|
30
|
+
expanded?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the content is initially expanded or hidden (uncontrolled)
|
|
33
|
+
*/
|
|
34
|
+
defaultExpanded?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Fired when the content display is toggled
|
|
37
|
+
*/
|
|
38
|
+
onToggle?: (event: React.MouseEvent, expanded: boolean) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The icon displayed in the toggle button when the content is hidden
|
|
41
|
+
*/
|
|
42
|
+
icon?: Renderable;
|
|
43
|
+
/**
|
|
44
|
+
* The icon displayed in the toggle button when the content is showing
|
|
45
|
+
*/
|
|
46
|
+
iconExpanded?: Renderable;
|
|
47
|
+
/**
|
|
48
|
+
* Transition content into view
|
|
49
|
+
*/
|
|
50
|
+
transition?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Toggle the border around the component
|
|
53
|
+
*/
|
|
54
|
+
border?: boolean;
|
|
55
|
+
};
|
|
56
|
+
type PropKeys = keyof ToggleGroupOwnProps;
|
|
57
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
58
|
+
type ToggleGroupStyle = {
|
|
59
|
+
borderColor: string;
|
|
60
|
+
};
|
|
61
|
+
type ToggleGroupProps = ToggleGroupOwnProps & OtherHTMLAttributes<ToggleGroupOwnProps> & WithStyleProps<ToggleGroupTheme, ToggleGroupStyle>;
|
|
62
|
+
declare const allowedProps: AllowedPropKeys;
|
|
63
|
+
export type { ToggleGroupProps, ToggleGroupStyle };
|
|
64
|
+
export { allowedProps };
|
|
65
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/ToggleGroup/v1/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,KAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB;;;OAGG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IACvE;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/D;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,KAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,KAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,KAAK,gBAAgB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/C,KAAK,gBAAgB,GAAG,mBAAmB,GACzC,mBAAmB,CAAC,mBAAmB,CAAC,GACxC,cAAc,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAA;AACpD,QAAA,MAAM,YAAY,EAAE,eAcnB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToggleGroupTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { ToggleGroupProps, ToggleGroupStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
11
|
+
* @return {Object} The final style object, which will be used in the component
|
|
12
|
+
*/
|
|
13
|
+
declare const generateStyle: (componentTheme: ToggleGroupTheme, _props: ToggleGroupProps) => ToggleGroupStyle;
|
|
14
|
+
export default generateStyle;
|
|
15
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/ToggleGroup/v1/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAEjE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,GACjB,gBAAgB,gBAAgB,EAChC,QAAQ,gBAAgB,KACvB,gBAIF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
|
+
import { ToggleGroupTheme } from '@instructure/shared-types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
5
|
+
* @param {Object} theme The actual theme object.
|
|
6
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
7
|
+
*/
|
|
8
|
+
declare const generateComponentTheme: (theme: Theme) => ToggleGroupTheme;
|
|
9
|
+
export default generateComponentTheme;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/ToggleGroup/v1/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,OAAO,KAAK,KAAG,gBAS9C,CAAA;AACD,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import type { ExpandableToggleProps } from '@instructure/ui-expandable/latest';
|
|
3
|
+
import type { ToggleGroupProps } from './props';
|
|
4
|
+
/**
|
|
5
|
+
---
|
|
6
|
+
category: components
|
|
7
|
+
---
|
|
8
|
+
**/
|
|
9
|
+
declare class ToggleGroup extends Component<ToggleGroupProps> {
|
|
10
|
+
static displayName: string;
|
|
11
|
+
static readonly componentId = "ToggleGroup";
|
|
12
|
+
static allowedProps: readonly (keyof {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
summary: React.ReactNode;
|
|
15
|
+
toggleLabel: React.ReactNode | ((expanded: boolean) => React.ReactNode);
|
|
16
|
+
as?: import("@instructure/shared-types").AsElementType;
|
|
17
|
+
elementRef?: (element: Element | null) => void;
|
|
18
|
+
size?: "small" | "medium" | "large";
|
|
19
|
+
expanded?: boolean;
|
|
20
|
+
defaultExpanded?: boolean;
|
|
21
|
+
onToggle?: (event: React.MouseEvent, expanded: boolean) => void;
|
|
22
|
+
icon?: import("@instructure/shared-types").Renderable;
|
|
23
|
+
iconExpanded?: import("@instructure/shared-types").Renderable;
|
|
24
|
+
transition?: boolean;
|
|
25
|
+
border?: boolean;
|
|
26
|
+
})[];
|
|
27
|
+
static defaultProps: {
|
|
28
|
+
readonly size: "medium";
|
|
29
|
+
readonly icon: import("react").ComponentType<import("@instructure/ui-icons").InstUIIconProps>;
|
|
30
|
+
readonly iconExpanded: import("react").ComponentType<import("@instructure/ui-icons").InstUIIconProps>;
|
|
31
|
+
readonly defaultExpanded: false;
|
|
32
|
+
readonly transition: true;
|
|
33
|
+
readonly as: "span";
|
|
34
|
+
readonly border: true;
|
|
35
|
+
};
|
|
36
|
+
ref: Element | null;
|
|
37
|
+
_button: HTMLElement | null;
|
|
38
|
+
_shouldTransition: boolean;
|
|
39
|
+
handleRef: (el: Element | null) => void;
|
|
40
|
+
handleButtonRef: (el: Element | null) => void;
|
|
41
|
+
get focused(): boolean;
|
|
42
|
+
focus(): void;
|
|
43
|
+
componentDidMount(): void;
|
|
44
|
+
componentDidUpdate(): void;
|
|
45
|
+
renderIcon(expanded: boolean): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
46
|
+
renderToggle(toggleProps: ReturnType<ExpandableToggleProps>, expanded: boolean): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
47
|
+
renderDetails(detailsProps: {
|
|
48
|
+
id: string;
|
|
49
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
50
|
+
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
51
|
+
}
|
|
52
|
+
export default ToggleGroup;
|
|
53
|
+
export { ToggleGroup };
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ToggleGroup/v2/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAS9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAa/C;;;;GAIG;AACH,cACM,WAAY,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IACnD,MAAM,CAAC,WAAW,SAAgB;IAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;;;;SAAe;IAElC,MAAM,CAAC,YAAY;;;;;;;;MAQT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAO;IAClC,iBAAiB,UAAQ;IAEzB,SAAS,GAAI,IAAI,OAAO,GAAG,IAAI,UAQ9B;IAED,eAAe,GAAI,IAAI,OAAO,GAAG,IAAI,UAEpC;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAIL,iBAAiB;IAIjB,kBAAkB;IAIlB,UAAU,CAAC,QAAQ,EAAE,OAAO;IAQ5B,YAAY,CACV,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC,EAC9C,QAAQ,EAAE,OAAO;IAyBnB,aAAa,CAAC,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAoB1C,MAAM;CA2CP;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|