@fluentui/react-label 9.1.4 → 9.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +46 -1
  3. package/CHANGELOG.md +16 -2
  4. package/lib/Label.js.map +1 -1
  5. package/lib/components/Label/Label.js.map +1 -1
  6. package/lib/components/Label/Label.types.js.map +1 -1
  7. package/lib/components/Label/index.js.map +1 -1
  8. package/lib/components/Label/renderLabel.js +1 -5
  9. package/lib/components/Label/renderLabel.js.map +1 -1
  10. package/lib/components/Label/useLabel.js +1 -0
  11. package/lib/components/Label/useLabel.js.map +1 -1
  12. package/lib/components/Label/useLabelStyles.js.map +1 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib-commonjs/Label.js +5 -4
  15. package/lib-commonjs/Label.js.map +1 -1
  16. package/lib-commonjs/components/Label/Label.js +19 -20
  17. package/lib-commonjs/components/Label/Label.js.map +1 -1
  18. package/lib-commonjs/components/Label/Label.types.js +3 -2
  19. package/lib-commonjs/components/Label/Label.types.js.map +1 -1
  20. package/lib-commonjs/components/Label/index.js +9 -8
  21. package/lib-commonjs/components/Label/index.js.map +1 -1
  22. package/lib-commonjs/components/Label/renderLabel.js +13 -20
  23. package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
  24. package/lib-commonjs/components/Label/useLabel.js +30 -41
  25. package/lib-commonjs/components/Label/useLabel.js.map +1 -1
  26. package/lib-commonjs/components/Label/useLabelStyles.js +73 -53
  27. package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
  28. package/lib-commonjs/index.js +16 -33
  29. package/lib-commonjs/index.js.map +1 -1
  30. package/package.json +8 -7
  31. package/lib-amd/Label.js +0 -6
  32. package/lib-amd/Label.js.map +0 -1
  33. package/lib-amd/components/Label/Label.js +0 -17
  34. package/lib-amd/components/Label/Label.js.map +0 -1
  35. package/lib-amd/components/Label/Label.types.js +0 -5
  36. package/lib-amd/components/Label/Label.types.js.map +0 -1
  37. package/lib-amd/components/Label/index.js +0 -10
  38. package/lib-amd/components/Label/index.js.map +0 -1
  39. package/lib-amd/components/Label/renderLabel.js +0 -16
  40. package/lib-amd/components/Label/renderLabel.js.map +0 -1
  41. package/lib-amd/components/Label/useLabel.js +0 -29
  42. package/lib-amd/components/Label/useLabel.js.map +0 -1
  43. package/lib-amd/components/Label/useLabelStyles.js +0 -57
  44. package/lib-amd/components/Label/useLabelStyles.js.map +0 -1
  45. package/lib-amd/index.js +0 -11
  46. package/lib-amd/index.js.map +0 -1
package/.swcrc ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/swcrc",
3
+ "exclude": [
4
+ "/testing",
5
+ "/**/*.cy.ts",
6
+ "/**/*.cy.tsx",
7
+ "/**/*.spec.ts",
8
+ "/**/*.spec.tsx",
9
+ "/**/*.test.ts",
10
+ "/**/*.test.tsx"
11
+ ],
12
+ "jsc": {
13
+ "parser": {
14
+ "syntax": "typescript",
15
+ "tsx": true,
16
+ "decorators": false,
17
+ "dynamicImport": false
18
+ },
19
+ "externalHelpers": true,
20
+ "transform": {
21
+ "react": {
22
+ "runtime": "classic",
23
+ "useSpread": true
24
+ }
25
+ },
26
+ "target": "es2019"
27
+ },
28
+ "minify": false,
29
+ "sourceMaps": true
30
+ }
package/CHANGELOG.json CHANGED
@@ -2,7 +2,52 @@
2
2
  "name": "@fluentui/react-label",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 16 Mar 2023 14:33:33 GMT",
5
+ "date": "Tue, 21 Mar 2023 21:18:50 GMT",
6
+ "tag": "@fluentui/react-label_v9.1.5",
7
+ "version": "9.1.5",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "tristan.watanabe@gmail.com",
12
+ "package": "@fluentui/react-label",
13
+ "commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
14
+ "comment": "chore: migrate to swc transpilation approach."
15
+ },
16
+ {
17
+ "author": "tristan.watanabe@gmail.com",
18
+ "package": "@fluentui/react-label",
19
+ "commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
20
+ "comment": "fix: add node field to package.json exports map."
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-label",
25
+ "comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
26
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-label",
31
+ "comment": "Bump @fluentui/react-theme to v9.1.7",
32
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-label",
37
+ "comment": "Bump @fluentui/react-utilities to v9.7.2",
38
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-label",
43
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
44
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Thu, 16 Mar 2023 14:36:59 GMT",
6
51
  "tag": "@fluentui/react-label_v9.1.4",
7
52
  "version": "9.1.4",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,26 @@
1
1
  # Change Log - @fluentui/react-label
2
2
 
3
- This log was last generated on Thu, 16 Mar 2023 14:33:33 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 21 Mar 2023 21:18:50 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.1.5)
8
+
9
+ Tue, 21 Mar 2023 21:18:50 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.1.4..@fluentui/react-label_v9.1.5)
11
+
12
+ ### Patches
13
+
14
+ - chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
15
+ - fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
16
+ - Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
17
+ - Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
19
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
20
+
7
21
  ## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.1.4)
8
22
 
9
- Thu, 16 Mar 2023 14:33:33 GMT
23
+ Thu, 16 Mar 2023 14:36:59 GMT
10
24
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.1.3..@fluentui/react-label_v9.1.4)
11
25
 
12
26
  ### Patches
