@fluentui/react-infobutton 9.0.0-beta.22 → 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 +64 -1
- package/CHANGELOG.md +19 -2
- package/lib/InfoButton.js.map +1 -1
- package/lib/InfoLabel.js.map +1 -1
- 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.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -1
- package/lib/components/InfoLabel/index.js.map +1 -1
- package/lib/components/InfoLabel/renderInfoLabel.js +1 -7
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabel.js +4 -2
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabelStyles.js.map +1 -1
- 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 +5 -4
- package/lib-commonjs/InfoLabel.js.map +1 -1
- 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 +16 -15
- package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +3 -2
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/index.js +9 -8
- package/lib-commonjs/components/InfoLabel/index.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +13 -22
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +53 -66
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js +55 -41
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js +24 -66
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -10
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,70 @@
|
|
|
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",
|
|
6
69
|
"tag": "@fluentui/react-infobutton_v9.0.0-beta.22",
|
|
7
70
|
"version": "9.0.0-beta.22",
|
|
8
71
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
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
|
+
|
|
7
24
|
## [9.0.0-beta.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.22)
|
|
8
25
|
|
|
9
|
-
Thu, 16 Mar 2023 14:
|
|
26
|
+
Thu, 16 Mar 2023 14:36:57 GMT
|
|
10
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)
|
|
11
28
|
|
|
12
29
|
### Changes
|
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,u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AAe,GAAGzB,oBAAA,CAAqB;IACzDW,KAAA,EAAOA,KAAA,CAAMG,OAAO,CAACY,IAAI;IACzBC,YAAA,EAAchB,KAAA,CAAMG,OAAO,CAACc,WAAW;IACvCC,YAAA,EAAc;EAChB;EAEAlB,KAAA,CAAMG,OAAO,CAACY,IAAI,GAAGF,WAAA;EACrBb,KAAA,CAAMG,OAAO,CAACgB,YAAY,GAAGlC,cAAA,CAAee,KAAA,CAAMG,OAAO,CAACgB,YAAY,EAAE,CAACC,CAAA,EAAGC,IAAA,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,\n buttonStyles.focusIndicator,\n open && buttonStyles.selected,\n size === 'large' && buttonStyles.large,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ;AAC1D,SAAAC,QAAA,EAAqBC,YAAY,EAAEC,UAAU,QAAQ;AACrD,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,oBAAA,GAAwD;EACnEC,IAAA,EAAM;EACN;EACAC,OAAA,EAAS;EACTC,OAAA,EAAS;AACX;AAEA;;;AAGA,MAAMC,eAAA,gBAAkBT,QAAA;EAAAU,IAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAA1B,MAAA;IAAAC,MAA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F,eAAA;EACrB,MAAM0F,oBAAA,GAAuBX,uBAAA;EAE7BO,KAAA,CAAMvF,OAAO,CAAC4F,SAAS,GAAGnG,YAAA,CACxBI,oBAAA,CAAqBG,OAAO,EAC5BwF,IAAA,KAAS,WAAWG,oBAAA,CAAqBjB,KAAK,EAC9Ca,KAAA,CAAMvF,OAAO,CAAC4F,SAAS;EAGzBL,KAAA,CAAMzF,IAAI,CAAC8F,SAAS,GAAGnG,YAAA,CACrBI,oBAAA,CAAqBC,IAAI,EACzB4F,YAAA,CAAaxF,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"sources":["
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
|
@@ -8,12 +8,6 @@ export const renderInfoLabel_unstable = state => {
|
|
|
8
8
|
slots,
|
|
9
9
|
slotProps
|
|
10
10
|
} = getSlots(state);
|
|
11
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
|
12
|
-
...slotProps.root
|
|
13
|
-
}, /*#__PURE__*/React.createElement(slots.label, {
|
|
14
|
-
...slotProps.label
|
|
15
|
-
}), slots.infoButton && /*#__PURE__*/React.createElement(slots.infoButton, {
|
|
16
|
-
...slotProps.infoButton
|
|
17
|
-
}));
|
|
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));
|
|
18
12
|
};
|
|
19
13
|
//# sourceMappingURL=renderInfoLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","renderInfoLabel_unstable","state","slots","slotProps","createElement","root","label","infoButton"],"sources":["
|
|
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"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _infoButton, _arialabelledby;
|
|
2
|
+
import * as React from 'react';
|
|
1
3
|
import { Label } from '@fluentui/react-label';
|
|
2
4
|
import { resolveShorthand, useId } from '@fluentui/react-utilities';
|
|
3
5
|
import { InfoButton } from '../InfoButton/InfoButton';
|
|
@@ -11,7 +13,6 @@ import { InfoButton } from '../InfoButton/InfoButton';
|
|
|
11
13
|
* @param ref - reference to label element of InfoLabel
|
|
12
14
|
*/
|
|
13
15
|
export const useInfoLabel_unstable = (props, ref) => {
|
|
14
|
-
var _a;
|
|
15
16
|
const {
|
|
16
17
|
root: rootShorthand,
|
|
17
18
|
label: labelShorthand,
|
|
@@ -47,7 +48,8 @@ export const useInfoLabel_unstable = (props, ref) => {
|
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
if (infoButton) {
|
|
50
|
-
|
|
51
|
+
var _;
|
|
52
|
+
(_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;
|
|
51
53
|
}
|
|
52
54
|
return {
|
|
53
55
|
size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Label","resolveShorthand","useId","InfoButton","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","size","info","className","style","labelProps","required","defaultProps","id","content","
|
|
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 },\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AA,EAAOT,KAAA;MACPW,UAAA,EAAYR;IACd;IACAI,IAAA;IACAE,KAAA;IACAE;EACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","__styles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"sources":["
|
|
1
|
+
{"version":3,"names":["tokens","__styles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"sources":["../../../src/components/InfoLabel/useInfoLabelStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nconst useLabelStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n cursor: 'inherit',\n color: 'inherit',\n },\n});\n\nconst useInfoButtonStyles = makeStyles({\n base: {\n verticalAlign: 'top',\n\n // Negative margin to align with the text\n marginTop: `calc(0px - ${tokens.spacingVerticalXXS})`,\n marginBottom: `calc(0px - ${tokens.spacingVerticalXXS})`,\n },\n\n large: {\n // Negative margin to align with the text\n marginTop: '-1px',\n marginBottom: '-1px',\n },\n});\n\n/**\n * Apply styling to the InfoLabel slots based on the state\n */\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n\n const labelStyles = useLabelStyles();\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n state.infoButton.className = mergeClasses(\n infoLabelClassNames.infoButton,\n infoButtonStyles.base,\n state.size === 'large' && infoButtonStyles.large,\n state.infoButton.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ;AAEvB,SAAAC,QAAA,EAAqBC,YAAY,QAAQ;AAGzC,OAAO,MAAMC,mBAAA,GAAsD;EACjEC,IAAA,EAAM;EACNC,KAAA,EAAO;EACPC,UAAA,EAAY;AACd;AAEA,MAAMC,cAAA,gBAAiBN,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAMvB;AAEA,MAAMC,mBAAA,gBAAsBZ,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAK,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,EAc5B;AAEA;;;AAGA,OAAO,MAAMK,2BAAA,GAA+BC,KAAA,IAA0C;EACpFA,KAAA,CAAMd,IAAI,CAACe,SAAS,GAAGjB,YAAA,CAAaC,mBAAA,CAAoBC,IAAI,EAAEc,KAAA,CAAMd,IAAI,CAACe,SAAS;EAElF,MAAMC,WAAA,GAAcb,cAAA;EACpBW,KAAA,CAAMb,KAAK,CAACc,SAAS,GAAGjB,YAAA,CAAaC,mBAAA,CAAoBE,KAAK,EAAEe,WAAA,CAAYZ,IAAI,EAAEU,KAAA,CAAMb,KAAK,CAACc,SAAS;EAEvG,MAAME,gBAAA,GAAmBR,mBAAA;EACzB,IAAIK,KAAA,CAAMZ,UAAU,EAAE;IACpBY,KAAA,CAAMZ,UAAU,CAACa,SAAS,GAAGjB,YAAA,CAC3BC,mBAAA,CAAoBG,UAAU,EAC9Be,gBAAA,CAAiBb,IAAI,EACrBU,KAAA,CAAMI,IAAI,KAAK,WAAWD,gBAAA,CAAiBL,KAAK,EAChDE,KAAA,CAAMZ,UAAU,CAACa,SAAS;EAE9B;EAEA,OAAOD,KAAA;AACT"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export {\n InfoButton,\n infoButtonClassNames,\n renderInfoButton_unstable,\n useInfoButtonStyles_unstable,\n useInfoButton_unstable,\n} from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton';\nexport {\n InfoLabel,\n infoLabelClassNames,\n renderInfoLabel_unstable,\n useInfoLabelStyles_unstable,\n useInfoLabel_unstable,\n} from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB;AAEP,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/InfoButton/index"), exports);
|
|
7
|
+
//# sourceMappingURL=InfoButton.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=InfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/InfoButton.js"],"sourcesContent":["export * from './components/InfoButton/index';\n//# sourceMappingURL=InfoButton.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/InfoLabel/index"), exports);
|
|
7
|
+
//# sourceMappingURL=InfoLabel.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=InfoLabel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/InfoLabel.js"],"sourcesContent":["export * from './components/InfoLabel/index';\n//# sourceMappingURL=InfoLabel.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,qCAAqC"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
DefaultInfoButtonIcon12: ()=>DefaultInfoButtonIcon12,
|
|
13
|
+
DefaultInfoButtonIcon16: ()=>DefaultInfoButtonIcon16,
|
|
14
|
+
DefaultInfoButtonIcon20: ()=>DefaultInfoButtonIcon20
|
|
5
15
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
16
|
+
const _reactIcons = require("@fluentui/react-icons");
|
|
17
|
+
const DefaultInfoButtonIcon12 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info12Filled, _reactIcons.Info12Regular);
|
|
18
|
+
const DefaultInfoButtonIcon16 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info16Filled, _reactIcons.Info16Regular);
|
|
19
|
+
const DefaultInfoButtonIcon20 = /*#__PURE__*/ (0, _reactIcons.bundleIcon)(_reactIcons.Info20Filled, _reactIcons.Info20Regular); //# sourceMappingURL=DefaultInfoButtonIcons.js.map
|
|
20
|
+
|
|
11
21
|
//# sourceMappingURL=DefaultInfoButtonIcons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/DefaultInfoButtonIcons.js"],"sourcesContent":["import { Info12Regular, Info12Filled, Info16Regular, Info16Filled, Info20Regular, Info20Filled, bundleIcon } from '@fluentui/react-icons';\nexport const DefaultInfoButtonIcon12 = /*#__PURE__*/bundleIcon(Info12Filled, Info12Regular);\nexport const DefaultInfoButtonIcon16 = /*#__PURE__*/bundleIcon(Info16Filled, Info16Regular);\nexport const DefaultInfoButtonIcon20 = /*#__PURE__*/bundleIcon(Info20Filled, Info20Regular);\n//# sourceMappingURL=DefaultInfoButtonIcons.js.map"],"names":["DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","bundleIcon","Info12Filled","Info12Regular","Info16Filled","Info16Regular","Info20Filled","Info20Regular"],"mappings":";;;;;;;;;;;IACaA,uBAAuB,MAAvBA;IACAC,uBAAuB,MAAvBA;IACAC,uBAAuB,MAAvBA;;4BAHqG;AAC3G,MAAMF,0BAA0B,WAAW,GAAEG,IAAAA,sBAAU,EAACC,wBAAY,EAAEC,yBAAa;AACnF,MAAMJ,0BAA0B,WAAW,GAAEE,IAAAA,sBAAU,EAACG,wBAAY,EAAEC,yBAAa;AACnF,MAAML,0BAA0B,WAAW,GAAEC,IAAAA,sBAAU,EAACK,wBAAY,EAAEC,yBAAa,GAC1F,kDAAkD"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "InfoButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>InfoButton
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const state = useInfoButton_1.useInfoButton_unstable(props, ref);
|
|
16
|
-
useInfoButtonStyles_1.useInfoButtonStyles_unstable(state);
|
|
17
|
-
return renderInfoButton_1.renderInfoButton_unstable(state);
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _renderInfoButton = require("./renderInfoButton");
|
|
12
|
+
const _useInfoButton = require("./useInfoButton");
|
|
13
|
+
const _useInfoButtonStyles = require("./useInfoButtonStyles");
|
|
14
|
+
const InfoButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
15
|
+
const state = (0, _useInfoButton.useInfoButton_unstable)(props, ref);
|
|
16
|
+
(0, _useInfoButtonStyles.useInfoButtonStyles_unstable)(state);
|
|
17
|
+
return (0, _renderInfoButton.renderInfoButton_unstable)(state);
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
InfoButton.displayName = 'InfoButton'; //# sourceMappingURL=InfoButton.js.map
|
|
20
|
+
|
|
20
21
|
//# sourceMappingURL=InfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/InfoButton.js"],"sourcesContent":["import * as React from 'react';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles';\n/**\n * InfoButtons provide a way to display additional information about a form field or an area in the UI.\n */\nexport const InfoButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useInfoButton_unstable(props, ref);\n useInfoButtonStyles_unstable(state);\n return renderInfoButton_unstable(state);\n});\nInfoButton.displayName = 'InfoButton';\n//# sourceMappingURL=InfoButton.js.map"],"names":["InfoButton","React","forwardRef","props","ref","state","useInfoButton_unstable","useInfoButtonStyles_unstable","renderInfoButton_unstable","displayName"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;kCACmB;+BACH;qCACM;AAItC,MAAMA,aAAa,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACtE,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5CG,IAAAA,iDAA4B,EAACF;IAC7B,OAAOG,IAAAA,2CAAyB,EAACH;AACnC;AACAL,WAAWS,WAAW,GAAG,cACzB,sCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/InfoButton.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=InfoButton.types.js.map"],"names":[],"mappings":";;;;CACA,4CAA4C"}
|