@fluentui/react-label
Advanced tools
Comparing version 0.0.0-nightly58c310891320211216.1 to 0.0.0-nightly5ab766c40f20220114.1
@@ -5,5 +5,5 @@ { | ||
{ | ||
"date": "Thu, 16 Dec 2021 04:14:55 GMT", | ||
"tag": "@fluentui/react-label_v0.0.0-nightly58c310891320211216.1", | ||
"version": "0.0.0-nightly58c310891320211216.1", | ||
"date": "Fri, 14 Jan 2022 04:15:08 GMT", | ||
"tag": "@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1", | ||
"version": "0.0.0-nightly5ab766c40f20220114.1", | ||
"comments": { | ||
@@ -14,10 +14,28 @@ "prerelease": [ | ||
"package": "@fluentui/react-label", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd", | ||
"comment": "Release nightly v9" | ||
}, | ||
{ | ||
"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": "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-nightly58c310891320211216.1", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc" | ||
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightly5ab766c40f20220114.1", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd" | ||
}, | ||
@@ -27,4 +45,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly58c310891320211216.1", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc" | ||
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly5ab766c40f20220114.1", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd" | ||
}, | ||
@@ -34,4 +52,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightly58c310891320211216.1", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc" | ||
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightly5ab766c40f20220114.1", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd" | ||
}, | ||
@@ -41,4 +59,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly58c310891320211216.1", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc" | ||
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly5ab766c40f20220114.1", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd" | ||
}, | ||
@@ -48,4 +66,4 @@ { | ||
"package": "@fluentui/react-label", | ||
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly58c310891320211216.1", | ||
"commit": "919f08a1b25cd5045dc729d44a65f64f7838f4dc" | ||
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly5ab766c40f20220114.1", | ||
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd" | ||
} | ||
@@ -55,2 +73,8 @@ ], | ||
{ | ||
"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": "andredias@microsoft.com", | ||
@@ -57,0 +81,0 @@ "package": "@fluentui/react-label", |
# Change Log - @fluentui/react-label | ||
This log was last generated on Thu, 16 Dec 2021 04:14:55 GMT and should not be manually modified. | ||
This log was last generated on Fri, 14 Jan 2022 04:15:08 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [0.0.0-nightly58c310891320211216.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightly58c310891320211216.1) | ||
## [0.0.0-nightly5ab766c40f20220114.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1) | ||
Thu, 16 Dec 2021 04:14:55 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v0.0.0-nightly58c310891320211216.1) | ||
Fri, 14 Jan 2022 04:15:08 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1) | ||
### Changes | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by email not defined) | ||
- Bump @fluentui/react-make-styles to v0.0.0-nightly58c310891320211216.1 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly58c310891320211216.1 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by beachball) | ||
- Bump @fluentui/babel-make-styles to v0.0.0-nightly58c310891320211216.1 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by beachball) | ||
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly58c310891320211216.1 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by beachball) | ||
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly58c310891320211216.1 ([commit](https://github.com/microsoft/fluentui/commit/919f08a1b25cd5045dc729d44a65f64f7838f4dc) by beachball) | ||
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by email not defined) | ||
- 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) | ||
- 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-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball) | ||
- Bump @fluentui/react-utilities to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball) | ||
- Bump @fluentui/babel-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball) | ||
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball) | ||
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball) | ||
@@ -21,0 +24,0 @@ ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.4) |
@@ -15,5 +15,2 @@ import type { ComponentProps } from '@fluentui/react-utilities'; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
@@ -37,2 +34,5 @@ /** | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -47,8 +47,2 @@ /** | ||
/** | ||
* Array of all shorthand properties listed in LabelShorthandProps | ||
* {@docCatergory Label} | ||
*/ | ||
export declare const labelShorthandProps: Array<keyof LabelSlots>; | ||
export declare type LabelSlots = { | ||
@@ -55,0 +49,0 @@ root: IntrinsicShorthandProps<'label'>; |
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React from 'react'; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
@@ -31,2 +28,5 @@ /** | ||
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -33,0 +33,0 @@ /** |
@@ -11,4 +11,2 @@ "use strict"; | ||
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities"); | ||
const useLabel_1 = /*#__PURE__*/require("./useLabel"); | ||
/** | ||
@@ -23,3 +21,3 @@ * Render the final JSX of Label | ||
slotProps | ||
} = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps); | ||
} = react_utilities_1.getSlots(state); | ||
return React.createElement(slots.root, { ...slotProps.root | ||
@@ -26,0 +24,0 @@ }, state.root.children, React.createElement(slots.required, { ...slotProps.required |
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. | ||
@@ -10,0 +5,0 @@ * |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.useLabel = exports.labelShorthandProps = void 0; | ||
exports.useLabel = void 0; | ||
@@ -13,9 +13,2 @@ 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. | ||
@@ -30,2 +23,3 @@ * | ||
const useLabel = (props, ref) => { | ||
@@ -32,0 +26,0 @@ const { |
@@ -10,2 +10,4 @@ "use strict"; | ||
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme"); | ||
exports.labelClassName = 'fui-Label'; | ||
@@ -12,0 +14,0 @@ /** |
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities'; | ||
import * as React from 'react'; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelCommons = { | ||
@@ -31,2 +28,5 @@ /** | ||
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons; | ||
/** | ||
* Label Props | ||
*/ | ||
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & { | ||
@@ -33,0 +33,0 @@ /** |
import * as React from 'react'; | ||
import { getSlots } from '@fluentui/react-utilities'; | ||
import { labelShorthandProps } from './useLabel'; | ||
/** | ||
@@ -12,3 +11,3 @@ * Render the final JSX of Label | ||
slotProps | ||
} = getSlots(state, labelShorthandProps); | ||
} = getSlots(state); | ||
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root | ||
@@ -15,0 +14,0 @@ }, state.root.children, /*#__PURE__*/React.createElement(slots.required, { ...slotProps.required |
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. | ||
@@ -10,0 +5,0 @@ * |
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. | ||
@@ -11,0 +5,0 @@ * |
import { __styles, mergeClasses } from '@fluentui/react-make-styles'; | ||
import { tokens } from '@fluentui/react-theme'; | ||
export const labelClassName = 'fui-Label'; | ||
@@ -3,0 +4,0 @@ /** |
{ | ||
"name": "@fluentui/react-label", | ||
"version": "0.0.0-nightly58c310891320211216.1", | ||
"version": "0.0.0-nightly5ab766c40f20220114.1", | ||
"description": "Label component for FluentUI library.", | ||
@@ -29,7 +29,7 @@ "main": "lib-commonjs/index.js", | ||
"devDependencies": { | ||
"@fluentui/babel-make-styles": "0.0.0-nightly58c310891320211216.1", | ||
"@fluentui/babel-make-styles": "0.0.0-nightly5ab766c40f20220114.1", | ||
"@fluentui/eslint-plugin": "*", | ||
"@fluentui/jest-serializer-make-styles": "0.0.0-nightly58c310891320211216.1", | ||
"@fluentui/jest-serializer-make-styles": "0.0.0-nightly5ab766c40f20220114.1", | ||
"@fluentui/react-conformance": "*", | ||
"@fluentui/react-conformance-make-styles": "0.0.0-nightly58c310891320211216.1", | ||
"@fluentui/react-conformance-make-styles": "0.0.0-nightly5ab766c40f20220114.1", | ||
"@fluentui/scripts": "^1.0.0", | ||
@@ -48,4 +48,4 @@ "@types/enzyme": "3.10.3", | ||
"dependencies": { | ||
"@fluentui/react-make-styles": "0.0.0-nightly58c310891320211216.1", | ||
"@fluentui/react-utilities": "0.0.0-nightly58c310891320211216.1", | ||
"@fluentui/react-make-styles": "0.0.0-nightly5ab766c40f20220114.1", | ||
"@fluentui/react-utilities": "0.0.0-nightly5ab766c40f20220114.1", | ||
"tslib": "^2.1.0" | ||
@@ -52,0 +52,0 @@ }, |
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: IntrinsicShorthandProps<'label'>; | ||
required?: IntrinsicShorthandProps<'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 | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128909
2194
+ Added@fluentui/keyboard-keys@0.0.0-nightly5ab766c40f20220114.1(transitive)
+ Added@fluentui/make-styles@0.0.0-nightly5ab766c40f20220114.1(transitive)
+ Added@fluentui/react-make-styles@0.0.0-nightly5ab766c40f20220114.1(transitive)
+ Added@fluentui/react-shared-contexts@0.0.0-nightly5ab766c40f20220114.1(transitive)
+ Added@fluentui/react-theme@0.0.0-nightly5ab766c40f20220114.1(transitive)
+ Added@fluentui/react-utilities@0.0.0-nightly5ab766c40f20220114.1(transitive)
- Removed@fluentui/keyboard-keys@0.0.0-nightly58c310891320211216.1(transitive)
- Removed@fluentui/make-styles@0.0.0-nightly58c310891320211216.1(transitive)
- Removed@fluentui/react-make-styles@0.0.0-nightly58c310891320211216.1(transitive)
- Removed@fluentui/react-shared-contexts@0.0.0-nightly58c310891320211216.1(transitive)
- Removed@fluentui/react-theme@0.0.0-nightly58c310891320211216.1(transitive)
- Removed@fluentui/react-utilities@0.0.0-nightly58c310891320211216.1(transitive)
- Removedinline-style-expand-shorthand@1.6.0(transitive)
Updated@fluentui/react-make-styles@0.0.0-nightly5ab766c40f20220114.1
Updated@fluentui/react-utilities@0.0.0-nightly5ab766c40f20220114.1