package/lib/Label.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["packages/react-components/react-label/src/Label.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './components/Label/index';\n"]}
1
+ {"version":3,"names":[],"sources":["../src/Label.ts"],"sourcesContent":["export * from './components/Label/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useLabel_unstable","renderLabel_unstable","useLabelStyles_unstable","useCustomStyleHooks_unstable","Label","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-label/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';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_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 const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAG1D,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,KAAK,gBAAoCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGR,iBAAiB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAE3CL,uBAAuB,CAACM,KAAK,CAAC;EAE9B,MAAM;IAAEN,uBAAuB,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACnFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,oBAAoB,CAACO,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFJ,KAAK,CAACM,WAAW,GAAG,OAAO"}
1
+ {"version":3,"names":["React","useLabel_unstable","renderLabel_unstable","useLabelStyles_unstable","useCustomStyleHooks_unstable","Label","forwardRef","props","ref","state","useCustomStyles","displayName"],"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';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_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 const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,iBAAiB,QAAQ;AAClC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AAGxC,SAASC,4BAA4B,QAAQ;AAE7C;;;AAGA,OAAO,MAAMC,KAAA,gBAAyCL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACrF,MAAMC,KAAA,GAAQR,iBAAA,CAAkBM,KAAA,EAAOC,GAAA;EAEvCL,uBAAA,CAAwBM,KAAA;EAExB,MAAM;IAAEN,uBAAA,EAAyBO;EAAe,CAAE,GAAGN,4BAAA;EACrDM,eAAA,CAAgBD,KAAA;EAEhB,OAAOP,oBAAA,CAAqBO,KAAA;AAC9B;AAEAJ,KAAA,CAAMM,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"Label.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-label/src/components/Label/Label.types.ts"],"names":[],"mappings":"","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"]}
1
+ {"version":3,"names":[],"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"],"mappings":"AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-label/src/components/Label/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"]}
1
+ {"version":3,"names":[],"sources":["../../../src/components/Label/index.ts"],"sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
@@ -8,10 +8,6 @@ export const renderLabel_unstable = state => {
8
8
  slots,
9
9
  slotProps
10
10
  } = getSlots(state);
11
- return /*#__PURE__*/React.createElement(slots.root, {
12
- ...slotProps.root
13
- }, state.root.children, slots.required && /*#__PURE__*/React.createElement(slots.required, {
14
- ...slotProps.required
15
- }));
11
+ return /*#__PURE__*/React.createElement(slots.root, slotProps.root, state.root.children, slots.required && /*#__PURE__*/React.createElement(slots.required, slotProps.required));
16
12
  };
17
13
  //# sourceMappingURL=renderLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderLabel_unstable","state","slots","slotProps","createElement","root","children","required"],"sources":["../src/packages/react-components/react-label/src/components/Label/renderLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAaE,KAAK,CAAC;EAExD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAC3BJ,KAAK,CAACI,IAAI,CAACC,QAAQ,EACnBJ,KAAK,CAACK,QAAQ,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,CAClD;AAEjB,CAAC"}
