@fluentui/react-tags 0.0.0-nightly-20240827-0406.1 → 0.0.0-nightly-20240828-0407.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-tags
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 28 Aug 2024 04:12:08 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20240828-0407.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v0.0.0-nightly-20240828-0407.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.3.16..@fluentui/react-tags_v0.0.0-nightly-
|
|
9
|
+
Wed, 28 Aug 2024 04:12:08 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.3.16..@fluentui/react-tags_v0.0.0-nightly-20240828-0407.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-aria to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-avatar to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
|
19
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
20
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
21
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
22
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
23
|
-
- Bump @fluentui/react-provider to v0.0.0-nightly-
|
|
24
|
-
- Bump @fluentui/react-conformance to v0.0.0-nightly-
|
|
25
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
16
|
+
- Bump @fluentui/react-aria to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
17
|
+
- Bump @fluentui/react-avatar to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
18
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
19
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
20
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
21
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
23
|
+
- Bump @fluentui/react-provider to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
24
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
25
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20240828-0407.1 ([commit](https://github.com/microsoft/fluentui/commit/6dbbecb7838a361951cb9a3a37b621ac46858be0) by beachball)
|
|
26
26
|
|
|
27
27
|
## [9.3.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.3.16)
|
|
28
28
|
|
|
@@ -91,8 +91,7 @@ const tagAvatarShapeMap = {
|
|
|
91
91
|
dismissIcon: slot.optional(props.dismissIcon, {
|
|
92
92
|
renderByDefault: dismissible,
|
|
93
93
|
defaultProps: {
|
|
94
|
-
children: /*#__PURE__*/ React.createElement(DismissRegular, null)
|
|
95
|
-
role: 'img'
|
|
94
|
+
children: /*#__PURE__*/ React.createElement(DismissRegular, null)
|
|
96
95
|
},
|
|
97
96
|
elementType: 'span'
|
|
98
97
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { DismissRegular } from '@fluentui/react-icons';\nimport type { TagProps, TagState } from './Tag.types';\nimport { Delete, Backspace } from '@fluentui/keyboard-keys';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\n\nconst tagAvatarSizeMap = {\n medium: 28,\n small: 20,\n 'extra-small': 16,\n} as const;\n\nconst tagAvatarShapeMap = {\n rounded: 'square',\n circular: 'circular',\n} as const;\n\n/**\n * Create the state required to render Tag.\n *\n * The returned state can be modified with hooks such as useTagStyles_unstable,\n * before being passed to renderTag_unstable.\n *\n * @param props - props from this instance of Tag\n * @param ref - reference to root HTMLSpanElement or HTMLButtonElement of Tag\n */\nexport const useTag_unstable = (props: TagProps, ref: React.Ref<HTMLSpanElement | HTMLButtonElement>): TagState => {\n const {\n handleTagDismiss,\n size: contextSize,\n disabled: contextDisabled,\n appearance: contextAppearance,\n dismissible: contextDismissible,\n role: tagGroupRole,\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-Tag', props.id);\n\n const {\n appearance = contextAppearance ?? 'filled',\n disabled = false,\n dismissible = contextDismissible ?? false,\n shape = 'rounded',\n size = contextSize,\n value = id,\n } = props;\n\n const dismissOnClick = useEventCallback((ev: React.MouseEvent<HTMLButtonElement>) => {\n props.onClick?.(ev);\n if (!ev.defaultPrevented) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const dismissOnKeyDown = useEventCallback((ev: React.KeyboardEvent<HTMLButtonElement>) => {\n props?.onKeyDown?.(ev);\n if (!ev.defaultPrevented && (ev.key === Delete || ev.key === Backspace)) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const elementType = dismissible ? 'button' : 'span';\n\n return {\n appearance,\n avatarShape: tagAvatarShapeMap[shape],\n avatarSize: tagAvatarSizeMap[size],\n disabled: contextDisabled ? true : disabled,\n dismissible,\n shape,\n size,\n\n components: {\n root: elementType,\n media: 'span',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n dismissIcon: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(elementType, {\n ref,\n role: tagGroupRole === 'listbox' ? 'option' : undefined,\n ...props,\n disabled: contextDisabled ? true : disabled,\n id,\n ...(dismissible && { onClick: dismissOnClick, onKeyDown: dismissOnKeyDown }),\n }),\n { elementType },\n ),\n\n media: slot.optional(props.media, { elementType: 'span' }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n primaryText: slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, { elementType: 'span' }),\n dismissIcon: slot.optional(props.dismissIcon, {\n renderByDefault: dismissible,\n defaultProps: {\n children: <DismissRegular />,\n
|
|
1
|
+
{"version":3,"sources":["useTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { DismissRegular } from '@fluentui/react-icons';\nimport type { TagProps, TagState } from './Tag.types';\nimport { Delete, Backspace } from '@fluentui/keyboard-keys';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\n\nconst tagAvatarSizeMap = {\n medium: 28,\n small: 20,\n 'extra-small': 16,\n} as const;\n\nconst tagAvatarShapeMap = {\n rounded: 'square',\n circular: 'circular',\n} as const;\n\n/**\n * Create the state required to render Tag.\n *\n * The returned state can be modified with hooks such as useTagStyles_unstable,\n * before being passed to renderTag_unstable.\n *\n * @param props - props from this instance of Tag\n * @param ref - reference to root HTMLSpanElement or HTMLButtonElement of Tag\n */\nexport const useTag_unstable = (props: TagProps, ref: React.Ref<HTMLSpanElement | HTMLButtonElement>): TagState => {\n const {\n handleTagDismiss,\n size: contextSize,\n disabled: contextDisabled,\n appearance: contextAppearance,\n dismissible: contextDismissible,\n role: tagGroupRole,\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-Tag', props.id);\n\n const {\n appearance = contextAppearance ?? 'filled',\n disabled = false,\n dismissible = contextDismissible ?? false,\n shape = 'rounded',\n size = contextSize,\n value = id,\n } = props;\n\n const dismissOnClick = useEventCallback((ev: React.MouseEvent<HTMLButtonElement>) => {\n props.onClick?.(ev);\n if (!ev.defaultPrevented) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const dismissOnKeyDown = useEventCallback((ev: React.KeyboardEvent<HTMLButtonElement>) => {\n props?.onKeyDown?.(ev);\n if (!ev.defaultPrevented && (ev.key === Delete || ev.key === Backspace)) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const elementType = dismissible ? 'button' : 'span';\n\n return {\n appearance,\n avatarShape: tagAvatarShapeMap[shape],\n avatarSize: tagAvatarSizeMap[size],\n disabled: contextDisabled ? true : disabled,\n dismissible,\n shape,\n size,\n\n components: {\n root: elementType,\n media: 'span',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n dismissIcon: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(elementType, {\n ref,\n role: tagGroupRole === 'listbox' ? 'option' : undefined,\n ...props,\n disabled: contextDisabled ? true : disabled,\n id,\n ...(dismissible && { onClick: dismissOnClick, onKeyDown: dismissOnKeyDown }),\n }),\n { elementType },\n ),\n\n media: slot.optional(props.media, { elementType: 'span' }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n primaryText: slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, { elementType: 'span' }),\n dismissIcon: slot.optional(props.dismissIcon, {\n renderByDefault: dismissible,\n defaultProps: {\n children: <DismissRegular />,\n },\n elementType: 'span',\n }),\n };\n};\n"],"names":["React","getIntrinsicElementProps","useEventCallback","useId","slot","DismissRegular","Delete","Backspace","useTagGroupContext_unstable","tagAvatarSizeMap","medium","small","tagAvatarShapeMap","rounded","circular","useTag_unstable","props","ref","handleTagDismiss","size","contextSize","disabled","contextDisabled","appearance","contextAppearance","dismissible","contextDismissible","role","tagGroupRole","id","shape","value","dismissOnClick","ev","onClick","defaultPrevented","dismissOnKeyDown","onKeyDown","key","elementType","avatarShape","avatarSize","components","root","media","icon","primaryText","secondaryText","dismissIcon","always","undefined","optional","renderByDefault","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AACpG,SAASC,cAAc,QAAQ,wBAAwB;AAEvD,SAASC,MAAM,EAAEC,SAAS,QAAQ,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iB,CAACkB,MAAM;QACrCW,YAAYhC,gBAAgB,CAACU,KAAK;QAClCE,UAAUC,kBAAkB,OAAOD;QACnCI;QACAK;QACAX;QAEAuB,YAAY;YACVC,MAAMJ;YACNK,OAAO;YACPC,MAAM;YACNC,aAAa;YACbC,eAAe;YACfC,aAAa;QACf;QAEAL,MAAMvC,KAAK6C,MAAM,CACfhD,yBAAyBsC,aAAa;YACpCtB;YACAU,MAAMC,iBAAiB,YAAY,WAAWsB;YAC9C,GAAGlC,KAAK;YACRK,UAAUC,kBAAkB,OAAOD;YACnCQ;YACA,GAAIJ,eAAe;gBAAES,SAASF;gBAAgBK,WAAWD;YAAiB,CAAC;QAC7E,IACA;YAAEG;QAAY;QAGhBK,OAAOxC,KAAK+C,QAAQ,CAACnC,MAAM4B,KAAK,EAAE;YAAEL,aAAa;QAAO;QACxDM,MAAMzC,KAAK+C,QAAQ,CAACnC,MAAM6B,IAAI,EAAE;YAAEN,aAAa;QAAO;QACtDO,aAAa1C,KAAK+C,QAAQ,CAACnC,MAAM8B,WAAW,EAAE;YAC5CM,iBAAiB;YACjBC,cAAc;gBACZC,UAAUtC,MAAMsC,QAAQ;YAC1B;YACAf,aAAa;QACf;QACAQ,eAAe3C,KAAK+C,QAAQ,CAACnC,MAAM+B,aAAa,EAAE;YAAER,aAAa;QAAO;QACxES,aAAa5C,KAAK+C,QAAQ,CAACnC,MAAMgC,WAAW,EAAE;YAC5CI,iBAAiB3B;YACjB4B,cAAc;gBACZC,wBAAU,oBAACjD;YACb;YACAkC,aAAa;QACf;IACF;AACF,EAAE"}
|
|
@@ -94,8 +94,7 @@ const useTag_unstable = (props, ref)=>{
|
|
|
94
94
|
dismissIcon: _reactutilities.slot.optional(props.dismissIcon, {
|
|
95
95
|
renderByDefault: dismissible,
|
|
96
96
|
defaultProps: {
|
|
97
|
-
children: /*#__PURE__*/ _react.createElement(_reacticons.DismissRegular, null)
|
|
98
|
-
role: 'img'
|
|
97
|
+
children: /*#__PURE__*/ _react.createElement(_reacticons.DismissRegular, null)
|
|
99
98
|
},
|
|
100
99
|
elementType: 'span'
|
|
101
100
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { DismissRegular } from '@fluentui/react-icons';\nimport type { TagProps, TagState } from './Tag.types';\nimport { Delete, Backspace } from '@fluentui/keyboard-keys';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\n\nconst tagAvatarSizeMap = {\n medium: 28,\n small: 20,\n 'extra-small': 16,\n} as const;\n\nconst tagAvatarShapeMap = {\n rounded: 'square',\n circular: 'circular',\n} as const;\n\n/**\n * Create the state required to render Tag.\n *\n * The returned state can be modified with hooks such as useTagStyles_unstable,\n * before being passed to renderTag_unstable.\n *\n * @param props - props from this instance of Tag\n * @param ref - reference to root HTMLSpanElement or HTMLButtonElement of Tag\n */\nexport const useTag_unstable = (props: TagProps, ref: React.Ref<HTMLSpanElement | HTMLButtonElement>): TagState => {\n const {\n handleTagDismiss,\n size: contextSize,\n disabled: contextDisabled,\n appearance: contextAppearance,\n dismissible: contextDismissible,\n role: tagGroupRole,\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-Tag', props.id);\n\n const {\n appearance = contextAppearance ?? 'filled',\n disabled = false,\n dismissible = contextDismissible ?? false,\n shape = 'rounded',\n size = contextSize,\n value = id,\n } = props;\n\n const dismissOnClick = useEventCallback((ev: React.MouseEvent<HTMLButtonElement>) => {\n props.onClick?.(ev);\n if (!ev.defaultPrevented) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const dismissOnKeyDown = useEventCallback((ev: React.KeyboardEvent<HTMLButtonElement>) => {\n props?.onKeyDown?.(ev);\n if (!ev.defaultPrevented && (ev.key === Delete || ev.key === Backspace)) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const elementType = dismissible ? 'button' : 'span';\n\n return {\n appearance,\n avatarShape: tagAvatarShapeMap[shape],\n avatarSize: tagAvatarSizeMap[size],\n disabled: contextDisabled ? true : disabled,\n dismissible,\n shape,\n size,\n\n components: {\n root: elementType,\n media: 'span',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n dismissIcon: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(elementType, {\n ref,\n role: tagGroupRole === 'listbox' ? 'option' : undefined,\n ...props,\n disabled: contextDisabled ? true : disabled,\n id,\n ...(dismissible && { onClick: dismissOnClick, onKeyDown: dismissOnKeyDown }),\n }),\n { elementType },\n ),\n\n media: slot.optional(props.media, { elementType: 'span' }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n primaryText: slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, { elementType: 'span' }),\n dismissIcon: slot.optional(props.dismissIcon, {\n renderByDefault: dismissible,\n defaultProps: {\n children: <DismissRegular />,\n
|
|
1
|
+
{"version":3,"sources":["useTag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useEventCallback, useId, slot } from '@fluentui/react-utilities';\nimport { DismissRegular } from '@fluentui/react-icons';\nimport type { TagProps, TagState } from './Tag.types';\nimport { Delete, Backspace } from '@fluentui/keyboard-keys';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\n\nconst tagAvatarSizeMap = {\n medium: 28,\n small: 20,\n 'extra-small': 16,\n} as const;\n\nconst tagAvatarShapeMap = {\n rounded: 'square',\n circular: 'circular',\n} as const;\n\n/**\n * Create the state required to render Tag.\n *\n * The returned state can be modified with hooks such as useTagStyles_unstable,\n * before being passed to renderTag_unstable.\n *\n * @param props - props from this instance of Tag\n * @param ref - reference to root HTMLSpanElement or HTMLButtonElement of Tag\n */\nexport const useTag_unstable = (props: TagProps, ref: React.Ref<HTMLSpanElement | HTMLButtonElement>): TagState => {\n const {\n handleTagDismiss,\n size: contextSize,\n disabled: contextDisabled,\n appearance: contextAppearance,\n dismissible: contextDismissible,\n role: tagGroupRole,\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-Tag', props.id);\n\n const {\n appearance = contextAppearance ?? 'filled',\n disabled = false,\n dismissible = contextDismissible ?? false,\n shape = 'rounded',\n size = contextSize,\n value = id,\n } = props;\n\n const dismissOnClick = useEventCallback((ev: React.MouseEvent<HTMLButtonElement>) => {\n props.onClick?.(ev);\n if (!ev.defaultPrevented) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const dismissOnKeyDown = useEventCallback((ev: React.KeyboardEvent<HTMLButtonElement>) => {\n props?.onKeyDown?.(ev);\n if (!ev.defaultPrevented && (ev.key === Delete || ev.key === Backspace)) {\n handleTagDismiss?.(ev, { value });\n }\n });\n\n const elementType = dismissible ? 'button' : 'span';\n\n return {\n appearance,\n avatarShape: tagAvatarShapeMap[shape],\n avatarSize: tagAvatarSizeMap[size],\n disabled: contextDisabled ? true : disabled,\n dismissible,\n shape,\n size,\n\n components: {\n root: elementType,\n media: 'span',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n dismissIcon: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps(elementType, {\n ref,\n role: tagGroupRole === 'listbox' ? 'option' : undefined,\n ...props,\n disabled: contextDisabled ? true : disabled,\n id,\n ...(dismissible && { onClick: dismissOnClick, onKeyDown: dismissOnKeyDown }),\n }),\n { elementType },\n ),\n\n media: slot.optional(props.media, { elementType: 'span' }),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n primaryText: slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n }),\n secondaryText: slot.optional(props.secondaryText, { elementType: 'span' }),\n dismissIcon: slot.optional(props.dismissIcon, {\n renderByDefault: dismissible,\n defaultProps: {\n children: <DismissRegular />,\n },\n elementType: 'span',\n }),\n };\n};\n"],"names":["useTag_unstable","tagAvatarSizeMap","medium","small","tagAvatarShapeMap","rounded","circular","props","ref","handleTagDismiss","size","contextSize","disabled","contextDisabled","appearance","contextAppearance","dismissible","contextDismissible","role","tagGroupRole","useTagGroupContext_unstable","id","useId","shape","value","dismissOnClick","useEventCallback","ev","onClick","defaultPrevented","dismissOnKeyDown","onKeyDown","key","Delete","Backspace","elementType","avatarShape","avatarSize","components","root","media","icon","primaryText","secondaryText","dismissIcon","slot","always","getIntrinsicElementProps","undefined","optional","renderByDefault","defaultProps","children","React","createElement","DismissRegular"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA2BaA;;;eAAAA;;;;iEA3BU;gCACiD;4BACzC;8BAEG;iCACU;AAE5C,MAAMC,mBAAmB;IACvBC,QAAQ;IACRC,OAAO;IACP,eAAe;AACjB;AAEA,MAAMC,oBAAoB;IACxBC,SAAS;IACTC,UAAU;AACZ;AAWO,MAAMN,kBAAkB,CAACO,OAAiBC;IAC/C,MAAM,EACJC,gBAAgB,EAChBC,MAAMC,WAAW,EACjBC,UAAUC,eAAe,EACzBC,YAAYC,iBAAiB,EAC7BC,aAAaC,kBAAkB,EAC/BC,MAAMC,YAAY,EACnB,GAAGC,IAAAA,4CAAAA;IAEJ,MAAMC,KAAKC,IAAAA,qBAAAA,EAAM,WAAWf,MAAMc,EAAE;IAEpC,MAAM,EACJP,aAAaC,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,oBAAqB,QAAQ,EAC1CH,WAAW,KAAK,EAChBI,cAAcC,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,qBAAsB,KAAK,EACzCM,QAAQ,SAAS,EACjBb,OAAOC,WAAW,EAClBa,QAAQH,EAAE,EACX,GAAGd;IAEJ,MAAMkB,iBAAiBC,IAAAA,gCAAAA,EAAiB,CAACC;YACvCpB;QAAAA,CAAAA,iBAAAA,MAAMqB,OAA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AAY;QAGhBK,OAAOK,oBAAAA,CAAKI,QAAQ,CAAC1C,MAAMiC,KAAK,EAAE;YAAEL,aAAa;QAAO;QACxDM,MAAMI,oBAAAA,CAAKI,QAAQ,CAAC1C,MAAMkC,IAAI,EAAE;YAAEN,aAAa;QAAO;QACtDO,aAAaG,oBAAAA,CAAKI,QAAQ,CAAC1C,MAAMmC,WAAW,EAAE;YAC5CQ,iBAAiB;YACjBC,cAAc;gBACZC,UAAU7C,MAAM6C,QAAQ;YAC1B;YACAjB,aAAa;QACf;QACAQ,eAAeE,oBAAAA,CAAKI,QAAQ,CAAC1C,MAAMoC,aAAa,EAAE;YAAER,aAAa;QAAO;QACxES,aAAaC,oBAAAA,CAAKI,QAAQ,CAAC1C,MAAMqC,WAAW,EAAE;YAC5CM,iBAAiBlC;YACjBmC,cAAc;gBACZC,UAAAA,WAAAA,GAAUC,OAAAC,aAAA,CAACC,0BAAAA,EAAAA;YACb;YACApB,aAAa;QACf;IACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-tags",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20240828-0407.1",
|
|
4
4
|
"description": "Fluent UI Tag component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
"start": "yarn storybook"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@fluentui/react-provider": "0.0.0-nightly-
|
|
30
|
+
"@fluentui/react-provider": "0.0.0-nightly-20240828-0407.1",
|
|
31
31
|
"@fluentui/eslint-plugin": "*",
|
|
32
|
-
"@fluentui/react-conformance": "0.0.0-nightly-
|
|
33
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
|
32
|
+
"@fluentui/react-conformance": "0.0.0-nightly-20240828-0407.1",
|
|
33
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20240828-0407.1",
|
|
34
34
|
"@fluentui/scripts-api-extractor": "*",
|
|
35
35
|
"@fluentui/scripts-cypress": "*",
|
|
36
36
|
"@fluentui/scripts-tasks": "*"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@fluentui/keyboard-keys": "0.0.0-nightly-
|
|
40
|
-
"@fluentui/react-aria": "0.0.0-nightly-
|
|
41
|
-
"@fluentui/react-avatar": "0.0.0-nightly-
|
|
39
|
+
"@fluentui/keyboard-keys": "0.0.0-nightly-20240828-0407.1",
|
|
40
|
+
"@fluentui/react-aria": "0.0.0-nightly-20240828-0407.1",
|
|
41
|
+
"@fluentui/react-avatar": "0.0.0-nightly-20240828-0407.1",
|
|
42
42
|
"@fluentui/react-icons": "^2.0.245",
|
|
43
|
-
"@fluentui/react-jsx-runtime": "0.0.0-nightly-
|
|
44
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
45
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
|
46
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
47
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
43
|
+
"@fluentui/react-jsx-runtime": "0.0.0-nightly-20240828-0407.1",
|
|
44
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20240828-0407.1",
|
|
45
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20240828-0407.1",
|
|
46
|
+
"@fluentui/react-theme": "0.0.0-nightly-20240828-0407.1",
|
|
47
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20240828-0407.1",
|
|
48
48
|
"@griffel/react": "^1.5.22",
|
|
49
49
|
"@swc/helpers": "^0.5.1"
|
|
50
50
|
},
|