@fluentui/react-infobutton 9.0.0-beta.21 → 9.0.0-beta.22

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.
Files changed (36) hide show
  1. package/CHANGELOG.json +40 -1
  2. package/CHANGELOG.md +15 -2
  3. package/dist/index.d.ts +64 -0
  4. package/lib/InfoLabel.js +2 -0
  5. package/lib/InfoLabel.js.map +1 -0
  6. package/lib/components/InfoLabel/InfoLabel.js +14 -0
  7. package/lib/components/InfoLabel/InfoLabel.js.map +1 -0
  8. package/lib/components/InfoLabel/InfoLabel.types.js +2 -0
  9. package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -0
  10. package/lib/components/InfoLabel/index.js +6 -0
  11. package/lib/components/InfoLabel/index.js.map +1 -0
  12. package/lib/components/InfoLabel/renderInfoLabel.js +19 -0
  13. package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -0
  14. package/lib/components/InfoLabel/useInfoLabel.js +64 -0
  15. package/lib/components/InfoLabel/useInfoLabel.js.map +1 -0
  16. package/lib/components/InfoLabel/useInfoLabelStyles.js +43 -0
  17. package/lib/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
  18. package/lib/index.js +1 -0
  19. package/lib/index.js.map +1 -1
  20. package/lib-commonjs/InfoLabel.js +8 -0
  21. package/lib-commonjs/InfoLabel.js.map +1 -0
  22. package/lib-commonjs/components/InfoLabel/InfoLabel.js +20 -0
  23. package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -0
  24. package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +6 -0
  25. package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -0
  26. package/lib-commonjs/components/InfoLabel/index.js +12 -0
  27. package/lib-commonjs/components/InfoLabel/index.js.map +1 -0
  28. package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +26 -0
  29. package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -0
  30. package/lib-commonjs/components/InfoLabel/useInfoLabel.js +71 -0
  31. package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -0
  32. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js +50 -0
  33. package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js.map +1 -0
  34. package/lib-commonjs/index.js +32 -1
  35. package/lib-commonjs/index.js.map +1 -1
  36. package/package.json +5 -4
package/CHANGELOG.json CHANGED
@@ -2,7 +2,46 @@
2
2
  "name": "@fluentui/react-infobutton",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 15 Mar 2023 10:17:05 GMT",
5
+ "date": "Thu, 16 Mar 2023 14:33:31 GMT",
6
+ "tag": "@fluentui/react-infobutton_v9.0.0-beta.22",
7
+ "version": "9.0.0-beta.22",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "behowell@microsoft.com",
12
+ "package": "@fluentui/react-infobutton",
13
+ "commit": "b106479e831318cfb3ddf10871e4240530498f31",
14
+ "comment": "feat: Add InfoLabel component"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-infobutton",
19
+ "comment": "Bump @fluentui/react-label to v9.1.4",
20
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-infobutton",
25
+ "comment": "Bump @fluentui/react-popover to v9.5.4",
26
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-infobutton",
31
+ "comment": "Bump @fluentui/react-tabster to v9.6.0",
32
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-infobutton",
37
+ "comment": "Bump @fluentui/react-utilities to v9.7.1",
38
+ "commit": "e7dcadf7cabae6bc6811ca04a630e7d850388f81"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 15 Mar 2023 10:19:53 GMT",
6
45
  "tag": "@fluentui/react-infobutton_v9.0.0-beta.21",
7
46
  "version": "9.0.0-beta.21",
8
47
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,25 @@
1
1
  # Change Log - @fluentui/react-infobutton
2
2
 