1
+ {"version":3,"names":["React","getSlots","renderLabel_unstable","state","slots","slotProps","createElement","root","children","required"],"sources":["../../../src/components/Label/renderLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,oBAAA,GAAwBC,KAAA,IAAsB;EACzD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAqBE,KAAA;EAElD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,EAC3BJ,KAAA,CAAMI,IAAI,CAACC,QAAQ,EACnBJ,KAAA,CAAMK,QAAQ,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,QAAQ,EAAKJ,SAAA,CAAUI,QAAQ;AAG/D"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { getNativeElementProps } from '@fluentui/react-utilities';
2
3
  import { resolveShorthand } from '@fluentui/react-utilities';
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["getNativeElementProps","resolveShorthand","useLabel_unstable","props","ref","disabled","required","weight","size","undefined","defaultProps","components","root"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\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: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,2BAA2B;AAEjE,SAASC,gBAAgB,QAAQ,2BAA2B;AAE5D;;;;;;;;;AASA,OAAO,MAAMC,iBAAiB,GAAGA,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;EAC9F,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC,QAAQ,GAAG,KAAK;IAAEC,MAAM,GAAG,SAAS;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGL,KAAK;EACzF,OAAO;IACLE,QAAQ;IACRC,QAAQ,EAAEL,gBAAgB,CAACK,QAAQ,KAAK,IAAI,GAAG,GAAG,GAAGA,QAAQ,IAAIG,SAAS,EAAE;MAC1EC,YAAY,EAAE;QAAE,aAAa,EAAE;MAAM;KACtC,CAAC;IACFH,MAAM;IACNC,IAAI;IACJG,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEN,QAAQ,EAAE;IAAM,CAAE;IAC/CM,IAAI,EAAEZ,qBAAqB,CAAC,OAAO,EAAE;MAAEI,GAAG;MAAE,GAAGD;IAAK,CAAE;GACvD;AACH,CAAC"}
1
+ {"version":3,"names":["React","getNativeElementProps","resolveShorthand","useLabel_unstable","props","ref","disabled","required","weight","size","undefined","defaultProps","components","root"],"sources":["../../../src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\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: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AAEtC,SAASC,gBAAgB,QAAQ;AAEjC;;;;;;;;;AASA,OAAO,MAAMC,iBAAA,GAAoBA,CAACC,KAAA,EAAmBC,GAAA,KAA4C;EAC/F,MAAM;IAAEC,QAAA,GAAW,KAAK;IAAEC,QAAA,GAAW,KAAK;IAAEC,MAAA,GAAS;IAAWC,IAAA,GAAO;EAAQ,CAAE,GAAGL,KAAA;EACpF,OAAO;IACLE,QAAA;IACAC,QAAA,EAAUL,gBAAA,CAAiBK,QAAA,KAAa,IAAI,GAAG,MAAMA,QAAA,IAAYG,SAAS,EAAE;MAC1EC,YAAA,EAAc;QAAE,eAAe;MAAO;IACxC;IACAH,MAAA;IACAC,IAAA;IACAG,UAAA,EAAY;MAAEC,IAAA,EAAM;MAASN,QAAA,EAAU;IAAO;IAC9CM,IAAA,EAAMZ,qBAAA,CAAsB,SAAS;MAAEI,GAAA;MAAK,GAAGD;IAAM;EACvD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tokens","labelClassNames","root","required","useStyles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","useLabelStyles_unstable","state","styles","className","size","weight"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabelStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAI9C,OAAO,MAAMC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGN,QAAA;EAAAI,IAAA;IAAAG,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;EAAA;EAAAH,QAAA;IAAAG,MAAA;IAAAE,MAAA;EAAA;EAAAC,gBAAA;IAAAH,MAAA;EAAA;EAAAI,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;AAAA,EAsChB;AAEF;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAiB,IAAgB;EACvE,MAAMC,MAAM,GAAGhB,SAAS,EAAE;EAC1Be,KAAK,CAACjB,IAAI,CAACmB,SAAS,GAAGtB,YAAY,CACjCE,eAAe,CAACC,IAAI,EACpBkB,MAAM,CAAClB,IAAI,EACXiB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACb,QAAQ,EACjCa,MAAM,CAACD,KAAK,CAACG,IAAI,CAAC,EAClBH,KAAK,CAACI,MAAM,KAAK,UAAU,IAAIH,MAAM,CAACJ,QAAQ,EAC9CG,KAAK,CAACjB,IAAI,CAACmB,SAAS,CACrB;EAED,IAAIF,KAAK,CAAChB,QAAQ,EAAE;IAClBgB,KAAK,CAAChB,QAAQ,CAACkB,SAAS,GAAGtB,YAAY,CACrCE,eAAe,CAACE,QAAQ,EACxBiB,MAAM,CAACjB,QAAQ,EACfgB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACX,gBAAgB,EACzCU,KAAK,CAAChB,QAAQ,CAACkB,SAAS,CACzB;;EAGH,OAAOF,KAAK;AACd,CAAC"}
1
+ {"version":3,"names":["__styles","mergeClasses","tokens","labelClassNames","root","required","useStyles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","useLabelStyles_unstable","state","styles","className","size","weight"],"sources":["../../../src/components/Label/useLabelStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AACzC,SAASC,MAAM,QAAQ;AAIvB,OAAO,MAAMC,eAAA,GAA8C;EACzDC,IAAA,EAAM;EACNC,QAAA,EAAU;AACZ;AAEA;;;AAGA,MAAMC,SAAA,gBAAYN,QAAA;EAAAI,IAAA;IAAAG,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;EAAA;EAAAH,QAAA;IAAAG,MAAA;IAAAE,MAAA;EAAA;EAAAC,gBAAA;IAAAH,MAAA;EAAA;EAAAI,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;AAAA,EAsClB;AAEA;;;AAGA,OAAO,MAAMC,uBAAA,GAA2BC,KAAA,IAAkC;EACxE,MAAMC,MAAA,GAAShB,SAAA;EACfe,KAAA,CAAMjB,IAAI,CAACmB,SAAS,GAAGtB,YAAA,CACrBE,eAAA,CAAgBC,IAAI,EACpBkB,MAAA,CAAOlB,IAAI,EACXiB,KAAA,CAAMZ,QAAQ,IAAIa,MAAA,CAAOb,QAAQ,EACjCa,MAAM,CAACD,KAAA,CAAMG,IAAI,CAAC,EAClBH,KAAA,CAAMI,MAAM,KAAK,cAAcH,MAAA,CAAOJ,QAAQ,EAC9CG,KAAA,CAAMjB,IAAI,CAACmB,SAAS;EAGtB,IAAIF,KAAA,CAAMhB,QAAQ,EAAE;IAClBgB,KAAA,CAAMhB,QAAQ,CAACkB,SAAS,GAAGtB,YAAA,CACzBE,eAAA,CAAgBE,QAAQ,EACxBiB,MAAA,CAAOjB,QAAQ,EACfgB,KAAA,CAAMZ,QAAQ,IAAIa,MAAA,CAAOX,gBAAgB,EACzCU,KAAA,CAAMhB,QAAQ,CAACkB,SAAS;EAE5B;EAEA,OAAOF,KAAA;AACT"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-label/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"]}
1
+ {"version":3,"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Label/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Label/index"), exports);
7
+ //# sourceMappingURL=Label.js.map
8
+
8
9
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-label/src/Label.ts"],"sourcesContent":["export * from './components/Label/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,8BAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Label.js"],"sourcesContent":["export * from './components/Label/index';\n//# sourceMappingURL=Label.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Label", {
6
+ enumerable: true,
7
+ get: ()=>Label
5
8
  });
6
- exports.Label = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const useLabel_1 = /*#__PURE__*/require("./useLabel");
9
- const renderLabel_1 = /*#__PURE__*/require("./renderLabel");
10
- const useLabelStyles_1 = /*#__PURE__*/require("./useLabelStyles");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- /**
13
- * A label component provides a title or name to a component.
14
- */
15
- exports.Label = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = useLabel_1.useLabel_unstable(props, ref);
17
- useLabelStyles_1.useLabelStyles_unstable(state);
18
- const {
19
- useLabelStyles_unstable: useCustomStyles
20
- } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
- useCustomStyles(state);
22
- return renderLabel_1.renderLabel_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _useLabel = require("./useLabel");
12
+ const _renderLabel = require("./renderLabel");
13
+ const _useLabelStyles = require("./useLabelStyles");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const Label = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
+ const state = (0, _useLabel.useLabel_unstable)(props, ref);
17
+ (0, _useLabelStyles.useLabelStyles_unstable)(state);
18
+ const { useLabelStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
19
+ useCustomStyles(state);
20
+ return (0, _renderLabel.renderLabel_unstable)(state);
23
21
  });
24
- exports.Label.displayName = 'Label';
22
+ Label.displayName = 'Label'; //# sourceMappingURL=Label.js.map
23
+
25
24
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","useLabel_1","renderLabel_1","useLabelStyles_1","react_shared_contexts_1","exports","Label","forwardRef","props","ref","state","useLabel_unstable","useLabelStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderLabel_unstable","displayName"],"sources":["../src/packages/react-components/react-label/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';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_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 const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,UAAA,gBAAAD,OAAA;AACA,MAAAE,aAAA,gBAAAF,OAAA;AACA,MAAAG,gBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,KAAK,gBAAoCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGT,UAAA,CAAAU,iBAAiB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE3CN,gBAAA,CAAAS,uBAAuB,CAACF,KAAK,CAAC;EAE9B,MAAM;IAAEE,uBAAuB,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACnFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,aAAA,CAAAa,oBAAoB,CAACL,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFL,OAAA,CAAAC,KAAK,CAACU,WAAW,GAAG,OAAO"}
1
+ {"version":3,"sources":["../../../lib/components/Label/Label.js"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n useLabelStyles_unstable(state);\n const {\n useLabelStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderLabel_unstable(state);\n});\nLabel.displayName = 'Label';\n//# sourceMappingURL=Label.js.map"],"names":["Label","React","forwardRef","props","ref","state","useLabel_unstable","useLabelStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderLabel_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;0BACW;6BACG;gCACG;qCACK;AAItC,MAAMA,QAAQ,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,uCAAuB,EAACF;IACxB,MAAM,EACJE,yBAAyBC,gBAAe,EACzC,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,iCAAoB,EAACL;AAC9B;AACAL,MAAMW,WAAW,GAAG,SACpB,iCAAiC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ //# sourceMappingURL=Label.types.js.map
6
+
6
7
  //# sourceMappingURL=Label.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/react-label/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"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Label/Label.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Label.types.js.map"],"names":[],"mappings":";;;;CACA,uCAAuC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Label"), exports);
8
- tslib_1.__exportStar(require("./Label.types"), exports);
9
- tslib_1.__exportStar(require("./renderLabel"), exports);
10
- tslib_1.__exportStar(require("./useLabel"), exports);
11
- tslib_1.__exportStar(require("./useLabelStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Label"), exports);
7
+ _exportStar(require("./Label.types"), exports);
8
+ _exportStar(require("./renderLabel"), exports);
9
+ _exportStar(require("./useLabel"), exports);
10
+ _exportStar(require("./useLabelStyles"), exports);
11
+ //# sourceMappingURL=index.js.map
12
+
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/index.ts"],"sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,aAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,gBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Label/index.js"],"sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,24 +1,17 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderLabel_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderLabel_unstable
5
8
  });
6
- exports.renderLabel_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Render the final JSX of Label
11
- */
12
- const renderLabel_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, {
18
- ...slotProps.root
19
- }, state.root.children, slots.required && React.createElement(slots.required, {
20
- ...slotProps.required
21
- }));
22
- };
23
- exports.renderLabel_unstable = renderLabel_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const renderLabel_unstable = (state)=>{
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
+ return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, state.root.children, slots.required && /*#__PURE__*/ _react.createElement(slots.required, slotProps.required));
15
+ }; //# sourceMappingURL=renderLabel.js.map
16
+
24
17
  //# sourceMappingURL=renderLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderLabel_unstable","state","slots","slotProps","getSlots","createElement","root","children","required","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/renderLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAaH,KAAK,CAAC;EAExD,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BL,KAAK,CAACK,IAAI,CAACC,QAAQ,EACnBL,KAAK,CAACM,QAAQ,IAAIX,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACM,QAAQ;IAAA,GAAKL,SAAS,CAACK;EAAQ,EAAI,CAClD;AAEjB,CAAC;AATYC,OAAA,CAAAT,oBAAoB,GAAAA,oBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Label/renderLabel.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, state.root.children, slots.required && /*#__PURE__*/React.createElement(slots.required, slotProps.required));\n};\n//# sourceMappingURL=renderLabel.js.map"],"names":["renderLabel_unstable","state","slots","slotProps","getSlots","React","createElement","root","children","required"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEN,MAAMM,IAAI,CAACC,QAAQ,EAAEN,MAAMO,QAAQ,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMO,QAAQ,EAAEN,UAAUM,QAAQ;AAChL,GACA,uCAAuC"}
