@fluentui/react-label
Advanced tools
Comparing version 0.0.0-nightlyfbae36b19b20211111.1 to 0.0.0-nightlyfc5cfdc52420220215.1
@@ -5,5 +5,5 @@ { | ||
{ | ||
"date": "Thu, 11 Nov 2021 04:18:59 GMT", | ||
"tag": "@fluentui/react-label_v0.0.0-nightlyfbae36b19b20211111.1", | ||
"version": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"date": "Tue, 15 Feb 2022 04:11:40 GMT", | ||
"tag": "@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1", | ||
"version": "0.0.0-nightlyfc5cfdc52420220215.1", | ||
"comments": { | ||
@@ -14,22 +14,129 @@ "prerelease": [ | ||
"package": "@fluentui/react-label", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025", | ||
"commit": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9", | ||
"comment": "Release nightly v9" | ||
}, | ||
{ | ||
"author": "gcox@microsoft.com", | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586", | ||
"comment": "Updated beta and RC components to ES2019" | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyfc5cfdc52420220215.1", | ||
"commit": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyfc5cfdc52420220215.1", | ||
"commit": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Thu, 10 Feb 2022 08:51:22 GMT", | ||
"tag": "@fluentui/react-label_v9.0.0-beta.5", | ||
"version": "9.0.0-beta.5", | ||
"comments": { | ||
"none": [ | ||
{ | ||
"author": "martinhochel@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "8dfa712156b70414205b87b5b6d099367b0c297d", | ||
"comment": "chore: use storybook runner for all vNext packages" | ||
}, | ||
{ | ||
"author": "elcraig@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "d892c7f79c543b6008634ecd669b75b5108cad46", | ||
"comment": "Relocate comment about props to the correct type, and update spec to accurately reflect props" | ||
}, | ||
{ | ||
"author": "bsunderhus@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "c0d4e63ee58e60e2c6674efbacc0783cd520984e", | ||
"comment": "Updates components with nullRender changes" | ||
}, | ||
{ | ||
"author": "elcraig@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "96d9c93544464bcc5ec36b7c5d724b77ae499c73", | ||
"comment": "Update docs description" | ||
}, | ||
{ | ||
"author": "andredias@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "084a7183511bae60a43e57fbd57979349c4736a4", | ||
"comment": "Migrate package to use solution tsconfigs" | ||
}, | ||
{ | ||
"author": "olfedias@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "9186578324773f95f4d61be3d70e67752159d843", | ||
"comment": "export static classes for components" | ||
"commit": "c061e98be4b4a718c72a144a1f60bb5515824612", | ||
"comment": "remove inline-style-expand-shorthand from tsconfigs" | ||
} | ||
], | ||
"prerelease": [ | ||
{ | ||
"author": "lingfangao@hotmail.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f", | ||
"comment": "Bump Fluent UI dependencies to 9.0.0-rc" | ||
}, | ||
{ | ||
"author": "olfedias@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "742c191b7f2ea28505e49304117c090f9f36386c", | ||
"comment": "Replace make-styles packages with griffel equivalents." | ||
}, | ||
{ | ||
"author": "mgodbolt@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "839ec14849e112b85aa321d034739ec421199141", | ||
"comment": "remove export of commons types" | ||
}, | ||
{ | ||
"author": "Humberto.Morimoto@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "e0b8e1fa6980077e7b311fd1c72c28d3e4305db0", | ||
"comment": "Updating based on changes to composition types." | ||
}, | ||
{ | ||
"author": "Humberto.Morimoto@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "0bc161458eae5ae8d387172430496ce9829b1bb1", | ||
"comment": "Using ComponentSlotProps instead of ObjectShorthandProps." | ||
}, | ||
{ | ||
"author": "behowell@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3", | ||
"comment": "Refactor component Slot typings" | ||
}, | ||
{ | ||
"author": "Humberto.Morimoto@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "a052fbc9204600669d32b0ac346032d2cd8d9204", | ||
"comment": "react-label: Replacing use of functions in makeStyles with direct use of tokens." | ||
}, | ||
{ | ||
"author": "behowell@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "7cc28ed8320b00f42d91c63882f10316db2205c5", | ||
"comment": "Remove component's shorthandProps array" | ||
}, | ||
{ | ||
"author": "behowell@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "317209bb5cd57c40f35bc42060acb7e3cce5ec95", | ||
"comment": "BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet" | ||
}, | ||
{ | ||
"author": "Humberto.Morimoto@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "00a5d945904c896a0664de6ba72c145a255f0848", | ||
"comment": "Updating use of tokens.fontWeight now that we don't need to use casting." | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyfbae36b19b20211111.1", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025" | ||
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1", | ||
"commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8" | ||
}, | ||
@@ -39,4 +146,19 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyfbae36b19b20211111.1", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025" | ||
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1", | ||
"commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Thu, 25 Nov 2021 08:34:14 GMT", | ||
"tag": "@fluentui/react-label_v9.0.0-beta.4", | ||
"version": "9.0.0-beta.4", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"author": "ololubek@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "a683ee69b17c667227acb71c59f609b4f1ca1ef9", | ||
"comment": "Add aria-hidden to Label required field" | ||
}, | ||
@@ -46,4 +168,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyfbae36b19b20211111.1", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025" | ||
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4", | ||
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b" | ||
}, | ||
@@ -53,4 +175,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyfbae36b19b20211111.1", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025" | ||
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4", | ||
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b" | ||
}, | ||
@@ -60,6 +182,25 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyfbae36b19b20211111.1", | ||
"commit": "b913f5d66978b4e311c72ff6ba9f00d5817ab025" | ||
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.4", | ||
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4", | ||
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4", | ||
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b" | ||
} | ||
], | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 12 Nov 2021 13:25:25 GMT", | ||
"tag": "@fluentui/react-label_v9.0.0-beta.3", | ||
"version": "9.0.0-beta.3", | ||
"comments": { | ||
"none": [ | ||
@@ -71,3 +212,53 @@ { | ||
"comment": "chore(Label): Rework documentation to desired format" | ||
}, | ||
{ | ||
"author": "lingfangao@hotmail.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "00f70581480b536e723fb69edf0ae617beac4807", | ||
"comment": "Remove beta release tag" | ||
} | ||
], | ||
"prerelease": [ | ||
{ | ||
"author": "gcox@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586", | ||
"comment": "Updated beta and RC components to ES2019" | ||
}, | ||
{ | ||
"author": "olfedias@microsoft.com", | ||
"package": "@fluentui/react-label", | ||
"commit": "9186578324773f95f4d61be3d70e67752159d843", | ||
"comment": "export static classes for components" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3", | ||
"commit": "742342e52c65066f779232e4e1302fedf0dd460d" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3", | ||
"commit": "742342e52c65066f779232e4e1302fedf0dd460d" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.3", | ||
"commit": "742342e52c65066f779232e4e1302fedf0dd460d" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3", | ||
"commit": "742342e52c65066f779232e4e1302fedf0dd460d" | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3", | ||
"commit": "742342e52c65066f779232e4e1302fedf0dd460d" | ||
} | ||
] | ||
@@ -74,0 +265,0 @@ } |
# Change Log - @fluentui/react-label | ||
This log was last generated on Thu, 11 Nov 2021 04:18:59 GMT and should not be manually modified. | ||
This log was last generated on Tue, 15 Feb 2022 04:11:40 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [0.0.0-nightlyfbae36b19b20211111.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightlyfbae36b19b20211111.1) | ||
## [0.0.0-nightlyfc5cfdc52420220215.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1) | ||
Thu, 11 Nov 2021 04:18:59 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.2..@fluentui/react-label_v0.0.0-nightlyfbae36b19b20211111.1) | ||
Tue, 15 Feb 2022 04:11:40 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.5..@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1) | ||
### Changes | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by email not defined) | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by email not defined) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightlyfc5cfdc52420220215.1 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyfc5cfdc52420220215.1 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by beachball) | ||
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.5) | ||
Thu, 10 Feb 2022 08:51:22 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v9.0.0-beta.5) | ||
### Changes | ||
- Bump Fluent UI dependencies to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com) | ||
- Replace make-styles packages with griffel equivalents. ([PR #21430](https://github.com/microsoft/fluentui/pull/21430) by olfedias@microsoft.com) | ||
- remove export of commons types ([PR #21660](https://github.com/microsoft/fluentui/pull/21660) by mgodbolt@microsoft.com) | ||
- Updating based on changes to composition types. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com) | ||
- Using ComponentSlotProps instead of ObjectShorthandProps. ([PR #20890](https://github.com/microsoft/fluentui/pull/20890) by Humberto.Morimoto@microsoft.com) | ||
- Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com) | ||
- react-label: Replacing use of functions in makeStyles with direct use of tokens. ([PR #21046](https://github.com/microsoft/fluentui/pull/21046) by Humberto.Morimoto@microsoft.com) | ||
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com) | ||
- BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com) | ||
- Updating use of tokens.fontWeight now that we don't need to use casting. ([PR #21217](https://github.com/microsoft/fluentui/pull/21217) by Humberto.Morimoto@microsoft.com) | ||
- Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball) | ||
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball) | ||
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.4) | ||
Thu, 25 Nov 2021 08:34:14 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.3..@fluentui/react-label_v9.0.0-beta.4) | ||
### Changes | ||
- Add aria-hidden to Label required field ([PR #20680](https://github.com/microsoft/fluentui/pull/20680) by ololubek@microsoft.com) | ||
- Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball) | ||
- Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball) | ||
- Bump @fluentui/babel-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball) | ||
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball) | ||
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball) | ||
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.3) | ||
Fri, 12 Nov 2021 13:25:25 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.2..@fluentui/react-label_v9.0.0-beta.3) | ||
### Changes | ||
- Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com) | ||
- export static classes for components ([PR #20456](https://github.com/microsoft/fluentui/pull/20456) by olfedias@microsoft.com) | ||
- Bump @fluentui/react-make-styles to v0.0.0-nightlyfbae36b19b20211111.1 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightlyfbae36b19b20211111.1 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by beachball) | ||
- Bump @fluentui/babel-make-styles to v0.0.0-nightlyfbae36b19b20211111.1 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by beachball) | ||
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyfbae36b19b20211111.1 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by beachball) | ||
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyfbae36b19b20211111.1 ([commit](https://github.com/microsoft/fluentui/commit/b913f5d66978b4e311c72ff6ba9f00d5817ab025) by beachball) | ||
- Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball) | ||
- Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball) | ||
- Bump @fluentui/babel-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball) | ||
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball) | ||
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball) | ||
@@ -23,0 +67,0 @@ ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.2) |
import type { ComponentProps } from '@fluentui/react-utilities'; | ||
import type { ComponentState } from '@fluentui/react-utilities'; | ||
import type { ForwardRefComponent } from '@fluentui/react-utilities'; | ||
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities'; | ||
import type { ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React_2 from 'react'; | ||
import type { Slot } from '@fluentui/react-utilities'; | ||
@@ -15,6 +14,3 @@ /** | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
declare type LabelCommons = { | ||
/** | ||
@@ -37,2 +33,5 @@ * Renders the label as disabled | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -44,14 +43,8 @@ /** | ||
*/ | ||
required?: boolean | ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>> | React_2.ReactNode; | ||
required?: boolean | Slot<'span'>; | ||
}; | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
export declare const labelShorthandProps: Array<keyof LabelSlots>; | ||
export declare type LabelSlots = { | ||
root: IntrinsicShorthandProps<'label'>; | ||
required?: IntrinsicShorthandProps<'span'>; | ||
root: Slot<'label'>; | ||
required?: Slot<'span'>; | ||
}; | ||
@@ -67,3 +60,3 @@ | ||
*/ | ||
export declare const renderLabel: (state: LabelState) => JSX.Element; | ||
export declare const renderLabel_unstable: (state: LabelState) => JSX.Element; | ||
@@ -73,4 +66,4 @@ /** | ||
* | ||
* The returned state can be modified with hooks such as useLabelStyles, | ||
* before being passed to renderLabel. | ||
* The returned state can be modified with hooks such as useLabelStyles_unstable, | ||
* before being passed to renderLabel_unstable. | ||
* | ||
@@ -80,3 +73,3 @@ * @param props - props from this instance of Label | ||
*/ | ||
export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState; | ||
export declare const useLabel_unstable: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState; | ||
@@ -86,4 +79,4 @@ /** | ||
*/ | ||
export declare const useLabelStyles: (state: LabelState) => LabelState; | ||
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState; | ||
export { } |
@@ -21,7 +21,7 @@ "use strict"; | ||
exports.Label = /*#__PURE__*/React.forwardRef((props, ref) => { | ||
const state = useLabel_1.useLabel(props, ref); | ||
useLabelStyles_1.useLabelStyles(state); | ||
return renderLabel_1.renderLabel(state); | ||
const state = useLabel_1.useLabel_unstable(props, ref); | ||
useLabelStyles_1.useLabelStyles_unstable(state); | ||
return renderLabel_1.renderLabel_unstable(state); | ||
}); | ||
exports.Label.displayName = 'Label'; | ||
//# sourceMappingURL=Label.js.map |
@@ -1,7 +0,3 @@ | ||
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React from 'react'; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; | ||
declare type LabelCommons = { | ||
/** | ||
@@ -24,4 +20,4 @@ * Renders the label as disabled | ||
export declare type LabelSlots = { | ||
root: IntrinsicShorthandProps<'label'>; | ||
required?: IntrinsicShorthandProps<'span'>; | ||
root: Slot<'label'>; | ||
required?: Slot<'span'>; | ||
}; | ||
@@ -32,2 +28,5 @@ /** | ||
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -39,3 +38,4 @@ /** | ||
*/ | ||
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode; | ||
required?: boolean | Slot<'span'>; | ||
}; | ||
export {}; |
@@ -5,2 +5,2 @@ import type { LabelState } from './Label.types'; | ||
*/ | ||
export declare const renderLabel: (state: LabelState) => JSX.Element; | ||
export declare const renderLabel_unstable: (state: LabelState) => JSX.Element; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.renderLabel = void 0; | ||
exports.renderLabel_unstable = void 0; | ||
@@ -12,4 +12,2 @@ const React = /*#__PURE__*/require("react"); | ||
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities"); | ||
const useLabel_1 = /*#__PURE__*/require("./useLabel"); | ||
/** | ||
@@ -20,11 +18,13 @@ * Render the final JSX of Label | ||
const renderLabel = state => { | ||
const renderLabel_unstable = state => { | ||
const { | ||
slots, | ||
slotProps | ||
} = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps); | ||
return React.createElement(slots.root, Object.assign({}, slotProps.root), state.root.children, React.createElement(slots.required, Object.assign({}, slotProps.required))); | ||
} = react_utilities_1.getSlots(state); | ||
return React.createElement(slots.root, { ...slotProps.root | ||
}, state.root.children, slots.required && React.createElement(slots.required, { ...slotProps.required | ||
})); | ||
}; | ||
exports.renderLabel = renderLabel; | ||
exports.renderLabel_unstable = renderLabel_unstable; | ||
//# sourceMappingURL=renderLabel.js.map |
import * as React from 'react'; | ||
import type { LabelProps, LabelSlots, LabelState } from './Label.types'; | ||
import type { LabelProps, LabelState } from './Label.types'; | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
export declare const labelShorthandProps: Array<keyof LabelSlots>; | ||
/** | ||
* Create the state required to render Label. | ||
* | ||
* The returned state can be modified with hooks such as useLabelStyles, | ||
* before being passed to renderLabel. | ||
* The returned state can be modified with hooks such as useLabelStyles_unstable, | ||
* before being passed to renderLabel_unstable. | ||
* | ||
@@ -17,2 +12,2 @@ * @param props - props from this instance of Label | ||
*/ | ||
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState; | ||
export declare const useLabel_unstable: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.useLabel = exports.labelShorthandProps = void 0; | ||
exports.useLabel_unstable = void 0; | ||
@@ -13,13 +13,6 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities"); | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
exports.labelShorthandProps = ['root', 'required']; | ||
/** | ||
* Create the state required to render Label. | ||
* | ||
* The returned state can be modified with hooks such as useLabelStyles, | ||
* before being passed to renderLabel. | ||
* The returned state can be modified with hooks such as useLabelStyles_unstable, | ||
* before being passed to renderLabel_unstable. | ||
* | ||
@@ -30,3 +23,4 @@ * @param props - props from this instance of Label | ||
const useLabel = (props, ref) => { | ||
const useLabel_unstable = (props, ref) => { | ||
const { | ||
@@ -40,6 +34,5 @@ disabled = false, | ||
disabled, | ||
required: react_utilities_2.resolveShorthand(required === false ? null : required, { | ||
required: !!required, | ||
required: react_utilities_2.resolveShorthand(required === true ? '*' : required || undefined, { | ||
defaultProps: { | ||
children: '*' | ||
'aria-hidden': 'true' | ||
} | ||
@@ -60,3 +53,3 @@ }), | ||
exports.useLabel = useLabel; | ||
exports.useLabel_unstable = useLabel_unstable; | ||
//# sourceMappingURL=useLabel.js.map |
@@ -6,2 +6,2 @@ import type { LabelState } from './Label.types'; | ||
*/ | ||
export declare const useLabelStyles: (state: LabelState) => LabelState; | ||
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState; |
@@ -6,6 +6,8 @@ "use strict"; | ||
}); | ||
exports.useLabelStyles = exports.labelClassName = void 0; | ||
exports.useLabelStyles_unstable = exports.labelClassName = void 0; | ||
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles"); | ||
const react_1 = /*#__PURE__*/require("@griffel/react"); | ||
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme"); | ||
exports.labelClassName = 'fui-Label'; | ||
@@ -16,3 +18,3 @@ /** | ||
const useStyles = /*#__PURE__*/react_make_styles_1.__styles({ | ||
const useStyles = /*#__PURE__*/react_1.__styles({ | ||
"root": { | ||
@@ -53,8 +55,8 @@ "Bahqtrf": "fk6fouc", | ||
const useLabelStyles = state => { | ||
const useLabelStyles_unstable = state => { | ||
const styles = useStyles(); | ||
state.root.className = react_make_styles_1.mergeClasses(exports.labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className); | ||
state.root.className = react_1.mergeClasses(exports.labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className); | ||
if (state.required) { | ||
state.required.className = react_make_styles_1.mergeClasses(styles.required, state.required.className); | ||
state.required.className = react_1.mergeClasses(styles.required, state.required.className); | ||
} | ||
@@ -65,3 +67,3 @@ | ||
exports.useLabelStyles = useLabelStyles; | ||
exports.useLabelStyles_unstable = useLabelStyles_unstable; | ||
//# sourceMappingURL=useLabelStyles.js.map |
import * as React from 'react'; | ||
import { useLabel } from './useLabel'; | ||
import { renderLabel } from './renderLabel'; | ||
import { useLabelStyles } from './useLabelStyles'; | ||
import { useLabel_unstable } from './useLabel'; | ||
import { renderLabel_unstable } from './renderLabel'; | ||
import { useLabelStyles_unstable } from './useLabelStyles'; | ||
/** | ||
@@ -10,7 +10,7 @@ * A label component provides a title or name to a component. | ||
export const Label = /*#__PURE__*/React.forwardRef((props, ref) => { | ||
const state = useLabel(props, ref); | ||
useLabelStyles(state); | ||
return renderLabel(state); | ||
const state = useLabel_unstable(props, ref); | ||
useLabelStyles_unstable(state); | ||
return renderLabel_unstable(state); | ||
}); | ||
Label.displayName = 'Label'; | ||
//# sourceMappingURL=Label.js.map |
@@ -1,7 +0,3 @@ | ||
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React from 'react'; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities'; | ||
declare type LabelCommons = { | ||
/** | ||
@@ -24,4 +20,4 @@ * Renders the label as disabled | ||
export declare type LabelSlots = { | ||
root: IntrinsicShorthandProps<'label'>; | ||
required?: IntrinsicShorthandProps<'span'>; | ||
root: Slot<'label'>; | ||
required?: Slot<'span'>; | ||
}; | ||
@@ -32,2 +28,5 @@ /** | ||
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -39,3 +38,4 @@ /** | ||
*/ | ||
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode; | ||
required?: boolean | Slot<'span'>; | ||
}; | ||
export {}; |
@@ -5,2 +5,2 @@ import type { LabelState } from './Label.types'; | ||
*/ | ||
export declare const renderLabel: (state: LabelState) => JSX.Element; | ||
export declare const renderLabel_unstable: (state: LabelState) => JSX.Element; |
import * as React from 'react'; | ||
import { getSlots } from '@fluentui/react-utilities'; | ||
import { labelShorthandProps } from './useLabel'; | ||
/** | ||
@@ -8,9 +7,11 @@ * Render the final JSX of Label | ||
export const renderLabel = state => { | ||
export const renderLabel_unstable = state => { | ||
const { | ||
slots, | ||
slotProps | ||
} = getSlots(state, labelShorthandProps); | ||
return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), state.root.children, /*#__PURE__*/React.createElement(slots.required, Object.assign({}, slotProps.required))); | ||
} = getSlots(state); | ||
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root | ||
}, state.root.children, slots.required && /*#__PURE__*/React.createElement(slots.required, { ...slotProps.required | ||
})); | ||
}; | ||
//# sourceMappingURL=renderLabel.js.map |
import * as React from 'react'; | ||
import type { LabelProps, LabelSlots, LabelState } from './Label.types'; | ||
import type { LabelProps, LabelState } from './Label.types'; | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
export declare const labelShorthandProps: Array<keyof LabelSlots>; | ||
/** | ||
* Create the state required to render Label. | ||
* | ||
* The returned state can be modified with hooks such as useLabelStyles, | ||
* before being passed to renderLabel. | ||
* The returned state can be modified with hooks such as useLabelStyles_unstable, | ||
* before being passed to renderLabel_unstable. | ||
* | ||
@@ -17,2 +12,2 @@ * @param props - props from this instance of Label | ||
*/ | ||
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState; | ||
export declare const useLabel_unstable: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState; |
import { getNativeElementProps } from '@fluentui/react-utilities'; | ||
import { resolveShorthand } from '@fluentui/react-utilities'; | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
export const labelShorthandProps = ['root', 'required']; | ||
/** | ||
* Create the state required to render Label. | ||
* | ||
* The returned state can be modified with hooks such as useLabelStyles, | ||
* before being passed to renderLabel. | ||
* The returned state can be modified with hooks such as useLabelStyles_unstable, | ||
* before being passed to renderLabel_unstable. | ||
* | ||
@@ -19,3 +13,3 @@ * @param props - props from this instance of Label | ||
export const useLabel = (props, ref) => { | ||
export const useLabel_unstable = (props, ref) => { | ||
const { | ||
@@ -29,6 +23,5 @@ disabled = false, | ||
disabled, | ||
required: resolveShorthand(required === false ? null : required, { | ||
required: !!required, | ||
required: resolveShorthand(required === true ? '*' : required || undefined, { | ||
defaultProps: { | ||
children: '*' | ||
'aria-hidden': 'true' | ||
} | ||
@@ -35,0 +28,0 @@ }), |
@@ -6,2 +6,2 @@ import type { LabelState } from './Label.types'; | ||
*/ | ||
export declare const useLabelStyles: (state: LabelState) => LabelState; | ||
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState; |
@@ -1,2 +0,3 @@ | ||
import { __styles, mergeClasses } from '@fluentui/react-make-styles'; | ||
import { __styles, mergeClasses } from '@griffel/react'; | ||
import { tokens } from '@fluentui/react-theme'; | ||
export const labelClassName = 'fui-Label'; | ||
@@ -43,3 +44,3 @@ /** | ||
export const useLabelStyles = state => { | ||
export const useLabelStyles_unstable = state => { | ||
const styles = useStyles(); | ||
@@ -46,0 +47,0 @@ state.root.className = mergeClasses(labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className); |
{ | ||
"name": "@fluentui/react-label", | ||
"version": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"description": "Label component for FluentUI library.", | ||
"version": "0.0.0-nightlyfc5cfdc52420220215.1", | ||
"description": "Fluent UI React Label component", | ||
"main": "lib-commonjs/index.js", | ||
@@ -22,13 +22,12 @@ "module": "lib/index.js", | ||
"start": "yarn storybook", | ||
"test": "jest", | ||
"test": "jest --passWithNoTests", | ||
"docs": "api-extractor run --config=config/api-extractor.local.json --local", | ||
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/packages/react-label/src && yarn docs", | ||
"storybook": "start-storybook" | ||
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-label/src && yarn docs", | ||
"storybook": "node ../../scripts/storybook/runner", | ||
"type-check": "tsc -b tsconfig.json" | ||
}, | ||
"devDependencies": { | ||
"@fluentui/babel-make-styles": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"@fluentui/eslint-plugin": "*", | ||
"@fluentui/jest-serializer-make-styles": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"@fluentui/react-conformance": "*", | ||
"@fluentui/react-conformance-make-styles": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"@fluentui/react-conformance-griffel": "0.0.0-nightlyfc5cfdc52420220215.1", | ||
"@fluentui/scripts": "^1.0.0", | ||
@@ -47,4 +46,4 @@ "@types/enzyme": "3.10.3", | ||
"dependencies": { | ||
"@fluentui/react-make-styles": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"@fluentui/react-utilities": "0.0.0-nightlyfbae36b19b20211111.1", | ||
"@fluentui/react-utilities": "0.0.0-nightlyfc5cfdc52420220215.1", | ||
"@griffel/react": "1.0.0", | ||
"tslib": "^2.1.0" | ||
@@ -59,3 +58,2 @@ }, | ||
"beachball": { | ||
"tag": "beta", | ||
"disallowedChangeTypes": [ | ||
@@ -62,0 +60,0 @@ "major", |
73
Spec.md
@@ -78,51 +78,44 @@ # @fluentui/react-label Spec | ||
```ts | ||
/** | ||
* Label Props | ||
*/ | ||
export type LabelProps = ComponentProps & | ||
React.LabelHTMLAttributes<HTMLElement> & { | ||
/** | ||
* Renders the label as disabled | ||
* @defaultvalue false | ||
*/ | ||
disabled?: boolean; | ||
export type LabelCommons = { | ||
/** | ||
* Renders the label as disabled | ||
* @defaultvalue false | ||
*/ | ||
disabled: boolean; | ||
/** | ||
* Whether the associated form field is required or not. If true it will be an asterisk, otherwise it will be what is provided. | ||
* @defaultvalue false | ||
*/ | ||
required?: boolean | ShorthandProps<ComponentProps>; | ||
/** | ||
* A label supports different sizes. | ||
* @defaultvalue 'medium' | ||
*/ | ||
size: 'small' | 'medium' | 'large'; | ||
/** | ||
* A label supports different font sizes, see tokens for reference. | ||
* @defaultvalue 'medium' | ||
*/ | ||
size?: 'small' | 'medium' | 'large'; | ||
/** | ||
* A label supports semibold/strong fontweight. | ||
* @defaultvalue false | ||
*/ | ||
strong: boolean; | ||
}; | ||
/** | ||
* A label supports semibold/strong fontweight. When size is set to large, label strong will be set by default. | ||
* @defaultvalue false | ||
*/ | ||
strong?: boolean; | ||
}; | ||
export type LabelSlots = { | ||
root: IntrinsicSlotProps<'label'>; | ||
required?: IntrinsicSlotProps<'span'>; | ||
}; | ||
/** | ||
* Names of the shorthand properties in LabelProps | ||
* State used in rendering Label | ||
*/ | ||
export type LabelShorthandProps = 'required'; | ||
export type LabelState = ComponentState<LabelSlots> & LabelCommons; | ||
/** | ||
* Names of LabelProps that have a default value in useLabel | ||
* Label Props | ||
*/ | ||
export type LabelDefaultedProps = never; | ||
/** | ||
* State used in rendering Label | ||
*/ | ||
export type LabelState = ComponentState<LabelProps, LabelShorthandProps, LabelDefaultedProps> & { | ||
/** | ||
* Ref to the root element | ||
*/ | ||
ref: React.Ref<HTMLElement>; | ||
}; | ||
export type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & | ||
Partial<LabelCommons> & { | ||
/** | ||
* Displays and indicator that the label is for a required field. The required prop can be set to true to display | ||
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator. | ||
* @defaultvalue false | ||
*/ | ||
required?: boolean | IntrinsicSlotProps<'span'> | React.ReactNode; | ||
}; | ||
``` | ||
@@ -129,0 +122,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
132240
14
2258
57
+ Added@griffel/react@1.0.0
+ Added@fluentui/keyboard-keys@0.0.0-nightlyfc5cfdc52420220215.1(transitive)
+ Added@fluentui/react-utilities@0.0.0-nightlyfc5cfdc52420220215.1(transitive)
+ Added@griffel/core@1.0.7(transitive)
+ Added@griffel/react@1.0.0(transitive)
- Removed@fluentui/react-make-styles@0.0.0-nightlyfbae36b19b20211111.1
- Removed@fluentui/keyboard-keys@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removed@fluentui/make-styles@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removed@fluentui/react-make-styles@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removed@fluentui/react-shared-contexts@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removed@fluentui/react-theme@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removed@fluentui/react-utilities@0.0.0-nightlyfbae36b19b20211111.1(transitive)
- Removedinline-style-expand-shorthand@1.6.0(transitive)
Updated@fluentui/react-utilities@0.0.0-nightlyfc5cfdc52420220215.1