3
- This log was last generated on Wed, 15 Mar 2023 10:17:05 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 16 Mar 2023 14:33:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.22)
8
+
9
+ Thu, 16 Mar 2023 14:33:31 GMT
10
+ [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
+
12
+ ### Changes
13
+
14
+ - feat: Add InfoLabel component ([PR #27118](https://github.com/microsoft/fluentui/pull/27118) by behowell@microsoft.com)
15
+ - Bump @fluentui/react-label to v9.1.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
16
+ - Bump @fluentui/react-popover to v9.5.4 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.6.0 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.7.1 ([PR #27229](https://github.com/microsoft/fluentui/pull/27229) by beachball)
19
+
7
20
  ## [9.0.0-beta.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-infobutton_v9.0.0-beta.21)
8
21
 
9
- Wed, 15 Mar 2023 10:17:05 GMT
22
+ Wed, 15 Mar 2023 10:19:53 GMT
10
23
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-infobutton_v9.0.0-beta.20..@fluentui/react-infobutton_v9.0.0-beta.21)
11
24
 
12
25
  ### Changes
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  import type { ComponentProps } from '@fluentui/react-utilities';
4
4
  import type { ComponentState } from '@fluentui/react-utilities';
5
5
  import { ForwardRefComponent } from '@fluentui/react-utilities';
6
+ import { Label } from '@fluentui/react-label';
6
7
  import type { PopoverProps } from '@fluentui/react-popover';
7
8
  import type { PopoverSurface } from '@fluentui/react-popover';
8
9
  import * as React_2 from 'react';
@@ -45,11 +46,58 @@ export declare type InfoButtonSlots = {
45
46
  */
46
47
  export declare type InfoButtonState = ComponentState<InfoButtonSlots> & Required<Pick<InfoButtonProps, 'size'>>;
47
48
 
49
+ /**
50
+ * InfoLabel component
51
+ */
52
+ export declare const InfoLabel: ForwardRefComponent<InfoLabelProps>;
53
+
54
+ export declare const infoLabelClassNames: SlotClassNames<InfoLabelSlots>;
55
+
56
+ /**
57
+ * InfoLabel Props
58
+ */
59
+ export declare type InfoLabelProps = ComponentProps<Partial<InfoLabelSlots>, 'label'> & {
60
+ /**
61
+ * The content of the InfoButton's popover.
62
+ */
63
+ info?: InfoButtonProps['content'];
64
+ };
65
+
66
+ export declare type InfoLabelSlots = {
67
+ root: NonNullable<Slot<'span'>>;
68
+ /**
69
+ * The Label component.
70
+ *
71
+ * It is not typically necessary to use this prop. The label text is the child of the `<InfoLabel>`, and other props
72
+ * such as `size` and `required` should be set directly on the `InfoLabel`.
73
+ *
74
+ * This is the PRIMARY slot: all native properties specified directly on `<InfoLabel>` will be applied to this slot,
75
+ * except `className` and `style`, which remain on the root slot.
76
+ */
77
+ label: NonNullable<Slot<typeof Label>>;
78
+ /**
79
+ * The InfoButton component.
80
+ *
81
+ * It is not typically necessary to use this prop. The content can be set using the `info` prop of the InfoLabel.
82
+ */
83
+ infoButton: Slot<typeof InfoButton>;
84
+ };
85
+
86
+ /**
87
+ * State used in rendering InfoLabel
88
+ */
89
+ export declare type InfoLabelState = ComponentState<InfoLabelSlots> & Pick<InfoLabelProps, 'size'>;
90
+
48
91
  /**
49
92
  * Render the final JSX of InfoButton
50
93
  */
51
94
  export declare const renderInfoButton_unstable: (state: InfoButtonState) => JSX.Element;
52
95
 
96
+ /**
97
+ * Render the final JSX of InfoLabel
98
+ */
99
+ export declare const renderInfoLabel_unstable: (state: InfoLabelState) => JSX.Element;
100
+
53
101
  /**
54
102
  * Create the state required to render InfoButton.
55
103
  *
@@ -66,4 +114,20 @@ export declare const useInfoButton_unstable: (props: InfoButtonProps, ref: React
66
114
  */
67
115
  export declare const useInfoButtonStyles_unstable: (state: InfoButtonState) => InfoButtonState;
68
116
 
117
+ /**
118
+ * Create the state required to render InfoLabel.
119
+ *
120
+ * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
121
+ * before being passed to renderInfoLabel_unstable.
122
+ *
123
+ * @param props - props from this instance of InfoLabel
124
+ * @param ref - reference to label element of InfoLabel
125
+ */
126
+ export declare const useInfoLabel_unstable: (props: InfoLabelProps, ref: React_2.Ref<HTMLLabelElement>) => InfoLabelState;
127
+
128
+ /**
129
+ * Apply styling to the InfoLabel slots based on the state
130
+ */
131
+ export declare const useInfoLabelStyles_unstable: (state: InfoLabelState) => InfoLabelState;
132
+
69
133
  export { }
@@ -0,0 +1,2 @@
1
+ export * from './components/InfoLabel/index';
2
+ //# sourceMappingURL=InfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoLabel.js","sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/InfoLabel.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './components/InfoLabel/index';\n"]}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { renderInfoLabel_unstable } from './renderInfoLabel';
3
+ import { useInfoLabel_unstable } from './useInfoLabel';
4
+ import { useInfoLabelStyles_unstable } from './useInfoLabelStyles';
5
+ /**
6
+ * InfoLabel component
7
+ */
8
+ export const InfoLabel = /*#__PURE__*/React.forwardRef((props, ref) => {
9
+ const state = useInfoLabel_unstable(props, ref);
10
+ useInfoLabelStyles_unstable(state);
11
+ return renderInfoLabel_unstable(state);
12
+ });
13
+ InfoLabel.displayName = 'InfoLabel';
14
+ //# sourceMappingURL=InfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","renderInfoLabel_unstable","useInfoLabel_unstable","useInfoLabelStyles_unstable","InfoLabel","forwardRef","props","ref","state","displayName"],"sources":["../src/packages/react-components/react-infobutton/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,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,wBAAwB,QAAQ,mBAAmB;AAC5D,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,2BAA2B,QAAQ,sBAAsB;AAElE;;;AAGA,OAAO,MAAMC,SAAS,gBAAwCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC5F,MAAMC,KAAK,GAAGN,qBAAqB,CAACI,KAAK,EAAEC,GAAG,CAAC;EAE/CJ,2BAA2B,CAACK,KAAK,CAAC;EAClC,OAAOP,wBAAwB,CAACO,KAAK,CAAC;AACxC,CAAC,CAAC;AAEFJ,SAAS,CAACK,WAAW,GAAG,WAAW"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=InfoLabel.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfoLabel.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoLabel/InfoLabel.types.ts"],"names":[],"mappings":"","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"]}
@@ -0,0 +1,6 @@
1
+ export * from './InfoLabel';
2
+ export * from './InfoLabel.types';
3
+ export * from './renderInfoLabel';
4
+ export * from './useInfoLabel';
5
+ export * from './useInfoLabelStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-infobutton/src/components/InfoLabel/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC","sourcesContent":["export * from './InfoLabel';\nexport * from './InfoLabel.types';\nexport * from './renderInfoLabel';\nexport * from './useInfoLabel';\nexport * from './useInfoLabelStyles';\n"]}
@@ -0,0 +1,19 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Render the final JSX of InfoLabel
5
+ */
6
+ export const renderInfoLabel_unstable = state => {
7
+ const {
8
+ slots,
9
+ slotProps
10
+ } = getSlots(state);
11
+ return /*#__PURE__*/React.createElement(slots.root, {
12
+ ...slotProps.root
13
+ }, /*#__PURE__*/React.createElement(slots.label, {
14
+ ...slotProps.label
15
+ }), slots.infoButton && /*#__PURE__*/React.createElement(slots.infoButton, {
16
+ ...slotProps.infoButton
17
+ }));
18
+ };
19
+ //# sourceMappingURL=renderInfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","getSlots","renderInfoLabel_unstable","state","slots","slotProps","createElement","root","label","infoButton"],"sources":["../src/packages/react-components/react-infobutton/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,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,wBAAwB,GAAIC,KAAqB,IAAI;EAChE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAiBE,KAAK,CAAC;EAE5D,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,gBAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACI,KAAK;IAAA,GAAKH,SAAS,CAACG;EAAK,EAAI,EACnCJ,KAAK,CAACK,UAAU,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,UAAU;IAAA,GAAKJ,SAAS,CAACI;EAAU,EAAI,CACxD;AAEjB,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { Label } from '@fluentui/react-label';
2
+ import { resolveShorthand, useId } from '@fluentui/react-utilities';
3
+ import { InfoButton } from '../InfoButton/InfoButton';
4
+ /**
5
+ * Create the state required to render InfoLabel.
6
+ *
7
+ * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
8
+ * before being passed to renderInfoLabel_unstable.
9
+ *
10
+ * @param props - props from this instance of InfoLabel
11
+ * @param ref - reference to label element of InfoLabel
12
+ */
13
+ export const useInfoLabel_unstable = (props, ref) => {
14
+ var _a;
15
+ const {
16
+ root: rootShorthand,
17
+ label: labelShorthand,
18
+ infoButton: infoButtonShorthand,
19
+ size,
20
+ info,
21
+ className,
22
+ style,
23
+ ...labelProps
24
+ } = props;
25
+ const root = resolveShorthand(rootShorthand, {
26
+ required: true,
27
+ defaultProps: {
28
+ className,
29
+ style
30
+ }
31
+ });
32
+ const label = resolveShorthand(labelShorthand, {
33
+ required: true,
34
+ defaultProps: {
35
+ id: useId('infolabel-'),
36
+ ref,
37
+ size,
38
+ ...labelProps
39
+ }
40
+ });
41
+ const infoButton = resolveShorthand(infoButtonShorthand, {
42
+ required: !!info,
43
+ defaultProps: {
44
+ id: useId('infobutton-'),
45
+ content: info,
46
+ size
47
+ }
48
+ });
49
+ if (infoButton) {
50
+ (_a = infoButton['aria-labelledby']) !== null && _a !== void 0 ? _a : infoButton['aria-labelledby'] = `${label.id} ${infoButton.id}`;
51
+ }
52
+ return {
53
+ size,
54
+ components: {
55
+ root: 'span',
56
+ label: Label,
57
+ infoButton: InfoButton
58
+ },
59
+ root,
60
+ label,
61
+ infoButton
62
+ };
63
+ };
64
+ //# sourceMappingURL=useInfoLabel.js.map
@@ -0,0 +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","_a","components"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\nimport type { InfoLabelProps, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props: InfoLabelProps, ref: React.Ref<HTMLLabelElement>): InfoLabelState => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n size,\n info,\n className,\n style,\n ...labelProps\n } = props;\n\n const root = resolveShorthand(rootShorthand, {\n required: true,\n defaultProps: {\n className,\n style,\n },\n });\n\n const label = resolveShorthand(labelShorthand, {\n required: true,\n defaultProps: {\n id: useId('infolabel-'),\n ref,\n size,\n ...labelProps,\n },\n });\n\n const infoButton = resolveShorthand(infoButtonShorthand, {\n required: !!info,\n defaultProps: {\n id: useId('infobutton-'),\n content: info,\n size,\n },\n });\n\n if (infoButton) {\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n }\n\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton,\n },\n root,\n label,\n infoButton,\n };\n};\n"],"mappings":"AAEA,SAASA,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AACnE,SAASC,UAAU,QAAQ,0BAA0B;AAGrD;;;;;;;;;AASA,OAAO,MAAMC,qBAAqB,GAAGA,CAACC,KAAqB,EAAEC,GAAgC,KAAoB;;EAC/G,MAAM;IACJC,IAAI,EAAEC,aAAa;IACnBC,KAAK,EAAEC,cAAc;IACrBC,UAAU,EAAEC,mBAAmB;IAC/BC,IAAI;IACJC,IAAI;IACJC,SAAS;IACTC,KAAK;IACL,GAAGC;EAAU,CACd,GAAGZ,KAAK;EAET,MAAME,IAAI,GAAGN,gBAAgB,CAACO,aAAa,EAAE;IAC3CU,QAAQ,EAAE,IAAI;IACdC,YAAY,EAAE;MACZJ,SAAS;MACTC;;GAEH,CAAC;EAEF,MAAMP,KAAK,GAAGR,gBAAgB,CAACS,cAAc,EAAE;IAC7CQ,QAAQ,EAAE,IAAI;IACdC,YAAY,EAAE;MACZC,EAAE,EAAElB,KAAK,CAAC,YAAY,CAAC;MACvBI,GAAG;MACHO,IAAI;MACJ,GAAGI;;GAEN,CAAC;EAEF,MAAMN,UAAU,GAAGV,gBAAgB,CAACW,mBAAmB,EAAE;IACvDM,QAAQ,EAAE,CAAC,CAACJ,IAAI;IAChBK,YAAY,EAAE;MACZC,EAAE,EAAElB,KAAK,CAAC,aAAa,CAAC;MACxBmB,OAAO,EAAEP,IAAI;MACbD;;GAEH,CAAC;EAEF,IAAIF,UAAU,EAAE;IACd,CAAAW,EAAA,GAAAX,UAAU,CAAC,iBAAiB,eAAAW,EAAA,cAAAA,EAAA,GAA5BX,UAAU,CAAC,iBAAiB,IAAM,GAAGF,KAAK,CAACW,EAAE,IAAIT,UAAU,CAACS,EAAE,EAAE;;EAGlE,OAAO;IACLP,IAAI;IACJU,UAAU,EAAE;MACVhB,IAAI,EAAE,MAAM;MACZE,KAAK,EAAET,KAAK;MACZW,UAAU,EAAER;KACb;IACDI,IAAI;IACJE,KAAK;IACLE;GACD;AACH,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { tokens } from '@fluentui/react-theme';
2
+ import { __styles, mergeClasses } from '@griffel/react';
3
+ export const infoLabelClassNames = {
4
+ root: 'fui-InfoLabel',
5
+ label: 'fui-InfoLabel__label',
6
+ infoButton: 'fui-InfoLabel__infoButton'
7
+ };
8
+ const useLabelStyles = /*#__PURE__*/__styles({
9
+ base: {
10
+ ha4doy: "f12kltsn",
11
+ Bceei9c: "fpo1scq",
12
+ sj55zd: "f1ym3bx4"
13
+ }
14
+ }, {
15
+ d: [".f12kltsn{vertical-align:top;}", ".fpo1scq{cursor:inherit;}", ".f1ym3bx4{color:inherit;}"]
16
+ });
17
+ const useInfoButtonStyles = /*#__PURE__*/__styles({
18
+ base: {
19
+ ha4doy: "f12kltsn",
20
+ B6of3ja: "f1bmzb36",
21
+ jrapky: "f1nyzk09"
22
+ },
23
+ large: {
24
+ B6of3ja: "fkrn0sh",
25
+ jrapky: "fmxx68s"
26
+ }
27
+ }, {
28
+ d: [".f12kltsn{vertical-align:top;}", ".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}", ".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}", ".fkrn0sh{margin-top:-1px;}", ".fmxx68s{margin-bottom:-1px;}"]
29
+ });
30
+ /**
31
+ * Apply styling to the InfoLabel slots based on the state
32
+ */
33
+ export const useInfoLabelStyles_unstable = state => {
34
+ state.root.className = mergeClasses(infoLabelClassNames.root, state.root.className);
35
+ const labelStyles = useLabelStyles();
36
+ state.label.className = mergeClasses(infoLabelClassNames.label, labelStyles.base, state.label.className);
37
+ const infoButtonStyles = useInfoButtonStyles();
38
+ if (state.infoButton) {
39
+ state.infoButton.className = mergeClasses(infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
40
+ }
41
+ return state;
42
+ };
43
+ //# sourceMappingURL=useInfoLabelStyles.js.map
@@ -0,0 +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":["../src/packages/react-components/react-infobutton/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,uBAAuB;AAE9C,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AAGzD,OAAO,MAAMC,mBAAmB,GAAmC;EACjEC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,sBAAsB;EAC7BC,UAAU,EAAE;CACb;AAED,MAAMC,cAAc,gBAAGN,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAMrB;AAEF,MAAMC,mBAAmB,gBAAGZ,QAAA;EAAAO,IAAA;IAAAC,MAAA;IAAAK,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,EAc1B;AAEF;;;AAGA,OAAO,MAAMK,2BAA2B,GAAIC,KAAqB,IAAoB;EACnFA,KAAK,CAACd,IAAI,CAACe,SAAS,GAAGjB,YAAY,CAACC,mBAAmB,CAACC,IAAI,EAAEc,KAAK,CAACd,IAAI,CAACe,SAAS,CAAC;EAEnF,MAAMC,WAAW,GAAGb,cAAc,EAAE;EACpCW,KAAK,CAACb,KAAK,CAACc,SAAS,GAAGjB,YAAY,CAACC,mBAAmB,CAACE,KAAK,EAAEe,WAAW,CAACZ,IAAI,EAAEU,KAAK,CAACb,KAAK,CAACc,SAAS,CAAC;EAExG,MAAME,gBAAgB,GAAGR,mBAAmB,EAAE;EAC9C,IAAIK,KAAK,CAACZ,UAAU,EAAE;IACpBY,KAAK,CAACZ,UAAU,CAACa,SAAS,GAAGjB,YAAY,CACvCC,mBAAmB,CAACG,UAAU,EAC9Be,gBAAgB,CAACb,IAAI,EACrBU,KAAK,CAACI,IAAI,KAAK,OAAO,IAAID,gBAAgB,CAACL,KAAK,EAChDE,KAAK,CAACZ,UAAU,CAACa,SAAS,CAC3B;;EAGH,OAAOD,KAAK;AACd,CAAC"}
package/lib/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { InfoButton, infoButtonClassNames, renderInfoButton_unstable, useInfoButtonStyles_unstable, useInfoButton_unstable } from './InfoButton';
2
+ export { InfoLabel, infoLabelClassNames, renderInfoLabel_unstable, useInfoLabelStyles_unstable, useInfoLabel_unstable } from './InfoLabel';
2
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"sources":["../src/packages/react-components/react-infobutton/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';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB,cAAc"}
1
+ {"version":3,"names":["InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"sources":["../src/packages/react-components/react-infobutton/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,cAAc;AAErB,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB,aAAa"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const tslib_1 = /*#__PURE__*/require("tslib");
7
+ tslib_1.__exportStar(require("./components/InfoLabel/index"), exports);
8
+ //# sourceMappingURL=InfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-infobutton/src/InfoLabel.ts"],"sourcesContent":["export * from './components/InfoLabel/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,kCAAAC,OAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InfoLabel = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const renderInfoLabel_1 = /*#__PURE__*/require("./renderInfoLabel");
9
+ const useInfoLabel_1 = /*#__PURE__*/require("./useInfoLabel");
10
+ const useInfoLabelStyles_1 = /*#__PURE__*/require("./useInfoLabelStyles");
11
+ /**
12
+ * InfoLabel component
13
+ */
14
+ exports.InfoLabel = /*#__PURE__*/React.forwardRef((props, ref) => {
15
+ const state = useInfoLabel_1.useInfoLabel_unstable(props, ref);
16
+ useInfoLabelStyles_1.useInfoLabelStyles_unstable(state);
17
+ return renderInfoLabel_1.renderInfoLabel_unstable(state);
18
+ });
19
+ exports.InfoLabel.displayName = 'InfoLabel';
20
+ //# sourceMappingURL=InfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","require","renderInfoLabel_1","useInfoLabel_1","useInfoLabelStyles_1","exports","InfoLabel","forwardRef","props","ref","state","useInfoLabel_unstable","useInfoLabelStyles_unstable","renderInfoLabel_unstable","displayName"],"sources":["../src/packages/react-components/react-infobutton/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,MAAAA,KAAA,gBAAAC,OAAA;AAIA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,cAAA,gBAAAF,OAAA;AACA,MAAAG,oBAAA,gBAAAH,OAAA;AAEA;;;AAGaI,OAAA,CAAAC,SAAS,gBAAwCN,KAAK,CAACO,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC5F,MAAMC,KAAK,GAAGP,cAAA,CAAAQ,qBAAqB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE/CL,oBAAA,CAAAQ,2BAA2B,CAACF,KAAK,CAAC;EAClC,OAAOR,iBAAA,CAAAW,wBAAwB,CAACH,KAAK,CAAC;AACxC,CAAC,CAAC;AAEFL,OAAA,CAAAC,SAAS,CAACQ,WAAW,GAAG,WAAW"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=InfoLabel.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../src/packages/react-components/react-infobutton/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":""}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const tslib_1 = /*#__PURE__*/require("tslib");
7
+ tslib_1.__exportStar(require("./InfoLabel"), exports);
8
+ tslib_1.__exportStar(require("./InfoLabel.types"), exports);
9
+ tslib_1.__exportStar(require("./renderInfoLabel"), exports);
10
+ tslib_1.__exportStar(require("./useInfoLabel"), exports);
11
+ tslib_1.__exportStar(require("./useInfoLabelStyles"), exports);
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoLabel/index.ts"],"sourcesContent":["export * from './InfoLabel';\nexport * from './InfoLabel.types';\nexport * from './renderInfoLabel';\nexport * from './useInfoLabel';\nexport * from './useInfoLabelStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,iBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,uBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,uBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,oBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,0BAAAC,OAAA"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderInfoLabel_unstable = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ /**
10
+ * Render the final JSX of InfoLabel
11
+ */
12
+ const renderInfoLabel_unstable = state => {
13
+ const {
14
+ slots,
15
+ slotProps
16
+ } = react_utilities_1.getSlots(state);
17
+ return React.createElement(slots.root, {
18
+ ...slotProps.root
19
+ }, React.createElement(slots.label, {
20
+ ...slotProps.label
21
+ }), slots.infoButton && React.createElement(slots.infoButton, {
22
+ ...slotProps.infoButton
23
+ }));
24
+ };
25
+ exports.renderInfoLabel_unstable = renderInfoLabel_unstable;
26
+ //# sourceMappingURL=renderInfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","require","react_utilities_1","renderInfoLabel_unstable","state","slots","slotProps","getSlots","createElement","root","label","infoButton","exports"],"sources":["../src/packages/react-components/react-infobutton/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,MAAAA,KAAA,gBAAAC,OAAA;AAEA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,wBAAwB,GAAIC,KAAqB,IAAI;EAChE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAiBH,KAAK,CAAC;EAE5D,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BT,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,KAAK;IAAA,GAAKJ,SAAS,CAACI;EAAK,EAAI,EACnCL,KAAK,CAACM,UAAU,IAAIX,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACM,UAAU;IAAA,GAAKL,SAAS,CAACK;EAAU,EAAI,CACxD;AAEjB,CAAC;AATYC,OAAA,CAAAT,wBAAwB,GAAAA,wBAAA"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useInfoLabel_unstable = void 0;
7
+ const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
+ const InfoButton_1 = /*#__PURE__*/require("../InfoButton/InfoButton");
10
+ /**
11
+ * Create the state required to render InfoLabel.
12
+ *
13
+ * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,
14
+ * before being passed to renderInfoLabel_unstable.
15
+ *
16
+ * @param props - props from this instance of InfoLabel
17
+ * @param ref - reference to label element of InfoLabel
18
+ */
19
+ const useInfoLabel_unstable = (props, ref) => {
20
+ var _a;
21
+ const {
22
+ root: rootShorthand,
23
+ label: labelShorthand,
24
+ infoButton: infoButtonShorthand,
25
+ size,
26
+ info,
27
+ className,
28
+ style,
29
+ ...labelProps
30
+ } = props;
31
+ const root = react_utilities_1.resolveShorthand(rootShorthand, {
32
+ required: true,
33
+ defaultProps: {
34
+ className,
35
+ style
36
+ }
37
+ });
38
+ const label = react_utilities_1.resolveShorthand(labelShorthand, {
39
+ required: true,
40
+ defaultProps: {
41
+ id: react_utilities_1.useId('infolabel-'),
42
+ ref,
43
+ size,
44
+ ...labelProps
45
+ }
46
+ });
47
+ const infoButton = react_utilities_1.resolveShorthand(infoButtonShorthand, {
48
+ required: !!info,
49
+ defaultProps: {
50
+ id: react_utilities_1.useId('infobutton-'),
51
+ content: info,
52
+ size
53
+ }
54
+ });
55
+ if (infoButton) {
56
+ (_a = infoButton['aria-labelledby']) !== null && _a !== void 0 ? _a : infoButton['aria-labelledby'] = `${label.id} ${infoButton.id}`;
57
+ }
58
+ return {
59
+ size,
60
+ components: {
61
+ root: 'span',
62
+ label: react_label_1.Label,
63
+ infoButton: InfoButton_1.InfoButton
64
+ },
65
+ root,
66
+ label,
67
+ infoButton
68
+ };
69
+ };
70
+ exports.useInfoLabel_unstable = useInfoLabel_unstable;
71
+ //# sourceMappingURL=useInfoLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["react_label_1","require","react_utilities_1","InfoButton_1","useInfoLabel_unstable","props","ref","root","rootShorthand","label","labelShorthand","infoButton","infoButtonShorthand","size","info","className","style","labelProps","resolveShorthand","required","defaultProps","id","useId","content","_a","components","Label","InfoButton","exports"],"sources":["../src/packages/react-components/react-infobutton/src/components/InfoLabel/useInfoLabel.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { Label } from '@fluentui/react-label';\nimport { resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { InfoButton } from '../InfoButton/InfoButton';\nimport type { InfoLabelProps, InfoLabelState } from './InfoLabel.types';\n\n/**\n * Create the state required to render InfoLabel.\n *\n * The returned state can be modified with hooks such as useInfoLabelStyles_unstable,\n * before being passed to renderInfoLabel_unstable.\n *\n * @param props - props from this instance of InfoLabel\n * @param ref - reference to label element of InfoLabel\n */\nexport const useInfoLabel_unstable = (props: InfoLabelProps, ref: React.Ref<HTMLLabelElement>): InfoLabelState => {\n const {\n root: rootShorthand,\n label: labelShorthand,\n infoButton: infoButtonShorthand,\n size,\n info,\n className,\n style,\n ...labelProps\n } = props;\n\n const root = resolveShorthand(rootShorthand, {\n required: true,\n defaultProps: {\n className,\n style,\n },\n });\n\n const label = resolveShorthand(labelShorthand, {\n required: true,\n defaultProps: {\n id: useId('infolabel-'),\n ref,\n size,\n ...labelProps,\n },\n });\n\n const infoButton = resolveShorthand(infoButtonShorthand, {\n required: !!info,\n defaultProps: {\n id: useId('infobutton-'),\n content: info,\n size,\n },\n });\n\n if (infoButton) {\n infoButton['aria-labelledby'] ??= `${label.id} ${infoButton.id}`;\n }\n\n return {\n size,\n components: {\n root: 'span',\n label: Label,\n infoButton: InfoButton,\n },\n root,\n label,\n infoButton,\n };\n};\n"],"mappings":";;;;;;AAEA,MAAAA,aAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,YAAA,gBAAAF,OAAA;AAGA;;;;;;;;;AASO,MAAMG,qBAAqB,GAAGA,CAACC,KAAqB,EAAEC,GAAgC,KAAoB;;EAC/G,MAAM;IACJC,IAAI,EAAEC,aAAa;IACnBC,KAAK,EAAEC,cAAc;IACrBC,UAAU,EAAEC,mBAAmB;IAC/BC,IAAI;IACJC,IAAI;IACJC,SAAS;IACTC,KAAK;IACL,GAAGC;EAAU,CACd,GAAGZ,KAAK;EAET,MAAME,IAAI,GAAGL,iBAAA,CAAAgB,gBAAgB,CAACV,aAAa,EAAE;IAC3CW,QAAQ,EAAE,IAAI;IACdC,YAAY,EAAE;MACZL,SAAS;MACTC;;GAEH,CAAC;EAEF,MAAMP,KAAK,GAAGP,iBAAA,CAAAgB,gBAAgB,CAACR,cAAc,EAAE;IAC7CS,QAAQ,EAAE,IAAI;IACdC,YAAY,EAAE;MACZC,EAAE,EAAEnB,iBAAA,CAAAoB,KAAK,CAAC,YAAY,CAAC;MACvBhB,GAAG;MACHO,IAAI;MACJ,GAAGI;;GAEN,CAAC;EAEF,MAAMN,UAAU,GAAGT,iBAAA,CAAAgB,gBAAgB,CAACN,mBAAmB,EAAE;IACvDO,QAAQ,EAAE,CAAC,CAACL,IAAI;IAChBM,YAAY,EAAE;MACZC,EAAE,EAAEnB,iBAAA,CAAAoB,KAAK,CAAC,aAAa,CAAC;MACxBC,OAAO,EAAET,IAAI;MACbD;;GAEH,CAAC;EAEF,IAAIF,UAAU,EAAE;IACd,CAAAa,EAAA,GAAAb,UAAU,CAAC,iBAAiB,eAAAa,EAAA,cAAAA,EAAA,GAA5Bb,UAAU,CAAC,iBAAiB,IAAM,GAAGF,KAAK,CAACY,EAAE,IAAIV,UAAU,CAACU,EAAE,EAAE;;EAGlE,OAAO;IACLR,IAAI;IACJY,UAAU,EAAE;MACVlB,IAAI,EAAE,MAAM;MACZE,KAAK,EAAET,aAAA,CAAA0B,KAAK;MACZf,UAAU,EAAER,YAAA,CAAAwB;KACb;IACDpB,IAAI;IACJE,KAAK;IACLE;GACD;AACH,CAAC;AAtDYiB,OAAA,CAAAxB,qBAAqB,GAAAA,qBAAA"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useInfoLabelStyles_unstable = exports.infoLabelClassNames = void 0;
7
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
+ exports.infoLabelClassNames = {
10
+ root: 'fui-InfoLabel',
11
+ label: 'fui-InfoLabel__label',
12
+ infoButton: 'fui-InfoLabel__infoButton'
13
+ };
14
+ const useLabelStyles = /*#__PURE__*/react_1.__styles({
15
+ base: {
16
+ ha4doy: "f12kltsn",
17
+ Bceei9c: "fpo1scq",
18
+ sj55zd: "f1ym3bx4"
19
+ }
20
+ }, {
21
+ d: [".f12kltsn{vertical-align:top;}", ".fpo1scq{cursor:inherit;}", ".f1ym3bx4{color:inherit;}"]
22
+ });
23
+ const useInfoButtonStyles = /*#__PURE__*/react_1.__styles({
24
+ base: {
25
+ ha4doy: "f12kltsn",
26
+ B6of3ja: "f1bmzb36",
27
+ jrapky: "f1nyzk09"
28
+ },
29
+ large: {
30
+ B6of3ja: "fkrn0sh",
31
+ jrapky: "fmxx68s"
32
+ }
33
+ }, {
34
+ d: [".f12kltsn{vertical-align:top;}", ".f1bmzb36{margin-top:calc(0px - var(--spacingVerticalXXS));}", ".f1nyzk09{margin-bottom:calc(0px - var(--spacingVerticalXXS));}", ".fkrn0sh{margin-top:-1px;}", ".fmxx68s{margin-bottom:-1px;}"]
35
+ });
36
+ /**
37
+ * Apply styling to the InfoLabel slots based on the state
38
+ */
39
+ const useInfoLabelStyles_unstable = state => {
40
+ state.root.className = react_1.mergeClasses(exports.infoLabelClassNames.root, state.root.className);
41
+ const labelStyles = useLabelStyles();
42
+ state.label.className = react_1.mergeClasses(exports.infoLabelClassNames.label, labelStyles.base, state.label.className);
43
+ const infoButtonStyles = useInfoButtonStyles();
44
+ if (state.infoButton) {
45
+ state.infoButton.className = react_1.mergeClasses(exports.infoLabelClassNames.infoButton, infoButtonStyles.base, state.size === 'large' && infoButtonStyles.large, state.infoButton.className);
46
+ }
47
+ return state;
48
+ };
49
+ exports.useInfoLabelStyles_unstable = useInfoLabelStyles_unstable;
50
+ //# sourceMappingURL=useInfoLabelStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["react_theme_1","require","react_1","exports","infoLabelClassNames","root","label","infoButton","useLabelStyles","__styles","base","ha4doy","Bceei9c","sj55zd","d","useInfoButtonStyles","B6of3ja","jrapky","large","useInfoLabelStyles_unstable","state","className","mergeClasses","labelStyles","infoButtonStyles","size"],"sources":["../src/packages/react-components/react-infobutton/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,MAAAA,aAAA,gBAAAC,OAAA;AAEA,MAAAC,OAAA,gBAAAD,OAAA;AAGaE,OAAA,CAAAC,mBAAmB,GAAmC;EACjEC,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,sBAAsB;EAC7BC,UAAU,EAAE;CACb;AAED,MAAMC,cAAc,gBAAGN,OAAA,CAAAO,QAAU;EAAAC,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAM/B;AAEF,MAAMC,mBAAmB,gBAAGb,OAAA,CAAAO,QAAU;EAAAC,IAAA;IAAAC,MAAA;IAAAK,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAF,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAH,CAAA;AAAA,EAcpC;AAEF;;;AAGO,MAAMK,2BAA2B,GAAIC,KAAqB,IAAoB;EACnFA,KAAK,CAACf,IAAI,CAACgB,SAAS,GAAGnB,OAAA,CAAAoB,YAAY,CAACnB,OAAA,CAAAC,mBAAmB,CAACC,IAAI,EAAEe,KAAK,CAACf,IAAI,CAACgB,SAAS,CAAC;EAEnF,MAAME,WAAW,GAAGf,cAAc,EAAE;EACpCY,KAAK,CAACd,KAAK,CAACe,SAAS,GAAGnB,OAAA,CAAAoB,YAAY,CAACnB,OAAA,CAAAC,mBAAmB,CAACE,KAAK,EAAEiB,WAAW,CAACb,IAAI,EAAEU,KAAK,CAACd,KAAK,CAACe,SAAS,CAAC;EAExG,MAAMG,gBAAgB,GAAGT,mBAAmB,EAAE;EAC9C,IAAIK,KAAK,CAACb,UAAU,EAAE;IACpBa,KAAK,CAACb,UAAU,CAACc,SAAS,GAAGnB,OAAA,CAAAoB,YAAY,CACvCnB,OAAA,CAAAC,mBAAmB,CAACG,UAAU,EAC9BiB,gBAAgB,CAACd,IAAI,EACrBU,KAAK,CAACK,IAAI,KAAK,OAAO,IAAID,gBAAgB,CAACN,KAAK,EAChDE,KAAK,CAACb,UAAU,CAACc,SAAS,CAC3B;;EAGH,OAAOD,KAAK;AACd,CAAC;AAjBYjB,OAAA,CAAAgB,2BAA2B,GAAAA,2BAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useInfoButton_unstable = exports.useInfoButtonStyles_unstable = exports.renderInfoButton_unstable = exports.infoButtonClassNames = exports.InfoButton = void 0;
6
+ exports.useInfoLabel_unstable = exports.useInfoLabelStyles_unstable = exports.renderInfoLabel_unstable = exports.infoLabelClassNames = exports.InfoLabel = exports.useInfoButton_unstable = exports.useInfoButtonStyles_unstable = exports.renderInfoButton_unstable = exports.infoButtonClassNames = exports.InfoButton = void 0;
7
7
  var InfoButton_1 = /*#__PURE__*/require("./InfoButton");
8
8
  Object.defineProperty(exports, "InfoButton", {
9
9
  enumerable: true,
@@ -35,4 +35,35 @@ Object.defineProperty(exports, "useInfoButton_unstable", {
35
35
  return InfoButton_1.useInfoButton_unstable;
36
36
  }
37
37
  });
38
+ var InfoLabel_1 = /*#__PURE__*/require("./InfoLabel");
39
+ Object.defineProperty(exports, "InfoLabel", {
40
+ enumerable: true,
41
+ get: function () {
42
+ return InfoLabel_1.InfoLabel;
43
+ }
44
+ });
45
+ Object.defineProperty(exports, "infoLabelClassNames", {
46
+ enumerable: true,
47
+ get: function () {
48
+ return InfoLabel_1.infoLabelClassNames;
49
+ }
50
+ });
51
+ Object.defineProperty(exports, "renderInfoLabel_unstable", {
52
+ enumerable: true,
53
+ get: function () {
54
+ return InfoLabel_1.renderInfoLabel_unstable;
55
+ }
56
+ });
57
+ Object.defineProperty(exports, "useInfoLabelStyles_unstable", {
58
+ enumerable: true,
59
+ get: function () {
60
+ return InfoLabel_1.useInfoLabelStyles_unstable;
61
+ }
62
+ });
63
+ Object.defineProperty(exports, "useInfoLabel_unstable", {
64
+ enumerable: true,
65
+ get: function () {
66
+ return InfoLabel_1.useInfoLabel_unstable;
67
+ }
68
+ });
38
69
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["InfoButton_1","require","Object","defineProperty","exports","enumerable","get","InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable"],"sources":["../src/packages/react-components/react-infobutton/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';\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,gBAAAC,OAAA;AACEC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAO,UAAU;EAAA;AAAA;AACVL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAQ,oBAAoB;EAAA;AAAA;AACpBN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAS,yBAAyB;EAAA;AAAA;AACzBP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAU,4BAA4B;EAAA;AAAA;AAC5BR,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAW,sBAAsB;EAAA;AAAA"}
1
+ {"version":3,"names":["InfoButton_1","require","Object","defineProperty","exports","enumerable","get","InfoButton","infoButtonClassNames","renderInfoButton_unstable","useInfoButtonStyles_unstable","useInfoButton_unstable","InfoLabel_1","InfoLabel","infoLabelClassNames","renderInfoLabel_unstable","useInfoLabelStyles_unstable","useInfoLabel_unstable"],"sources":["../src/packages/react-components/react-infobutton/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,IAAAA,YAAA,gBAAAC,OAAA;AACEC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAO,UAAU;EAAA;AAAA;AACVL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAQ,oBAAoB;EAAA;AAAA;AACpBN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAS,yBAAyB;EAAA;AAAA;AACzBP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAU,4BAA4B;EAAA;AAAA;AAC5BR,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,YAAA,CAAAW,sBAAsB;EAAA;AAAA;AAGxB,IAAAC,WAAA,gBAAAX,OAAA;AACEC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,WAAA,CAAAC,SAAS;EAAA;AAAA;AACTX,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,WAAA,CAAAE,mBAAmB;EAAA;AAAA;AACnBZ,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,WAAA,CAAAG,wBAAwB;EAAA;AAAA;AACxBb,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,WAAA,CAAAI,2BAA2B;EAAA;AAAA;AAC3Bd,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,WAAA,CAAAK,qBAAqB;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-infobutton",
3
- "version": "9.0.0-beta.21",
3
+ "version": "9.0.0-beta.22",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -33,10 +33,11 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@fluentui/react-icons": "^2.0.175",
36
- "@fluentui/react-popover": "^9.5.3",
37
- "@fluentui/react-tabster": "^9.5.7",
36
+ "@fluentui/react-label": "^9.1.4",
37
+ "@fluentui/react-popover": "^9.5.4",
38
+ "@fluentui/react-tabster": "^9.6.0",
38
39
  "@fluentui/react-theme": "^9.1.6",
39
- "@fluentui/react-utilities": "^9.7.0",
40
+ "@fluentui/react-utilities": "^9.7.1",
40
41
  "@griffel/react": "^1.5.2",
41
42
  "tslib": "^2.1.0"
42
43
  },