@@ -1,45 +1,34 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useLabel_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useLabel_unstable
5
8
  });
6
- exports.useLabel_unstable = void 0;
7
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
- const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Create the state required to render Label.
11
- *
12
- * The returned state can be modified with hooks such as useLabelStyles_unstable,
13
- * before being passed to renderLabel_unstable.
14
- *
15
- * @param props - props from this instance of Label
16
- * @param ref - reference to root HTMLElement of Label
17
- */
18
- const useLabel_unstable = (props, ref) => {
19
- const {
20
- disabled = false,
21
- required = false,
22
- weight = 'regular',
23
- size = 'medium'
24
- } = props;
25
- return {
26
- disabled,
27
- required: react_utilities_2.resolveShorthand(required === true ? '*' : required || undefined, {
28
- defaultProps: {
29
- 'aria-hidden': 'true'
30
- }
31
- }),
32
- weight,
33
- size,
34
- components: {
35
- root: 'label',
36
- required: 'span'
37
- },
38
- root: react_utilities_1.getNativeElementProps('label', {
39
- ref,
40
- ...props
41
- })
42
- };
43
- };
44
- exports.useLabel_unstable = useLabel_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ const useLabel_unstable = (props, ref)=>{
13
+ const { disabled =false , required =false , weight ='regular' , size ='medium' } = props;
14
+ return {
15
+ disabled,
16
+ required: (0, _reactUtilities.resolveShorthand)(required === true ? '*' : required || undefined, {
17
+ defaultProps: {
18
+ 'aria-hidden': 'true'
19
+ }
20
+ }),
21
+ weight,
22
+ size,
23
+ components: {
24
+ root: 'label',
25
+ required: 'span'
26
+ },
27
+ root: (0, _reactUtilities.getNativeElementProps)('label', {
28
+ ref,
29
+ ...props
30
+ })
31
+ };
32
+ }; //# sourceMappingURL=useLabel.js.map
33
+
45
34
  //# sourceMappingURL=useLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_utilities_1","require","react_utilities_2","useLabel_unstable","props","ref","disabled","required","weight","size","resolveShorthand","undefined","defaultProps","components","root","getNativeElementProps","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\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: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA;;;;;;;;;AASO,MAAME,iBAAiB,GAAGA,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;EAC9F,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC,QAAQ,GAAG,KAAK;IAAEC,MAAM,GAAG,SAAS;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGL,KAAK;EACzF,OAAO;IACLE,QAAQ;IACRC,QAAQ,EAAEL,iBAAA,CAAAQ,gBAAgB,CAACH,QAAQ,KAAK,IAAI,GAAG,GAAG,GAAGA,QAAQ,IAAII,SAAS,EAAE;MAC1EC,YAAY,EAAE;QAAE,aAAa,EAAE;MAAM;KACtC,CAAC;IACFJ,MAAM;IACNC,IAAI;IACJI,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEP,QAAQ,EAAE;IAAM,CAAE;IAC/CO,IAAI,EAAEd,iBAAA,CAAAe,qBAAqB,CAAC,OAAO,EAAE;MAAEV,GAAG;MAAE,GAAGD;IAAK,CAAE;GACvD;AACH,CAAC;AAZYY,OAAA,CAAAb,iBAAiB,GAAAA,iBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Label/useLabel.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { resolveShorthand } from '@fluentui/react-utilities';\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, ref) => {\n const {\n disabled = false,\n required = false,\n weight = 'regular',\n size = 'medium'\n } = props;\n return {\n disabled,\n required: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: {\n 'aria-hidden': 'true'\n }\n }),\n weight,\n size,\n components: {\n root: 'label',\n required: 'span'\n },\n root: getNativeElementProps('label', {\n ref,\n ...props\n })\n };\n};\n//# sourceMappingURL=useLabel.js.map"],"names":["useLabel_unstable","props","ref","disabled","required","weight","size","resolveShorthand","undefined","defaultProps","components","root","getNativeElementProps"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACe;AAW/B,MAAMA,oBAAoB,CAACC,OAAOC,MAAQ;IAC/C,MAAM,EACJC,UAAW,KAAK,CAAA,EAChBC,UAAW,KAAK,CAAA,EAChBC,QAAS,UAAS,EAClBC,MAAO,SAAQ,EAChB,GAAGL;IACJ,OAAO;QACLE;QACAC,UAAUG,IAAAA,gCAAgB,EAACH,aAAa,IAAI,GAAG,MAAMA,YAAYI,SAAS,EAAE;YAC1EC,cAAc;gBACZ,eAAe;YACjB;QACF;QACAJ;QACAC;QACAI,YAAY;YACVC,MAAM;YACNP,UAAU;QACZ;QACAO,MAAMC,IAAAA,qCAAqB,EAAC,SAAS;YACnCV;YACA,GAAGD,KAAK;QACV;IACF;AACF,GACA,oCAAoC"}
