Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+1831
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
@fluentui/react-label
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
+49
View File
@@ -0,0 +1,49 @@
# @fluentui/react-label
**Label components for [Fluent UI React](https://react.fluentui.dev/)**
Labels provide a name or title to a component or group of components, e.g., text fields, checkboxes, radio buttons, and dropdown menus.
## Usage
To import `Label`:
```js
import { Label } from '@fluentui/react-components';
```
### Examples
```tsx
import * as React from 'react';
import { Label } from '@fluentui/react-components';
import { useId } from '@fluentui/react-utilities';
export const labelExample = () => {
const inputId = useId('firstNameLabel-');
return (
<>
<Label htmlfor={inputId} required strong>
First Name
</Label>
<input id={inputId} />
</>
);
};
```
See [Fluent UI Storybook](https://react.fluentui.dev/) for more detailed usage examples.
Alternatively, run Storybook locally with:
1. `yarn start`
2. Select `react-label` from the list.
### Specification
See [Spec.md](./Spec.md).
### Migration Guide
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Label implementation.
+73
View File
@@ -0,0 +1,73 @@
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
/**
* A label component provides a title or name to a component.
*/
export declare const Label: ForwardRefComponent<LabelProps>;
export declare const labelClassNames: SlotClassNames<LabelSlots>;
/**
* Label Props
*/
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & {
/**
* Renders the label as disabled
* @default false
*/
disabled?: boolean;
/**
* Displays an 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.
* @default false
*/
required?: boolean | Slot<'span'>;
/**
* A label supports different sizes.
* @default 'medium'
*/
size?: 'small' | 'medium' | 'large';
/**
* A label supports regular and semibold fontweight.
* @default regular
*/
weight?: 'regular' | 'semibold';
};
export declare type LabelSlots = {
root: Slot<'label'>;
required?: Slot<'span'>;
};
/**
* State used in rendering Label
*/
export declare type LabelState = ComponentState<LabelSlots> & Required<Pick<LabelProps, 'disabled' | 'size' | 'weight'>>;
/**
* Render the final JSX of Label
*/
export declare const renderLabel_unstable: (state: LabelState) => JSX.Element;
/**
* Create the state required to render Label.
*
* The returned state can be modified with hooks such as useLabelStyles_unstable,
* before being passed to renderLabel_unstable.
*
* @param props - props from this instance of Label
* @param ref - reference to root HTMLElement of Label
*/
export declare const useLabel_unstable: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState;
/**
* Apply styling to the Label slots based on the state
*/
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState;
export { }
+28
View File
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Label: function() {
return _index.Label;
},
labelClassNames: function() {
return _index.labelClassNames;
},
renderLabel_unstable: function() {
return _index.renderLabel_unstable;
},
useLabelStyles_unstable: function() {
return _index.useLabelStyles_unstable;
},
useLabel_unstable: function() {
return _index.useLabel_unstable;
}
});
const _index = require("./components/Label/index");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Label.ts"],"sourcesContent":["export type { LabelProps, LabelSlots, LabelState } from './components/Label/index';\nexport {\n Label,\n labelClassNames,\n renderLabel_unstable,\n useLabelStyles_unstable,\n useLabel_unstable,\n} from './components/Label/index';\n"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,KAAK;eAALA,YAAK;;IACLC,eAAe;eAAfA,sBAAe;;IACfC,oBAAoB;eAApBA,2BAAoB;;IACpBC,uBAAuB;eAAvBA,8BAAuB;;IACvBC,iBAAiB;eAAjBA,wBAAiB;;;uBACZ"}
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Label", {
enumerable: true,
get: function() {
return Label;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useLabel = require("./useLabel");
const _renderLabel = require("./renderLabel");
const _useLabelStylesstyles = require("./useLabelStyles.styles");
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
const Label = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useLabel.useLabel_unstable)(props, ref);
(0, _useLabelStylesstyles.useLabelStyles_unstable)(state);
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useLabelStyles_unstable')(state);
return (0, _renderLabel.renderLabel_unstable)(state);
});
Label.displayName = 'Label';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles.styles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label: ForwardRefComponent<LabelProps> = React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n\n useLabelStyles_unstable(state);\n\n useCustomStyleHook_unstable('useLabelStyles_unstable')(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"names":["Label","React","forwardRef","props","ref","state","useLabel_unstable","useLabelStyles_unstable","useCustomStyleHook_unstable","renderLabel_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;0BACW;6BACG;sCACG;qCAGI;AAKrC,MAAMA,QAAAA,WAAAA,GAAyCC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQC,IAAAA,2BAAAA,EAAkBH,OAAOC;IAEvCG,IAAAA,6CAAAA,EAAwBF;IAExBG,IAAAA,gDAAAA,EAA4B,2BAA2BH;IAEvD,OAAOI,IAAAA,iCAAAA,EAAqBJ;AAC9B;AAEAL,MAAMU,WAAW,GAAG"}
@@ -0,0 +1,6 @@
/**
* State used in rendering Label
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/Label.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Label Props\n */\nexport type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & {\n /**\n * Renders the label as disabled\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Displays an indicator that the label is for a required field. The required prop can be set to true to display\n * an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.\n * @default false\n */\n required?: boolean | Slot<'span'>;\n\n /**\n * A label supports different sizes.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A label supports regular and semibold fontweight.\n * @default regular\n */\n weight?: 'regular' | 'semibold';\n};\n\nexport type LabelSlots = {\n root: Slot<'label'>;\n required?: Slot<'span'>;\n};\n\n/**\n * State used in rendering Label\n */\nexport type LabelState = ComponentState<LabelSlots> & Required<Pick<LabelProps, 'disabled' | 'size' | 'weight'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAqCA;;CAEC"}
@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Label: function() {
return _Label.Label;
},
labelClassNames: function() {
return _useLabelStylesstyles.labelClassNames;
},
renderLabel_unstable: function() {
return _renderLabel.renderLabel_unstable;
},
useLabelStyles_unstable: function() {
return _useLabelStylesstyles.useLabelStyles_unstable;
},
useLabel_unstable: function() {
return _useLabel.useLabel_unstable;
}
});
const _Label = require("./Label");
const _renderLabel = require("./renderLabel");
const _useLabel = require("./useLabel");
const _useLabelStylesstyles = require("./useLabelStyles.styles");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/index.ts"],"sourcesContent":["export { Label } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label.types';\nexport { renderLabel_unstable } from './renderLabel';\nexport { useLabel_unstable } from './useLabel';\nexport { labelClassNames, useLabelStyles_unstable } from './useLabelStyles.styles';\n"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAILC,eAAe;eAAfA,qCAAe;;IAFfC,oBAAoB;eAApBA,iCAAoB;;IAEHC,uBAAuB;eAAvBA,6CAAuB;;IADxCC,iBAAiB;eAAjBA,2BAAiB;;;uBAHJ;6BAEe;0BACH;sCACuB"}
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderLabel_unstable", {
enumerable: true,
get: function() {
return renderLabel_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const renderLabel_unstable = (state)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.root.children,
state.required && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.required, {})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/renderLabel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { LabelState, LabelSlots } from './Label.types';\n\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = (state: LabelState) => {\n assertSlots<LabelSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.required && <state.required />}\n </state.root>\n );\n};\n"],"names":["renderLabel_unstable","state","assertSlots","_jsxs","root","children","required","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,uBAAuB,CAACC;IACnCC,IAAAA,2BAAAA,EAAwBD;IAExB,OAAA,WAAA,GACEE,IAAAA,gBAAA,EAACF,MAAMG,IAAI,EAAA;;YACRH,MAAMG,IAAI,CAACC,QAAQ;YACnBJ,MAAMK,QAAQ,IAAA,WAAA,GAAIC,IAAAA,eAAA,EAACN,MAAMK,QAAQ,EAAA,CAAA;;;AAGxC"}
@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useLabel_unstable", {
enumerable: true,
get: function() {
return useLabel_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const useLabel_unstable = (props, ref)=>{
const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;
return {
disabled,
required: _reactutilities.slot.optional(required === true ? '*' : required || undefined, {
defaultProps: {
'aria-hidden': 'true'
},
elementType: 'span'
}),
weight,
size,
components: {
root: 'label',
required: 'span'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('label', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLLabelElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
...props
}), {
elementType: 'label'
})
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\n\n/**\n * Create the state required to render Label.\n *\n * The returned state can be modified with hooks such as useLabelStyles_unstable,\n * before being passed to renderLabel_unstable.\n *\n * @param props - props from this instance of Label\n * @param ref - reference to root HTMLElement of Label\n */\nexport const useLabel_unstable = (props: LabelProps, ref: React.Ref<HTMLElement>): LabelState => {\n const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;\n return {\n disabled,\n required: slot.optional(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n elementType: 'span',\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: slot.always(\n getIntrinsicElementProps('label', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLLabelElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLLabelElement>,\n ...props,\n }),\n { elementType: 'label' },\n ),\n };\n};\n"],"names":["useLabel_unstable","props","ref","disabled","required","weight","size","slot","optional","undefined","defaultProps","elementType","components","root","always","getIntrinsicElementProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;gCACwB;AAYxC,MAAMA,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,WAAW,KAAK,EAAEC,SAAS,SAAS,EAAEC,OAAO,QAAQ,EAAE,GAAGL;IACpF,OAAO;QACLE;QACAC,UAAUG,oBAAAA,CAAKC,QAAQ,CAACJ,aAAa,OAAO,MAAMA,YAAYK,WAAW;YACvEC,cAAc;gBAAE,eAAe;YAAO;YACtCC,aAAa;QACf;QACAN;QACAC;QACAM,YAAY;YAAEC,MAAM;YAAST,UAAU;QAAO;QAC9CS,MAAMN,oBAAAA,CAAKO,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,SAAS;YAChC,SAAS;YACT,8EAA8E;YAC9E,4FAA4F;YAC5Fb,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAEU,aAAa;QAAQ;IAE3B;AACF"}
@@ -0,0 +1,91 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
labelClassNames: function() {
return labelClassNames;
},
useLabelStyles_unstable: function() {
return useLabelStyles_unstable;
}
});
const _react = require("@griffel/react");
const labelClassNames = {
root: 'fui-Label',
required: 'fui-Label__required'
};
/**
* Styles for the label
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
root: {
Bahqtrf: "fk6fouc",
sj55zd: "f19n0e5"
},
disabled: {
sj55zd: "f1s2aq7o",
Bbusuzp: "f1dcs8yz"
},
required: {
sj55zd: "f1whyuy6",
uwmqm3: [
"fruq291",
"f7x41pl"
]
},
small: {
Be2twd7: "fy9rknc",
Bg96gwp: "fwrc4pm"
},
medium: {
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi"
},
large: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k",
Bhrd7zp: "fl43uef"
},
semibold: {
Bhrd7zp: "fl43uef"
}
}, {
d: [
".fk6fouc{font-family:var(--fontFamilyBase);}",
".f19n0e5{color:var(--colorNeutralForeground1);}",
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
".f1whyuy6{color:var(--colorPaletteRedForeground3);}",
".fruq291{padding-left:var(--spacingHorizontalXS);}",
".f7x41pl{padding-right:var(--spacingHorizontalXS);}",
".fy9rknc{font-size:var(--fontSizeBase200);}",
".fwrc4pm{line-height:var(--lineHeightBase200);}",
".fkhj508{font-size:var(--fontSizeBase300);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}",
".fod5ikn{font-size:var(--fontSizeBase400);}",
".faaz57k{line-height:var(--lineHeightBase400);}",
".fl43uef{font-weight:var(--fontWeightSemibold);}"
],
m: [
[
"@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}",
{
m: "(forced-colors: active)"
}
]
]
});
const useLabelStyles_unstable = (state)=>{
'use no memo';
const styles = useStyles();
state.root.className = (0, _react.mergeClasses)(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
if (state.required) {
state.required.className = (0, _react.mergeClasses)(labelClassNames.required, styles.required, state.disabled && styles.disabled, state.required.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["useLabelStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const labelClassNames = {\n root: 'fui-Label',\n required: 'fui-Label__required'\n};\n/**\n * Styles for the label\n */ const useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText'\n }\n },\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: tokens.spacingHorizontalXS\n },\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200\n },\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold\n },\n semibold: {\n fontWeight: tokens.fontWeightSemibold\n }\n});\n/**\n * Apply styling to the Label slots based on the state\n */ export const useLabelStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);\n if (state.required) {\n state.required.className = mergeClasses(labelClassNames.required, styles.required, state.disabled && styles.disabled, state.required.className);\n }\n return state;\n};\n"],"names":["labelClassNames","useLabelStyles_unstable","root","required","useStyles","__styles","Bahqtrf","sj55zd","disabled","Bbusuzp","uwmqm3","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","m","state","styles","className","mergeClasses","size","weight"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,eAAe;eAAfA;;IAwCIC,uBAAuB;eAAvBA;;;uBA1CwB;AAElC,MAAMD,kBAAkB;IAC3BE,MAAM;IACNC,UAAU;AACd;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAH,MAAA;QAAAI,SAAA;QAAAC,QAAA;IAAA;IAAAC,UAAA;QAAAD,QAAA;QAAAE,SAAA;IAAA;IAAAN,UAAA;QAAAI,QAAA;QAAAG,QAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,OAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;IAAAC,QAAA;QAAAF,SAAA;QAAAC,SAAA;IAAA;IAAAE,OAAA;QAAAH,SAAA;QAAAC,SAAA;QAAAG,SAAA;IAAA;IAAAC,UAAA;QAAAD,SAAA;IAAA;AAAA,GAAA;IAAAE,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA;YAAA;SAAA;KAAA;AAAA;AAkCX,MAAMlB,0BAA2BmB,CAAAA;IACxC;IACA,MAAMC,SAASjB;IACfgB,MAAMlB,IAAI,CAACoB,SAAS,GAAGC,IAAAA,mBAAY,EAACvB,gBAAgBE,IAAI,EAAEmB,OAAOnB,IAAI,EAAEkB,MAAMZ,QAAQ,IAAIa,OAAOb,QAAQ,EAAEa,MAAM,CAACD,MAAMI,IAAI,CAAC,EAAEJ,MAAMK,MAAM,KAAK,cAAcJ,OAAOJ,QAAQ,EAAEG,MAAMlB,IAAI,CAACoB,SAAS;IAClM,IAAIF,MAAMjB,QAAQ,EAAE;QAChBiB,MAAMjB,QAAQ,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACvB,gBAAgBG,QAAQ,EAAEkB,OAAOlB,QAAQ,EAAEiB,MAAMZ,QAAQ,IAAIa,OAAOb,QAAQ,EAAEY,MAAMjB,QAAQ,CAACmB,SAAS;IAClJ;IACA,OAAOF;AACX"}
+28
View File
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
Label: function() {
return _Label.Label;
},
labelClassNames: function() {
return _Label.labelClassNames;
},
renderLabel_unstable: function() {
return _Label.renderLabel_unstable;
},
useLabelStyles_unstable: function() {
return _Label.useLabelStyles_unstable;
},
useLabel_unstable: function() {
return _Label.useLabel_unstable;
}
});
const _Label = require("./Label");
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,KAAK;eAALA,YAAK;;IAAEC,eAAe;eAAfA,sBAAe;;IAAEC,oBAAoB;eAApBA,2BAAoB;;IAAEC,uBAAuB;eAAvBA,8BAAuB;;IAAEC,iBAAiB;eAAjBA,wBAAiB;;;uBAAQ"}
+1
View File
@@ -0,0 +1 @@
export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './components/Label/index';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/Label.ts"],"sourcesContent":["export type { LabelProps, LabelSlots, LabelState } from './components/Label/index';\nexport {\n Label,\n labelClassNames,\n renderLabel_unstable,\n useLabelStyles_unstable,\n useLabel_unstable,\n} from './components/Label/index';\n"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,2BAA2B"}
+14
View File
@@ -0,0 +1,14 @@
import * as React from 'react';
import { useLabel_unstable } from './useLabel';
import { renderLabel_unstable } from './renderLabel';
import { useLabelStyles_unstable } from './useLabelStyles.styles';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
/**
* A label component provides a title or name to a component.
*/ export const Label = /*#__PURE__*/ React.forwardRef((props, ref)=>{
const state = useLabel_unstable(props, ref);
useLabelStyles_unstable(state);
useCustomStyleHook_unstable('useLabelStyles_unstable')(state);
return renderLabel_unstable(state);
});
Label.displayName = 'Label';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles.styles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label: ForwardRefComponent<LabelProps> = React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n\n useLabelStyles_unstable(state);\n\n useCustomStyleHook_unstable('useLabelStyles_unstable')(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"names":["React","useLabel_unstable","renderLabel_unstable","useLabelStyles_unstable","useCustomStyleHook_unstable","Label","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCL,wBAAwBM;IAExBL,4BAA4B,2BAA2BK;IAEvD,OAAOP,qBAAqBO;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
@@ -0,0 +1,3 @@
/**
* State used in rendering Label
*/ export { };
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/Label.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Label Props\n */\nexport type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & {\n /**\n * Renders the label as disabled\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Displays an indicator that the label is for a required field. The required prop can be set to true to display\n * an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.\n * @default false\n */\n required?: boolean | Slot<'span'>;\n\n /**\n * A label supports different sizes.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A label supports regular and semibold fontweight.\n * @default regular\n */\n weight?: 'regular' | 'semibold';\n};\n\nexport type LabelSlots = {\n root: Slot<'label'>;\n required?: Slot<'span'>;\n};\n\n/**\n * State used in rendering Label\n */\nexport type LabelState = ComponentState<LabelSlots> & Required<Pick<LabelProps, 'disabled' | 'size' | 'weight'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAqCA;;CAEC,GACD,WAAiH"}
+4
View File
@@ -0,0 +1,4 @@
export { Label } from './Label';
export { renderLabel_unstable } from './renderLabel';
export { useLabel_unstable } from './useLabel';
export { labelClassNames, useLabelStyles_unstable } from './useLabelStyles.styles';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/index.ts"],"sourcesContent":["export { Label } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label.types';\nexport { renderLabel_unstable } from './renderLabel';\nexport { useLabel_unstable } from './useLabel';\nexport { labelClassNames, useLabelStyles_unstable } from './useLabelStyles.styles';\n"],"names":["Label","renderLabel_unstable","useLabel_unstable","labelClassNames","useLabelStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,KAAK,QAAQ,UAAU;AAEhC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
+13
View File
@@ -0,0 +1,13 @@
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
import { assertSlots } from '@fluentui/react-utilities';
/**
* Render the final JSX of Label
*/ export const renderLabel_unstable = (state)=>{
assertSlots(state);
return /*#__PURE__*/ _jsxs(state.root, {
children: [
state.root.children,
state.required && /*#__PURE__*/ _jsx(state.required, {})
]
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/renderLabel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { LabelState, LabelSlots } from './Label.types';\n\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = (state: LabelState) => {\n assertSlots<LabelSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.required && <state.required />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderLabel_unstable","state","root","children","required"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IAExB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,QAAQ,kBAAI,KAACH,MAAMG,QAAQ;;;AAGxC,EAAE"}
+37
View File
@@ -0,0 +1,37 @@
import * as React from 'react';
import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
/**
* Create the state required to render Label.
*
* The returned state can be modified with hooks such as useLabelStyles_unstable,
* before being passed to renderLabel_unstable.
*
* @param props - props from this instance of Label
* @param ref - reference to root HTMLElement of Label
*/ export const useLabel_unstable = (props, ref)=>{
const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;
return {
disabled,
required: slot.optional(required === true ? '*' : required || undefined, {
defaultProps: {
'aria-hidden': 'true'
},
elementType: 'span'
}),
weight,
size,
components: {
root: 'label',
required: 'span'
},
root: slot.always(getIntrinsicElementProps('label', {
// FIXME:
// `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLLabelElement`
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
ref: ref,
...props
}), {
elementType: 'label'
})
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\n\n/**\n * Create the state required to render Label.\n *\n * The returned state can be modified with hooks such as useLabelStyles_unstable,\n * before being passed to renderLabel_unstable.\n *\n * @param props - props from this instance of Label\n * @param ref - reference to root HTMLElement of Label\n */\nexport const useLabel_unstable = (props: LabelProps, ref: React.Ref<HTMLElement>): LabelState => {\n const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;\n return {\n disabled,\n required: slot.optional(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n elementType: 'span',\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: slot.always(\n getIntrinsicElementProps('label', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLLabelElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLLabelElement>,\n ...props,\n }),\n { elementType: 'label' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useLabel_unstable","props","ref","disabled","required","weight","size","optional","undefined","defaultProps","elementType","components","root","always"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,WAAW,KAAK,EAAEC,SAAS,SAAS,EAAEC,OAAO,QAAQ,EAAE,GAAGL;IACpF,OAAO;QACLE;QACAC,UAAUL,KAAKQ,QAAQ,CAACH,aAAa,OAAO,MAAMA,YAAYI,WAAW;YACvEC,cAAc;gBAAE,eAAe;YAAO;YACtCC,aAAa;QACf;QACAL;QACAC;QACAK,YAAY;YAAEC,MAAM;YAASR,UAAU;QAAO;QAC9CQ,MAAMb,KAAKc,MAAM,CACff,yBAAyB,SAAS;YAChC,SAAS;YACT,8EAA8E;YAC9E,4FAA4F;YAC5FI,KAAKA;YACL,GAAGD,KAAK;QACV,IACA;YAAES,aAAa;QAAQ;IAE3B;AACF,EAAE"}
@@ -0,0 +1,57 @@
import { __styles, mergeClasses } from '@griffel/react';
import { tokens } from '@fluentui/react-theme';
export const labelClassNames = {
root: 'fui-Label',
required: 'fui-Label__required'
};
/**
* Styles for the label
*/
const useStyles = /*#__PURE__*/__styles({
root: {
Bahqtrf: "fk6fouc",
sj55zd: "f19n0e5"
},
disabled: {
sj55zd: "f1s2aq7o",
Bbusuzp: "f1dcs8yz"
},
required: {
sj55zd: "f1whyuy6",
uwmqm3: ["fruq291", "f7x41pl"]
},
small: {
Be2twd7: "fy9rknc",
Bg96gwp: "fwrc4pm"
},
medium: {
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi"
},
large: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k",
Bhrd7zp: "fl43uef"
},
semibold: {
Bhrd7zp: "fl43uef"
}
}, {
d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fruq291{padding-left:var(--spacingHorizontalXS);}", ".f7x41pl{padding-right:var(--spacingHorizontalXS);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}"],
m: [["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
m: "(forced-colors: active)"
}]]
});
/**
* Apply styling to the Label slots based on the state
*/
export const useLabelStyles_unstable = state => {
'use no memo';
const styles = useStyles();
state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
if (state.required) {
state.required.className = mergeClasses(labelClassNames.required, styles.required, state.disabled && styles.disabled, state.required.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"names":["__styles","mergeClasses","tokens","labelClassNames","root","required","useStyles","Bahqtrf","sj55zd","disabled","Bbusuzp","uwmqm3","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","m","useLabelStyles_unstable","state","styles","className","size","weight"],"sources":["useLabelStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const labelClassNames = {\n root: 'fui-Label',\n required: 'fui-Label__required'\n};\n/**\n * Styles for the label\n */ const useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText'\n }\n },\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: tokens.spacingHorizontalXS\n },\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200\n },\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300\n },\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold\n },\n semibold: {\n fontWeight: tokens.fontWeightSemibold\n }\n});\n/**\n * Apply styling to the Label slots based on the state\n */ export const useLabelStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);\n if (state.required) {\n state.required.className = mergeClasses(labelClassNames.required, styles.required, state.disabled && styles.disabled, state.required.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,eAAe,GAAG;EAC3BC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE;AACd,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGN,QAAA;EAAAI,IAAA;IAAAG,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;IAAAE,OAAA;EAAA;EAAAL,QAAA;IAAAG,MAAA;IAAAG,MAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAF,OAAA;IAAAC,OAAA;EAAA;EAAAE,KAAA;IAAAH,OAAA;IAAAC,OAAA;IAAAG,OAAA;EAAA;EAAAC,QAAA;IAAAD,OAAA;EAAA;AAAA;EAAAE,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;AAAA,CA+BrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,uBAAuB,GAAIC,KAAK,IAAG;EAChD,aAAa;;EACb,MAAMC,MAAM,GAAGjB,SAAS,CAAC,CAAC;EAC1BgB,KAAK,CAAClB,IAAI,CAACoB,SAAS,GAAGvB,YAAY,CAACE,eAAe,CAACC,IAAI,EAAEmB,MAAM,CAACnB,IAAI,EAAEkB,KAAK,CAACb,QAAQ,IAAIc,MAAM,CAACd,QAAQ,EAAEc,MAAM,CAACD,KAAK,CAACG,IAAI,CAAC,EAAEH,KAAK,CAACI,MAAM,KAAK,UAAU,IAAIH,MAAM,CAACL,QAAQ,EAAEI,KAAK,CAAClB,IAAI,CAACoB,SAAS,CAAC;EACnM,IAAIF,KAAK,CAACjB,QAAQ,EAAE;IAChBiB,KAAK,CAACjB,QAAQ,CAACmB,SAAS,GAAGvB,YAAY,CAACE,eAAe,CAACE,QAAQ,EAAEkB,MAAM,CAAClB,QAAQ,EAAEiB,KAAK,CAACb,QAAQ,IAAIc,MAAM,CAACd,QAAQ,EAAEa,KAAK,CAACjB,QAAQ,CAACmB,SAAS,CAAC;EACnJ;EACA,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
+1
View File
@@ -0,0 +1 @@
export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"rangeMappings":"","mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
+55
View File
@@ -0,0 +1,55 @@
{
"name": "@fluentui/react-label",
"version": "9.1.83",
"description": "Fluent UI React Label component",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/react-conformance": "*",
"@fluentui/react-conformance-griffel": "*",
"@fluentui/scripts-api-extractor": "*"
},
"dependencies": {
"@fluentui/react-shared-contexts": "^9.21.2",
"@fluentui/react-theme": "^9.1.24",
"@fluentui/react-utilities": "^9.18.20",
"@fluentui/react-jsx-runtime": "^9.0.50",
"@griffel/react": "^1.5.22",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <19.0.0",
"@types/react-dom": ">=16.9.0 <19.0.0",
"react": ">=16.14.0 <19.0.0",
"react-dom": ">=16.14.0 <19.0.0"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
]
}