@fluentui/react-infolabel 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -12
- package/README.md +13 -0
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.module.css +136 -0
- 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 +2 -2
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.styles.css.js +14 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.css.js.map +1 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.css.js +14 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/InfoButton/useInfoButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.module.css +18 -0
- 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 +2 -2
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabel.js +2 -4
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.css.js +15 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.css.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.css.js +15 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.css.js.map +1 -0
- package/lib/components/InfoLabel/useInfoLabelStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/InfoButton.cjs +6 -6
- package/lib-commonjs/InfoLabel.cjs +6 -6
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.cjs +4 -4
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.module.css +136 -0
- package/lib-commonjs/components/InfoButton/InfoButton.types.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/index.cjs +6 -6
- package/lib-commonjs/components/InfoButton/index.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.cjs +3 -3
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.css.cjs +33 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.css.cjs +33 -0
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/InfoLabel.module.css +18 -0
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/index.cjs +6 -6
- package/lib-commonjs/components/InfoLabel/index.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabel.cjs +2 -4
- package/lib-commonjs/components/InfoLabel/useInfoLabel.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.cjs +3 -3
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.css.cjs +34 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.css.cjs +34 -0
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/index.cjs +11 -11
- package/lib-commonjs/index.cjs.map +1 -1
- package/package.json +15 -15
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-infolabel
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 31 Oct 2026 11:08:45 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.
|
|
7
|
+
## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-infolabel_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infolabel_v9.4.25..@fluentui/react-infolabel_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
|
|
9
|
+
Sat, 31 Oct 2026 11:08:45 GMT
|
|
11
10
|
|
|
12
11
|
### Changes
|
|
13
12
|
|
|
14
|
-
- Release 9.
|
|
15
|
-
- Bump @fluentui/react-jsx-runtime to v9.
|
|
16
|
-
- Bump @fluentui/react-label to v9.
|
|
17
|
-
- Bump @fluentui/react-popover to v9.
|
|
18
|
-
- Bump @fluentui/react-shared-contexts to v9.
|
|
19
|
-
- Bump @fluentui/react-tabster to v9.
|
|
20
|
-
- Bump @fluentui/react-theme to v9.
|
|
21
|
-
- Bump @fluentui/react-utilities to v9.
|
|
13
|
+
- Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
14
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
15
|
+
- Bump @fluentui/react-label to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-popover to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
|
|
22
|
+
## [9.4.28](https://github.com/microsoft/fluentui/tree/@fluentui/react-infolabel_v9.4.28)
|
|
23
|
+
|
|
24
|
+
Mon, 19 Oct 2026 16:49:01 GMT
|
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infolabel_v9.4.27..@fluentui/react-infolabel_v9.4.28)
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
30
|
+
- Bump @fluentui/react-label to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
31
|
+
- Bump @fluentui/react-popover to v9.14.10 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
32
|
+
- Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
33
|
+
- Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
34
|
+
|
|
35
|
+
## [9.4.27](https://github.com/microsoft/fluentui/tree/@fluentui/react-infolabel_v9.4.27)
|
|
36
|
+
|
|
37
|
+
Wed, 23 Sep 2026 09:04:33 GMT
|
|
38
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infolabel_v9.4.26..@fluentui/react-infolabel_v9.4.27)
|
|
39
|
+
|
|
40
|
+
### Patches
|
|
41
|
+
|
|
42
|
+
- Bump @fluentui/react-popover to v9.14.9 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
43
|
+
|
|
44
|
+
## [9.4.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-infolabel_v9.4.26)
|
|
45
|
+
|
|
46
|
+
Tue, 22 Sep 2026 11:25:39 GMT
|
|
47
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infolabel_v9.4.25..@fluentui/react-infolabel_v9.4.26)
|
|
48
|
+
|
|
49
|
+
### Patches
|
|
50
|
+
|
|
51
|
+
- fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
|
|
52
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
53
|
+
- Bump @fluentui/react-label to v9.4.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
54
|
+
- Bump @fluentui/react-popover to v9.14.8 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
55
|
+
- Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
56
|
+
- Bump @fluentui/react-tabster to v9.26.18 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
57
|
+
- Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
58
|
|
|
23
59
|
## [9.4.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-infolabel_v9.4.25)
|
|
24
60
|
|
package/README.md
CHANGED
|
@@ -11,3 +11,16 @@ const InfoLabelExample = () => {
|
|
|
11
11
|
return <InfoLabel info="Sample information">Sample label</InfoLabel>;
|
|
12
12
|
};
|
|
13
13
|
```
|
|
14
|
+
|
|
15
|
+
## Opt-in CSS Modules styles
|
|
16
|
+
|
|
17
|
+
The `use*Styles.styles.css` modules beside the existing Griffel hooks provide opt-in,
|
|
18
|
+
layered CSS alternatives with the same exports. Configure the bundler to replace
|
|
19
|
+
`.styles` with `.styles.css.ts` for source imports and `.styles.js` with
|
|
20
|
+
`.styles.css.js` for built imports. Load CSS Modules as default class-name maps and
|
|
21
|
+
retain the package CSS assets. Default component imports still use Griffel.
|
|
22
|
+
Composed components require their own style alternatives; this does not remove
|
|
23
|
+
all reachable Griffel dependencies. Browser, forced-colors, RTL, and visual-regression
|
|
24
|
+
parity must be validated before switching defaults.
|
|
25
|
+
|
|
26
|
+
Select the `Label` and `InfoButton` alternatives together with `InfoLabel`. `InfoButton` styles its portaled info surface independently, but the composed `Popover` still needs its own alternative. Use headless icons with their CSS defaults in the `fluentui` layer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"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"],"names":["Info12Regular","Info12Filled","Info16Regular","Info16Filled","Info20Regular","Info20Filled","bundleIcon","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20"],"mappings":"AAAA,SACEA,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,UAAU,QACL,wBAAwB;AAE/B,OAAO,MAAMC,0BAA0BD,WAAWL,cAAcD,eAAe;AAC/E,OAAO,MAAMQ,0BAA0BF,WAAWH,cAAcD,eAAe;AAC/E,OAAO,MAAMO,0BAA0BH,WAAWD,cAAcD,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/InfoButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderInfoButton_unstable } from './renderInfoButton';\nimport { useInfoButton_unstable } from './useInfoButton';\nimport { useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\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 useCustomStyleHook_unstable('useInfoButtonStyles_unstable')(state);\n\n return renderInfoButton_unstable(state);\n});\n\nInfoButton.displayName = 'InfoButton';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoButton_unstable","useInfoButton_unstable","useInfoButtonStyles_unstable","InfoButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,SAASC,yBAAyB,QAAQ,wBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,4BAA4B,QAAQ,kCAA+B;AAG5E;;CAEC,GACD,OAAO,MAAMC,2BAAmDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQN,uBAAuBI,OAAOC;IAE5CJ,6BAA6BK;IAC7BR,4BAA4B,gCAAgCQ;IAE5D,OAAOP,0BAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
@import url('@fluentui/react-icons/headless/styles.css') layer(fluentui);
|
|
2
|
+
|
|
3
|
+
@layer fluentui {
|
|
4
|
+
.root {
|
|
5
|
+
align-items: center;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
text-decoration-line: none;
|
|
10
|
+
vertical-align: middle;
|
|
11
|
+
position: relative;
|
|
12
|
+
background-color: var(--colorTransparentBackground);
|
|
13
|
+
color: var(--colorNeutralForeground2);
|
|
14
|
+
border-top-style: none;
|
|
15
|
+
border-inline-end-style: none;
|
|
16
|
+
border-bottom-style: none;
|
|
17
|
+
border-inline-start-style: none;
|
|
18
|
+
border-radius: var(--borderRadiusMedium);
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: var(--spacingVerticalXS) var(--spacingHorizontalXS);
|
|
21
|
+
& :global(.fui-Icon-filled) {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& :global(.fui-Icon-regular) {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
background-color: var(--colorTransparentBackgroundHover);
|
|
31
|
+
color: var(--colorNeutralForeground2BrandHover);
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
& :global(.fui-Icon-filled) {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& :global(.fui-Icon-regular) {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover:active {
|
|
43
|
+
background-color: var(--colorTransparentBackgroundPressed);
|
|
44
|
+
color: var(--colorNeutralForeground2BrandPressed);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.root {
|
|
49
|
+
@media (forced-colors: active) {
|
|
50
|
+
color: CanvasText;
|
|
51
|
+
&:hover,
|
|
52
|
+
&:hover:active {
|
|
53
|
+
forced-color-adjust: none;
|
|
54
|
+
background-color: Highlight;
|
|
55
|
+
color: Canvas;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.root:where(.open) {
|
|
61
|
+
background-color: var(--colorTransparentBackgroundSelected);
|
|
62
|
+
color: var(--colorNeutralForeground2BrandSelected);
|
|
63
|
+
& :global(.fui-Icon-filled) {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
& :global(.fui-Icon-regular) {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (forced-colors: active) {
|
|
72
|
+
background-color: Highlight;
|
|
73
|
+
color: Canvas;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.root:where(.large) {
|
|
78
|
+
padding: var(--spacingVerticalXXS) var(--spacingVerticalXXS);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.root {
|
|
82
|
+
&:focus {
|
|
83
|
+
outline-style: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:focus-visible {
|
|
87
|
+
outline-style: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&[data-fui-focus-visible] {
|
|
91
|
+
border-top-color: transparent;
|
|
92
|
+
border-right-color: transparent;
|
|
93
|
+
border-bottom-color: transparent;
|
|
94
|
+
border-left-color: transparent;
|
|
95
|
+
&::after {
|
|
96
|
+
content: '';
|
|
97
|
+
position: absolute;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
z-index: 1;
|
|
100
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
101
|
+
border-radius: var(--borderRadiusMedium);
|
|
102
|
+
top: calc(var(--strokeWidthThick) * -1);
|
|
103
|
+
inset-inline-end: calc(var(--strokeWidthThick) * -1);
|
|
104
|
+
bottom: calc(var(--strokeWidthThick) * -1);
|
|
105
|
+
inset-inline-start: calc(var(--strokeWidthThick) * -1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (forced-colors: active) {
|
|
109
|
+
&::after {
|
|
110
|
+
border-top-color: Highlight;
|
|
111
|
+
border-right-color: Highlight;
|
|
112
|
+
border-bottom-color: Highlight;
|
|
113
|
+
border-left-color: Highlight;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.info {
|
|
120
|
+
max-width: calc(var(--spacingHorizontalXXXL) * 8 + var(--spacingHorizontalS));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.info:where(.small, .medium) {
|
|
124
|
+
font-family: var(--fontFamilyBase);
|
|
125
|
+
font-size: var(--fontSizeBase200);
|
|
126
|
+
font-weight: var(--fontWeightRegular);
|
|
127
|
+
line-height: var(--lineHeightBase200);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.info:where(.large) {
|
|
131
|
+
font-family: var(--fontFamilyBase);
|
|
132
|
+
font-size: var(--fontSizeBase300);
|
|
133
|
+
font-weight: var(--fontWeightRegular);
|
|
134
|
+
line-height: var(--lineHeightBase300);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"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 info and root slots. Use this slot to pass props to the Popover.\n */\n popover: NonNullable<Slot<Partial<Omit<PopoverProps, 'openOnHover'>>>>;\n\n /**\n * The information to be displayed in the PopoverSurface when the button is pressed.\n */\n info: NonNullable<Slot<typeof PopoverSurface>>;\n};\n\n/**\n * InfoButton Props\n */\nexport type InfoButtonProps = Omit<ComponentProps<Partial<InfoButtonSlots>>, 'disabled' | 'popover'> & {\n /**\n * Size of the InfoButton.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Whether the InfoButton should be rendered inline or on a Portal.\n *\n * @default true\n */\n inline?: boolean;\n\n /**\n * The Popover element that wraps the info and root slots. Use this slot to pass props to the Popover.\n */\n popover?: InfoButtonSlots['popover'];\n};\n\n/**\n * State used in rendering InfoButton\n */\nexport type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'inline' | 'size'>>;\n"],"names":[],"mappings":"AAyCA;;CAEC,GACD,WAAmH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/index.ts"],"sourcesContent":["export { InfoButton } from './InfoButton';\nexport type { InfoButtonProps, InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nexport { renderInfoButton_unstable } from './renderInfoButton';\nexport { useInfoButton_unstable } from './useInfoButton';\nexport { infoButtonClassNames, useInfoButtonStyles_unstable } from './useInfoButtonStyles.styles';\n"],"names":["InfoButton","renderInfoButton_unstable","useInfoButton_unstable","infoButtonClassNames","useInfoButtonStyles_unstable"],"mappings":"AAAA,SAASA,UAAU,QAAQ,kBAAe;AAE1C,SAASC,yBAAyB,QAAQ,wBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,oBAAoB,EAAEC,4BAA4B,QAAQ,kCAA+B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
import { PopoverTrigger } from "@fluentui/react-popover";
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of InfoButton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/renderInfoButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { PopoverTrigger } 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): JSXElement => {\n assertSlots<InfoButtonSlots>(state);\n\n return (\n <state.popover>\n <PopoverTrigger>\n <state.root />\n </PopoverTrigger>\n <state.info />\n </state.popover>\n );\n};\n"],"names":["assertSlots","PopoverTrigger","renderInfoButton_unstable","state","popover","root","info"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,cAAc,QAAQ,0BAA0B;AAGzD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCH,YAA6BG;IAE7B,qBACE,MAACA,MAAMC,OAAO;;0BACZ,KAACH;0BACC,cAAA,KAACE,MAAME,IAAI;;0BAEb,KAACF,MAAMG,IAAI;;;AAGjB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/useInfoButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n useControllableState,\n slot,\n useMergedRefs,\n elementContains,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\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 HTMLButtonElement of InfoButton\n */\nexport const useInfoButton_unstable = (props: InfoButtonProps, ref: React.Ref<HTMLButtonElement>): InfoButtonState => {\n const { size = 'medium', inline = true, popover, info, ...rest } = props;\n\n const rootRef = useMergedRefs(ref);\n\n const state: InfoButtonState = {\n inline,\n size,\n\n components: {\n root: 'button',\n popover: Popover as React.FC<Partial<PopoverProps>>,\n info: PopoverSurface,\n },\n\n root: slot.always(\n // eslint-disable-next-line react-hooks/refs\n getIntrinsicElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n 'aria-label': 'information',\n ...rest,\n ref: rootRef,\n }),\n { elementType: 'button' },\n ),\n popover: slot.always(popover, {\n defaultProps: {\n inline,\n positioning: 'above-start',\n size: popoverSizeMap[size],\n withArrow: true,\n },\n elementType: Popover as React.FC<Partial<Omit<PopoverProps, 'openOnHover'>>>,\n }),\n info: slot.always(info, {\n defaultProps: {\n role: 'note',\n tabIndex: -1,\n },\n elementType: PopoverSurface,\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 const infoRef = useMergedRefs(state.info.ref);\n state.info.ref = infoRef;\n\n // Hide the popover when focus moves out of the button and popover\n const onBlurButtonOrInfo = (e: React.FocusEvent) => {\n const nextFocused = e.relatedTarget;\n\n if (nextFocused && rootRef.current !== nextFocused && !elementContains(infoRef.current, nextFocused)) {\n setPopoverOpen(false);\n }\n };\n\n // eslint-disable-next-line react-hooks/refs\n state.root.onBlur = useEventCallback(mergeCallbacks(state.root.onBlur, onBlurButtonOrInfo));\n // eslint-disable-next-line react-hooks/refs\n state.info.onBlurCapture = useEventCallback(mergeCallbacks(state.info.onBlurCapture, onBlurButtonOrInfo));\n return state;\n};\n"],"names":["React","DefaultInfoButtonIcon12","DefaultInfoButtonIcon16","DefaultInfoButtonIcon20","getIntrinsicElementProps","mergeCallbacks","useControllableState","slot","useMergedRefs","elementContains","useEventCallback","Popover","PopoverSurface","infoButtonIconMap","small","medium","large","popoverSizeMap","useInfoButton_unstable","props","ref","size","inline","popover","info","rest","rootRef","state","components","root","always","children","type","elementType","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","open","defaultState","defaultOpen","initialState","onOpenChange","e","data","infoRef","onBlurButtonOrInfo","nextFocused","relatedTarget","current","onBlur","onBlurCapture"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,uBAAuB,EAAEC,uBAAuB,EAAEC,uBAAuB,QAAQ,8BAA2B;AACrH,SACEC,wBAAwB,EACxBC,cAAc,EACdC,oBAAoB,EACpBC,IAAI,EACJC,aAAa,EACbC,eAAe,EACfC,gBAAgB,QACX,4BAA4B;AACnC,SAASC,OAAO,EAAEC,cAAc,QAAQ,0BAA0B;AAIlE,MAAMC,oBAAoB;IACxBC,qBAAO,oBAACb;IACRc,sBAAQ,oBAACb;IACTc,qBAAO,oBAACb;AACV;AAEA,MAAMc,iBAAiB;IACrBH,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAME,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,OAAO,QAAQ,EAAEC,SAAS,IAAI,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGC,MAAM,GAAGN;IAEnE,MAAMO,UAAUlB,cAAcY;IAE9B,MAAMO,QAAyB;QAC7BL;QACAD;QAEAO,YAAY;YACVC,MAAM;YACNN,SAASZ;YACTa,MAAMZ;QACR;QAEAiB,MAAMtB,KAAKuB,MAAM,CACf,4CAA4C;QAC5C1B,yBAAyB,UAAU;YACjC2B,UAAUlB,iBAAiB,CAACQ,KAAK;YACjCW,MAAM;YACN,cAAc;YACd,GAAGP,IAAI;YACPL,KAAKM;QACP,IACA;YAAEO,aAAa;QAAS;QAE1BV,SAAShB,KAAKuB,MAAM,CAACP,SAAS;YAC5BW,cAAc;gBACZZ;gBACAa,aAAa;gBACbd,MAAMJ,cAAc,CAACI,KAAK;gBAC1Be,WAAW;YACb;YACAH,aAAatB;QACf;QACAa,MAAMjB,KAAKuB,MAAM,CAACN,MAAM;YACtBU,cAAc;gBACZG,MAAM;gBACNC,UAAU,CAAC;YACb;YACAL,aAAarB;QACf;IACF;IAEA,MAAM,CAAC2B,aAAaC,eAAe,GAAGlC,qBAAqB;QACzDqB,OAAOA,MAAMJ,OAAO,CAACkB,IAAI;QACzBC,cAAcf,MAAMJ,OAAO,CAACoB,WAAW;QACvCC,cAAc;IAChB;IAEAjB,MAAMJ,OAAO,CAACkB,IAAI,GAAGF;IACrBZ,MAAMJ,OAAO,CAACsB,YAAY,GAAGxC,eAAesB,MAAMJ,OAAO,CAACsB,YAAY,EAAE,CAACC,GAAGC,OAASP,eAAeO,KAAKN,IAAI;IAE7G,MAAMO,UAAUxC,cAAcmB,MAAMH,IAAI,CAACJ,GAAG;IAC5CO,MAAMH,IAAI,CAACJ,GAAG,GAAG4B;IAEjB,kEAAkE;IAClE,MAAMC,qBAAqB,CAACH;QAC1B,MAAMI,cAAcJ,EAAEK,aAAa;QAEnC,IAAID,eAAexB,QAAQ0B,OAAO,KAAKF,eAAe,CAACzC,gBAAgBuC,QAAQI,OAAO,EAAEF,cAAc;YACpGV,eAAe;QACjB;IACF;IAEA,4CAA4C;IAC5Cb,MAAME,IAAI,CAACwB,MAAM,GAAG3C,iBAAiBL,eAAesB,MAAME,IAAI,CAACwB,MAAM,EAAEJ;IACvE,4CAA4C;IAC5CtB,MAAMH,IAAI,CAAC8B,aAAa,GAAG5C,iBAAiBL,eAAesB,MAAMH,IAAI,CAAC8B,aAAa,EAAEL;IACrF,OAAOtB;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InfoButton.module.css";
|
|
3
|
+
export const infoButtonClassNames = {
|
|
4
|
+
root: 'fui-InfoButton',
|
|
5
|
+
// this className won't be used, but it's needed to satisfy the type checker
|
|
6
|
+
popover: 'fui-InfoButton__popover',
|
|
7
|
+
info: 'fui-InfoButton__info'
|
|
8
|
+
};
|
|
9
|
+
export const useInfoButtonStyles_unstable = (state)=>{
|
|
10
|
+
state.root.className = clsx(infoButtonClassNames.root, styles.root, styles[state.size], state.popover.open && styles.open, state.root.className);
|
|
11
|
+
// The surface is portaled, so it must carry its own size class.
|
|
12
|
+
state.info.className = clsx(infoButtonClassNames.info, styles.info, styles[state.size], state.info.className);
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/useInfoButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nimport styles from './InfoButton.module.css';\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 info: 'fui-InfoButton__info',\n};\n\nexport const useInfoButtonStyles_unstable = (state: InfoButtonState): InfoButtonState => {\n state.root.className = clsx(\n infoButtonClassNames.root,\n styles.root,\n styles[state.size],\n state.popover.open && styles.open,\n state.root.className,\n );\n // The surface is portaled, so it must carry its own size class.\n state.info.className = clsx(infoButtonClassNames.info, styles.info, styles[state.size], state.info.className);\n\n return state;\n};\n"],"names":["clsx","styles","infoButtonClassNames","root","popover","info","useInfoButtonStyles_unstable","state","className","size","open"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,0BAA0B;AAE7C,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACN,4EAA4E;IAC5EC,SAAS;IACTC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,+BAA+B,CAACC;IAC3CA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KACrBE,qBAAqBC,IAAI,EACzBF,OAAOE,IAAI,EACXF,MAAM,CAACM,MAAME,IAAI,CAAC,EAClBF,MAAMH,OAAO,CAACM,IAAI,IAAIT,OAAOS,IAAI,EACjCH,MAAMJ,IAAI,CAACK,SAAS;IAEtB,gEAAgE;IAChED,MAAMF,IAAI,CAACG,SAAS,GAAGR,KAAKE,qBAAqBG,IAAI,EAAEJ,OAAOI,IAAI,EAAEJ,MAAM,CAACM,MAAME,IAAI,CAAC,EAAEF,MAAMF,IAAI,CAACG,SAAS;IAE5G,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InfoButton.module.css";
|
|
3
|
+
export const infoButtonClassNames = {
|
|
4
|
+
root: 'fui-InfoButton',
|
|
5
|
+
// this className won't be used, but it's needed to satisfy the type checker
|
|
6
|
+
popover: 'fui-InfoButton__popover',
|
|
7
|
+
info: 'fui-InfoButton__info'
|
|
8
|
+
};
|
|
9
|
+
export const useInfoButtonStyles_unstable = (state)=>{
|
|
10
|
+
state.root.className = clsx(infoButtonClassNames.root, styles.root, styles[state.size], state.popover.open && styles.open, state.root.className);
|
|
11
|
+
// The surface is portaled, so it must carry its own size class.
|
|
12
|
+
state.info.className = clsx(infoButtonClassNames.info, styles.info, styles[state.size], state.info.className);
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/useInfoButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InfoButtonSlots, InfoButtonState } from './InfoButton.types';\nimport styles from './InfoButton.module.css';\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 info: 'fui-InfoButton__info',\n};\n\nexport const useInfoButtonStyles_unstable = (state: InfoButtonState): InfoButtonState => {\n state.root.className = clsx(\n infoButtonClassNames.root,\n styles.root,\n styles[state.size],\n state.popover.open && styles.open,\n state.root.className,\n );\n // The surface is portaled, so it must carry its own size class.\n state.info.className = clsx(infoButtonClassNames.info, styles.info, styles[state.size], state.info.className);\n\n return state;\n};\n"],"names":["clsx","styles","infoButtonClassNames","root","popover","info","useInfoButtonStyles_unstable","state","className","size","open"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,0BAA0B;AAE7C,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACN,4EAA4E;IAC5EC,SAAS;IACTC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,+BAA+B,CAACC;IAC3CA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KACrBE,qBAAqBC,IAAI,EACzBF,OAAOE,IAAI,EACXF,MAAM,CAACM,MAAME,IAAI,CAAC,EAClBF,MAAMH,OAAO,CAACM,IAAI,IAAIT,OAAOS,IAAI,EACjCH,MAAMJ,IAAI,CAACK,SAAS;IAEtB,gEAAgE;IAChED,MAAMF,IAAI,CAACG,SAAS,GAAGR,KAAKE,qBAAqBG,IAAI,EAAEJ,OAAOI,IAAI,EAAEJ,MAAM,CAACM,MAAME,IAAI,CAAC,EAAEF,MAAMF,IAAI,CAACG,SAAS;IAE5G,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoButton/useInfoButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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 info: 'fui-InfoButton__info',\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 borderRadius: tokens.borderRadiusMedium,\n margin: '0',\n 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 cursor: 'pointer',\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 padding: `${tokens.spacingVerticalXXS} ${tokens.spacingVerticalXXS}`,\n },\n});\n\nconst usePopoverSurfaceStyles = makeStyles({\n base: {\n maxWidth: '264px',\n },\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 // eslint-disable-next-line react-hooks/immutability\n state.info.className = mergeClasses(\n infoButtonClassNames.info,\n popoverSurfaceStyles.base,\n size === 'large' ? popoverSurfaceStyles.large : popoverSurfaceStyles.smallMedium,\n state.info.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\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"],"names":["createFocusOutlineStyle","iconFilledClassName","iconRegularClassName","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","infoButtonClassNames","root","popover","info","useButtonStyles","base","alignItems","boxSizing","display","justifyContent","textDecorationLine","verticalAlign","position","backgroundColor","colorTransparentBackground","color","colorNeutralForeground2","borderStyle","borderRadius","borderRadiusMedium","margin","padding","spacingVerticalXS","spacingHorizontalXS","colorTransparentBackgroundHover","colorNeutralForeground2BrandHover","cursor","colorTransparentBackgroundPressed","colorNeutralForeground2BrandPressed","selected","colorTransparentBackgroundSelected","colorNeutralForeground2BrandSelected","highContrast","forcedColorAdjust","focusIndicator","large","spacingVerticalXXS","usePopoverSurfaceStyles","maxWidth","smallMedium","caption1","body1","useInfoButtonStyles_unstable","state","size","open","buttonStyles","popoverSurfaceStyles","className"],"mappings":"AAAA;AAEA,SAASA,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,wBAAwB;AAClF,SAASC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACtE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAIjE,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACN,4EAA4E;IAC5EC,SAAS;IACTC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,kBAAkBT,WAAW;IACjCU,MAAM;QACJC,YAAY;QACZC,WAAW;QACXC,SAAS;QACTC,gBAAgB;QAChBC,oBAAoB;QACpBC,eAAe;QACfC,UAAU;QAEVC,iBAAiBf,OAAOgB,0BAA0B;QAClDC,OAAOjB,OAAOkB,uBAAuB;QAErC,GAAGnB,WAAWoB,WAAW,CAAC,OAAO;QACjCC,cAAcpB,OAAOqB,kBAAkB;QACvCC,QAAQ;QACRC,SAAS,GAAGvB,OAAOwB,iBAAiB,CAAC,CAAC,EAAExB,OAAOyB,mBAAmB,EAAE;QAEpE,CAAC,CAAC,GAAG,EAAE9B,qBAAqB,CAAC,EAAE;YAC7Be,SAAS;QACX;QACA,CAAC,CAAC,GAAG,EAAEd,sBAAsB,CAAC,EAAE;YAC9Bc,SAAS;QACX;QAEA,UAAU;YACRK,iBAAiBf,OAAO0B,+BAA+B;YACvDT,OAAOjB,OAAO2B,iCAAiC;YAC/CC,QAAQ;YAER,CAAC,CAAC,GAAG,EAAEjC,qBAAqB,CAAC,EAAE;gBAC7Be,SAAS;YACX;YACA,CAAC,CAAC,GAAG,EAAEd,sBAAsB,CAAC,EAAE;gBAC9Bc,SAAS;YACX;QACF;QACA,iBAAiB;YACfK,iBAAiBf,OAAO6B,iCAAiC;YACzDZ,OAAOjB,OAAO8B,mCAAmC;QACnD;IACF;IAEAC,UAAU;QACRhB,iBAAiBf,OAAOgC,kCAAkC;QAC1Df,OAAOjB,OAAOiC,oCAAoC;QAElD,CAAC,CAAC,GAAG,EAAEtC,qBAAqB,CAAC,EAAE;YAC7Be,SAAS;QACX;QACA,CAAC,CAAC,GAAG,EAAEd,sBAAsB,CAAC,EAAE;YAC9Bc,SAAS;QACX;QAEA,kCAAkC;YAChCK,iBAAiB;YACjBE,OAAO;QACT;IACF;IAEAiB,cAAc;QACZ,kCAAkC;YAChCjB,OAAO;YAEP,wBAAwB;gBACtBkB,mBAAmB;gBACnBpB,iBAAiB;gBACjBE,OAAO;YACT;QACF;IACF;IAEAmB,gBAAgB1C;IAEhB2C,OAAO;QACLd,SAAS,GAAGvB,OAAOsC,kBAAkB,CAAC,CAAC,EAAEtC,OAAOsC,kBAAkB,EAAE;IACtE;AACF;AAEA,MAAMC,0BAA0B1C,WAAW;IACzCU,MAAM;QACJiC,UAAU;IACZ;IACAC,aAAaxC,iBAAiByC,QAAQ;IACtCL,OAAOpC,iBAAiB0C,KAAK;AAC/B;AAEA;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3C,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAM,EAAEE,IAAI,EAAE,GAAGF,MAAMzC,OAAO;IAC9B,MAAM4C,eAAe1C;IACrB,MAAM2C,uBAAuBV;IAE7B,oDAAoD;IACpDM,MAAMxC,IAAI,CAAC6C,SAAS,GAAGpD,aACrBI,qBAAqBG,IAAI,EACzB4C,qBAAqB1C,IAAI,EACzBuC,SAAS,UAAUG,qBAAqBZ,KAAK,GAAGY,qBAAqBR,WAAW,EAChFI,MAAMxC,IAAI,CAAC6C,SAAS;IAGtB,oDAAoD;IACpDL,MAAM1C,IAAI,CAAC+C,SAAS,GAAGpD,aACrBI,qBAAqBC,IAAI,EACzB6C,aAAazC,IAAI,EACjByC,aAAad,YAAY,EACzBc,aAAaZ,cAAc,EAC3BW,QAAQC,aAAajB,QAAQ,EAC7Be,SAAS,WAAWE,aAAaX,KAAK,EACtCQ,MAAM1C,IAAI,CAAC+C,SAAS;IAGtB,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/InfoLabel.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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.styles';\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 useCustomStyleHook_unstable('useInfoLabelStyles_unstable')(state);\n\n return renderInfoLabel_unstable(state);\n});\n\nInfoLabel.displayName = 'InfoLabel';\n"],"names":["React","useCustomStyleHook_unstable","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,kCAAkC;AAG9E,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,2BAA2B,QAAQ,iCAA8B;AAE1E;;CAEC,GACD,OAAO,MAAMC,0BAAiDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQN,sBAAsBI,OAAOC;IAE3CJ,4BAA4BK;IAC5BR,4BAA4B,+BAA+BQ;IAE3D,OAAOP,yBAAyBO;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.label {
|
|
3
|
+
vertical-align: top;
|
|
4
|
+
cursor: inherit;
|
|
5
|
+
color: inherit;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.infoButton {
|
|
9
|
+
vertical-align: top;
|
|
10
|
+
margin-top: calc(0px - var(--spacingVerticalXXS));
|
|
11
|
+
margin-bottom: calc(0px - var(--spacingVerticalXXS));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:where(.large) > .infoButton {
|
|
15
|
+
margin-top: calc(var(--spacingVerticalXXS) / -2);
|
|
16
|
+
margin-bottom: calc(var(--spacingVerticalXXS) / -2);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/InfoLabel.types.ts"],"sourcesContent":["import type { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { 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['info'];\n};\n\n/**\n * State used in rendering InfoLabel\n */\nexport type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;\n"],"names":[],"mappings":"AAqCA;;CAEC,GACD,WAA2F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/index.ts"],"sourcesContent":["export { InfoLabel } from './InfoLabel';\nexport type { InfoLabelProps, InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\nexport { renderInfoLabel_unstable } from './renderInfoLabel';\nexport { useInfoLabel_unstable } from './useInfoLabel';\nexport { infoLabelClassNames, useInfoLabelStyles_unstable } from './useInfoLabelStyles.styles';\n"],"names":["InfoLabel","renderInfoLabel_unstable","useInfoLabel_unstable","infoLabelClassNames","useInfoLabelStyles_unstable"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iBAAc;AAExC,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,mBAAmB,EAAEC,2BAA2B,QAAQ,iCAA8B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of InfoLabel
|
|
5
5
|
*/ export const renderInfoLabel_unstable = (state)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/renderInfoLabel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } 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): JSXElement => {\n assertSlots<InfoLabelSlots>(state);\n\n return (\n <state.root>\n <state.label />\n {state.infoButton && <state.infoButton />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderInfoLabel_unstable","state","root","label","infoButton"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvCF,YAA4BE;IAE5B,qBACE,MAACA,MAAMC,IAAI;;0BACT,KAACD,MAAME,KAAK;YACXF,MAAMG,UAAU,kBAAI,KAACH,MAAMG,UAAU;;;AAG5C,EAAE"}
|
|
@@ -47,7 +47,7 @@ import { InfoButton } from "../InfoButton/InfoButton.js";
|
|
|
47
47
|
setOpen(data.open);
|
|
48
48
|
}));
|
|
49
49
|
if (infoButton) {
|
|
50
|
-
var _infoButton, _arialabelledby;
|
|
50
|
+
var _infoButton, _arialabelledby, _;
|
|
51
51
|
infoButton.popover = infoButtonPopover;
|
|
52
52
|
const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup
|
|
53
53
|
infoButton.info = slot.optional(infoButton === null || infoButton === void 0 ? void 0 : infoButton.info, {
|
|
@@ -57,12 +57,10 @@ import { InfoButton } from "../InfoButton/InfoButton.js";
|
|
|
57
57
|
},
|
|
58
58
|
elementType: 'div'
|
|
59
59
|
});
|
|
60
|
-
var _;
|
|
61
60
|
(_ = (_infoButton = infoButton)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _infoButton[_arialabelledby] = `${label.id} ${infoButton.id}`;
|
|
62
61
|
if (open) {
|
|
62
|
+
var _root, _ariaowns, _1;
|
|
63
63
|
var _infoButton_info;
|
|
64
|
-
var _root, _ariaowns;
|
|
65
|
-
var _1;
|
|
66
64
|
(_1 = (_root = root)[_ariaowns = 'aria-owns']) !== null && _1 !== void 0 ? _1 : _root[_ariaowns] = (_infoButton_info = infoButton.info) === null || _infoButton_info === void 0 ? void 0 : _infoButton_info.id;
|
|
67
65
|
}
|
|
68
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { mergeCallbacks, useId, slot, useEventCallback } 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 info,\n size,\n className,\n style,\n ...labelProps\n } = props;\n const baseId = useId('infolabel-');\n const [open, setOpen] = React.useState(false);\n\n const root = slot.always(rootShorthand, {\n defaultProps: {\n className,\n style,\n },\n elementType: 'span',\n });\n\n const label = slot.always(labelShorthand, {\n defaultProps: {\n id: baseId + '__label',\n ref,\n size,\n ...labelProps,\n },\n elementType: Label,\n });\n\n const infoButton = slot.optional(infoButtonShorthand, {\n renderByDefault: !!info,\n defaultProps: {\n id: baseId + '__infoButton',\n size,\n info,\n },\n elementType: InfoButton,\n });\n\n const infoButtonPopover = slot.always(infoButton?.popover, {\n elementType: 'div',\n });\n infoButtonPopover.onOpenChange = useEventCallback(\n mergeCallbacks(infoButtonPopover.onOpenChange, (_, data) => {\n setOpen(data.open);\n }),\n );\n\n if (infoButton) {\n infoButton.popover = infoButtonPopover;\n const infoPopupId = baseId + '__info'; // used as a self-referencing aria-labelledby to name the popup\n infoButton.info = slot.optional(infoButton?.info, {\n defaultProps: {\n id: infoPopupId,\n 'aria-labelledby': infoPopupId,\n },\n elementType: 'div',\n });\n\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n\n if (open) {\n root['aria-owns'] ??= infoButton.info?.id;\n }\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"],"names":["React","Label","mergeCallbacks","useId","slot","useEventCallback","InfoButton","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","info","size","className","style","labelProps","baseId","open","setOpen","useState","always","defaultProps","elementType","id","optional","renderByDefault","infoButtonPopover","popover","onOpenChange","_","data","infoPopupId","components"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,cAAc,EAAEC,KAAK,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAC1F,SAASC,UAAU,QAAQ,8BAA2B;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EACJC,MAAMC,aAAa,EACnBC,OAAOC,cAAc,EACrBC,YAAYC,mBAAmB,EAC/BC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,KAAK,EACL,GAAGC,YACJ,GAAGZ;IACJ,MAAMa,SAASlB,MAAM;IACrB,MAAM,CAACmB,MAAMC,QAAQ,GAAGvB,MAAMwB,QAAQ,CAAC;IAEvC,MAAMd,OAAON,KAAKqB,MAAM,CAACd,eAAe;QACtCe,cAAc;YACZR;YACAC;QACF;QACAQ,aAAa;IACf;IAEA,MAAMf,QAAQR,KAAKqB,MAAM,CAACZ,gBAAgB;QACxCa,cAAc;YACZE,IAAIP,SAAS;YACbZ;YACAQ;YACA,GAAGG,UAAU;QACf;QACAO,aAAa1B;IACf;IAEA,MAAMa,aAAaV,KAAKyB,QAAQ,CAACd,qBAAqB;QACpDe,iBAAiB,CAAC,CAACd;QACnBU,cAAc;YACZE,IAAIP,SAAS;YACbJ;YACAD;QACF;QACAW,aAAarB;IACf;IAEA,MAAMyB,oBAAoB3B,KAAKqB,MAAM,CAACX,uBAAAA,iCAAAA,WAAYkB,OAAO,EAAE;QACzDL,aAAa;IACf;IACAI,kBAAkBE,YAAY,GAAG5B,iBAC/BH,eAAe6B,kBAAkBE,YAAY,EAAE,CAACC,GAAGC;QACjDZ,QAAQY,KAAKb,IAAI;IACnB;IAGF,IAAIR,YAAY;YAWdA,aAAW,iBAAXA;QAVAA,WAAWkB,OAAO,GAAGD;QACrB,MAAMK,cAAcf,SAAS,UAAU,+DAA+D;QACtGP,WAAWE,IAAI,GAAGZ,KAAKyB,QAAQ,CAACf,uBAAAA,iCAAAA,WAAYE,IAAI,EAAE;YAChDU,cAAc;gBACZE,IAAIQ;gBACJ,mBAAmBA;YACrB;YACAT,aAAa;QACf;SAEAb,IAAAA,CAAAA,cAAAA,WAAU,CAAC,kBAAA,kBAAkB,cAA7BA,eAAAA,IAAAA,WAAU,CAAC,gBAAkB,GAAK,GAAGF,MAAMgB,EAAE,CAAC,CAAC,EAAEd,WAAWc,EAAE,EAAE;QAEhE,IAAIN,MAAM;gBACRZ,OAAK,WAALA;gBAAsBI;aAAtBJ,KAAAA,CAAAA,QAAAA,KAAI,CAAC,YAAA,YAAY,cAAjBA,gBAAAA,KAAAA,KAAI,CAAC,UAAY,IAAKI,mBAAAA,WAAWE,IAAI,cAAfF,uCAAAA,iBAAiBc,EAAE;QAC3C;IACF;IAEA,OAAO;QACLX;QACAoB,YAAY;YACV3B,MAAM;YACNE,OAAOX;YACPa,YAAYR;QACd;QACAI;QACAE;QACAE;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InfoLabel.module.css";
|
|
3
|
+
export const infoLabelClassNames = {
|
|
4
|
+
root: 'fui-InfoLabel',
|
|
5
|
+
label: 'fui-InfoLabel__label',
|
|
6
|
+
infoButton: 'fui-InfoLabel__infoButton'
|
|
7
|
+
};
|
|
8
|
+
export const useInfoLabelStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(infoLabelClassNames.root, state.size === 'large' && styles.large, state.root.className);
|
|
10
|
+
state.label.className = clsx(infoLabelClassNames.label, styles.label, state.label.className);
|
|
11
|
+
if (state.infoButton) {
|
|
12
|
+
state.infoButton.className = clsx(infoLabelClassNames.infoButton, styles.infoButton, state.infoButton.className);
|
|
13
|
+
}
|
|
14
|
+
return state;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/useInfoLabelStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\nimport styles from './InfoLabel.module.css';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n state.root.className = clsx(infoLabelClassNames.root, state.size === 'large' && styles.large, state.root.className);\n state.label.className = clsx(infoLabelClassNames.label, styles.label, state.label.className);\n if (state.infoButton) {\n state.infoButton.className = clsx(infoLabelClassNames.infoButton, styles.infoButton, state.infoButton.className);\n }\n\n return state;\n};\n"],"names":["clsx","styles","infoLabelClassNames","root","label","infoButton","useInfoLabelStyles_unstable","state","className","size","large"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,yBAAyB;AAE5C,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,YAAY;AACd,EAAE;AAEF,OAAO,MAAMC,8BAA8B,CAACC;IAC1CA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KAAKE,oBAAoBC,IAAI,EAAEI,MAAME,IAAI,KAAK,WAAWR,OAAOS,KAAK,EAAEH,MAAMJ,IAAI,CAACK,SAAS;IAClHD,MAAMH,KAAK,CAACI,SAAS,GAAGR,KAAKE,oBAAoBE,KAAK,EAAEH,OAAOG,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC3F,IAAID,MAAMF,UAAU,EAAE;QACpBE,MAAMF,UAAU,CAACG,SAAS,GAAGR,KAAKE,oBAAoBG,UAAU,EAAEJ,OAAOI,UAAU,EAAEE,MAAMF,UAAU,CAACG,SAAS;IACjH;IAEA,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InfoLabel.module.css";
|
|
3
|
+
export const infoLabelClassNames = {
|
|
4
|
+
root: 'fui-InfoLabel',
|
|
5
|
+
label: 'fui-InfoLabel__label',
|
|
6
|
+
infoButton: 'fui-InfoLabel__infoButton'
|
|
7
|
+
};
|
|
8
|
+
export const useInfoLabelStyles_unstable = (state)=>{
|
|
9
|
+
state.root.className = clsx(infoLabelClassNames.root, state.size === 'large' && styles.large, state.root.className);
|
|
10
|
+
state.label.className = clsx(infoLabelClassNames.label, styles.label, state.label.className);
|
|
11
|
+
if (state.infoButton) {
|
|
12
|
+
state.infoButton.className = clsx(infoLabelClassNames.infoButton, styles.infoButton, state.infoButton.className);
|
|
13
|
+
}
|
|
14
|
+
return state;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/useInfoLabelStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InfoLabelSlots, InfoLabelState } from './InfoLabel.types';\nimport styles from './InfoLabel.module.css';\n\nexport const infoLabelClassNames: SlotClassNames<InfoLabelSlots> = {\n root: 'fui-InfoLabel',\n label: 'fui-InfoLabel__label',\n infoButton: 'fui-InfoLabel__infoButton',\n};\n\nexport const useInfoLabelStyles_unstable = (state: InfoLabelState): InfoLabelState => {\n state.root.className = clsx(infoLabelClassNames.root, state.size === 'large' && styles.large, state.root.className);\n state.label.className = clsx(infoLabelClassNames.label, styles.label, state.label.className);\n if (state.infoButton) {\n state.infoButton.className = clsx(infoLabelClassNames.infoButton, styles.infoButton, state.infoButton.className);\n }\n\n return state;\n};\n"],"names":["clsx","styles","infoLabelClassNames","root","label","infoButton","useInfoLabelStyles_unstable","state","className","size","large"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,yBAAyB;AAE5C,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,YAAY;AACd,EAAE;AAEF,OAAO,MAAMC,8BAA8B,CAACC;IAC1CA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KAAKE,oBAAoBC,IAAI,EAAEI,MAAME,IAAI,KAAK,WAAWR,OAAOS,KAAK,EAAEH,MAAMJ,IAAI,CAACK,SAAS;IAClHD,MAAMH,KAAK,CAACI,SAAS,GAAGR,KAAKE,oBAAoBE,KAAK,EAAEH,OAAOG,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC3F,IAAID,MAAMF,UAAU,EAAE;QACpBE,MAAMF,UAAU,CAACG,SAAS,GAAGR,KAAKE,oBAAoBG,UAAU,EAAEJ,OAAOI,UAAU,EAAEE,MAAMF,UAAU,CAACG,SAAS;IACjH;IAEA,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoLabel/useInfoLabelStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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 // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);\n\n const labelStyles = useLabelStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);\n\n const infoButtonStyles = useInfoButtonStyles();\n if (state.infoButton) {\n // eslint-disable-next-line react-hooks/immutability\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"],"names":["tokens","makeStyles","mergeClasses","infoLabelClassNames","root","label","infoButton","useLabelStyles","base","verticalAlign","cursor","color","useInfoButtonStyles","marginTop","spacingVerticalXXS","marginBottom","large","useInfoLabelStyles_unstable","state","className","labelStyles","infoButtonStyles","size"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAE/C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,YAAY;AACd,EAAE;AAEF,MAAMC,iBAAiBN,WAAW;IAChCO,MAAM;QACJC,eAAe;QACfC,QAAQ;QACRC,OAAO;IACT;AACF;AAEA,MAAMC,sBAAsBX,WAAW;IACrCO,MAAM;QACJC,eAAe;QAEf,yCAAyC;QACzCI,WAAW,CAAC,WAAW,EAAEb,OAAOc,kBAAkB,CAAC,CAAC,CAAC;QACrDC,cAAc,CAAC,WAAW,EAAEf,OAAOc,kBAAkB,CAAC,CAAC,CAAC;IAC1D;IAEAE,OAAO;QACL,yCAAyC;QACzCH,WAAW;QACXE,cAAc;IAChB;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,8BAA8B,CAACC;IAC1C,oDAAoD;IACpDA,MAAMd,IAAI,CAACe,SAAS,GAAGjB,aAAaC,oBAAoBC,IAAI,EAAEc,MAAMd,IAAI,CAACe,SAAS;IAElF,MAAMC,cAAcb;IACpB,oDAAoD;IACpDW,MAAMb,KAAK,CAACc,SAAS,GAAGjB,aAAaC,oBAAoBE,KAAK,EAAEe,YAAYZ,IAAI,EAAEU,MAAMb,KAAK,CAACc,SAAS;IAEvG,MAAME,mBAAmBT;IACzB,IAAIM,MAAMZ,UAAU,EAAE;QACpB,oDAAoD;QACpDY,MAAMZ,UAAU,CAACa,SAAS,GAAGjB,aAC3BC,oBAAoBG,UAAU,EAC9Be,iBAAiBb,IAAI,EACrBU,MAAMI,IAAI,KAAK,WAAWD,iBAAiBL,KAAK,EAChDE,MAAMZ,UAAU,CAACa,SAAS;IAE9B;IAEA,OAAOD;AACT,EAAE"}
|