@@ -1,62 +1,82 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ labelClassNames: ()=>labelClassNames,
13
+ useLabelStyles_unstable: ()=>useLabelStyles_unstable
5
14
  });
6
- exports.useLabelStyles_unstable = exports.labelClassNames = void 0;
7
- const react_1 = /*#__PURE__*/require("@griffel/react");
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
- exports.labelClassNames = {
10
- root: 'fui-Label',
11
- required: 'fui-Label__required'
15
+ const _react = require("@griffel/react");
16
+ const labelClassNames = {
17
+ root: 'fui-Label',
18
+ required: 'fui-Label__required'
12
19
  };
13
20
  /**
14
21
  * Styles for the label
15
- */
16
- const useStyles = /*#__PURE__*/react_1.__styles({
17
- root: {
18
- Bahqtrf: "fk6fouc",
19
- sj55zd: "f19n0e5"
20
- },
21
- disabled: {
22
- sj55zd: "f1s2aq7o"
23
- },
24
- required: {
25
- sj55zd: "f1whyuy6",
26
- uwmqm3: ["fycuoez", "f8wuabp"]
27
- },
28
- requiredDisabled: {
29
- sj55zd: "f1s2aq7o"
30
- },
31
- small: {
32
- Be2twd7: "fy9rknc",
33
- Bg96gwp: "fwrc4pm"
34
- },
35
- medium: {
36
- Be2twd7: "fkhj508",
37
- Bg96gwp: "f1i3iumi"
38
- },
39
- large: {
40
- Be2twd7: "fod5ikn",
41
- Bg96gwp: "faaz57k",
42
- Bhrd7zp: "fl43uef"
43
- },
44
- semibold: {
45
- Bhrd7zp: "fl43uef"
46
- }
22
+ */ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
23
+ root: {
24
+ Bahqtrf: "fk6fouc",
25
+ sj55zd: "f19n0e5"
26
+ },
27
+ disabled: {
28
+ sj55zd: "f1s2aq7o"
29
+ },
30
+ required: {
31
+ sj55zd: "f1whyuy6",
32
+ uwmqm3: [
33
+ "fycuoez",
34
+ "f8wuabp"
35
+ ]
36
+ },
37
+ requiredDisabled: {
38
+ sj55zd: "f1s2aq7o"
39
+ },
40
+ small: {
41
+ Be2twd7: "fy9rknc",
42
+ Bg96gwp: "fwrc4pm"
43
+ },
44
+ medium: {
45
+ Be2twd7: "fkhj508",
46
+ Bg96gwp: "f1i3iumi"
47
+ },
48
+ large: {
49
+ Be2twd7: "fod5ikn",
50
+ Bg96gwp: "faaz57k",
51
+ Bhrd7zp: "fl43uef"
52
+ },
53
+ semibold: {
54
+ Bhrd7zp: "fl43uef"
55
+ }
47
56
  }, {
48
- d: [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fycuoez{padding-left:4px;}", ".f8wuabp{padding-right:4px;}", ".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);}"]
57
+ d: [
58
+ ".fk6fouc{font-family:var(--fontFamilyBase);}",
59
+ ".f19n0e5{color:var(--colorNeutralForeground1);}",
60
+ ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
61
+ ".f1whyuy6{color:var(--colorPaletteRedForeground3);}",
62
+ ".fycuoez{padding-left:4px;}",
63
+ ".f8wuabp{padding-right:4px;}",
64
+ ".fy9rknc{font-size:var(--fontSizeBase200);}",
65
+ ".fwrc4pm{line-height:var(--lineHeightBase200);}",
66
+ ".fkhj508{font-size:var(--fontSizeBase300);}",
67
+ ".f1i3iumi{line-height:var(--lineHeightBase300);}",
68
+ ".fod5ikn{font-size:var(--fontSizeBase400);}",
69
+ ".faaz57k{line-height:var(--lineHeightBase400);}",
70
+ ".fl43uef{font-weight:var(--fontWeightSemibold);}"
71
+ ]
49
72
  });
