@fluentui/react-tags 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0
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 +49 -13
- package/lib/components/InteractionTag/InteractionTag.js.map +1 -1
- package/lib/components/InteractionTag/InteractionTag.module.css +23 -0
- package/lib/components/InteractionTag/InteractionTag.types.js.map +1 -1
- package/lib/components/InteractionTag/index.js.map +1 -1
- package/lib/components/InteractionTag/renderInteractionTag.js +2 -2
- package/lib/components/InteractionTag/renderInteractionTag.js.map +1 -1
- package/lib/components/InteractionTag/useInteractionTag.js.map +1 -1
- package/lib/components/InteractionTag/useInteractionTagContextValues.js.map +1 -1
- package/lib/components/InteractionTag/useInteractionTagStyles.styles.css.js +9 -0
- package/lib/components/InteractionTag/useInteractionTagStyles.styles.css.js.map +1 -0
- package/lib/components/InteractionTag/useInteractionTagStyles.styles.raw.css.js +9 -0
- package/lib/components/InteractionTag/useInteractionTagStyles.styles.raw.css.js.map +1 -0
- package/lib/components/InteractionTag/useInteractionTagStyles.styles.raw.js.map +1 -1
- package/lib/components/InteractionTagPrimary/InteractionTagPrimary.js.map +1 -1
- package/lib/components/InteractionTagPrimary/InteractionTagPrimary.module.css +277 -0
- package/lib/components/InteractionTagPrimary/InteractionTagPrimary.types.js.map +1 -1
- package/lib/components/InteractionTagPrimary/index.js.map +1 -1
- package/lib/components/InteractionTagPrimary/renderInteractionTagPrimary.js +2 -2
- package/lib/components/InteractionTagPrimary/renderInteractionTagPrimary.js.map +1 -1
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimary.js.map +1 -1
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.css.js +26 -0
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.css.js.map +1 -0
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.css.js +26 -0
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.css.js.map +1 -0
- package/lib/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.js.map +1 -1
- package/lib/components/InteractionTagSecondary/InteractionTagSecondary.js.map +1 -1
- package/lib/components/InteractionTagSecondary/InteractionTagSecondary.module.css +194 -0
- package/lib/components/InteractionTagSecondary/InteractionTagSecondary.types.js.map +1 -1
- package/lib/components/InteractionTagSecondary/index.js.map +1 -1
- package/lib/components/InteractionTagSecondary/renderInteractionTagSecondary.js +2 -2
- package/lib/components/InteractionTagSecondary/renderInteractionTagSecondary.js.map +1 -1
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondary.js +1 -2
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondary.js.map +1 -1
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.css.js +9 -0
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.css.js.map +1 -0
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.css.js +9 -0
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.css.js.map +1 -0
- package/lib/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.js.map +1 -1
- package/lib/components/Tag/Tag.js.map +1 -1
- package/lib/components/Tag/Tag.module.css +222 -0
- package/lib/components/Tag/Tag.types.js.map +1 -1
- package/lib/components/Tag/TagSlots.module.css +97 -0
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/Tag/renderTag.js +2 -2
- package/lib/components/Tag/renderTag.js.map +1 -1
- package/lib/components/Tag/useTag.js +1 -2
- package/lib/components/Tag/useTag.js.map +1 -1
- package/lib/components/Tag/useTagStyles.styles.css.js +51 -0
- package/lib/components/Tag/useTagStyles.styles.css.js.map +1 -0
- package/lib/components/Tag/useTagStyles.styles.raw.css.js +51 -0
- package/lib/components/Tag/useTagStyles.styles.raw.css.js.map +1 -0
- package/lib/components/Tag/useTagStyles.styles.raw.js.map +1 -1
- package/lib/components/TagGroup/TagGroup.js.map +1 -1
- package/lib/components/TagGroup/TagGroup.module.css +14 -0
- package/lib/components/TagGroup/TagGroup.types.js.map +1 -1
- package/lib/components/TagGroup/index.js.map +1 -1
- package/lib/components/TagGroup/renderTagGroup.js +2 -2
- package/lib/components/TagGroup/renderTagGroup.js.map +1 -1
- package/lib/components/TagGroup/useTagGroup.js.map +1 -1
- package/lib/components/TagGroup/useTagGroupContextValues.js.map +1 -1
- package/lib/components/TagGroup/useTagGroupStyles.styles.css.js +9 -0
- package/lib/components/TagGroup/useTagGroupStyles.styles.css.js.map +1 -0
- package/lib/components/TagGroup/useTagGroupStyles.styles.raw.css.js +9 -0
- package/lib/components/TagGroup/useTagGroupStyles.styles.raw.css.js.map +1 -0
- package/lib/components/TagGroup/useTagGroupStyles.styles.raw.js.map +1 -1
- package/lib/contexts/interactionTagContext.js.map +1 -1
- package/lib/contexts/tagGroupContext.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/useTagAvatarContextValues.js.map +1 -1
- package/lib-commonjs/InteractionTag.cjs +8 -8
- package/lib-commonjs/InteractionTagPrimary.cjs +7 -7
- package/lib-commonjs/InteractionTagSecondary.cjs +7 -7
- package/lib-commonjs/Tag.cjs +11 -11
- package/lib-commonjs/Tag.cjs.map +1 -1
- package/lib-commonjs/TagGroup.cjs +8 -8
- package/lib-commonjs/components/InteractionTag/InteractionTag.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/InteractionTag.module.css +23 -0
- package/lib-commonjs/components/InteractionTag/InteractionTag.types.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/index.cjs +8 -8
- package/lib-commonjs/components/InteractionTag/index.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/renderInteractionTag.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/useInteractionTag.cjs +3 -3
- package/lib-commonjs/components/InteractionTag/useInteractionTag.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/useInteractionTagContextValues.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.cjs +3 -3
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/InteractionTag/useInteractionTagStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/InteractionTagPrimary/InteractionTagPrimary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/InteractionTagPrimary.module.css +277 -0
- package/lib-commonjs/components/InteractionTagPrimary/InteractionTagPrimary.types.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/index.cjs +7 -7
- package/lib-commonjs/components/InteractionTagPrimary/index.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/renderInteractionTagPrimary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimary.cjs +3 -3
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.cjs +3 -3
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.css.cjs +45 -0
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.css.cjs +45 -0
- package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimaryStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/InteractionTagSecondary/InteractionTagSecondary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/InteractionTagSecondary.module.css +194 -0
- package/lib-commonjs/components/InteractionTagSecondary/InteractionTagSecondary.types.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/index.cjs +7 -7
- package/lib-commonjs/components/InteractionTagSecondary/index.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/renderInteractionTagSecondary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondary.cjs +4 -5
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondary.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.cjs +3 -3
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondaryStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/Tag/Tag.cjs.map +1 -1
- package/lib-commonjs/components/Tag/Tag.module.css +222 -0
- package/lib-commonjs/components/Tag/Tag.types.cjs.map +1 -1
- package/lib-commonjs/components/Tag/TagSlots.module.css +97 -0
- package/lib-commonjs/components/Tag/index.cjs +11 -11
- package/lib-commonjs/components/Tag/index.cjs.map +1 -1
- package/lib-commonjs/components/Tag/renderTag.cjs.map +1 -1
- package/lib-commonjs/components/Tag/useTag.cjs +4 -5
- package/lib-commonjs/components/Tag/useTag.cjs.map +1 -1
- package/lib-commonjs/components/Tag/useTagStyles.styles.cjs +7 -7
- package/lib-commonjs/components/Tag/useTagStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Tag/useTagStyles.styles.css.cjs +82 -0
- package/lib-commonjs/components/Tag/useTagStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Tag/useTagStyles.styles.raw.cjs +7 -7
- package/lib-commonjs/components/Tag/useTagStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Tag/useTagStyles.styles.raw.css.cjs +82 -0
- package/lib-commonjs/components/Tag/useTagStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/TagGroup/TagGroup.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/TagGroup.module.css +14 -0
- package/lib-commonjs/components/TagGroup/TagGroup.types.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/index.cjs +8 -8
- package/lib-commonjs/components/TagGroup/index.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/renderTagGroup.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/useTagGroup.cjs +3 -3
- package/lib-commonjs/components/TagGroup/useTagGroup.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/useTagGroupContextValues.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.cjs +3 -3
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/TagGroup/useTagGroupStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/contexts/interactionTagContext.cjs +4 -4
- package/lib-commonjs/contexts/interactionTagContext.cjs.map +1 -1
- package/lib-commonjs/contexts/tagGroupContext.cjs +4 -4
- package/lib-commonjs/contexts/tagGroupContext.cjs.map +1 -1
- package/lib-commonjs/index.cjs +38 -38
- package/lib-commonjs/index.cjs.map +1 -1
- package/lib-commonjs/utils/index.cjs.map +1 -1
- package/lib-commonjs/utils/types.cjs.map +1 -1
- package/lib-commonjs/utils/useTagAvatarContextValues.cjs.map +1 -1
- package/package.json +16 -16
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,61 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-tags
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 31 Oct 2026 11:08:38 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.
|
|
7
|
+
## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.9.5..@fluentui/react-tags_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
|
|
9
|
+
Sat, 31 Oct 2026 11:08:38 GMT
|
|
11
10
|
|
|
12
11
|
### Changes
|
|
13
12
|
|
|
14
|
-
- Release 9.
|
|
15
|
-
- Bump @fluentui/keyboard-keys to v9.
|
|
16
|
-
- Bump @fluentui/react-aria to v9.
|
|
17
|
-
- Bump @fluentui/react-avatar to v9.
|
|
18
|
-
- Bump @fluentui/react-jsx-runtime to v9.
|
|
19
|
-
- Bump @fluentui/react-shared-contexts to v9.
|
|
20
|
-
- Bump @fluentui/react-tabster to v9.
|
|
21
|
-
- Bump @fluentui/react-theme to v9.
|
|
22
|
-
- Bump @fluentui/react-utilities to v9.
|
|
13
|
+
- Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
14
|
+
- Bump @fluentui/keyboard-keys to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
15
|
+
- Bump @fluentui/react-aria to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-avatar to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
- Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
|
+
|
|
23
|
+
## [9.9.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.9.8)
|
|
24
|
+
|
|
25
|
+
Mon, 19 Oct 2026 16:49:01 GMT
|
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.9.7..@fluentui/react-tags_v9.9.8)
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- Bump @fluentui/react-aria to v9.17.16 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
31
|
+
- Bump @fluentui/react-avatar to v9.11.9 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
32
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
33
|
+
- Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
34
|
+
- Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
35
|
+
|
|
36
|
+
## [9.9.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.9.7)
|
|
37
|
+
|
|
38
|
+
Wed, 23 Sep 2026 09:04:33 GMT
|
|
39
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.9.6..@fluentui/react-tags_v9.9.7)
|
|
40
|
+
|
|
41
|
+
### Patches
|
|
42
|
+
|
|
43
|
+
- Bump @fluentui/react-avatar to v9.11.8 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
44
|
+
|
|
45
|
+
## [9.9.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.9.6)
|
|
46
|
+
|
|
47
|
+
Tue, 22 Sep 2026 11:25:39 GMT
|
|
48
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.9.5..@fluentui/react-tags_v9.9.6)
|
|
49
|
+
|
|
50
|
+
### Patches
|
|
51
|
+
|
|
52
|
+
- fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
|
|
53
|
+
- Bump @fluentui/react-aria to v9.17.15 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
54
|
+
- Bump @fluentui/react-avatar to v9.11.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
55
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
56
|
+
- Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
57
|
+
- Bump @fluentui/react-tabster to v9.26.18 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
58
|
+
- Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
23
59
|
|
|
24
60
|
## [9.9.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.9.5)
|
|
25
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/InteractionTag.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useInteractionTag_unstable } from './useInteractionTag';\nimport { renderInteractionTag_unstable } from './renderInteractionTag';\nimport { useInteractionTagStyles_unstable } from './useInteractionTagStyles.styles';\nimport { useInteractionTagContextValues_unstable } from './useInteractionTagContextValues';\nimport type { InteractionTagProps } from './InteractionTag.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * InteractionTag component - a visual representation of an attribute with primary and secondary actions.\n * Can have `InteractionTagPrimary` and `InteractionTagSecondary` components as its children.\n */\nexport const InteractionTag: ForwardRefComponent<InteractionTagProps> = React.forwardRef((props, ref) => {\n const state = useInteractionTag_unstable(props, ref);\n\n useInteractionTagStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInteractionTagStyles_unstable')(state);\n\n return renderInteractionTag_unstable(state, useInteractionTagContextValues_unstable(state));\n});\n\nInteractionTag.displayName = 'InteractionTag';\n"],"names":["React","useInteractionTag_unstable","renderInteractionTag_unstable","useInteractionTagStyles_unstable","useInteractionTagContextValues_unstable","useCustomStyleHook_unstable","InteractionTag","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,gCAAgC,QAAQ,sCAAmC;AACpF,SAASC,uCAAuC,QAAQ,sCAAmC;AAG3F,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,+BAA2DN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQT,2BAA2BO,OAAOC;IAEhDN,iCAAiCO;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOR,8BAA8BQ,OAAON,wCAAwCM;AACtF,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: fit-content;
|
|
7
|
+
}
|
|
8
|
+
.rounded {
|
|
9
|
+
border-radius: var(--borderRadiusMedium);
|
|
10
|
+
}
|
|
11
|
+
.circular {
|
|
12
|
+
border-radius: var(--borderRadiusCircular);
|
|
13
|
+
}
|
|
14
|
+
.medium {
|
|
15
|
+
height: var(--spacingHorizontalXXXL);
|
|
16
|
+
}
|
|
17
|
+
.small {
|
|
18
|
+
height: var(--spacingHorizontalXXL);
|
|
19
|
+
}
|
|
20
|
+
.extra-small {
|
|
21
|
+
height: var(--spacingHorizontalXL);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/InteractionTag.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport type {\n TagAppearance,\n TagShape,\n TagSize,\n TagValue,\n TagDismissHandler,\n TagSelectHandler,\n} from '../../utils/types';\n\nexport type InteractionTagContextValues = {\n interactionTag: InteractionTagContextValue;\n};\n\nexport type InteractionTagSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * InteractionTag Props\n */\nexport type InteractionTagProps<Value = TagValue> = ComponentProps<Partial<InteractionTagSlots>> & {\n /**\n * An InteractionTag can have filled, outlined or brand experience.\n *\n * @default 'filled'\n */\n appearance?: TagAppearance;\n\n /**\n * An InteractionTag can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * An InteractionTag can be selected.\n * Note: This prop only changes the appearance of the tag at the moment. A future PR will add the integration with TagGroup.\n *\n * @default false\n */\n selected?: boolean;\n\n /**\n * An InteractionTag can have rounded or circular shape.\n *\n * @default 'round'\n */\n shape?: TagShape;\n\n /**\n * An InteractionTag has three sizes.\n *\n * @default 'medium'\n */\n size?: TagSize;\n\n /**\n * Unique value identifying the tag within a TagGroup\n */\n value?: Value;\n};\n\n/**\n * State used in rendering InteractionTag\n */\nexport type InteractionTagState<Value = TagValue> = ComponentState<InteractionTagSlots> &\n Required<Pick<InteractionTagProps, 'appearance' | 'disabled' | 'selected' | 'shape' | 'size' | 'value'>> & {\n /**\n * Event handler from TagGroup context that allows TagGroup to dismiss the tag\n */\n handleTagDismiss: TagDismissHandler<Value>;\n\n /**\n * Event handler from TagGroup context that allows TagGroup to select the tag\n */\n handleTagSelect?: TagSelectHandler<Value>;\n\n /**\n * Selected values from TagGroup context\n */\n selectedValues: Value[];\n\n /**\n * id to assign to InteractionTagPrimary\n */\n interactionTagPrimaryId: string;\n };\n\n/**\n * InteractionTag Base Props - omits design-only props\n */\nexport type InteractionTagBaseProps<Value = TagValue> = Omit<\n InteractionTagProps<Value>,\n 'appearance' | 'size' | 'shape'\n>;\n\n/**\n * InteractionTag Base State - omits design-only state\n */\nexport type InteractionTagBaseState<Value = TagValue> = Omit<\n InteractionTagState<Value>,\n 'appearance' | 'size' | 'shape'\n>;\n"],"names":[],"mappings":"AAmGA;;CAEC,GACD,WAGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/index.ts"],"sourcesContent":["export { InteractionTag } from './InteractionTag';\nexport type {\n InteractionTagBaseProps,\n InteractionTagBaseState,\n InteractionTagContextValues,\n InteractionTagProps,\n InteractionTagSlots,\n InteractionTagState,\n} from './InteractionTag.types';\nexport { renderInteractionTag_unstable } from './renderInteractionTag';\nexport { useInteractionTagBase_unstable, useInteractionTag_unstable } from './useInteractionTag';\nexport { interactionTagClassNames, useInteractionTagStyles_unstable } from './useInteractionTagStyles.styles';\nexport { useInteractionTagContextValues_unstable } from './useInteractionTagContextValues';\n"],"names":["InteractionTag","renderInteractionTag_unstable","useInteractionTagBase_unstable","useInteractionTag_unstable","interactionTagClassNames","useInteractionTagStyles_unstable","useInteractionTagContextValues_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,sBAAmB;AASlD,SAASC,6BAA6B,QAAQ,4BAAyB;AACvE,SAASC,8BAA8B,EAAEC,0BAA0B,QAAQ,yBAAsB;AACjG,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,sCAAmC;AAC9G,SAASC,uCAAuC,QAAQ,sCAAmC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
import { InteractionTagContextProvider } from "../../contexts/interactionTagContext.js";
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of InteractionTag
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/renderInteractionTag.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InteractionTagBaseState, InteractionTagSlots, InteractionTagContextValues } from './InteractionTag.types';\nimport { InteractionTagContextProvider } from '../../contexts/interactionTagContext';\n\n/**\n * Render the final JSX of InteractionTag\n */\nexport const renderInteractionTag_unstable = (\n state: InteractionTagBaseState,\n contextValues: InteractionTagContextValues,\n): JSXElement => {\n assertSlots<InteractionTagSlots>(state);\n\n return (\n <InteractionTagContextProvider value={contextValues.interactionTag}>\n <state.root />\n </InteractionTagContextProvider>\n );\n};\n"],"names":["assertSlots","InteractionTagContextProvider","renderInteractionTag_unstable","state","contextValues","value","interactionTag","root"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,6BAA6B,QAAQ,0CAAuC;AAErF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAJ,YAAiCG;IAEjC,qBACE,KAACF;QAA8BI,OAAOD,cAAcE,cAAc;kBAChE,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/useInteractionTag.tsx"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport type {\n InteractionTagBaseProps,\n InteractionTagBaseState,\n InteractionTagProps,\n InteractionTagState,\n} from './InteractionTag.types';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\n\n/**\n * Create the base state required to render InteractionTag, without design-only props.\n *\n * @param props - props from this instance of InteractionTag (without appearance, size, shape)\n * @param ref - reference to root HTMLDivElement of InteractionTag\n */\nexport const useInteractionTagBase_unstable = (\n props: InteractionTagBaseProps,\n ref: React.Ref<HTMLDivElement>,\n): InteractionTagBaseState => {\n const {\n handleTagDismiss,\n handleTagSelect,\n disabled: contextDisabled,\n selectedValues = [],\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-InteractionTag-', props.id);\n\n const interactionTagPrimaryId = useId('fui-InteractionTagPrimary-');\n\n const { disabled = false, selected = false, value = id } = props;\n\n return {\n disabled: contextDisabled ? true : disabled,\n handleTagDismiss,\n handleTagSelect,\n interactionTagPrimaryId,\n selected: selectedValues.includes(value) || selected,\n selectedValues,\n value,\n\n components: {\n root: 'div',\n },\n\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n disabled: contextDisabled ? true : disabled,\n id,\n }),\n { elementType: 'div' },\n ),\n };\n};\n\n/**\n * Create the state required to render InteractionTag.\n *\n * The returned state can be modified with hooks such as useInteractionTagStyles_unstable,\n * before being passed to renderInteractionTag_unstable.\n *\n * @param props - props from this instance of InteractionTag\n * @param ref - reference to root HTMLDivElement of InteractionTag\n */\nexport const useInteractionTag_unstable = (\n props: InteractionTagProps,\n ref: React.Ref<HTMLDivElement>,\n): InteractionTagState => {\n const { size: contextSize, appearance: contextAppearance } = useTagGroupContext_unstable();\n\n const { appearance = contextAppearance ?? 'filled', shape = 'rounded', size = contextSize } = props;\n\n return {\n ...useInteractionTagBase_unstable(props, ref),\n appearance,\n shape,\n size,\n };\n};\n"],"names":["getIntrinsicElementProps","useId","slot","useTagGroupContext_unstable","useInteractionTagBase_unstable","props","ref","handleTagDismiss","handleTagSelect","disabled","contextDisabled","selectedValues","id","interactionTagPrimaryId","selected","value","includes","components","root","always","elementType","useInteractionTag_unstable","size","contextSize","appearance","contextAppearance","shape"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAOlF,SAASC,2BAA2B,QAAQ,oCAAiC;AAE7E;;;;;CAKC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAM,EACJC,gBAAgB,EAChBC,eAAe,EACfC,UAAUC,eAAe,EACzBC,iBAAiB,EAAE,EACpB,GAAGR;IAEJ,MAAMS,KAAKX,MAAM,uBAAuBI,MAAMO,EAAE;IAEhD,MAAMC,0BAA0BZ,MAAM;IAEtC,MAAM,EAAEQ,WAAW,KAAK,EAAEK,WAAW,KAAK,EAAEC,QAAQH,EAAE,EAAE,GAAGP;IAE3D,OAAO;QACLI,UAAUC,kBAAkB,OAAOD;QACnCF;QACAC;QACAK;QACAC,UAAUH,eAAeK,QAAQ,CAACD,UAAUD;QAC5CH;QACAI;QAEAE,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMhB,KAAKiB,MAAM,CACfnB,yBAAyB,OAAO;YAC9BM;YACA,GAAGD,KAAK;YACRI,UAAUC,kBAAkB,OAAOD;YACnCG;QACF,IACA;YAAEQ,aAAa;QAAM;IAEzB;AACF,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxChB,OACAC;IAEA,MAAM,EAAEgB,MAAMC,WAAW,EAAEC,YAAYC,iBAAiB,EAAE,GAAGtB;IAE7D,MAAM,EAAEqB,aAAaC,8BAAAA,+BAAAA,oBAAqB,QAAQ,EAAEC,QAAQ,SAAS,EAAEJ,OAAOC,WAAW,EAAE,GAAGlB;IAE9F,OAAO;QACL,GAAGD,+BAA+BC,OAAOC,IAAI;QAC7CkB;QACAE;QACAJ;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/useInteractionTagContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { InteractionTagState, InteractionTagContextValues } from './InteractionTag.types';\n\nexport function useInteractionTagContextValues_unstable(state: InteractionTagState): InteractionTagContextValues {\n const {\n appearance,\n disabled,\n handleTagDismiss,\n handleTagSelect,\n interactionTagPrimaryId,\n selected,\n selectedValues,\n shape,\n size,\n value,\n } = state;\n\n return {\n interactionTag: React.useMemo(\n () => ({\n appearance,\n disabled,\n handleTagDismiss,\n handleTagSelect,\n interactionTagPrimaryId,\n selected,\n selectedValues,\n shape,\n size,\n value,\n }),\n [\n appearance,\n disabled,\n handleTagDismiss,\n handleTagSelect,\n interactionTagPrimaryId,\n selected,\n selectedValues,\n shape,\n size,\n value,\n ],\n ),\n };\n}\n"],"names":["React","useInteractionTagContextValues_unstable","state","appearance","disabled","handleTagDismiss","handleTagSelect","interactionTagPrimaryId","selected","selectedValues","shape","size","value","interactionTag","useMemo"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,wCAAwCC,KAA0B;IAChF,MAAM,EACJC,UAAU,EACVC,QAAQ,EACRC,gBAAgB,EAChBC,eAAe,EACfC,uBAAuB,EACvBC,QAAQ,EACRC,cAAc,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACN,GAAGV;IAEJ,OAAO;QACLW,gBAAgBb,MAAMc,OAAO,CAC3B,IAAO,CAAA;gBACLX;gBACAC;gBACAC;gBACAC;gBACAC;gBACAC;gBACAC;gBACAC;gBACAC;gBACAC;YACF,CAAA,GACA;YACET;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;SACD;IAEL;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InteractionTag.module.css";
|
|
3
|
+
export const interactionTagClassNames = {
|
|
4
|
+
root: 'fui-InteractionTag'
|
|
5
|
+
};
|
|
6
|
+
export const useInteractionTagStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(interactionTagClassNames.root, styles.root, styles[state.size], styles[state.shape], state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/useInteractionTagStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InteractionTagSlots, InteractionTagState } from './InteractionTag.types';\nimport styles from './InteractionTag.module.css';\n\nexport const interactionTagClassNames: SlotClassNames<InteractionTagSlots> = {\n root: 'fui-InteractionTag',\n};\n\nexport const useInteractionTagStyles_unstable = (state: InteractionTagState): InteractionTagState => {\n state.root.className = clsx(\n interactionTagClassNames.root,\n styles.root,\n styles[state.size],\n styles[state.shape],\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","interactionTagClassNames","root","useInteractionTagStyles_unstable","state","className","size","shape"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,mCAAmC,CAACC;IAC/CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,yBAAyBC,IAAI,EAC7BF,OAAOE,IAAI,EACXF,MAAM,CAACI,MAAME,IAAI,CAAC,EAClBN,MAAM,CAACI,MAAMG,KAAK,CAAC,EACnBH,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./InteractionTag.module.css";
|
|
3
|
+
export const interactionTagClassNames = {
|
|
4
|
+
root: 'fui-InteractionTag'
|
|
5
|
+
};
|
|
6
|
+
export const useInteractionTagStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(interactionTagClassNames.root, styles.root, styles[state.size], styles[state.shape], state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/useInteractionTagStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { InteractionTagSlots, InteractionTagState } from './InteractionTag.types';\nimport styles from './InteractionTag.module.css';\n\nexport const interactionTagClassNames: SlotClassNames<InteractionTagSlots> = {\n root: 'fui-InteractionTag',\n};\n\nexport const useInteractionTagStyles_unstable = (state: InteractionTagState): InteractionTagState => {\n state.root.className = clsx(\n interactionTagClassNames.root,\n styles.root,\n styles[state.size],\n styles[state.shape],\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","interactionTagClassNames","root","useInteractionTagStyles_unstable","state","className","size","shape"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,mCAAmC,CAACC;IAC/CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,yBAAyBC,IAAI,EAC7BF,OAAOE,IAAI,EACXF,MAAM,CAACI,MAAME,IAAI,CAAC,EAClBN,MAAM,CAACI,MAAMG,KAAK,CAAC,EACnBH,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTag/useInteractionTagStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { InteractionTagSlots, InteractionTagState } from './InteractionTag.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nexport const interactionTagClassNames: SlotClassNames<InteractionTagSlots> = {\n root: 'fui-InteractionTag',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n alignItems: 'center',\n boxSizing: 'border-box',\n width: 'fit-content',\n});\n\nconst useRootStyles = makeStyles({\n rounded: { borderRadius: tokens.borderRadiusMedium },\n circular: { borderRadius: tokens.borderRadiusCircular },\n\n medium: {\n height: '32px',\n },\n small: {\n height: '24px',\n },\n 'extra-small': {\n height: '20px',\n },\n});\n\n/**\n * Apply styling to the InteractionTag slots based on the state\n */\nexport const useInteractionTagStyles_unstable = (state: InteractionTagState): InteractionTagState => {\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n\n const { shape, size } = state;\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n interactionTagClassNames.root,\n rootBaseClassName,\n rootStyles[shape],\n rootStyles[size],\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","interactionTagClassNames","root","useRootBaseClassName","display","alignItems","boxSizing","width","useRootStyles","rounded","borderRadius","borderRadiusMedium","circular","borderRadiusCircular","medium","height","small","useInteractionTagStyles_unstable","state","rootBaseClassName","rootStyles","shape","size","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,QAAQ,wBAAwB;AAE/C,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,MAAMC,uBAAuBN,gBAAgB;IAC3CO,SAAS;IACTC,YAAY;IACZC,WAAW;IACXC,OAAO;AACT;AAEA,MAAMC,gBAAgBV,WAAW;IAC/BW,SAAS;QAAEC,cAAcV,OAAOW,kBAAkB;IAAC;IACnDC,UAAU;QAAEF,cAAcV,OAAOa,oBAAoB;IAAC;IAEtDC,QAAQ;QACNC,QAAQ;IACV;IACAC,OAAO;QACLD,QAAQ;IACV;IACA,eAAe;QACbA,QAAQ;IACV;AACF;AAEA;;CAEC,GACD,OAAO,MAAME,mCAAmC,CAACC;IAC/C,MAAMC,oBAAoBhB;IAC1B,MAAMiB,aAAaZ;IAEnB,MAAM,EAAEa,KAAK,EAAEC,IAAI,EAAE,GAAGJ;IAExB,oDAAoD;IACpDA,MAAMhB,IAAI,CAACqB,SAAS,GAAGxB,aACrBE,yBAAyBC,IAAI,EAC7BiB,mBACAC,UAAU,CAACC,MAAM,EACjBD,UAAU,CAACE,KAAK,EAChBJ,MAAMhB,IAAI,CAACqB,SAAS;IAGtB,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTagPrimary/InteractionTagPrimary.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useInteractionTagPrimary_unstable } from './useInteractionTagPrimary';\nimport { renderInteractionTagPrimary_unstable } from './renderInteractionTagPrimary';\nimport { useInteractionTagPrimaryStyles_unstable } from './useInteractionTagPrimaryStyles.styles';\nimport type { InteractionTagPrimaryProps } from './InteractionTagPrimary.types';\nimport { useTagAvatarContextValues_unstable } from '../../utils';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * InteractionTagPrimary component - used as the first child of the `InteractionTag` component.\n * Provides visual attributes such as media, icon, primary and secondary text, as well as the ability to attach a primary action.\n */\nexport const InteractionTagPrimary: ForwardRefComponent<InteractionTagPrimaryProps> = React.forwardRef((props, ref) => {\n const state = useInteractionTagPrimary_unstable(props, ref);\n\n useInteractionTagPrimaryStyles_unstable(state);\n\n useCustomStyleHook_unstable('useInteractionTagPrimaryStyles_unstable')(state);\n\n return renderInteractionTagPrimary_unstable(state, useTagAvatarContextValues_unstable(state));\n});\n\nInteractionTagPrimary.displayName = 'InteractionTagPrimary';\n"],"names":["React","useInteractionTagPrimary_unstable","renderInteractionTagPrimary_unstable","useInteractionTagPrimaryStyles_unstable","useTagAvatarContextValues_unstable","useCustomStyleHook_unstable","InteractionTagPrimary","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,iCAAiC,QAAQ,gCAA6B;AAC/E,SAASC,oCAAoC,QAAQ,mCAAgC;AACrF,SAASC,uCAAuC,QAAQ,6CAA0C;AAElG,SAASC,kCAAkC,QAAQ,uBAAc;AACjE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,sCAAyEN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7G,MAAMC,QAAQT,kCAAkCO,OAAOC;IAEvDN,wCAAwCO;IAExCL,4BAA4B,2CAA2CK;IAEvE,OAAOR,qCAAqCQ,OAAON,mCAAmCM;AACxF,GAAG;AAEHJ,sBAAsBK,WAAW,GAAG"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
@import url('@fluentui/react-icons/headless/styles.css') layer(fluentui);
|
|
2
|
+
|
|
3
|
+
@layer fluentui {
|
|
4
|
+
.root:where(.rounded) {
|
|
5
|
+
color: inherit;
|
|
6
|
+
font-family: inherit;
|
|
7
|
+
padding: 0px;
|
|
8
|
+
border-style: none;
|
|
9
|
+
appearance: button;
|
|
10
|
+
text-align: unset;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
display: inline-grid;
|
|
13
|
+
height: 100%;
|
|
14
|
+
align-items: center;
|
|
15
|
+
grid-template-areas: 'media primary ' 'media secondary';
|
|
16
|
+
border: var(--strokeWidthThin) solid var(--colorTransparentStroke);
|
|
17
|
+
&[data-fui-focus-visible] {
|
|
18
|
+
outline: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
19
|
+
z-index: 1;
|
|
20
|
+
}
|
|
21
|
+
border-radius: var(--borderRadiusMedium);
|
|
22
|
+
@media (forced-colors: active) {
|
|
23
|
+
position: relative;
|
|
24
|
+
&::before {
|
|
25
|
+
content: '';
|
|
26
|
+
border-top: var(--strokeWidthThin) solid;
|
|
27
|
+
position: absolute;
|
|
28
|
+
inset: calc(var(--strokeWidthThin) * -1);
|
|
29
|
+
border-start-start-radius: var(--borderRadiusMedium);
|
|
30
|
+
border-start-end-radius: var(--borderRadiusMedium);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.root:where(.circular) {
|
|
35
|
+
color: inherit;
|
|
36
|
+
font-family: inherit;
|
|
37
|
+
padding: 0px;
|
|
38
|
+
border-style: none;
|
|
39
|
+
appearance: button;
|
|
40
|
+
text-align: unset;
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
display: inline-grid;
|
|
43
|
+
height: 100%;
|
|
44
|
+
align-items: center;
|
|
45
|
+
grid-template-areas: 'media primary ' 'media secondary';
|
|
46
|
+
border: var(--strokeWidthThin) solid var(--colorTransparentStroke);
|
|
47
|
+
&[data-fui-focus-visible] {
|
|
48
|
+
outline: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
49
|
+
z-index: 1;
|
|
50
|
+
}
|
|
51
|
+
border-radius: var(--borderRadiusCircular);
|
|
52
|
+
@media (forced-colors: active) {
|
|
53
|
+
position: relative;
|
|
54
|
+
&::before {
|
|
55
|
+
content: '';
|
|
56
|
+
border-top: var(--strokeWidthThin) solid;
|
|
57
|
+
border-inline-start: var(--strokeWidthThin) solid;
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset: calc(var(--strokeWidthThin) * -1);
|
|
60
|
+
border-start-start-radius: var(--borderRadiusCircular);
|
|
61
|
+
border-end-start-radius: var(--borderRadiusCircular);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
.filled:where(:not(.disabled)) {
|
|
66
|
+
background-color: var(--colorNeutralBackground3);
|
|
67
|
+
color: var(--colorNeutralForeground2);
|
|
68
|
+
&:hover {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
background-color: var(--colorNeutralBackground3Hover);
|
|
71
|
+
color: var(--colorNeutralForeground2Hover);
|
|
72
|
+
}
|
|
73
|
+
&:active {
|
|
74
|
+
background-color: var(--colorNeutralBackground3Pressed);
|
|
75
|
+
color: var(--colorNeutralForeground2Pressed);
|
|
76
|
+
}
|
|
77
|
+
@media (forced-colors: active) {
|
|
78
|
+
&:hover {
|
|
79
|
+
background-color: HighlightText;
|
|
80
|
+
}
|
|
81
|
+
&:active {
|
|
82
|
+
background-color: HighlightText;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
.outline:where(:not(.disabled)) {
|
|
87
|
+
background-color: var(--colorSubtleBackground);
|
|
88
|
+
color: var(--colorNeutralForeground2);
|
|
89
|
+
border-top-color: var(--colorNeutralStroke1);
|
|
90
|
+
border-inline-end-color: var(--colorNeutralStroke1);
|
|
91
|
+
border-bottom-color: var(--colorNeutralStroke1);
|
|
92
|
+
border-inline-start-color: var(--colorNeutralStroke1);
|
|
93
|
+
&:hover {
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
background-color: var(--colorSubtleBackgroundHover);
|
|
96
|
+
color: var(--colorNeutralForeground2Hover);
|
|
97
|
+
& :global(.fui-Icon-filled) {
|
|
98
|
+
display: inline;
|
|
99
|
+
color: var(--colorNeutralForeground2BrandHover);
|
|
100
|
+
}
|
|
101
|
+
& :global(.fui-Icon-regular) {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
&:active {
|
|
106
|
+
background-color: var(--colorSubtleBackgroundPressed);
|
|
107
|
+
color: var(--colorNeutralForeground2Pressed);
|
|
108
|
+
& :global(.fui-Icon-filled) {
|
|
109
|
+
display: inline;
|
|
110
|
+
color: var(--colorNeutralForeground2BrandPressed);
|
|
111
|
+
}
|
|
112
|
+
& :global(.fui-Icon-regular) {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
@media (forced-colors: active) {
|
|
117
|
+
&:hover {
|
|
118
|
+
background-color: HighlightText;
|
|
119
|
+
}
|
|
120
|
+
&:active {
|
|
121
|
+
background-color: HighlightText;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.brand:where(:not(.disabled)) {
|
|
126
|
+
background-color: var(--colorBrandBackground2);
|
|
127
|
+
color: var(--colorBrandForeground2);
|
|
128
|
+
&:hover {
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
background-color: var(--colorBrandBackground2Hover);
|
|
131
|
+
color: var(--colorCompoundBrandForeground1Hover);
|
|
132
|
+
}
|
|
133
|
+
&:active {
|
|
134
|
+
background-color: var(--colorBrandBackground2Pressed);
|
|
135
|
+
color: var(--colorCompoundBrandForeground1Pressed);
|
|
136
|
+
}
|
|
137
|
+
@media (forced-colors: active) {
|
|
138
|
+
&:hover {
|
|
139
|
+
background-color: HighlightText;
|
|
140
|
+
}
|
|
141
|
+
&:active {
|
|
142
|
+
background-color: HighlightText;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
.selected:where(:not(.disabled)) {
|
|
147
|
+
background: var(--colorBrandBackground);
|
|
148
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
149
|
+
border-top-color: var(--colorBrandStroke1);
|
|
150
|
+
border-inline-end-color: var(--colorBrandStroke1);
|
|
151
|
+
border-bottom-color: var(--colorBrandStroke1);
|
|
152
|
+
border-inline-start-color: var(--colorBrandStroke1);
|
|
153
|
+
@media (forced-colors: active) {
|
|
154
|
+
forced-color-adjust: none;
|
|
155
|
+
background-color: Highlight;
|
|
156
|
+
color: HighlightText;
|
|
157
|
+
}
|
|
158
|
+
&:hover {
|
|
159
|
+
background-color: var(--colorBrandBackgroundHover);
|
|
160
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
161
|
+
& :global(.fui-Icon-filled) {
|
|
162
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
163
|
+
}
|
|
164
|
+
@media (forced-colors: active) {
|
|
165
|
+
background-color: Highlight;
|
|
166
|
+
color: HighlightText;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
&:active {
|
|
170
|
+
background-color: var(--colorBrandBackgroundPressed);
|
|
171
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
172
|
+
& :global(.fui-Icon-filled) {
|
|
173
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
174
|
+
}
|
|
175
|
+
@media (forced-colors: active) {
|
|
176
|
+
background-color: Highlight;
|
|
177
|
+
color: HighlightText;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
.medium {
|
|
182
|
+
padding-inline-end: calc(var(--spacingHorizontalS) - var(--strokeWidthThin));
|
|
183
|
+
}
|
|
184
|
+
.small {
|
|
185
|
+
padding-inline-end: calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin));
|
|
186
|
+
}
|
|
187
|
+
.extra-small {
|
|
188
|
+
padding-inline-end: calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin));
|
|
189
|
+
position: relative;
|
|
190
|
+
@media (forced-colors: none) {
|
|
191
|
+
&:before,
|
|
192
|
+
&:after {
|
|
193
|
+
content: '';
|
|
194
|
+
position: absolute;
|
|
195
|
+
/* Extend the 20px control to the fixed 24px accessible pointer target. */
|
|
196
|
+
height: 2px;
|
|
197
|
+
inset-inline-start: 0;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
200
|
+
&:before {
|
|
201
|
+
bottom: 100%;
|
|
202
|
+
}
|
|
203
|
+
&:after {
|
|
204
|
+
top: 100%;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
.disabled:where(.filled) {
|
|
209
|
+
cursor: not-allowed;
|
|
210
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
211
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
212
|
+
border-top-color: var(--colorTransparentStrokeDisabled);
|
|
213
|
+
border-inline-end-color: var(--colorTransparentStrokeDisabled);
|
|
214
|
+
border-bottom-color: var(--colorTransparentStrokeDisabled);
|
|
215
|
+
border-inline-start-color: var(--colorTransparentStrokeDisabled);
|
|
216
|
+
}
|
|
217
|
+
.disabled:where(.outline) {
|
|
218
|
+
cursor: not-allowed;
|
|
219
|
+
background-color: var(--colorSubtleBackground);
|
|
220
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
221
|
+
border-top-color: var(--colorNeutralStrokeDisabled);
|
|
222
|
+
border-inline-end-color: var(--colorNeutralStrokeDisabled);
|
|
223
|
+
border-bottom-color: var(--colorNeutralStrokeDisabled);
|
|
224
|
+
border-inline-start-color: var(--colorNeutralStrokeDisabled);
|
|
225
|
+
}
|
|
226
|
+
.disabled:where(.brand) {
|
|
227
|
+
cursor: not-allowed;
|
|
228
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
229
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
230
|
+
border-top-color: var(--colorTransparentStrokeDisabled);
|
|
231
|
+
border-inline-end-color: var(--colorTransparentStrokeDisabled);
|
|
232
|
+
border-bottom-color: var(--colorTransparentStrokeDisabled);
|
|
233
|
+
border-inline-start-color: var(--colorTransparentStrokeDisabled);
|
|
234
|
+
}
|
|
235
|
+
.withoutMedia:where(.medium) {
|
|
236
|
+
padding-inline-start: calc(var(--spacingHorizontalS) - var(--strokeWidthThin));
|
|
237
|
+
}
|
|
238
|
+
.withoutMedia:where(.small) {
|
|
239
|
+
padding-inline-start: calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin));
|
|
240
|
+
}
|
|
241
|
+
.withoutMedia:where(.extra-small) {
|
|
242
|
+
padding-inline-start: calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin));
|
|
243
|
+
}
|
|
244
|
+
.circular:where(:not(.hasSecondaryAction)) {
|
|
245
|
+
@media (forced-colors: active) {
|
|
246
|
+
position: relative;
|
|
247
|
+
&::before {
|
|
248
|
+
border-inline-end: var(--strokeWidthThin) solid transparent;
|
|
249
|
+
border-start-end-radius: var(--borderRadiusCircular);
|
|
250
|
+
border-end-end-radius: var(--borderRadiusCircular);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
.hasSecondaryAction {
|
|
255
|
+
border-start-end-radius: var(--borderRadiusNone);
|
|
256
|
+
border-end-end-radius: var(--borderRadiusNone);
|
|
257
|
+
border-inline-end-style: none;
|
|
258
|
+
&[data-fui-focus-visible] {
|
|
259
|
+
border-start-end-radius: var(--borderRadiusNone);
|
|
260
|
+
border-end-end-radius: var(--borderRadiusNone);
|
|
261
|
+
}
|
|
262
|
+
@media (forced-colors: active) {
|
|
263
|
+
&::before {
|
|
264
|
+
border-start-end-radius: 0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
.hasSecondaryAction:where(.medium) {
|
|
269
|
+
padding-inline-end: var(--spacingHorizontalS);
|
|
270
|
+
}
|
|
271
|
+
.hasSecondaryAction:where(.small) {
|
|
272
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
273
|
+
}
|
|
274
|
+
.hasSecondaryAction:where(.extra-small) {
|
|
275
|
+
padding-inline-end: var(--spacingHorizontalSNudge);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTagPrimary/InteractionTagPrimary.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport type { TagAvatarContextValues, UseTagAvatarContextValuesOptions } from '../../utils/useTagAvatarContextValues';\n\nexport type InteractionTagPrimaryContextValues = TagAvatarContextValues;\n\nexport type InteractionTagPrimarySlots = {\n root: NonNullable<Slot<'button'>>;\n\n /**\n * Slot for a visual element, usually an avatar\n */\n media?: Slot<'span'>;\n\n /**\n * Slot for an icon\n */\n icon?: Slot<'span'>;\n\n /**\n * Main text for the InteractionTagPrimary button. Children of the root slot are automatically rendered here\n */\n primaryText: Slot<'span'>;\n\n /**\n * Secondary text that describes or complements the main text\n */\n secondaryText?: Slot<'span'>;\n};\n\n/**\n * InteractionTagPrimary Props\n */\nexport type InteractionTagPrimaryProps = ComponentProps<Partial<InteractionTagPrimarySlots>> & {\n /**\n * Whether the `InteractionTag` component has a `Secondary` component that provides an secondary action.\n * If `true`, the `InteractionTagPrimary` component will adjust its styles to accommodate the `Secondary` component.\n *\n * @default false\n */\n hasSecondaryAction?: boolean;\n};\n\n/**\n * State used in rendering InteractionTagPrimary\n */\nexport type InteractionTagPrimaryState = ComponentState<InteractionTagPrimarySlots> &\n Required<\n Pick<InteractionTagContextValue, 'appearance' | 'disabled' | 'selected' | 'shape' | 'size'> &\n Pick<InteractionTagPrimaryProps, 'hasSecondaryAction'>\n > &\n UseTagAvatarContextValuesOptions;\n\n/**\n * InteractionTagPrimary Base Props - same as InteractionTagPrimaryProps (no design-only own props)\n */\nexport type InteractionTagPrimaryBaseProps = InteractionTagPrimaryProps;\n\n/**\n * InteractionTagPrimary Base State - omits design-only state derived from context\n */\nexport type InteractionTagPrimaryBaseState = Omit<\n InteractionTagPrimaryState,\n 'appearance' | 'size' | 'shape' | 'avatarShape' | 'avatarSize'\n>;\n"],"names":[],"mappings":"AA0DA;;CAEC,GACD,WAGE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTagPrimary/index.ts"],"sourcesContent":["export { InteractionTagPrimary } from './InteractionTagPrimary';\nexport type {\n InteractionTagPrimaryBaseProps,\n InteractionTagPrimaryBaseState,\n InteractionTagPrimaryContextValues,\n InteractionTagPrimaryProps,\n InteractionTagPrimarySlots,\n InteractionTagPrimaryState,\n} from './InteractionTagPrimary.types';\nexport { renderInteractionTagPrimary_unstable } from './renderInteractionTagPrimary';\nexport { useInteractionTagPrimaryBase_unstable, useInteractionTagPrimary_unstable } from './useInteractionTagPrimary';\nexport {\n interactionTagPrimaryClassNames,\n useInteractionTagPrimaryStyles_unstable,\n} from './useInteractionTagPrimaryStyles.styles';\n"],"names":["InteractionTagPrimary","renderInteractionTagPrimary_unstable","useInteractionTagPrimaryBase_unstable","useInteractionTagPrimary_unstable","interactionTagPrimaryClassNames","useInteractionTagPrimaryStyles_unstable"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,6BAA0B;AAShE,SAASC,oCAAoC,QAAQ,mCAAgC;AACrF,SAASC,qCAAqC,EAAEC,iCAAiC,QAAQ,gCAA6B;AACtH,SACEC,+BAA+B,EAC/BC,uCAAuC,QAClC,6CAA0C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
import { AvatarContextProvider } from "@fluentui/react-avatar";
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of InteractionTagPrimary
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTagPrimary/renderInteractionTagPrimary.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type {\n InteractionTagPrimaryBaseState,\n InteractionTagPrimarySlots,\n InteractionTagPrimaryContextValues,\n} from './InteractionTagPrimary.types';\nimport { AvatarContextProvider } from '@fluentui/react-avatar';\n\n/**\n * Render the final JSX of InteractionTagPrimary\n */\nexport const renderInteractionTagPrimary_unstable = (\n state: InteractionTagPrimaryBaseState,\n contextValues: InteractionTagPrimaryContextValues,\n): JSXElement => {\n assertSlots<InteractionTagPrimarySlots>(state);\n\n return (\n <state.root>\n {state.media && (\n <AvatarContextProvider value={contextValues.avatar}>\n <state.media />\n </AvatarContextProvider>\n )}\n {state.icon && <state.icon />}\n {state.primaryText && <state.primaryText />}\n {state.secondaryText && <state.secondaryText />}\n </state.root>\n );\n};\n"],"names":["assertSlots","AvatarContextProvider","renderInteractionTagPrimary_unstable","state","contextValues","root","media","value","avatar","icon","primaryText","secondaryText"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAOxD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D;;CAEC,GACD,OAAO,MAAMC,uCAAuC,CAClDC,OACAC;IAEAJ,YAAwCG;IAExC,qBACE,MAACA,MAAME,IAAI;;YACRF,MAAMG,KAAK,kBACV,KAACL;gBAAsBM,OAAOH,cAAcI,MAAM;0BAChD,cAAA,KAACL,MAAMG,KAAK;;YAGfH,MAAMM,IAAI,kBAAI,KAACN,MAAMM,IAAI;YACzBN,MAAMO,WAAW,kBAAI,KAACP,MAAMO,WAAW;YACvCP,MAAMQ,aAAa,kBAAI,KAACR,MAAMQ,aAAa;;;AAGlD,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InteractionTagPrimary/useInteractionTagPrimary.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type {\n InteractionTagPrimaryBaseProps,\n InteractionTagPrimaryBaseState,\n InteractionTagPrimaryProps,\n InteractionTagPrimaryState,\n} from './InteractionTagPrimary.types';\nimport { useInteractionTagContext_unstable } from '../../contexts/interactionTagContext';\n\nconst avatarSizeMap = {\n medium: 28,\n small: 20,\n 'extra-small': 16,\n} as const;\n\nconst avatarShapeMap = {\n rounded: 'square',\n circular: 'circular',\n} as const;\n\n/**\n * Create the base state required to render InteractionTagPrimary, without design-only props.\n *\n * @param props - props from this instance of InteractionTagPrimary\n * @param ref - reference to root HTMLButtonElement of InteractionTagPrimary\n */\nexport const useInteractionTagPrimaryBase_unstable = (\n props: InteractionTagPrimaryBaseProps,\n ref: React.Ref<HTMLButtonElement>,\n): InteractionTagPrimaryBaseState => {\n const {\n disabled,\n handleTagSelect,\n interactionTagPrimaryId,\n selected: contextSelected,\n selectedValues,\n value,\n } = useInteractionTagContext_unstable();\n const { hasSecondaryAction = false } = props;\n\n const onClick = useEventCallback(\n mergeCallbacks(props?.onClick, (event: React.MouseEvent<HTMLButtonElement>) =>\n handleTagSelect?.(event, { type: 'click', event, value, selectedValues }),\n ),\n );\n\n return {\n disabled,\n hasSecondaryAction,\n selected: contextSelected,\n\n components: {\n root: 'button',\n media: 'span',\n icon: 'span',\n primaryText: 'span',\n secondaryText: 'span',\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n disabled,\n id: interactionTagPrimaryId,\n ...(handleTagSelect !== undefined && { 'aria-pressed': contextSelected }),\n onClick,\n ...props,\n }),\n { elementType: 'button' },\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 };\n};\n\n/**\n * Create the state required to render InteractionTagPrimary.\n *\n * The returned state can be modified with hooks such as useInteractionTagPrimaryStyles_unstable,\n * before being passed to renderInteractionTagPrimary_unstable.\n *\n * @param props - props from this instance of InteractionTagPrimary\n * @param ref - reference to root HTMLButtonElement of InteractionTagPrimary\n */\nexport const useInteractionTagPrimary_unstable = (\n props: InteractionTagPrimaryProps,\n ref: React.Ref<HTMLButtonElement>,\n): InteractionTagPrimaryState => {\n const { appearance, shape, size } = useInteractionTagContext_unstable();\n\n return {\n ...useInteractionTagPrimaryBase_unstable(props, ref),\n appearance,\n avatarShape: avatarShapeMap[shape],\n avatarSize: avatarSizeMap[size],\n shape,\n size,\n };\n};\n"],"names":["getIntrinsicElementProps","mergeCallbacks","slot","useEventCallback","useInteractionTagContext_unstable","avatarSizeMap","medium","small","avatarShapeMap","rounded","circular","useInteractionTagPrimaryBase_unstable","props","ref","disabled","handleTagSelect","interactionTagPrimaryId","selected","contextSelected","selectedValues","value","hasSecondaryAction","onClick","event","type","components","root","media","icon","primaryText","secondaryText","always","id","undefined","elementType","optional","renderByDefault","defaultProps","children","useInteractionTagPrimary_unstable","appearance","shape","size","avatarShape","avatarSize"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAO7G,SAASC,iCAAiC,QAAQ,0CAAuC;AAEzF,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,OAAO;IACP,eAAe;AACjB;AAEA,MAAMC,iBAAiB;IACrBC,SAAS;IACTC,UAAU;AACZ;AAEA;;;;;CAKC,GACD,OAAO,MAAMC,wCAAwC,CACnDC,OACAC;IAEA,MAAM,EACJC,QAAQ,EACRC,eAAe,EACfC,uBAAuB,EACvBC,UAAUC,eAAe,EACzBC,cAAc,EACdC,KAAK,EACN,GAAGhB;IACJ,MAAM,EAAEiB,qBAAqB,KAAK,EAAE,GAAGT;IAEvC,MAAMU,UAAUnB,iBACdF,eAAeW,kBAAAA,4BAAAA,MAAOU,OAAO,EAAE,CAACC,QAC9BR,4BAAAA,sCAAAA,gBAAkBQ,OAAO;YAAEC,MAAM;YAASD;YAAOH;YAAOD;QAAe;IAI3E,OAAO;QACLL;QACAO;QACAJ,UAAUC;QAEVO,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,MAAM;YACNC,aAAa;YACbC,eAAe;QACjB;QAEAJ,MAAMxB,KAAK6B,MAAM,CACf/B,yBAAyB,UAAU;YACjCa;YACAC;YACAkB,IAAIhB;YACJ,GAAID,oBAAoBkB,aAAa;gBAAE,gBAAgBf;YAAgB,CAAC;YACxEI;YACA,GAAGV,KAAK;QACV,IACA;YAAEsB,aAAa;QAAS;QAG1BP,OAAOzB,KAAKiC,QAAQ,CAACvB,MAAMe,KAAK,EAAE;YAAEO,aAAa;QAAO;QACxDN,MAAM1B,KAAKiC,QAAQ,CAACvB,MAAMgB,IAAI,EAAE;YAAEM,aAAa;QAAO;QACtDL,aAAa3B,KAAKiC,QAAQ,CAACvB,MAAMiB,WAAW,EAAE;YAC5CO,iBAAiB;YACjBC,cAAc;gBACZC,UAAU1B,MAAM0B,QAAQ;YAC1B;YACAJ,aAAa;QACf;QACAJ,eAAe5B,KAAKiC,QAAQ,CAACvB,MAAMkB,aAAa,EAAE;YAAEI,aAAa;QAAO;IAC1E;AACF,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMK,oCAAoC,CAC/C3B,OACAC;IAEA,MAAM,EAAE2B,UAAU,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGtC;IAEpC,OAAO;QACL,GAAGO,sCAAsCC,OAAOC,IAAI;QACpD2B;QACAG,aAAanC,cAAc,CAACiC,MAAM;QAClCG,YAAYvC,aAAa,CAACqC,KAAK;QAC/BD;QACAC;IACF;AACF,EAAE"}
|