@fluentui/react-infobutton 9.0.0-beta.21 → 9.0.0-beta.23
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/.swcrc +30 -0
- package/CHANGELOG.json +103 -1
- package/CHANGELOG.md +32 -2
- package/dist/index.d.ts +64 -0
- package/lib/InfoButton.js.map +1 -1
- package/lib/InfoLabel.js +2 -0
- package/lib/InfoLabel.js.map +1 -0
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/index.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +1 -7
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.js +14 -0
- package/lib/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/InfoLabel.types.js +2 -0
- package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib/components/InfoLabel/index.js +6 -0
- package/lib/components/InfoLabel/index.js.map +1 -0
- package/lib/components/InfoLabel/renderInfoLabel.js +13 -0
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabel.js +66 -0
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.js +43 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +5 -4
- package/lib-commonjs/InfoButton.js.map +1 -1
- package/lib-commonjs/InfoLabel.js +9 -0
- package/lib-commonjs/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +17 -7
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +16 -15
- package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.types.js +3 -2
- package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib-commonjs/components/InfoButton/index.js +9 -8
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +14 -23
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +58 -67
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +331 -149
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/InfoLabel.js +21 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +7 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/index.js +13 -0
- package/lib-commonjs/components/InfoLabel/index.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +17 -0
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +58 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js +64 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
- package/lib-commonjs/index.js +22 -33
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -9
package/.swcrc
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
+
"exclude": [
|
|
4
|
+
"/testing",
|
|
5
|
+
"/**/*.cy.ts",
|
|
6
|
+
"/**/*.cy.tsx",
|
|
7
|
+
"/**/*.spec.ts",
|
|
8
|
+
"/**/*.spec.tsx",
|
|
9
|
+
"/**/*.test.ts",
|
|
10
|
+
"/**/*.test.tsx"
|
|
11
|
+
],
|
|
12
|
+
"jsc": {
|
|
13
|
+
"parser": {
|
|
14
|
+
"syntax": "typescript",
|
|
15
|
+
"tsx": true,
|
|
16
|
+
"decorators": false,
|
|
17
|
+
"dynamicImport": false
|
|
18
|
+
},
|
|
19
|
+
"externalHelpers": true,
|
|
20
|
+
"transform": {
|
|
21
|
+
"react": {
|
|
22
|
+
"runtime": "classic",
|
|
23
|
+
"useSpread": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
27
|
+
},
|
|
28
|
+
"minify": false,
|
|
29
|
+
"sourceMaps": true
|
|
30
|
+
}
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,109 @@
|
|
|
2
2
|
"name": "@fluentui/react-infobutton",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 21 Mar 2023 21:18:48 GMT",
|
|
6
|
+
"tag": "@fluentui/react-infobutton_v9.0.0-beta.23",
|
|
7
|
+
"version": "9.0.0-beta.23",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "makotom@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-infobutton",
|
|
13
|
+
"commit": "7fde5c94869ff9841b142b7ff1d0a3df0ab58f74",
|
|
14
|
+
"comment": "chore: Bumping version of @fluentui/react-icons to ^2.0.196."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "tristan.watanabe@gmail.com",
|
|
18
|
+
"package": "@fluentui/react-infobutton",
|
|
19
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
20
|
+
"comment": "fix: add node field to package.json exports map."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "tristan.watanabe@gmail.com",
|
|
24
|
+
"package": "@fluentui/react-infobutton",
|
|
25
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
26
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-infobutton",
|
|
31
|
+
"comment": "Bump @fluentui/react-label to v9.1.5",
|
|
32
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-infobutton",
|
|
37
|
+
"comment": "Bump @fluentui/react-popover to v9.5.5",
|
|
38
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-infobutton",
|
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
|
44
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-infobutton",
|
|
49
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
50
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"author": "beachball",
|
|
54
|
+
"package": "@fluentui/react-infobutton",
|
|
55
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
56
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"author": "beachball",
|
|
60
|
+
"package": "@fluentui/react-infobutton",
|
|
61
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
62
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"date": "Thu, 16 Mar 2023 14:36:57 GMT",
|
|
69
|
+
"tag": "@fluentui/react-infobutton_v9.0.0-beta.22",
|
|
70
|
+
"version": "9.0.0-beta.22",
|
|
71
|
+
"comments": {
|
|
72
|
+
"prerelease": [
|
|
73
|
+
{
|
|
74
|
+
"author": "behowell@microsoft.com",
|
|
75
|
+
"package": "@fluentui/react-infobutton",
|
|
76
|
+
"commit": "b106479e831318cfb3ddf10871e4240530498f31",
|
|
77
|
+
"comment": "feat: Add InfoLabel component"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-infobutton",
|
|
82
|
+
"comment": "Bump @fluentui/react-label to v9.1.4",
|
|
83
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@fluentui/react-infobutton",
|
|
88
|
+
"comment": "Bump @fluentui/react-popover to v9.5.4",
|
|
89
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-infobutton",
|
|
94
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.0",
|
|
95
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-infobutton",
|
|
100
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.1",
|
|
101
|
+
"commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"date": "Wed, 15 Mar 2023 10:19:53 GMT",
|
|
6
108
|
"tag": "@fluentui/react-infobutton_v9.0.0-beta.21",
|
|
7
109
|
"version": "9.0.0-beta.21",
|
|
8
110
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-infobutton
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 21 Mar 2023 21:18:48 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.23](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.23)
|
|
8
|
+
|
|
9
|
+
Tue, 21 Mar 2023 21:18:48 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infobutton_v9.0.0-beta.22..@fluentui/react-infobutton_v9.0.0-beta.23)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- chore: Bumping version of @fluentui/react-icons to ^2.0.196. ([PR #27100](https://github.com/microsoft/fluentui/pull/27100) by makotom@microsoft.com)
|
|
15
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
16
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
17
|
+
- Bump @fluentui/react-label to v9.1.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
18
|
+
- Bump @fluentui/react-popover to v9.5.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
20
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
21
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
22
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
23
|
+
|
|
24
|
+
## [9.0.0-beta.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.22)
|
|
25
|
+
|
|
26
|
+
Thu, 16 Mar 2023 14:36:57 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infobutton_v9.0.0-beta.21..@fluentui/react-infobutton_v9.0.0-beta.22)
|
|
28
|
+
|
|
29
|
+
### Changes
|
|
30
|
+
|
|
31
|
+
- feat: Add InfoLabel component ([PR #27118](https://github.com/microsoft/fluentui/pull/27118) by behowell@microsoft.com)
|
|
32
|
+
- Bump @fluentui/react-label to v9.1.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
33
|
+
- Bump @fluentui/react-popover to v9.5.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
34
|
+
- Bump @fluentui/react-tabster to v9.6.0 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
35
|
+
- Bump @fluentui/react-utilities to v9.7.1 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
|
|
36
|
+
|
|
7
37
|
## [9.0.0-beta.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.21)
|
|
8
38
|
|
|
9
|
-
Wed, 15 Mar 2023 10:
|
|
39
|
+
Wed, 15 Mar 2023 10:19:53 GMT
|
|
10
40
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infobutton_v9.0.0-beta.20..@fluentui/react-infobutton_v9.0.0-beta.21)
|
|
11
41
|
|
|
12
42
|
### Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
5
5
|
import { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
6
|
+
import { Label } from '@fluentui/react-label';
|
|
6
7
|
import type { PopoverProps } from '@fluentui/react-popover';
|
|
7
8
|
import type { PopoverSurface } from '@fluentui/react-popover';
|
|
8
9
|
import * as React_2 from 'react';
|
|
@@ -45,11 +46,58 @@ export declare type InfoButtonSlots = {
|
|
|
45
46
|
*/
|
|
46
47
|
export declare type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'size'>>;
|
|
47
48
|
|
|
49
|
+
/**
|
|
50
|
+
* InfoLabel component
|
|
51
|
+
*/
|
|
52
|
+
export declare const InfoLabel: ForwardRefComponent<InfoLabelProps>;
|
|
53
|
+
|
|
54
|
+
export declare const infoLabelClassNames: SlotClassNames<InfoLabelSlots>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* InfoLabel Props
|
|
58
|
+
*/
|
|
59
|
+
export declare type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {
|
|
60
|
+
/**
|
|
61
|
+
* The content of the InfoButton's popover.
|
|
62
|
+
*/
|
|
63
|
+
info?: InfoButtonProps['content'];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export declare type InfoLabelSlots = {
|
|
67
|
+
root: NonNullable<Slot<'span'>>;
|
|
68
|
+
/**
|
|
69
|
+
* The Label component.
|
|
70
|
+
*
|
|
71
|
+
* It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props
|
|
72
|
+
* such as `size` and `required` should be set directly on the `InfoLabel`.
|
|
73
|
+
*
|
|
74
|
+
* This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,
|
|
75
|
+
* except `className` and `style`, which remain on the root slot.
|
|
76
|
+
*/
|
|
77
|
+
label: NonNullable<Slot<typeof Label>>;
|
|
78
|
+
/**
|
|
79
|
+
* The InfoButton component.
|
|
80
|
+
*
|
|
81
|
+
* It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.
|
|
82
|
+
*/
|
|
83
|
+
infoButton: Slot<typeof InfoButton>;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* State used in rendering InfoLabel
|
|
88
|
+
*/
|
|
89
|
+
export declare type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;
|
|
90
|
+
|
|
48
91
|
/**
|
|
49
92
|
* Render the final JSX of InfoButton
|
|
50
93
|
*/
|
|
51
94
|
export declare const renderInfoButton_unstable: (state: InfoButtonState) => JSX.Element;
|
|
52
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Render the final JSX of InfoLabel
|
|
98
|
+
*/
|
|
99
|
+
export declare const renderInfoLabel_unstable: (state: InfoLabelState) => JSX.Element;
|
|
100
|
+
|
|
53
101
|
/**
|
|
54
102
|
* Create the state required to render InfoButton.
|
|
55
103
|
*
|
|
@@ -66,4 +114,20 @@ export declare const useInfoButton_unstable: (props: InfoButtonProps, ref: React
|
|
|
66
114
|
*/
|
|
67
115
|
export declare const useInfoButtonStyles_unstable: (state: InfoButtonState) => InfoButtonState;
|
|
68
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Create the state required to render InfoLabel.
|
|
119
|
+
*
|
|
120
|
+
* The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
|
|
121
|
+
* before being passed to renderInfoLabel_unstable.
|
|
122
|
+
*
|
|
123
|
+
* @param props - props from this instance of InfoLabel
|
|
124
|
+
* @param ref - reference to label element of InfoLabel
|
|
125
|
+
*/
|
|
126
|
+
export declare const useInfoLabel_unstable: (props: InfoLabelProps, ref: React_2.Ref<HTMLLabelElement>) => InfoLabelState;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Apply styling to the InfoLabel slots based on the state
|
|
130
|
+
*/
|
|
131
|
+
export declare const useInfoLabelStyles_unstable: (state: InfoLabelState) => InfoLabelState;
|
|
132
|
+
|
|
69
133
|
export { }
|
package/lib/InfoButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/InfoButton.ts"],"sourcesContent":["export * from './components/InfoButton/index';\n"],"mappings":"AAAA,cAAc"}
|
package/lib/InfoLabel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../src/InfoLabel.ts"],"sourcesContent":["export * from './components/InfoLabel/index';\n"],"mappings":"AAAA,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"sources":["
|
|
1
|
+
{"version":3,"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"sources":["../../../src/components/InfoButton/DefaultInfoButtonIcons.tsx"],"sourcesContent":["import {\n Info12Regular,\n Info12Filled,\n Info16Regular,\n Info16Filled,\n Info20Regular,\n Info20Filled,\n bundleIcon,\n} from '@fluentui/react-icons';\n\nexport const DefaultInfoButtonIcon12 = bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = bundleIcon(Info20Filled, Info20Regular);\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,UAAU,QACL;AAEP,OAAO,MAAMC,uBAAA,gBAA0BD,UAAA,CAAWL,YAAA,EAAcD,aAAA;AAChE,OAAO,MAAMQ,uBAAA,gBAA0BF,UAAA,CAAWH,YAAA,EAAcD,aAAA;AAChE,OAAO,MAAMO,uBAAA,gBAA0BH,UAAA,CAAWD,YAAA,EAAcD,aAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles';\nimport type { InfoButtonProps } from './InfoButton.types';\n\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton: ForwardRefComponent<InfoButtonProps> = React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n\n useInfoButtonStyles_unstable(state);\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAEvB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,sBAAsB,QAAQ;AACvC,SAASC,4BAA4B,QAAQ;AAG7C;;;AAGA,OAAO,MAAMC,UAAA,gBAAmDJ,KAAA,CAAMK,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC/F,MAAMC,KAAA,GAAQN,sBAAA,CAAuBI,KAAA,EAAOC,GAAA;EAE5CJ,4BAAA,CAA6BK,KAAA;EAC7B,OAAOP,yBAAA,CAA0BO,KAAA;AACnC;AAEAJ,UAAA,CAAWK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/InfoButton/InfoButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { PopoverProps, PopoverSurface } from '@fluentui/react-popover';\n\nexport type InfoButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * The Popover element that wraps the content and root. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<PopoverProps>>>;\n\n /**\n * The content to be displayed in the PopoverSurface when the button is pressed.\n */\n content: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering InfoButton\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'size'>>;\n"],"mappings":"AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/InfoButton/index.ts"],"sourcesContent":["export * from './InfoButton';\nexport * from './InfoButton.types';\nexport * from './renderInfoButton';\nexport * from './useInfoButton';\nexport * from './useInfoButtonStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
|
@@ -9,12 +9,6 @@ export const renderInfoButton_unstable = state => {
|
|
|
9
9
|
slots,
|
|
10
10
|
slotProps
|
|
11
11
|
} = getSlots(state);
|
|
12
|
-
return /*#__PURE__*/React.createElement(slots.popover,
|
|
13
|
-
...slotProps.popover
|
|
14
|
-
}, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(slots.root, {
|
|
15
|
-
...slotProps.root
|
|
16
|
-
})), /*#__PURE__*/React.createElement(slots.content, {
|
|
17
|
-
...slotProps.content
|
|
18
|
-
}));
|
|
12
|
+
return /*#__PURE__*/React.createElement(slots.popover, slotProps.popover, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(slots.root, slotProps.root)), /*#__PURE__*/React.createElement(slots.content, slotProps.content));
|
|
19
13
|
};
|
|
20
14
|
//# sourceMappingURL=renderInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","PopoverTrigger","renderInfoButton_unstable","state","slots","slotProps","createElement","popover","root","content"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getSlots","PopoverTrigger","renderInfoButton_unstable","state","slots","slotProps","createElement","popover","root","content"],"sources":["../../../src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\nimport type { PopoverProps } from '@fluentui/react-popover';\nimport type { InfoButtonState, InfoButtonSlots } from './InfoButton.types';\n\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = (state: InfoButtonState) => {\n const { slots, slotProps } = getSlots<InfoButtonSlots>(state);\n\n return (\n <slots.popover {...(slotProps.popover as PopoverProps)}>\n <PopoverTrigger>\n <slots.root {...slotProps.root} />\n </PopoverTrigger>\n <slots.content {...slotProps.content} />\n </slots.popover>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAI/B;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAA2B;EACnE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGL,QAAA,CAA0BG,KAAA;EAEvD,oBACEJ,KAAA,CAAAO,aAAA,CAACF,KAAA,CAAMG,OAAO,EAAMF,SAAA,CAAUE,OAAO,eACnCR,KAAA,CAAAO,aAAA,CAACL,cAAA,qBACCF,KAAA,CAAAO,aAAA,CAACF,KAAA,CAAMI,IAAI,EAAKH,SAAA,CAAUG,IAAI,iBAEhCT,KAAA,CAAAO,aAAA,CAACF,KAAA,CAAMK,OAAO,EAAKJ,SAAA,CAAUI,OAAO;AAG1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","getNativeElementProps","mergeCallbacks","resolveShorthand","Popover","PopoverSurface","useControllableState","infoButtonIconMap","small","createElement","medium","large","popoverSizeMap","useInfoButton_unstable","props","ref","size","state","components","root","popover","content","children","type","required","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","open","defaultState","defaultOpen","initialState","onOpenChange","e","data"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","getNativeElementProps","mergeCallbacks","resolveShorthand","Popover","PopoverSurface","useControllableState","infoButtonIconMap","small","createElement","medium","large","popoverSizeMap","useInfoButton_unstable","props","ref","size","state","components","root","popover","content","children","type","required","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","open","defaultState","defaultOpen","initialState","onOpenChange","e","data"],"sources":["../../../src/components/InfoButton/useInfoButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type { InfoButtonProps, InfoButtonState } from './InfoButton.types';\nimport type { PopoverProps } from '@fluentui/react-popover';\n\nconst infoButtonIconMap = {\n small: <DefaultInfoButtonIcon12 />,\n medium: <DefaultInfoButtonIcon16 />,\n large: <DefaultInfoButtonIcon20 />,\n} as const;\n\nconst popoverSizeMap = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\n/**\n * Create the state required to render InfoButton.\n *\n * The returned state can be modified with hooks such as useInfoButtonStyles_unstable,\n * before being passed to renderInfoButton_unstable.\n *\n * @param props - props from this instance of InfoButton\n * @param ref - reference to root HTMLElement of InfoButton\n */\nexport const useInfoButton_unstable = (props: InfoButtonProps, ref: React.Ref<HTMLElement>): InfoButtonState => {\n const { size = 'medium' } = props;\n\n const state: InfoButtonState = {\n size,\n\n components: {\n root: 'button',\n popover: Popover as React.FC<Partial<PopoverProps>>,\n content: PopoverSurface,\n },\n\n root: getNativeElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n 'aria-label': 'information',\n ...props,\n ref,\n }),\n popover: resolveShorthand(props.popover, {\n required: true,\n defaultProps: {\n positioning: 'above-start',\n size: popoverSizeMap[size],\n withArrow: true,\n },\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n role: 'note',\n tabIndex: -1,\n },\n }),\n };\n\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: state.popover.open,\n defaultState: state.popover.defaultOpen,\n initialState: false,\n });\n\n state.popover.open = popoverOpen;\n state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,EAAEC,uBAAuB,EAAEC,uBAAuB,QAAQ;AAC1F,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ;AACxE,SAASC,OAAO,EAAEC,cAAc,QAAQ;AACxC,SAASC,oBAAoB,QAAQ;AAIrC,MAAMC,iBAAA,GAAoB;EACxBC,KAAA,eAAOX,KAAA,CAAAY,aAAA,CAACX,uBAAA;EACRY,MAAA,eAAQb,KAAA,CAAAY,aAAA,CAACV,uBAAA;EACTY,KAAA,eAAOd,KAAA,CAAAY,aAAA,CAACT,uBAAA;AACV;AAE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,KAASP,cAAA,CAAeO,IAAA,CAAKN,IAAI;EAE7G,OAAOf,KAAA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFocusOutlineStyle","iconFilledClassName","iconRegularClassName","__styles","mergeClasses","shorthands","tokens","typographyStyles","infoButtonClassNames","root","popover","content","useButtonStyles","base","Bt984gj","B7ck84d","mc9l5x","Brf1p80","w71qe1","ha4doy","qhf8xq","De3pzq","sj55zd","icvyot","vrafjx","oivjwe","wvpqe5","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","D0sxk3","t6yez3","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","iro3zm","B2d53fq","selected","Bsw6fvg","Bbusuzp","highContrast","Bs6v0vm","B46dtvo","gh1jta","focusIndicator","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","large","d","h","m","f","i","usePopoverSurfaceStyles","smallMedium","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","useInfoButtonStyles_unstable","state","size","open","buttonStyles","popoverSurfaceStyles","className"],"sources":["
|
|
1
|
+
{"version":3,"names":["createFocusOutlineStyle","iconFilledClassName","iconRegularClassName","__styles","mergeClasses","shorthands","tokens","typographyStyles","infoButtonClassNames","root","popover","content","useButtonStyles","base","Bt984gj","B7ck84d","mc9l5x","Brf1p80","w71qe1","ha4doy","qhf8xq","De3pzq","sj55zd","icvyot","vrafjx","oivjwe","wvpqe5","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","B6of3ja","t21cq0","jrapky","Frg6f3","z8tnut","z189sj","Byoj8tv","uwmqm3","D0sxk3","t6yez3","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","iro3zm","B2d53fq","selected","Bsw6fvg","Bbusuzp","highContrast","Bs6v0vm","B46dtvo","gh1jta","focusIndicator","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bjwuhne","Ghsupd","Bule8hv","large","d","h","m","f","i","usePopoverSurfaceStyles","smallMedium","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","useInfoButtonStyles_unstable","state","size","open","buttonStyles","popoverSurfaceStyles","className"],"sources":["../../../src/components/InfoButton/useInfoButtonStyles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const infoButtonClassNames: SlotClassNames<InfoButtonSlots> = {\n root: 'fui-InfoButton',\n // this className won't be used, but it's needed to satisfy the type checker\n popover: 'fui-InfoButton__popover',\n content: 'fui-InfoButton__content',\n};\n\n/**\n * Styles for the root slot\n */\nconst useButtonStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'inline-flex',\n justifyContent: 'center',\n textDecorationLine: 'none',\n verticalAlign: 'middle',\n position: 'relative',\n\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground2,\n\n ...shorthands.borderStyle('none'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.margin(0),\n ...shorthands.padding(tokens.spacingVerticalXS, tokens.spacingHorizontalXS),\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline-flex',\n },\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n color: tokens.colorNeutralForeground2BrandHover,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline-flex',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n\n selected: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n color: tokens.colorNeutralForeground2BrandSelected,\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline-flex',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n color: 'Canvas',\n },\n },\n\n highContrast: {\n '@media (forced-colors: active)': {\n color: 'CanvasText',\n\n ':hover,:hover:active': {\n forcedColorAdjust: 'none',\n backgroundColor: 'Highlight',\n color: 'Canvas',\n },\n },\n },\n\n focusIndicator: createFocusOutlineStyle(),\n\n large: {\n ...shorthands.padding(tokens.spacingVerticalXXS, tokens.spacingVerticalXXS),\n },\n});\n\nconst usePopoverSurfaceStyles = makeStyles({\n smallMedium: typographyStyles.caption1,\n large: typographyStyles.body1,\n});\n\n/**\n * Apply styling to the InfoButton slots based on the state\n */\nexport const useInfoButtonStyles_unstable = (state: InfoButtonState): InfoButtonState => {\n const { size } = state;\n const { open } = state.popover;\n const buttonStyles = useButtonStyles();\n const popoverSurfaceStyles = usePopoverSurfaceStyles();\n\n state.content.className = mergeClasses(\n infoButtonClassNames.content,\n size === 'large' && popoverSurfaceStyles.large,\n state.content.className,\n );\n\n state.root.className = mergeClasses(\n infoButtonClassNames.root,\n buttonStyles.base,\n buttonStyles.highContrast,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AaxF,IAAI,EACjBwF,YAAA,CAAanD,YAAY,EACzBmD,YAAA,CAAa/C,cAAc,EAC3B8C,IAAA,IAAQC,YAAA,CAAatD,QAAQ,EAC7BoD,IAAA,KAAS,WAAWE,YAAA,CAAahB,KAAK,EACtCa,KAAA,CAAMzF,IAAI,CAAC8F,SAAS;EAGtB,OAAOL,KAAA;AACT"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { renderInfoLabel_unstable } from './renderInfoLabel';
|
|
3
|
+
import { useInfoLabel_unstable } from './useInfoLabel';
|
|
4
|
+
import { useInfoLabelStyles_unstable } from './useInfoLabelStyles';
|
|
5
|
+
/**
|
|
6
|
+
* InfoLabel component
|
|
7
|
+
*/
|
|
8
|
+
export const InfoLabel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
|
+
const state = useInfoLabel_unstable(props, ref);
|
|
10
|
+
useInfoLabelStyles_unstable(state);
|
|
11
|
+
return renderInfoLabel_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
InfoLabel.displayName = 'InfoLabel';
|
|
14
|
+
//# sourceMappingURL=InfoLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/InfoLabel/InfoLabel.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { InfoLabelProps } from './InfoLabel.types';\nimport { renderInfoLabel_unstable } from './renderInfoLabel';\nimport { useInfoLabel_unstable } from './useInfoLabel';\nimport { useInfoLabelStyles_unstable } from './useInfoLabelStyles';\n\n/**\n * InfoLabel component\n */\nexport const InfoLabel: ForwardRefComponent<InfoLabelProps> = React.forwardRef((props, ref) => {\n const state = useInfoLabel_unstable(props, ref);\n\n useInfoLabelStyles_unstable(state);\n return renderInfoLabel_unstable(state);\n});\n\nInfoLabel.displayName = 'InfoLabel';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAIvB,SAASC,wBAAwB,QAAQ;AACzC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,SAAA,gBAAiDJ,KAAA,CAAMK,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC7F,MAAMC,KAAA,GAAQN,qBAAA,CAAsBI,KAAA,EAAOC,GAAA;EAE3CJ,2BAAA,CAA4BK,KAAA;EAC5B,OAAOP,wBAAA,CAAyBO,KAAA;AAClC;AAEAJ,SAAA,CAAUK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/InfoLabel/InfoLabel.types.ts"],"sourcesContent":["import { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton';\nimport type { InfoButtonProps } from '../InfoButton';\n\nexport type InfoLabelSlots = {\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Label component.\n *\n * It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props\n * such as `size` and `required` should be set directly on the `InfoLabel`.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n label: NonNullable<Slot<typeof Label>>;\n\n /**\n * The InfoButton component.\n *\n * It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.\n */\n infoButton: Slot<typeof InfoButton>;\n};\n\n/**\n * InfoLabel Props\n */\nexport type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {\n /**\n * The content of the InfoButton's popover.\n */\n info?: InfoButtonProps['content'];\n};\n\n/**\n * State used in rendering InfoLabel\n */\nexport type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/components/InfoLabel/index.ts"],"sourcesContent":["export * from './InfoLabel';\nexport * from './InfoLabel.types';\nexport * from './renderInfoLabel';\nexport * from './useInfoLabel';\nexport * from './useInfoLabelStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of InfoLabel
|
|
5
|
+
*/
|
|
6
|
+
export const renderInfoLabel_unstable = state => {
|
|
7
|
+
const {
|
|
8
|
+
slots,
|
|
9
|
+
slotProps
|
|
10
|
+
} = getSlots(state);
|
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.label, slotProps.label), slots.infoButton && /*#__PURE__*/React.createElement(slots.infoButton, slotProps.infoButton));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=renderInfoLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","getSlots","renderInfoLabel_unstable","state","slots","slotProps","createElement","root","label","infoButton"],"sources":["../../../src/components/InfoLabel/renderInfoLabel.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Render the final JSX of InfoLabel\n */\nexport const renderInfoLabel_unstable = (state: InfoLabelState) => {\n const { slots, slotProps } = getSlots<InfoLabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.label {...slotProps.label} />\n {slots.infoButton && <slots.infoButton {...slotProps.infoButton} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAEvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,wBAAA,GAA4BC,KAAA,IAA0B;EACjE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAyBE,KAAA;EAEtD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,KAAK,EAAKH,SAAA,CAAUG,KAAK,GAC/BJ,KAAA,CAAMK,UAAU,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,UAAU,EAAKJ,SAAA,CAAUI,UAAU;AAGrE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var _infoButton, _arialabelledby;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Label } from '@fluentui/react-label';
|
|
4
|
+
import { resolveShorthand, useId } from '@fluentui/react-utilities';
|
|
5
|
+
import { InfoButton } from '../InfoButton/InfoButton';
|
|
6
|
+
/**
|
|
7
|
+
* Create the state required to render InfoLabel.
|
|
8
|
+
*
|
|
9
|
+
* The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
|
|
10
|
+
* before being passed to renderInfoLabel_unstable.
|
|
11
|
+
*
|
|
12
|
+
* @param props - props from this instance of InfoLabel
|
|
13
|
+
* @param ref - reference to label element of InfoLabel
|
|
14
|
+
*/
|
|
15
|
+
export const useInfoLabel_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
root: rootShorthand,
|
|
18
|
+
label: labelShorthand,
|
|
19
|
+
infoButton: infoButtonShorthand,
|
|
20
|
+
size,
|
|
21
|
+
info,
|
|
22
|
+
className,
|
|
23
|
+
style,
|
|
24
|
+
...labelProps
|
|
25
|
+
} = props;
|
|
26
|
+
const root = resolveShorthand(rootShorthand, {
|
|
27
|
+
required: true,
|
|
28
|
+
defaultProps: {
|
|
29
|
+
className,
|
|
30
|
+
style
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const label = resolveShorthand(labelShorthand, {
|
|
34
|
+
required: true,
|
|
35
|
+
defaultProps: {
|
|
36
|
+
id: useId('infolabel-'),
|
|
37
|
+
ref,
|
|
38
|
+
size,
|
|
39
|
+
...labelProps
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const infoButton = resolveShorthand(infoButtonShorthand, {
|
|
43
|
+
required: !!info,
|
|
44
|
+
defaultProps: {
|
|
45
|
+
id: useId('infobutton-'),
|
|
46
|
+
content: info,
|
|
47
|
+
size
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (infoButton) {
|
|
51
|
+
var _;
|
|
52
|
+
(_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
size,
|
|
56
|
+
components: {
|
|
57
|
+
root: 'span',
|
|
58
|
+
label: Label,
|
|
59
|
+
infoButton: InfoButton
|
|
60
|
+
},
|
|
61
|
+
root,
|
|
62
|
+
label,
|
|
63
|
+
infoButton
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=useInfoLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_infoButton","_arialabelledby","React","Label","resolveShorthand","useId","InfoButton","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","size","info","className","style","labelProps","required","defaultProps","id","content","_","components"],"sources":["../../../src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\nimport type { InfoLabelProps, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props: InfoLabelProps, ref: React.Ref<HTMLLabelElement>): InfoLabelState => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n size,\n info,\n className,\n style,\n ...labelProps\n } = props;\n\n const root = resolveShorthand(rootShorthand, {\n required: true,\n defaultProps: {\n className,\n style,\n },\n });\n\n const label = resolveShorthand(labelShorthand, {\n required: true,\n defaultProps: {\n id: useId('infolabel-'),\n ref,\n size,\n ...labelProps,\n },\n });\n\n const infoButton = resolveShorthand(infoButtonShorthand, {\n required: !!info,\n defaultProps: {\n id: useId('infobutton-'),\n content: info,\n size,\n },\n });\n\n if (infoButton) {\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n }\n\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton,\n },\n root,\n label,\n infoButton,\n };\n};\n"],"mappings":"IAwDIA,WAAA,EAAWC,eAAA;AAxDf,YAAYC,KAAA,MAAW;AAEvB,SAASC,KAAK,QAAQ;AACtB,SAASC,gBAAgB,EAAEC,KAAK,QAAQ;AACxC,SAASC,UAAU,QAAQ;AAG3B;;;;;;;;;AASA,OAAO,MAAMC,qBAAA,GAAwBA,CAACC,KAAA,EAAuBC,GAAA,KAAqD;EAChH,MAAM;IACJC,IAAA,EAAMC,aAAA;IACNC,KAAA,EAAOC,cAAA;IACPC,UAAA,EAAYC,mBAAA;IACZC,IAAA;IACAC,IAAA;IACAC,SAAA;IACAC,KAAA;IACA,GAAGC;EAAA,CACJ,GAAGZ,KAAA;EAEJ,MAAME,IAAA,GAAON,gBAAA,CAAiBO,aAAA,EAAe;IAC3CU,QAAA,EAAU,IAAI;IACdC,YAAA,EAAc;MACZJ,SAAA;MACAC;IACF;EACF;EAEA,MAAMP,KAAA,GAAQR,gBAAA,CAAiBS,cAAA,EAAgB;IAC7CQ,QAAA,EAAU,IAAI;IACdC,YAAA,EAAc;MACZC,EAAA,EAAIlB,KAAA,CAAM;MACVI,GAAA;MACAO,IAAA;MACA,GAAGI;IACL;EACF;EAEA,MAAMN,UAAA,GAAaV,gBAAA,CAAiBW,mBAAA,EAAqB;IACvDM,QAAA,EAAU,CAAC,CAACJ,IAAA;IACZK,YAAA,EAAc;MACZC,EAAA,EAAIlB,KAAA,CAAM;MACVmB,OAAA,EAASP,IAAA;MACTD;IACF;EACF;EAEA,IAAIF,UAAA,EAAY;;IACd,CAAAW,CAAA,IAAAzB,WAAA,GAAAc,UAAA,EAAWb,eAAA,qBAAkB,cAAAwB,CAAA,cAAAA,CAAA,GAA7BzB,WAAU,CAACC,eAAA,CAAkB,GAAM,GAAEW,KAAA,CAAMW,EAAG,IAAGT,UAAA,CAAWS,EAAG,EAAC;EAClE;EAEA,OAAO;IACLP,IAAA;IACAU,UAAA,EAAY;MACVhB,IAAA,EAAM;MACNE,KAAA,EAAOT,KAAA;MACPW,UAAA,EAAYR;IACd;IACAI,IAAA;IACAE,KAAA;IACAE;EACF;AACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { tokens } from '@fluentui/react-theme';
|
|
2
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
3
|
+
export const infoLabelClassNames = {
|
|
4
|
+
root: 'fui-InfoLabel',
|
|
5
|
+
label: 'fui-InfoLabel__label',
|
|
6
|
+
infoButton: 'fui-InfoLabel__infoButton'
|
|
7
|
+
};
|
|
8
|
+
const useLabelStyles = /*#__PURE__*/__styles({
|
|
9
|
+
base: {
|
|
10
|
+
ha4doy: "f12kltsn",
|
|
11
|
+
Bceei9c: "fpo1scq",
|
|
12
|
+
sj55zd: "f1ym3bx4"
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
d: [".f12kltsn{vertical-align:top;}", ".fpo1scq{cursor:inherit;}", ".f1ym3bx4{color:inherit;}"]
|
|
16
|
+
});
|
|
17
|
+
const useInfoButtonStyles = /*#__PURE__*/__styles({
|
|
18
|
+
base: {
|
|
19
|
+
ha4doy: "f12kltsn",
|
|
20
|
+
B6of3ja: "f1bmzb36",
|
|
21
|
+
jrapky: "f1nyzk09"
|
|
22
|
+
},
|
|
23
|
+
large: {
|
|
24
|
+
B6of3ja: "fkrn0sh",
|
|
25
|
+
jrapky: "fmxx68s"
|
|
26
|
+
}
|
|
27
|
+
}, {
|
|
28
|
+
d: [".f12kltsn{vertical-align:top;}", ".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}", ".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}", ".fkrn0sh{margin-top:-1px;}", ".fmxx68s{margin-bottom:-1px;}"]
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Apply styling to the InfoLabel slots based on the state
|
|
32
|
+
*/
|
|
33
|
+
export const useInfoLabelStyles_unstable = state => {
|
|
34
|
+
state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);
|
|
35
|
+
const labelStyles = useLabelStyles();
|
|
36
|
+
state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);
|
|
37
|
+
const infoButtonStyles = useInfoButtonStyles();
|
|
38
|
+
if (state.infoButton) {
|
|
39
|
+
state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
|
|
40
|
+
}
|
|
41
|
+
return state;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=useInfoLabelStyles.js.map
|