50
- /**
51
- * Apply styling to the Label slots based on the state
52
- */
53
- const useLabelStyles_unstable = state => {
54
- const styles = useStyles();
55
- state.root.className = react_1.mergeClasses(exports.labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
56
- if (state.required) {
57
- state.required.className = react_1.mergeClasses(exports.labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
58
- }
59
- return state;
60
- };
61
- exports.useLabelStyles_unstable = useLabelStyles_unstable;
73
+ const useLabelStyles_unstable = (state)=>{
74
+ const styles = useStyles();
75
+ 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);
76
+ if (state.required) {
77
+ state.required.className = (0, _react.mergeClasses)(labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
78
+ }
79
+ return state;
80
+ }; //# sourceMappingURL=useLabelStyles.js.map
81
+
62
82
  //# sourceMappingURL=useLabelStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_1","require","react_theme_1","exports","labelClassNames","root","required","useStyles","__styles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","useLabelStyles_unstable","state","styles","className","mergeClasses","size","weight"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabelStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AAIaE,OAAA,CAAAC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGP,OAAA,CAAAQ,QAAU;EAAAH,IAAA;IAAAI,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;EAAA;EAAAJ,QAAA;IAAAI,MAAA;IAAAE,MAAA;EAAA;EAAAC,gBAAA;IAAAH,MAAA;EAAA;EAAAI,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;AAAA,EAsC1B;AAEF;;;AAGO,MAAMC,uBAAuB,GAAIC,KAAiB,IAAgB;EACvE,MAAMC,MAAM,GAAGjB,SAAS,EAAE;EAC1BgB,KAAK,CAAClB,IAAI,CAACoB,SAAS,GAAGzB,OAAA,CAAA0B,YAAY,CACjCvB,OAAA,CAAAC,eAAe,CAACC,IAAI,EACpBmB,MAAM,CAACnB,IAAI,EACXkB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACb,QAAQ,EACjCa,MAAM,CAACD,KAAK,CAACI,IAAI,CAAC,EAClBJ,KAAK,CAACK,MAAM,KAAK,UAAU,IAAIJ,MAAM,CAACJ,QAAQ,EAC9CG,KAAK,CAAClB,IAAI,CAACoB,SAAS,CACrB;EAED,IAAIF,KAAK,CAACjB,QAAQ,EAAE;IAClBiB,KAAK,CAACjB,QAAQ,CAACmB,SAAS,GAAGzB,OAAA,CAAA0B,YAAY,CACrCvB,OAAA,CAAAC,eAAe,CAACE,QAAQ,EACxBkB,MAAM,CAAClB,QAAQ,EACfiB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACX,gBAAgB,EACzCU,KAAK,CAACjB,QAAQ,CAACmB,SAAS,CACzB;;EAGH,OAAOF,KAAK;AACd,CAAC;AArBYpB,OAAA,CAAAmB,uBAAuB,GAAAA,uBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Label/useLabelStyles.js"],"sourcesContent":["import { __styles, 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 */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n Bahqtrf: \"fk6fouc\",\n sj55zd: \"f19n0e5\"\n },\n disabled: {\n sj55zd: \"f1s2aq7o\"\n },\n required: {\n sj55zd: \"f1whyuy6\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"]\n },\n requiredDisabled: {\n sj55zd: \"f1s2aq7o\"\n },\n small: {\n Be2twd7: \"fy9rknc\",\n Bg96gwp: \"fwrc4pm\"\n },\n medium: {\n Be2twd7: \"fkhj508\",\n Bg96gwp: \"f1i3iumi\"\n },\n large: {\n Be2twd7: \"fod5ikn\",\n Bg96gwp: \"faaz57k\",\n Bhrd7zp: \"fl43uef\"\n },\n semibold: {\n Bhrd7zp: \"fl43uef\"\n }\n}, {\n d: [\".fk6fouc{font-family:var(--fontFamilyBase);}\", \".f19n0e5{color:var(--colorNeutralForeground1);}\", \".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}\", \".f1whyuy6{color:var(--colorPaletteRedForeground3);}\", \".fycuoez{padding-left:4px;}\", \".f8wuabp{padding-right:4px;}\", \".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);}\"]\n});\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = state => {\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.requiredDisabled, state.required.className);\n }\n return state;\n};\n//# sourceMappingURL=useLabelStyles.js.map"],"names":["labelClassNames","useLabelStyles_unstable","root","required","useStyles","__styles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","state","styles","className","mergeClasses","size","weight"],"mappings":";;;;;;;;;;;IAEaA,eAAe,MAAfA;IA4CAC,uBAAuB,MAAvBA;;uBA9C0B;AAEhC,MAAMD,kBAAkB;IAC7BE,MAAM;IACNC,UAAU;AACZ;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCH,MAAM;QACJI,SAAS;QACTC,QAAQ;IACV;IACAC,UAAU;QACRD,QAAQ;IACV;IACAJ,UAAU;QACRI,QAAQ;QACRE,QAAQ;YAAC;YAAW;SAAU;IAChC;IACAC,kBAAkB;QAChBH,QAAQ;IACV;IACAI,OAAO;QACLC,SAAS;QACTC,SAAS;IACX;IACAC,QAAQ;QACNF,SAAS;QACTC,SAAS;IACX;IACAE,OAAO;QACLH,SAAS;QACTC,SAAS;QACTG,SAAS;IACX;IACAC,UAAU;QACRD,SAAS;IACX;AACF,GAAG;IACDE,GAAG;QAAC;QAAgD;QAAmD;QAA2D;QAAuD;QAA+B;QAAgC;QAA+C;QAAmD;QAA+C;QAAoD;QAA+C;QAAmD;KAAmD;AACpnB;AAIO,MAAMjB,0BAA0BkB,CAAAA,QAAS;IAC9C,MAAMC,SAAShB;IACfe,MAAMjB,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,gBAAgBE,IAAI,EAAEkB,OAAOlB,IAAI,EAAEiB,MAAMX,QAAQ,IAAIY,OAAOZ,QAAQ,EAAEY,MAAM,CAACD,MAAMI,IAAI,CAAC,EAAEJ,MAAMK,MAAM,KAAK,cAAcJ,OAAOH,QAAQ,EAAEE,MAAMjB,IAAI,CAACmB,SAAS;IAClM,IAAIF,MAAMhB,QAAQ,EAAE;QAClBgB,MAAMhB,QAAQ,CAACkB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,gBAAgBG,QAAQ,EAAEiB,OAAOjB,QAAQ,EAAEgB,MAAMX,QAAQ,IAAIY,OAAOV,gBAAgB,EAAES,MAAMhB,QAAQ,CAACkB,SAAS;IACxJ,CAAC;IACD,OAAOF;AACT,GACA,0CAA0C"}
@@ -1,38 +1,21 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useLabel_unstable = exports.useLabelStyles_unstable = exports.renderLabel_unstable = exports.labelClassNames = exports.Label = void 0;
7
- var Label_1 = /*#__PURE__*/require("./Label");
8
- Object.defineProperty(exports, "Label", {
9
- enumerable: true,
10
- get: function () {
11
- return Label_1.Label;
12
- }
13
- });
14
- Object.defineProperty(exports, "labelClassNames", {
15
- enumerable: true,
16
- get: function () {
17
- return Label_1.labelClassNames;
18
- }
3
+ value: true
19
4
  });
20
- Object.defineProperty(exports, "renderLabel_unstable", {
21
- enumerable: true,
22
- get: function () {
23
- return Label_1.renderLabel_unstable;
24
- }
25
- });
26
- Object.defineProperty(exports, "useLabelStyles_unstable", {
27
- enumerable: true,
28
- get: function () {
29
- return Label_1.useLabelStyles_unstable;
30
- }
31
- });
32
- Object.defineProperty(exports, "useLabel_unstable", {
33
- enumerable: true,
34
- get: function () {
35
- return Label_1.useLabel_unstable;
36
- }
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ Label: ()=>_label.Label,
13
+ labelClassNames: ()=>_label.labelClassNames,
14
+ renderLabel_unstable: ()=>_label.renderLabel_unstable,
15
+ useLabelStyles_unstable: ()=>_label.useLabelStyles_unstable,
16
+ useLabel_unstable: ()=>_label.useLabel_unstable
37
17
  });
18
+ const _label = require("./Label");
19
+ //# sourceMappingURL=index.js.map
20
+
38
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Label_1","require","Object","defineProperty","exports","enumerable","get","Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"sources":["../src/packages/react-components/react-label/src/index.ts"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAO,KAAK;EAAA;AAAA;AAAEL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAQ,eAAe;EAAA;AAAA;AAAEN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAS,oBAAoB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAU,uBAAuB;EAAA;AAAA;AAAER,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAW,iBAAiB;EAAA;AAAA"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\n//# sourceMappingURL=index.js.map"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;;uBAAQ;CACzG,iCAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-label",
3
- "version": "9.1.4",
3
+ "version": "9.1.5",
4
4
  "description": "Fluent UI React Label component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,21 +22,21 @@
22
22
  "test": "jest --passWithNoTests",
23
23
  "storybook": "start-storybook",
24
24
  "type-check": "tsc -b tsconfig.json",
25
- "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
25
+ "generate-api": "just-scripts generate-api"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
30
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.20",
31
31
  "@fluentui/scripts-api-extractor": "*",
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-shared-contexts": "^9.3.1",
36
- "@fluentui/react-theme": "^9.1.6",
37
- "@fluentui/react-utilities": "^9.7.1",
35
+ "@fluentui/react-shared-contexts": "^9.3.2",
36
+ "@fluentui/react-theme": "^9.1.7",
37
+ "@fluentui/react-utilities": "^9.7.2",
38
38
  "@griffel/react": "^1.5.2",
39
- "tslib": "^2.1.0"
39
+ "@swc/helpers": "^0.4.14"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@types/react": ">=16.8.0 <19.0.0",
@@ -53,6 +53,7 @@
53
53
  "exports": {
54
54
  ".": {
55
55
  "types": "./dist/index.d.ts",
56
+ "node": "./lib-commonjs/index.js",
56
57
  "import": "./lib/index.js",
57
58
  "require": "./lib-commonjs/index.js"
58
59
  },
package/lib-amd/Label.js DELETED
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/Label/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-label/src/Label.ts"],"names":[],"mappings":";;;IAAA,uCAAyC","sourcesContent":["export * from './components/Label/index';\n"]}
@@ -1,17 +0,0 @@
1
- define(["require", "exports", "react", "./useLabel", "./renderLabel", "./useLabelStyles", "@fluentui/react-shared-contexts"], function (require, exports, React, useLabel_1, renderLabel_1, useLabelStyles_1, react_shared_contexts_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Label = void 0;
5
- /**
6
- * A label component provides a title or name to a component.
7
- */
8
- exports.Label = React.forwardRef(function (props, ref) {
9
- var state = useLabel_1.useLabel_unstable(props, ref);
10
- useLabelStyles_1.useLabelStyles_unstable(state);
11
- var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useLabelStyles_unstable;
12
- useCustomStyles(state);
13
- return renderLabel_1.renderLabel_unstable(state);
14
- });
15
- exports.Label.displayName = 'Label';
16
- });
17
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/Label.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAEvB,IAAyB,eAAe,GAAK,oDAA4B,EAAE,wBAAnC,CAAoC;QACpF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_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 const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"]}
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=Label.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/Label.types.ts"],"names":[],"mappings":"","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"]}
@@ -1,10 +0,0 @@
1
- define(["require", "exports", "tslib", "./Label", "./Label.types", "./renderLabel", "./useLabel", "./useLabelStyles"], function (require, exports, tslib_1, Label_1, Label_types_1, renderLabel_1, useLabel_1, useLabelStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Label_1, exports);
5
- tslib_1.__exportStar(Label_types_1, exports);
6
- tslib_1.__exportStar(renderLabel_1, exports);
7
- tslib_1.__exportStar(useLabel_1, exports);
8
- tslib_1.__exportStar(useLabelStyles_1, exports);
9
- });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IACxB,6CAA8B;IAC9B,6CAA8B;IAC9B,0CAA2B;IAC3B,gDAAiC","sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"]}
@@ -1,16 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderLabel_unstable = void 0;
5
- /**
6
- * Render the final JSX of Label
7
- */
8
- var renderLabel_unstable = function (state) {
9
- var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
10
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
- state.root.children,
12
- slots.required && React.createElement(slots.required, tslib_1.__assign({}, slotProps.required))));
13
- };
14
- exports.renderLabel_unstable = renderLabel_unstable;
15
- });
16
- //# sourceMappingURL=renderLabel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderLabel.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/renderLabel.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAAiB;QAC9C,IAAA,KAAuB,0BAAQ,CAAa,KAAK,CAAC,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAgC,CAAC;QAEzD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,IAAI,CAAC,QAAQ;YACnB,KAAK,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI,CAClD,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,oBAAoB,wBAS/B","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"]}
@@ -1,29 +0,0 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-utilities", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1, react_utilities_2) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLabel_unstable = void 0;
5
- /**
6
- * Create the state required to render Label.
7
- *
8
- * The returned state can be modified with hooks such as useLabelStyles_unstable,
9
- * before being passed to renderLabel_unstable.
10
- *
11
- * @param props - props from this instance of Label
12
- * @param ref - reference to root HTMLElement of Label
13
- */
14
- var useLabel_unstable = function (props, ref) {
15
- var _a = props.disabled, disabled = _a === void 0 ? false : _a, _b = props.required, required = _b === void 0 ? false : _b, _c = props.weight, weight = _c === void 0 ? 'regular' : _c, _d = props.size, size = _d === void 0 ? 'medium' : _d;
16
- return {
17
- disabled: disabled,
18
- required: react_utilities_2.resolveShorthand(required === true ? '*' : required || undefined, {
19
- defaultProps: { 'aria-hidden': 'true' },
20
- }),
21
- weight: weight,
22
- size: size,
23
- components: { root: 'label', required: 'span' },
24
- root: react_utilities_1.getNativeElementProps('label', tslib_1.__assign({ ref: ref }, props)),
25
- };
26
- };
27
- exports.useLabel_unstable = useLabel_unstable;
28
- });
29
- //# sourceMappingURL=useLabel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLabel.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/useLabel.tsx"],"names":[],"mappings":";;;;IAKA;;;;;;;;OAQG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAA2B;QACtE,IAAA,KAA4E,KAAK,SAAjE,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAA0D,KAAK,SAA/C,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,KAAwC,KAAK,OAA3B,EAAlB,MAAM,mBAAG,SAAS,KAAA,EAAE,KAAoB,KAAK,KAAV,EAAf,IAAI,mBAAG,QAAQ,KAAA,CAAW;QAC1F,OAAO;YACL,QAAQ,UAAA;YACR,QAAQ,EAAE,kCAAgB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAE;gBAC1E,YAAY,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE;aACxC,CAAC;YACF,MAAM,QAAA;YACN,IAAI,MAAA;YACJ,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;YAC/C,IAAI,EAAE,uCAAqB,CAAC,OAAO,qBAAI,GAAG,KAAA,IAAK,KAAK,EAAG;SACxD,CAAC;IACJ,CAAC,CAAC;IAZW,QAAA,iBAAiB,qBAY5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\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: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"]}
@@ -1,57 +0,0 @@
1
- define(["require", "exports", "@griffel/react", "@fluentui/react-theme"], function (require, exports, react_1, react_theme_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLabelStyles_unstable = exports.labelClassNames = void 0;
5
- exports.labelClassNames = {
6
- root: 'fui-Label',
7
- required: 'fui-Label__required',
8
- };
9
- /**
10
- * Styles for the label
11
- */
12
- var useStyles = react_1.makeStyles({
13
- root: {
14
- fontFamily: react_theme_1.tokens.fontFamilyBase,
15
- color: react_theme_1.tokens.colorNeutralForeground1,
16
- },
17
- disabled: {
18
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
19
- },
20
- required: {
21
- color: react_theme_1.tokens.colorPaletteRedForeground3,
22
- paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS
23
- },
24
- requiredDisabled: {
25
- color: react_theme_1.tokens.colorNeutralForegroundDisabled,
26
- },
27
- small: {
28
- fontSize: react_theme_1.tokens.fontSizeBase200,
29
- lineHeight: react_theme_1.tokens.lineHeightBase200,
30
- },
31
- medium: {
32
- fontSize: react_theme_1.tokens.fontSizeBase300,
33
- lineHeight: react_theme_1.tokens.lineHeightBase300,
34
- },
35
- large: {
36
- fontSize: react_theme_1.tokens.fontSizeBase400,
37
- lineHeight: react_theme_1.tokens.lineHeightBase400,
38
- fontWeight: react_theme_1.tokens.fontWeightSemibold,
39
- },
40
- semibold: {
41
- fontWeight: react_theme_1.tokens.fontWeightSemibold,
42
- },
43
- });
44
- /**
45
- * Apply styling to the Label slots based on the state
46
- */
47
- var useLabelStyles_unstable = function (state) {
48
- var styles = useStyles();
49
- state.root.className = react_1.mergeClasses(exports.labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
50
- if (state.required) {
51
- state.required.className = react_1.mergeClasses(exports.labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
52
- }
53
- return state;
54
- };
55
- exports.useLabelStyles_unstable = useLabelStyles_unstable;
56
- });
57
- //# sourceMappingURL=useLabelStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLabelStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,qBAAqB;KAChC,CAAC;IAEF;;OAEG;IACH,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,UAAU,EAAE,oBAAM,CAAC,cAAc;YACjC,KAAK,EAAE,oBAAM,CAAC,uBAAuB;SACtC;QAED,QAAQ,EAAE;YACR,KAAK,EAAE,oBAAM,CAAC,8BAA8B;SAC7C;QAED,QAAQ,EAAE;YACR,KAAK,EAAE,oBAAM,CAAC,0BAA0B;YACxC,WAAW,EAAE,KAAK,EAAE,oEAAoE;SACzF;QAED,gBAAgB,EAAE;YAChB,KAAK,EAAE,oBAAM,CAAC,8BAA8B;SAC7C;QAED,KAAK,EAAE;YACL,QAAQ,EAAE,oBAAM,CAAC,eAAe;YAChC,UAAU,EAAE,oBAAM,CAAC,iBAAiB;SACrC;QAED,MAAM,EAAE;YACN,QAAQ,EAAE,oBAAM,CAAC,eAAe;YAChC,UAAU,EAAE,oBAAM,CAAC,iBAAiB;SACrC;QAED,KAAK,EAAE;YACL,QAAQ,EAAE,oBAAM,CAAC,eAAe;YAChC,UAAU,EAAE,oBAAM,CAAC,iBAAiB;YACpC,UAAU,EAAE,oBAAM,CAAC,kBAAkB;SACtC;QAED,QAAQ,EAAE;YACR,UAAU,EAAE,oBAAM,CAAC,kBAAkB;SACtC;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAiB;QACvD,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,uBAAe,CAAC,IAAI,EACpB,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EACjC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAClB,KAAK,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,IAAI,KAAK,CAAC,QAAQ,EAAE;YAClB,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,oBAAY,CACrC,uBAAe,CAAC,QAAQ,EACxB,MAAM,CAAC,QAAQ,EACf,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,gBAAgB,EACzC,KAAK,CAAC,QAAQ,CAAC,SAAS,CACzB,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IArBW,QAAA,uBAAuB,2BAqBlC","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"]}
package/lib-amd/index.js DELETED
@@ -1,11 +0,0 @@
1
- define(["require", "exports", "./Label"], function (require, exports, Label_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLabel_unstable = exports.useLabelStyles_unstable = exports.renderLabel_unstable = exports.labelClassNames = exports.Label = void 0;
5
- Object.defineProperty(exports, "Label", { enumerable: true, get: function () { return Label_1.Label; } });
6
- Object.defineProperty(exports, "labelClassNames", { enumerable: true, get: function () { return Label_1.labelClassNames; } });
7
- Object.defineProperty(exports, "renderLabel_unstable", { enumerable: true, get: function () { return Label_1.renderLabel_unstable; } });
8
- Object.defineProperty(exports, "useLabelStyles_unstable", { enumerable: true, get: function () { return Label_1.useLabelStyles_unstable; } });
9
- Object.defineProperty(exports, "useLabel_unstable", { enumerable: true, get: function () { return Label_1.useLabel_unstable; } });
10
- });
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-label/src/index.ts"],"names":[],"mappings":";;;;IAAS,8FAAA,KAAK,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,6GAAA,oBAAoB,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAAE,0GAAA,iBAAiB,OAAA","sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"]}