@fluentui/react-tags 9.7.19 → 9.8.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/index.d.ts +96 -5
  3. package/lib/InteractionTag.js +1 -1
  4. package/lib/InteractionTag.js.map +1 -1
  5. package/lib/InteractionTagPrimary.js +1 -1
  6. package/lib/InteractionTagPrimary.js.map +1 -1
  7. package/lib/InteractionTagSecondary.js +1 -1
  8. package/lib/InteractionTagSecondary.js.map +1 -1
  9. package/lib/Tag.js +1 -1
  10. package/lib/Tag.js.map +1 -1
  11. package/lib/TagGroup.js +1 -1
  12. package/lib/TagGroup.js.map +1 -1
  13. package/lib/components/InteractionTag/InteractionTag.types.js +1 -1
  14. package/lib/components/InteractionTag/InteractionTag.types.js.map +1 -1
  15. package/lib/components/InteractionTag/index.js +1 -1
  16. package/lib/components/InteractionTag/index.js.map +1 -1
  17. package/lib/components/InteractionTag/renderInteractionTag.js.map +1 -1
  18. package/lib/components/InteractionTag/useInteractionTag.js +23 -11
  19. package/lib/components/InteractionTag/useInteractionTag.js.map +1 -1
  20. package/lib/components/InteractionTagPrimary/InteractionTagPrimary.types.js +1 -1
  21. package/lib/components/InteractionTagPrimary/InteractionTagPrimary.types.js.map +1 -1
  22. package/lib/components/InteractionTagPrimary/index.js +1 -1
  23. package/lib/components/InteractionTagPrimary/index.js.map +1 -1
  24. package/lib/components/InteractionTagPrimary/renderInteractionTagPrimary.js.map +1 -1
  25. package/lib/components/InteractionTagPrimary/useInteractionTagPrimary.js +22 -11
  26. package/lib/components/InteractionTagPrimary/useInteractionTagPrimary.js.map +1 -1
  27. package/lib/components/InteractionTagSecondary/InteractionTagSecondary.types.js +1 -1
  28. package/lib/components/InteractionTagSecondary/InteractionTagSecondary.types.js.map +1 -1
  29. package/lib/components/InteractionTagSecondary/index.js +1 -1
  30. package/lib/components/InteractionTagSecondary/index.js.map +1 -1
  31. package/lib/components/InteractionTagSecondary/renderInteractionTagSecondary.js.map +1 -1
  32. package/lib/components/InteractionTagSecondary/useInteractionTagSecondary.js +24 -10
  33. package/lib/components/InteractionTagSecondary/useInteractionTagSecondary.js.map +1 -1
  34. package/lib/components/Tag/Tag.types.js +1 -1
  35. package/lib/components/Tag/Tag.types.js.map +1 -1
  36. package/lib/components/Tag/index.js +1 -1
  37. package/lib/components/Tag/index.js.map +1 -1
  38. package/lib/components/Tag/renderTag.js.map +1 -1
  39. package/lib/components/Tag/useTag.js +31 -16
  40. package/lib/components/Tag/useTag.js.map +1 -1
  41. package/lib/components/TagGroup/TagGroup.types.js.map +1 -1
  42. package/lib/components/TagGroup/index.js +1 -1
  43. package/lib/components/TagGroup/index.js.map +1 -1
  44. package/lib/components/TagGroup/renderTagGroup.js.map +1 -1
  45. package/lib/components/TagGroup/useTagGroup.js +20 -9
  46. package/lib/components/TagGroup/useTagGroup.js.map +1 -1
  47. package/lib/index.js +5 -5
  48. package/lib/index.js.map +1 -1
  49. package/lib-commonjs/InteractionTag.js +3 -0
  50. package/lib-commonjs/InteractionTag.js.map +1 -1
  51. package/lib-commonjs/InteractionTagPrimary.js +3 -0
  52. package/lib-commonjs/InteractionTagPrimary.js.map +1 -1
  53. package/lib-commonjs/InteractionTagSecondary.js +3 -0
  54. package/lib-commonjs/InteractionTagSecondary.js.map +1 -1
  55. package/lib-commonjs/Tag.js +3 -0
  56. package/lib-commonjs/Tag.js.map +1 -1
  57. package/lib-commonjs/TagGroup.js +3 -0
  58. package/lib-commonjs/TagGroup.js.map +1 -1
  59. package/lib-commonjs/components/InteractionTag/InteractionTag.types.js +1 -1
  60. package/lib-commonjs/components/InteractionTag/InteractionTag.types.js.map +1 -1
  61. package/lib-commonjs/components/InteractionTag/index.js +3 -0
  62. package/lib-commonjs/components/InteractionTag/index.js.map +1 -1
  63. package/lib-commonjs/components/InteractionTag/renderInteractionTag.js.map +1 -1
  64. package/lib-commonjs/components/InteractionTag/useInteractionTag.js +24 -9
  65. package/lib-commonjs/components/InteractionTag/useInteractionTag.js.map +1 -1
  66. package/lib-commonjs/components/InteractionTagPrimary/InteractionTagPrimary.types.js +1 -1
  67. package/lib-commonjs/components/InteractionTagPrimary/InteractionTagPrimary.types.js.map +1 -1
  68. package/lib-commonjs/components/InteractionTagPrimary/index.js +3 -0
  69. package/lib-commonjs/components/InteractionTagPrimary/index.js.map +1 -1
  70. package/lib-commonjs/components/InteractionTagPrimary/renderInteractionTagPrimary.js.map +1 -1
  71. package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimary.js +24 -10
  72. package/lib-commonjs/components/InteractionTagPrimary/useInteractionTagPrimary.js.map +1 -1
  73. package/lib-commonjs/components/InteractionTagSecondary/InteractionTagSecondary.types.js +1 -1
  74. package/lib-commonjs/components/InteractionTagSecondary/InteractionTagSecondary.types.js.map +1 -1
  75. package/lib-commonjs/components/InteractionTagSecondary/index.js +3 -0
  76. package/lib-commonjs/components/InteractionTagSecondary/index.js.map +1 -1
  77. package/lib-commonjs/components/InteractionTagSecondary/renderInteractionTagSecondary.js.map +1 -1
  78. package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondary.js +26 -9
  79. package/lib-commonjs/components/InteractionTagSecondary/useInteractionTagSecondary.js.map +1 -1
  80. package/lib-commonjs/components/Tag/Tag.types.js +1 -1
  81. package/lib-commonjs/components/Tag/Tag.types.js.map +1 -1
  82. package/lib-commonjs/components/Tag/index.js +3 -0
  83. package/lib-commonjs/components/Tag/index.js.map +1 -1
  84. package/lib-commonjs/components/Tag/renderTag.js.map +1 -1
  85. package/lib-commonjs/components/Tag/useTag.js +32 -14
  86. package/lib-commonjs/components/Tag/useTag.js.map +1 -1
  87. package/lib-commonjs/components/TagGroup/TagGroup.types.js.map +1 -1
  88. package/lib-commonjs/components/TagGroup/index.js +3 -0
  89. package/lib-commonjs/components/TagGroup/index.js.map +1 -1
  90. package/lib-commonjs/components/TagGroup/renderTagGroup.js.map +1 -1
  91. package/lib-commonjs/components/TagGroup/useTagGroup.js +21 -7
  92. package/lib-commonjs/components/TagGroup/useTagGroup.js.map +1 -1
  93. package/lib-commonjs/index.js +15 -0
  94. package/lib-commonjs/index.js.map +1 -1
  95. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,12 +1,22 @@
1
1
  # Change Log - @fluentui/react-tags
2
2
 
3
- This log was last generated on Mon, 30 Mar 2026 14:35:50 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 01 Apr 2026 15:50:23 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.8.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.8.0)
8
+
9
+ Wed, 01 Apr 2026 15:50:23 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.7.19..@fluentui/react-tags_v9.8.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: add base hooks for Tags components ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by dmytrokirpa@microsoft.com)
15
+ - Bump @fluentui/react-avatar to v9.11.0 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
16
+
7
17
  ## [9.7.19](https://github.com/microsoft/fluentui/tree/@fluentui/react-tags_v9.7.19)
8
18
 
9
- Mon, 30 Mar 2026 14:35:50 GMT
19
+ Mon, 30 Mar 2026 14:37:41 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tags_v9.7.18..@fluentui/react-tags_v9.7.19)
11
21
 
12
22
  ### Patches
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { AvatarShape } from '@fluentui/react-avatar';
2
2
  import { AvatarSize } from '@fluentui/react-avatar';
3
3
  import { ComponentProps } from '@fluentui/react-utilities';
4
4
  import { ComponentState } from '@fluentui/react-utilities';
5
+ import type { DistributiveOmit } from '@fluentui/react-utilities';
5
6
  import type { EventData } from '@fluentui/react-utilities';
6
7
  import type { EventHandler } from '@fluentui/react-utilities';
7
8
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
@@ -16,6 +17,16 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
16
17
  */
17
18
  export declare const InteractionTag: ForwardRefComponent<InteractionTagProps>;
18
19
 
20
+ /**
21
+ * InteractionTag Base Props - omits design-only props
22
+ */
23
+ export declare type InteractionTagBaseProps<Value = TagValue> = Omit<InteractionTagProps<Value>, 'appearance' | 'size' | 'shape'>;
24
+
25
+ /**
26
+ * InteractionTag Base State - omits design-only state
27
+ */
28
+ export declare type InteractionTagBaseState<Value = TagValue> = Omit<InteractionTagState<Value>, 'appearance' | 'size' | 'shape'>;
29
+
19
30
  export declare const interactionTagClassNames: SlotClassNames<InteractionTagSlots>;
20
31
 
21
32
  /**
@@ -39,6 +50,16 @@ declare type InteractionTagContextValues = {
39
50
  */
40
51
  export declare const InteractionTagPrimary: ForwardRefComponent<InteractionTagPrimaryProps>;
41
52
 
53
+ /**
54
+ * InteractionTagPrimary Base Props - same as InteractionTagPrimaryProps (no design-only own props)
55
+ */
56
+ export declare type InteractionTagPrimaryBaseProps = InteractionTagPrimaryProps;
57
+
58
+ /**
59
+ * InteractionTagPrimary Base State - omits design-only state derived from context
60
+ */
61
+ export declare type InteractionTagPrimaryBaseState = Omit<InteractionTagPrimaryState, 'appearance' | 'size' | 'shape' | 'avatarShape' | 'avatarSize'>;
62
+
42
63
  export declare const interactionTagPrimaryClassNames: SlotClassNames<InteractionTagPrimarySlots>;
43
64
 
44
65
  export declare type InteractionTagPrimaryContextValues = TagAvatarContextValues;
@@ -127,6 +148,16 @@ export declare type InteractionTagProps<Value = TagValue> = ComponentProps<Parti
127
148
  */
128
149
  export declare const InteractionTagSecondary: ForwardRefComponent<InteractionTagSecondaryProps>;
129
150
 
151
+ /**
152
+ * InteractionTagSecondary Base Props - same as InteractionTagSecondaryProps (no design-only own props)
153
+ */
154
+ export declare type InteractionTagSecondaryBaseProps = InteractionTagSecondaryProps;
155
+
156
+ /**
157
+ * InteractionTagSecondary Base State - omits design-only state derived from context
158
+ */
159
+ export declare type InteractionTagSecondaryBaseState = Omit<InteractionTagSecondaryState, 'appearance' | 'size' | 'shape'>;
160
+
130
161
  export declare const interactionTagSecondaryClassNames: SlotClassNames<InteractionTagSecondarySlots>;
131
162
 
132
163
  /**
@@ -172,27 +203,27 @@ export declare type InteractionTagState<Value = TagValue> = ComponentState<Inter
172
203
  /**
173
204
  * Render the final JSX of InteractionTag
174
205
  */
175
- export declare const renderInteractionTag_unstable: (state: InteractionTagState, contextValues: InteractionTagContextValues) => JSXElement;
206
+ export declare const renderInteractionTag_unstable: (state: InteractionTagBaseState, contextValues: InteractionTagContextValues) => JSXElement;
176
207
 
177
208
  /**
178
209
  * Render the final JSX of InteractionTagPrimary
179
210
  */
180
- export declare const renderInteractionTagPrimary_unstable: (state: InteractionTagPrimaryState, contextValues: InteractionTagPrimaryContextValues) => JSXElement;
211
+ export declare const renderInteractionTagPrimary_unstable: (state: InteractionTagPrimaryBaseState, contextValues: InteractionTagPrimaryContextValues) => JSXElement;
181
212
 
182
213
  /**
183
214
  * Render the final JSX of InteractionTagSecondary
184
215
  */
185
- export declare const renderInteractionTagSecondary_unstable: (state: InteractionTagSecondaryState) => JSXElement;
216
+ export declare const renderInteractionTagSecondary_unstable: (state: InteractionTagSecondaryBaseState) => JSXElement;
186
217
 
187
218
  /**
188
219
  * Render the final JSX of Tag
189
220
  */
190
- export declare const renderTag_unstable: (state: TagState, contextValues: TagContextValues) => JSXElement;
221
+ export declare const renderTag_unstable: (state: TagBaseState, contextValues: TagContextValues) => JSXElement;
191
222
 
192
223
  /**
193
224
  * Render the final JSX of TagGroup
194
225
  */
195
- export declare const renderTagGroup_unstable: (state: TagGroupState, contextValue: TagGroupContextValues) => JSXElement;
226
+ export declare const renderTagGroup_unstable: (state: TagGroupBaseState, contextValue: TagGroupContextValues) => JSXElement;
196
227
 
197
228
  /**
198
229
  * Tag component - a visual representation of an attribute.
@@ -209,6 +240,16 @@ declare type TagAvatarContextValues = {
209
240
  };
210
241
  };
211
242
 
243
+ /**
244
+ * Tag Base Props - omits design-only props
245
+ */
246
+ export declare type TagBaseProps = DistributiveOmit<TagProps, 'appearance' | 'size' | 'shape'>;
247
+
248
+ /**
249
+ * Tag Base State - omits design-only state
250
+ */
251
+ export declare type TagBaseState = DistributiveOmit<TagState, 'appearance' | 'size' | 'shape' | 'avatarShape' | 'avatarSize'>;
252
+
212
253
  export declare const tagClassNames: SlotClassNames<TagSlots>;
213
254
 
214
255
  declare type TagContextValues = TagAvatarContextValues;
@@ -227,6 +268,16 @@ export declare type TagDismissHandler<Value = TagValue> = (e: TagDismissEvent, d
227
268
  */
228
269
  export declare const TagGroup: ForwardRefComponent<TagGroupProps>;
229
270
 
271
+ /**
272
+ * TagGroup Base Props - omits design-only props
273
+ */
274
+ export declare type TagGroupBaseProps<Value = TagValue> = Omit<TagGroupProps<Value>, 'appearance' | 'size'>;
275
+
276
+ /**
277
+ * TagGroup Base State - omits design-only state
278
+ */
279
+ export declare type TagGroupBaseState<Value = TagValue> = Omit<TagGroupState<Value>, 'appearance' | 'size'>;
280
+
230
281
  export declare const tagGroupClassNames: SlotClassNames<TagGroupSlots>;
231
282
 
232
283
  /**
@@ -382,6 +433,14 @@ export declare type TagValue = string;
382
433
  */
383
434
  export declare const useInteractionTag_unstable: (props: InteractionTagProps, ref: React_2.Ref<HTMLDivElement>) => InteractionTagState;
384
435
 
436
+ /**
437
+ * Create the base state required to render InteractionTag, without design-only props.
438
+ *
439
+ * @param props - props from this instance of InteractionTag (without appearance, size, shape)
440
+ * @param ref - reference to root HTMLDivElement of InteractionTag
441
+ */
442
+ export declare const useInteractionTagBase_unstable: (props: InteractionTagBaseProps, ref: React_2.Ref<HTMLDivElement>) => InteractionTagBaseState;
443
+
385
444
  export declare function useInteractionTagContextValues_unstable(state: InteractionTagState): InteractionTagContextValues;
386
445
 
387
446
  /**
@@ -395,6 +454,14 @@ export declare function useInteractionTagContextValues_unstable(state: Interacti
395
454
  */
396
455
  export declare const useInteractionTagPrimary_unstable: (props: InteractionTagPrimaryProps, ref: React_2.Ref<HTMLButtonElement>) => InteractionTagPrimaryState;
397
456
 
457
+ /**
458
+ * Create the base state required to render InteractionTagPrimary, without design-only props.
459
+ *
460
+ * @param props - props from this instance of InteractionTagPrimary
461
+ * @param ref - reference to root HTMLButtonElement of InteractionTagPrimary
462
+ */
463
+ export declare const useInteractionTagPrimaryBase_unstable: (props: InteractionTagPrimaryBaseProps, ref: React_2.Ref<HTMLButtonElement>) => InteractionTagPrimaryBaseState;
464
+
398
465
  export declare const useInteractionTagPrimaryStyles_unstable: (state: InteractionTagPrimaryState) => InteractionTagPrimaryState;
399
466
 
400
467
  /**
@@ -408,6 +475,14 @@ export declare const useInteractionTagPrimaryStyles_unstable: (state: Interactio
408
475
  */
409
476
  export declare const useInteractionTagSecondary_unstable: (props: InteractionTagSecondaryProps, ref: React_2.Ref<HTMLButtonElement>) => InteractionTagSecondaryState;
410
477
 
478
+ /**
479
+ * Create the base state required to render InteractionTagSecondary, without design-only props.
480
+ *
481
+ * @param props - props from this instance of InteractionTagSecondary
482
+ * @param ref - reference to root HTMLButtonElement of InteractionTagSecondary
483
+ */
484
+ export declare const useInteractionTagSecondaryBase_unstable: (props: InteractionTagSecondaryBaseProps, ref: React_2.Ref<HTMLButtonElement>) => InteractionTagSecondaryBaseState;
485
+
411
486
  export declare const useInteractionTagSecondaryStyles_unstable: (state: InteractionTagSecondaryState) => InteractionTagSecondaryState;
412
487
 
413
488
  /**
@@ -433,6 +508,14 @@ declare type UseTagAvatarContextValuesOptions = {
433
508
  avatarShape: AvatarShape;
434
509
  };
435
510
 
511
+ /**
512
+ * Create the base state required to render Tag, without design-only props.
513
+ *
514
+ * @param props - props from this instance of Tag (without appearance, size, shape)
515
+ * @param ref - reference to root HTMLSpanElement or HTMLButtonElement of Tag
516
+ */
517
+ export declare const useTagBase_unstable: (props: TagBaseProps, ref: React_2.Ref<HTMLSpanElement | HTMLButtonElement>) => TagBaseState;
518
+
436
519
  /**
437
520
  * Create the state required to render TagGroup.
438
521
  *
@@ -444,6 +527,14 @@ declare type UseTagAvatarContextValuesOptions = {
444
527
  */
445
528
  export declare const useTagGroup_unstable: (props: TagGroupProps, ref: React_2.Ref<HTMLDivElement>) => TagGroupState;
446
529
 
530
+ /**
531
+ * Create the base state required to render TagGroup, without design-only props.
532
+ *
533
+ * @param props - props from this instance of TagGroup (without appearance, size)
534
+ * @param ref - reference to root HTMLDivElement of TagGroup
535
+ */
536
+ export declare const useTagGroupBase_unstable: (props: TagGroupBaseProps, ref: React_2.Ref<HTMLDivElement>) => TagGroupBaseState;
537
+
447
538
  export declare function useTagGroupContextValues_unstable(state: TagGroupState): TagGroupContextValues;
448
539
 
449
540
  /**
@@ -1 +1 @@
1
- export { InteractionTag, interactionTagClassNames, renderInteractionTag_unstable, useInteractionTagContextValues_unstable, useInteractionTagStyles_unstable, useInteractionTag_unstable } from './components/InteractionTag/index';
1
+ export { InteractionTag, interactionTagClassNames, renderInteractionTag_unstable, useInteractionTagContextValues_unstable, useInteractionTagStyles_unstable, useInteractionTagBase_unstable, useInteractionTag_unstable } from './components/InteractionTag/index';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/InteractionTag.ts"],"sourcesContent":["export type {\n InteractionTagContextValues,\n InteractionTagProps,\n InteractionTagSlots,\n InteractionTagState,\n} from './components/InteractionTag/index';\nexport {\n InteractionTag,\n interactionTagClassNames,\n renderInteractionTag_unstable,\n useInteractionTagContextValues_unstable,\n useInteractionTagStyles_unstable,\n useInteractionTag_unstable,\n} from './components/InteractionTag/index';\n"],"names":["InteractionTag","interactionTagClassNames","renderInteractionTag_unstable","useInteractionTagContextValues_unstable","useInteractionTagStyles_unstable","useInteractionTag_unstable"],"mappings":"AAMA,SACEA,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,uCAAuC,EACvCC,gCAAgC,EAChCC,0BAA0B,QACrB,oCAAoC"}
1
+ {"version":3,"sources":["../src/InteractionTag.ts"],"sourcesContent":["export type {\n InteractionTagBaseProps,\n InteractionTagBaseState,\n InteractionTagContextValues,\n InteractionTagProps,\n InteractionTagSlots,\n InteractionTagState,\n} from './components/InteractionTag/index';\nexport {\n InteractionTag,\n interactionTagClassNames,\n renderInteractionTag_unstable,\n useInteractionTagContextValues_unstable,\n useInteractionTagStyles_unstable,\n useInteractionTagBase_unstable,\n useInteractionTag_unstable,\n} from './components/InteractionTag/index';\n"],"names":["InteractionTag","interactionTagClassNames","renderInteractionTag_unstable","useInteractionTagContextValues_unstable","useInteractionTagStyles_unstable","useInteractionTagBase_unstable","useInteractionTag_unstable"],"mappings":"AAQA,SACEA,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,uCAAuC,EACvCC,gCAAgC,EAChCC,8BAA8B,EAC9BC,0BAA0B,QACrB,oCAAoC"}
@@ -1 +1 @@
1
- export { InteractionTagPrimary, interactionTagPrimaryClassNames, renderInteractionTagPrimary_unstable, useInteractionTagPrimaryStyles_unstable, useInteractionTagPrimary_unstable } from './components/InteractionTagPrimary/index';
1
+ export { InteractionTagPrimary, interactionTagPrimaryClassNames, renderInteractionTagPrimary_unstable, useInteractionTagPrimaryStyles_unstable, useInteractionTagPrimaryBase_unstable, useInteractionTagPrimary_unstable } from './components/InteractionTagPrimary/index';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/InteractionTagPrimary.ts"],"sourcesContent":["export type {\n InteractionTagPrimaryContextValues,\n InteractionTagPrimaryProps,\n InteractionTagPrimarySlots,\n InteractionTagPrimaryState,\n} from './components/InteractionTagPrimary/index';\nexport {\n InteractionTagPrimary,\n interactionTagPrimaryClassNames,\n renderInteractionTagPrimary_unstable,\n useInteractionTagPrimaryStyles_unstable,\n useInteractionTagPrimary_unstable,\n} from './components/InteractionTagPrimary/index';\n"],"names":["InteractionTagPrimary","interactionTagPrimaryClassNames","renderInteractionTagPrimary_unstable","useInteractionTagPrimaryStyles_unstable","useInteractionTagPrimary_unstable"],"mappings":"AAMA,SACEA,qBAAqB,EACrBC,+BAA+B,EAC/BC,oCAAoC,EACpCC,uCAAuC,EACvCC,iCAAiC,QAC5B,2CAA2C"}
1
+ {"version":3,"sources":["../src/InteractionTagPrimary.ts"],"sourcesContent":["export type {\n InteractionTagPrimaryBaseProps,\n InteractionTagPrimaryBaseState,\n InteractionTagPrimaryContextValues,\n InteractionTagPrimaryProps,\n InteractionTagPrimarySlots,\n InteractionTagPrimaryState,\n} from './components/InteractionTagPrimary/index';\nexport {\n InteractionTagPrimary,\n interactionTagPrimaryClassNames,\n renderInteractionTagPrimary_unstable,\n useInteractionTagPrimaryStyles_unstable,\n useInteractionTagPrimaryBase_unstable,\n useInteractionTagPrimary_unstable,\n} from './components/InteractionTagPrimary/index';\n"],"names":["InteractionTagPrimary","interactionTagPrimaryClassNames","renderInteractionTagPrimary_unstable","useInteractionTagPrimaryStyles_unstable","useInteractionTagPrimaryBase_unstable","useInteractionTagPrimary_unstable"],"mappings":"AAQA,SACEA,qBAAqB,EACrBC,+BAA+B,EAC/BC,oCAAoC,EACpCC,uCAAuC,EACvCC,qCAAqC,EACrCC,iCAAiC,QAC5B,2CAA2C"}
@@ -1 +1 @@
1
- export { InteractionTagSecondary, interactionTagSecondaryClassNames, renderInteractionTagSecondary_unstable, useInteractionTagSecondaryStyles_unstable, useInteractionTagSecondary_unstable } from './components/InteractionTagSecondary/index';
1
+ export { InteractionTagSecondary, interactionTagSecondaryClassNames, renderInteractionTagSecondary_unstable, useInteractionTagSecondaryStyles_unstable, useInteractionTagSecondaryBase_unstable, useInteractionTagSecondary_unstable } from './components/InteractionTagSecondary/index';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/InteractionTagSecondary.ts"],"sourcesContent":["export type {\n InteractionTagSecondaryProps,\n InteractionTagSecondarySlots,\n InteractionTagSecondaryState,\n} from './components/InteractionTagSecondary/index';\nexport {\n InteractionTagSecondary,\n interactionTagSecondaryClassNames,\n renderInteractionTagSecondary_unstable,\n useInteractionTagSecondaryStyles_unstable,\n useInteractionTagSecondary_unstable,\n} from './components/InteractionTagSecondary/index';\n"],"names":["InteractionTagSecondary","interactionTagSecondaryClassNames","renderInteractionTagSecondary_unstable","useInteractionTagSecondaryStyles_unstable","useInteractionTagSecondary_unstable"],"mappings":"AAKA,SACEA,uBAAuB,EACvBC,iCAAiC,EACjCC,sCAAsC,EACtCC,yCAAyC,EACzCC,mCAAmC,QAC9B,6CAA6C"}
1
+ {"version":3,"sources":["../src/InteractionTagSecondary.ts"],"sourcesContent":["export type {\n InteractionTagSecondaryBaseProps,\n InteractionTagSecondaryBaseState,\n InteractionTagSecondaryProps,\n InteractionTagSecondarySlots,\n InteractionTagSecondaryState,\n} from './components/InteractionTagSecondary/index';\nexport {\n InteractionTagSecondary,\n interactionTagSecondaryClassNames,\n renderInteractionTagSecondary_unstable,\n useInteractionTagSecondaryStyles_unstable,\n useInteractionTagSecondaryBase_unstable,\n useInteractionTagSecondary_unstable,\n} from './components/InteractionTagSecondary/index';\n"],"names":["InteractionTagSecondary","interactionTagSecondaryClassNames","renderInteractionTagSecondary_unstable","useInteractionTagSecondaryStyles_unstable","useInteractionTagSecondaryBase_unstable","useInteractionTagSecondary_unstable"],"mappings":"AAOA,SACEA,uBAAuB,EACvBC,iCAAiC,EACjCC,sCAAsC,EACtCC,yCAAyC,EACzCC,uCAAuC,EACvCC,mCAAmC,QAC9B,6CAA6C"}
package/lib/Tag.js CHANGED
@@ -1 +1 @@
1
- export { Tag, renderTag_unstable, tagClassNames, useIconStyles, useMediaStyles, usePrimaryTextStyles, useSecondaryTextBaseClassName, useTagStyles_unstable, useTag_unstable } from './components/Tag/index';
1
+ export { Tag, renderTag_unstable, tagClassNames, useIconStyles, useMediaStyles, usePrimaryTextStyles, useSecondaryTextBaseClassName, useTagStyles_unstable, useTagBase_unstable, useTag_unstable } from './components/Tag/index';
package/lib/Tag.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Tag.ts"],"sourcesContent":["export type { TagContextValues, TagProps, TagSlots, TagState } from './components/Tag/index';\nexport {\n Tag,\n renderTag_unstable,\n tagClassNames,\n useIconStyles,\n useMediaStyles,\n usePrimaryTextStyles,\n useSecondaryTextBaseClassName,\n useTagStyles_unstable,\n useTag_unstable,\n} from './components/Tag/index';\n"],"names":["Tag","renderTag_unstable","tagClassNames","useIconStyles","useMediaStyles","usePrimaryTextStyles","useSecondaryTextBaseClassName","useTagStyles_unstable","useTag_unstable"],"mappings":"AACA,SACEA,GAAG,EACHC,kBAAkB,EAClBC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,oBAAoB,EACpBC,6BAA6B,EAC7BC,qBAAqB,EACrBC,eAAe,QACV,yBAAyB"}
1
+ {"version":3,"sources":["../src/Tag.ts"],"sourcesContent":["export type {\n TagBaseProps,\n TagBaseState,\n TagContextValues,\n TagProps,\n TagSlots,\n TagState,\n} from './components/Tag/index';\nexport {\n Tag,\n renderTag_unstable,\n tagClassNames,\n useIconStyles,\n useMediaStyles,\n usePrimaryTextStyles,\n useSecondaryTextBaseClassName,\n useTagStyles_unstable,\n useTagBase_unstable,\n useTag_unstable,\n} from './components/Tag/index';\n"],"names":["Tag","renderTag_unstable","tagClassNames","useIconStyles","useMediaStyles","usePrimaryTextStyles","useSecondaryTextBaseClassName","useTagStyles_unstable","useTagBase_unstable","useTag_unstable"],"mappings":"AAQA,SACEA,GAAG,EACHC,kBAAkB,EAClBC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,oBAAoB,EACpBC,6BAA6B,EAC7BC,qBAAqB,EACrBC,mBAAmB,EACnBC,eAAe,QACV,yBAAyB"}
package/lib/TagGroup.js CHANGED
@@ -1 +1 @@
1
- export { TagGroup, renderTagGroup_unstable, tagGroupClassNames, useTagGroupContextValues_unstable, useTagGroupStyles_unstable, useTagGroup_unstable } from './components/TagGroup/index';
1
+ export { TagGroup, renderTagGroup_unstable, tagGroupClassNames, useTagGroupContextValues_unstable, useTagGroupStyles_unstable, useTagGroupBase_unstable, useTagGroup_unstable } from './components/TagGroup/index';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/TagGroup.ts"],"sourcesContent":["export type { TagGroupContextValues, TagGroupProps, TagGroupSlots, TagGroupState } from './components/TagGroup/index';\nexport {\n TagGroup,\n renderTagGroup_unstable,\n tagGroupClassNames,\n useTagGroupContextValues_unstable,\n useTagGroupStyles_unstable,\n useTagGroup_unstable,\n} from './components/TagGroup/index';\n"],"names":["TagGroup","renderTagGroup_unstable","tagGroupClassNames","useTagGroupContextValues_unstable","useTagGroupStyles_unstable","useTagGroup_unstable"],"mappings":"AACA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,iCAAiC,EACjCC,0BAA0B,EAC1BC,oBAAoB,QACf,8BAA8B"}
1
+ {"version":3,"sources":["../src/TagGroup.ts"],"sourcesContent":["export type {\n TagGroupBaseProps,\n TagGroupBaseState,\n TagGroupContextValues,\n TagGroupProps,\n TagGroupSlots,\n TagGroupState,\n} from './components/TagGroup/index';\nexport {\n TagGroup,\n renderTagGroup_unstable,\n tagGroupClassNames,\n useTagGroupContextValues_unstable,\n useTagGroupStyles_unstable,\n useTagGroupBase_unstable,\n useTagGroup_unstable,\n} from './components/TagGroup/index';\n"],"names":["TagGroup","renderTagGroup_unstable","tagGroupClassNames","useTagGroupContextValues_unstable","useTagGroupStyles_unstable","useTagGroupBase_unstable","useTagGroup_unstable"],"mappings":"AAQA,SACEA,QAAQ,EACRC,uBAAuB,EACvBC,kBAAkB,EAClBC,iCAAiC,EACjCC,0BAA0B,EAC1BC,wBAAwB,EACxBC,oBAAoB,QACf,8BAA8B"}
@@ -1,3 +1,3 @@
1
1
  /**
2
- * State used in rendering InteractionTag
2
+ * InteractionTag Base State - omits design-only state
3
3
  */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTag/InteractionTag.types.ts"],"sourcesContent":["import { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport { TagAppearance, TagShape, TagSize, TagValue, TagDismissHandler, TagSelectHandler } 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"],"names":[],"mappings":"AA0DA;;CAEC,GACD,WAqBI"}
1
+ {"version":3,"sources":["../src/components/InteractionTag/InteractionTag.types.ts"],"sourcesContent":["import { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport { TagAppearance, TagShape, TagSize, TagValue, TagDismissHandler, TagSelectHandler } 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":"AA4FA;;CAEC,GACD,WAGE"}
@@ -1,5 +1,5 @@
1
1
  export { InteractionTag } from './InteractionTag';
2
2
  export { renderInteractionTag_unstable } from './renderInteractionTag';
3
- export { useInteractionTag_unstable } from './useInteractionTag';
3
+ export { useInteractionTagBase_unstable, useInteractionTag_unstable } from './useInteractionTag';
4
4
  export { interactionTagClassNames, useInteractionTagStyles_unstable } from './useInteractionTagStyles.styles';
5
5
  export { useInteractionTagContextValues_unstable } from './useInteractionTagContextValues';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTag/index.ts"],"sourcesContent":["export { InteractionTag } from './InteractionTag';\nexport type {\n InteractionTagContextValues,\n InteractionTagProps,\n InteractionTagSlots,\n InteractionTagState,\n} from './InteractionTag.types';\nexport { renderInteractionTag_unstable } from './renderInteractionTag';\nexport { useInteractionTag_unstable } from './useInteractionTag';\nexport { interactionTagClassNames, useInteractionTagStyles_unstable } from './useInteractionTagStyles.styles';\nexport { useInteractionTagContextValues_unstable } from './useInteractionTagContextValues';\n"],"names":["InteractionTag","renderInteractionTag_unstable","useInteractionTag_unstable","interactionTagClassNames","useInteractionTagStyles_unstable","useInteractionTagContextValues_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAOlD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,mCAAmC;AAC9G,SAASC,uCAAuC,QAAQ,mCAAmC"}
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,mBAAmB;AASlD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,8BAA8B,EAAEC,0BAA0B,QAAQ,sBAAsB;AACjG,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,mCAAmC;AAC9G,SAASC,uCAAuC,QAAQ,mCAAmC"}
@@ -1 +1 @@
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 { InteractionTagState, 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: InteractionTagState,\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;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,6BAA6B,QAAQ,uCAAuC;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
+ {"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;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,6BAA6B,QAAQ,uCAAuC;AAErF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAC3CC,OACAC;IAEAJ,YAAiCG;IAEjC,qBACE,KAACF;QAA8BI,OAAOD,cAAcE,cAAc;kBAChE,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
@@ -3,28 +3,22 @@ import * as React from 'react';
3
3
  import { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';
4
4
  import { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';
5
5
  /**
6
- * Create the state required to render InteractionTag.
7
- *
8
- * The returned state can be modified with hooks such as useInteractionTagStyles_unstable,
9
- * before being passed to renderInteractionTag_unstable.
6
+ * Create the base state required to render InteractionTag, without design-only props.
10
7
  *
11
- * @param props - props from this instance of InteractionTag
8
+ * @param props - props from this instance of InteractionTag (without appearance, size, shape)
12
9
  * @param ref - reference to root HTMLDivElement of InteractionTag
13
- */ export const useInteractionTag_unstable = (props, ref)=>{
14
- const { handleTagDismiss, handleTagSelect, size: contextSize, disabled: contextDisabled, appearance: contextAppearance, selectedValues = [] } = useTagGroupContext_unstable();
10
+ */ export const useInteractionTagBase_unstable = (props, ref)=>{
11
+ const { handleTagDismiss, handleTagSelect, disabled: contextDisabled, selectedValues = [] } = useTagGroupContext_unstable();
15
12
  const id = useId('fui-InteractionTag-', props.id);
16
13
  const interactionTagPrimaryId = useId('fui-InteractionTagPrimary-');
17
- const { appearance = contextAppearance !== null && contextAppearance !== void 0 ? contextAppearance : 'filled', disabled = false, selected = false, shape = 'rounded', size = contextSize, value = id } = props;
14
+ const { disabled = false, selected = false, value = id } = props;
18
15
  return {
19
- appearance,
20
16
  disabled: contextDisabled ? true : disabled,
21
17
  handleTagDismiss,
22
18
  handleTagSelect,
23
19
  interactionTagPrimaryId,
24
20
  selected: selectedValues.includes(value) || selected,
25
21
  selectedValues,
26
- shape,
27
- size,
28
22
  value,
29
23
  components: {
30
24
  root: 'div'
@@ -39,3 +33,21 @@ import { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';
39
33
  })
40
34
  };
41
35
  };
36
+ /**
37
+ * Create the state required to render InteractionTag.
38
+ *
39
+ * The returned state can be modified with hooks such as useInteractionTagStyles_unstable,
40
+ * before being passed to renderInteractionTag_unstable.
41
+ *
42
+ * @param props - props from this instance of InteractionTag
43
+ * @param ref - reference to root HTMLDivElement of InteractionTag
44
+ */ export const useInteractionTag_unstable = (props, ref)=>{
45
+ const { size: contextSize, appearance: contextAppearance } = useTagGroupContext_unstable();
46
+ const { appearance = contextAppearance !== null && contextAppearance !== void 0 ? contextAppearance : 'filled', shape = 'rounded', size = contextSize } = props;
47
+ return {
48
+ ...useInteractionTagBase_unstable(props, ref),
49
+ appearance,
50
+ shape,
51
+ size
52
+ };
53
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTag/useInteractionTag.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport type { InteractionTagProps, InteractionTagState } from './InteractionTag.types';\nimport { useTagGroupContext_unstable } from '../../contexts/tagGroupContext';\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 {\n handleTagDismiss,\n handleTagSelect,\n size: contextSize,\n disabled: contextDisabled,\n appearance: contextAppearance,\n selectedValues = [],\n } = useTagGroupContext_unstable();\n\n const id = useId('fui-InteractionTag-', props.id);\n\n const interactionTagPrimaryId = useId('fui-InteractionTagPrimary-');\n\n const {\n appearance = contextAppearance ?? 'filled',\n disabled = false,\n selected = false,\n shape = 'rounded',\n size = contextSize,\n value = id,\n } = props;\n\n return {\n appearance,\n disabled: contextDisabled ? true : disabled,\n handleTagDismiss,\n handleTagSelect,\n interactionTagPrimaryId,\n selected: selectedValues.includes(value) || selected,\n selectedValues,\n shape,\n size,\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"],"names":["React","getIntrinsicElementProps","useId","slot","useTagGroupContext_unstable","useInteractionTag_unstable","props","ref","handleTagDismiss","handleTagSelect","size","contextSize","disabled","contextDisabled","appearance","contextAppearance","selectedValues","id","interactionTagPrimaryId","selected","shape","value","includes","components","root","always","elementType"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAElF,SAASC,2BAA2B,QAAQ,iCAAiC;AAE7E;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EACJC,gBAAgB,EAChBC,eAAe,EACfC,MAAMC,WAAW,EACjBC,UAAUC,eAAe,EACzBC,YAAYC,iBAAiB,EAC7BC,iBAAiB,EAAE,EACpB,GAAGZ;IAEJ,MAAMa,KAAKf,MAAM,uBAAuBI,MAAMW,EAAE;IAEhD,MAAMC,0BAA0BhB,MAAM;IAEtC,MAAM,EACJY,aAAaC,8BAAAA,+BAAAA,oBAAqB,QAAQ,EAC1CH,WAAW,KAAK,EAChBO,WAAW,KAAK,EAChBC,QAAQ,SAAS,EACjBV,OAAOC,WAAW,EAClBU,QAAQJ,EAAE,EACX,GAAGX;IAEJ,OAAO;QACLQ;QACAF,UAAUC,kBAAkB,OAAOD;QACnCJ;QACAC;QACAS;QACAC,UAAUH,eAAeM,QAAQ,CAACD,UAAUF;QAC5CH;QACAI;QACAV;QACAW;QAEAE,YAAY;YACVC,MAAM;QACR;QAEAA,MAAMrB,KAAKsB,MAAM,CACfxB,yBAAyB,OAAO;YAC9BM;YACA,GAAGD,KAAK;YACRM,UAAUC,kBAAkB,OAAOD;YACnCK;QACF,IACA;YAAES,aAAa;QAAM;IAEzB;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/InteractionTag/useInteractionTag.tsx"],"sourcesContent":["'use client';\n\nimport * 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":["React","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;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAOlF,SAASC,2BAA2B,QAAQ,iCAAiC;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,3 +1,3 @@
1
1
  /**
2
- * State used in rendering InteractionTagPrimary
2
+ * InteractionTagPrimary Base State - omits design-only state derived from context
3
3
  */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagPrimary/InteractionTagPrimary.types.ts"],"sourcesContent":["import { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport { 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"],"names":[],"mappings":"AA2CA;;CAEC,GACD,WAKmC"}
1
+ {"version":3,"sources":["../src/components/InteractionTagPrimary/InteractionTagPrimary.types.ts"],"sourcesContent":["import { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\nimport { 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,4 +1,4 @@
1
1
  export { InteractionTagPrimary } from './InteractionTagPrimary';
2
2
  export { renderInteractionTagPrimary_unstable } from './renderInteractionTagPrimary';
3
- export { useInteractionTagPrimary_unstable } from './useInteractionTagPrimary';
3
+ export { useInteractionTagPrimaryBase_unstable, useInteractionTagPrimary_unstable } from './useInteractionTagPrimary';
4
4
  export { interactionTagPrimaryClassNames, useInteractionTagPrimaryStyles_unstable } from './useInteractionTagPrimaryStyles.styles';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagPrimary/index.ts"],"sourcesContent":["export { InteractionTagPrimary } from './InteractionTagPrimary';\nexport type {\n InteractionTagPrimaryContextValues,\n InteractionTagPrimaryProps,\n InteractionTagPrimarySlots,\n InteractionTagPrimaryState,\n} from './InteractionTagPrimary.types';\nexport { renderInteractionTagPrimary_unstable } from './renderInteractionTagPrimary';\nexport { useInteractionTagPrimary_unstable } from './useInteractionTagPrimary';\nexport {\n interactionTagPrimaryClassNames,\n useInteractionTagPrimaryStyles_unstable,\n} from './useInteractionTagPrimaryStyles.styles';\n"],"names":["InteractionTagPrimary","renderInteractionTagPrimary_unstable","useInteractionTagPrimary_unstable","interactionTagPrimaryClassNames","useInteractionTagPrimaryStyles_unstable"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,0BAA0B;AAOhE,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SACEC,+BAA+B,EAC/BC,uCAAuC,QAClC,0CAA0C"}
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,0BAA0B;AAShE,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,qCAAqC,EAAEC,iCAAiC,QAAQ,6BAA6B;AACtH,SACEC,+BAA+B,EAC/BC,uCAAuC,QAClC,0CAA0C"}
@@ -1 +1 @@
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 InteractionTagPrimaryState,\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: InteractionTagPrimaryState,\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;AAEjD,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
+ {"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;AAEjD,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"}
@@ -12,15 +12,12 @@ const avatarShapeMap = {
12
12
  circular: 'circular'
13
13
  };
14
14
  /**
15
- * Create the state required to render InteractionTagPrimary.
16
- *
17
- * The returned state can be modified with hooks such as useInteractionTagPrimaryStyles_unstable,
18
- * before being passed to renderInteractionTagPrimary_unstable.
15
+ * Create the base state required to render InteractionTagPrimary, without design-only props.
19
16
  *
20
17
  * @param props - props from this instance of InteractionTagPrimary
21
18
  * @param ref - reference to root HTMLButtonElement of InteractionTagPrimary
22
- */ export const useInteractionTagPrimary_unstable = (props, ref)=>{
23
- const { appearance, disabled, handleTagSelect, interactionTagPrimaryId, selected: contextSelected, selectedValues, shape, size, value } = useInteractionTagContext_unstable();
19
+ */ export const useInteractionTagPrimaryBase_unstable = (props, ref)=>{
20
+ const { disabled, handleTagSelect, interactionTagPrimaryId, selected: contextSelected, selectedValues, value } = useInteractionTagContext_unstable();
24
21
  const { hasSecondaryAction = false } = props;
25
22
  const onClick = useEventCallback(mergeCallbacks(props === null || props === void 0 ? void 0 : props.onClick, (event)=>handleTagSelect === null || handleTagSelect === void 0 ? void 0 : handleTagSelect(event, {
26
23
  type: 'click',
@@ -29,14 +26,9 @@ const avatarShapeMap = {
29
26
  selectedValues
30
27
  })));
31
28
  return {
32
- appearance,
33
- avatarShape: avatarShapeMap[shape],
34
- avatarSize: avatarSizeMap[size],
35
29
  disabled,
36
30
  hasSecondaryAction,
37
31
  selected: contextSelected,
38
- shape,
39
- size,
40
32
  components: {
41
33
  root: 'button',
42
34
  media: 'span',
@@ -74,3 +66,22 @@ const avatarShapeMap = {
74
66
  })
75
67
  };
76
68
  };
69
+ /**
70
+ * Create the state required to render InteractionTagPrimary.
71
+ *
72
+ * The returned state can be modified with hooks such as useInteractionTagPrimaryStyles_unstable,
73
+ * before being passed to renderInteractionTagPrimary_unstable.
74
+ *
75
+ * @param props - props from this instance of InteractionTagPrimary
76
+ * @param ref - reference to root HTMLButtonElement of InteractionTagPrimary
77
+ */ export const useInteractionTagPrimary_unstable = (props, ref)=>{
78
+ const { appearance, shape, size } = useInteractionTagContext_unstable();
79
+ return {
80
+ ...useInteractionTagPrimaryBase_unstable(props, ref),
81
+ appearance,
82
+ avatarShape: avatarShapeMap[shape],
83
+ avatarSize: avatarSizeMap[size],
84
+ shape,
85
+ size
86
+ };
87
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagPrimary/useInteractionTagPrimary.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type { InteractionTagPrimaryProps, InteractionTagPrimaryState } 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 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 {\n appearance,\n disabled,\n handleTagSelect,\n interactionTagPrimaryId,\n selected: contextSelected,\n selectedValues,\n shape,\n size,\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 appearance,\n avatarShape: avatarShapeMap[shape],\n avatarSize: avatarSizeMap[size],\n disabled,\n hasSecondaryAction,\n selected: contextSelected,\n shape,\n size,\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"],"names":["React","getIntrinsicElementProps","mergeCallbacks","slot","useEventCallback","useInteractionTagContext_unstable","avatarSizeMap","medium","small","avatarShapeMap","rounded","circular","useInteractionTagPrimary_unstable","props","ref","appearance","disabled","handleTagSelect","interactionTagPrimaryId","selected","contextSelected","selectedValues","shape","size","value","hasSecondaryAction","onClick","event","type","avatarShape","avatarSize","components","root","media","icon","primaryText","secondaryText","always","id","undefined","elementType","optional","renderByDefault","defaultProps","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAE7G,SAASC,iCAAiC,QAAQ,uCAAuC;AAEzF,MAAMC,gBAAgB;IACpBC,QAAQ;IACRC,OAAO;IACP,eAAe;AACjB;AAEA,MAAMC,iBAAiB;IACrBC,SAAS;IACTC,UAAU;AACZ;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC,OACAC;IAEA,MAAM,EACJC,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,uBAAuB,EACvBC,UAAUC,eAAe,EACzBC,cAAc,EACdC,KAAK,EACLC,IAAI,EACJC,KAAK,EACN,GAAGnB;IACJ,MAAM,EAAEoB,qBAAqB,KAAK,EAAE,GAAGZ;IAEvC,MAAMa,UAAUtB,iBACdF,eAAeW,kBAAAA,4BAAAA,MAAOa,OAAO,EAAE,CAACC,QAC9BV,4BAAAA,sCAAAA,gBAAkBU,OAAO;YAAEC,MAAM;YAASD;YAAOH;YAAOH;QAAe;IAI3E,OAAO;QACLN;QACAc,aAAapB,cAAc,CAACa,MAAM;QAClCQ,YAAYxB,aAAa,CAACiB,KAAK;QAC/BP;QACAS;QACAN,UAAUC;QACVE;QACAC;QAEAQ,YAAY;YACVC,MAAM;YACNC,OAAO;YACPC,MAAM;YACNC,aAAa;YACbC,eAAe;QACjB;QAEAJ,MAAM7B,KAAKkC,MAAM,CACfpC,yBAAyB,UAAU;YACjCa;YACAE;YACAsB,IAAIpB;YACJ,GAAID,oBAAoBsB,aAAa;gBAAE,gBAAgBnB;YAAgB,CAAC;YACxEM;YACA,GAAGb,KAAK;QACV,IACA;YAAE2B,aAAa;QAAS;QAG1BP,OAAO9B,KAAKsC,QAAQ,CAAC5B,MAAMoB,KAAK,EAAE;YAAEO,aAAa;QAAO;QACxDN,MAAM/B,KAAKsC,QAAQ,CAAC5B,MAAMqB,IAAI,EAAE;YAAEM,aAAa;QAAO;QACtDL,aAAahC,KAAKsC,QAAQ,CAAC5B,MAAMsB,WAAW,EAAE;YAC5CO,iBAAiB;YACjBC,cAAc;gBACZC,UAAU/B,MAAM+B,QAAQ;YAC1B;YACAJ,aAAa;QACf;QACAJ,eAAejC,KAAKsC,QAAQ,CAAC5B,MAAMuB,aAAa,EAAE;YAAEI,aAAa;QAAO;IAC1E;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/InteractionTagPrimary/useInteractionTagPrimary.ts"],"sourcesContent":["'use client';\n\nimport * 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":["React","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;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAO7G,SAASC,iCAAiC,QAAQ,uCAAuC;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"}
@@ -1,3 +1,3 @@
1
1
  /**
2
- * State used in rendering InteractionTagSecondary
2
+ * InteractionTagSecondary Base State - omits design-only state derived from context
3
3
  */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagSecondary/InteractionTagSecondary.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\n\nexport type InteractionTagSecondarySlots = {\n root: NonNullable<Slot<'button'>>;\n};\n\n/**\n * InteractionTagSecondary Props\n */\nexport type InteractionTagSecondaryProps = ComponentProps<InteractionTagSecondarySlots>;\n\n/**\n * State used in rendering InteractionTagSecondary\n */\nexport type InteractionTagSecondaryState = ComponentState<InteractionTagSecondarySlots> &\n Required<Pick<InteractionTagContextValue, 'appearance' | 'disabled' | 'selected' | 'shape' | 'size'>>;\n"],"names":[],"mappings":"AAYA;;CAEC,GACD,WACwG"}
1
+ {"version":3,"sources":["../src/components/InteractionTagSecondary/InteractionTagSecondary.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { InteractionTagContextValue } from '../../contexts/interactionTagContext';\n\nexport type InteractionTagSecondarySlots = {\n root: NonNullable<Slot<'button'>>;\n};\n\n/**\n * InteractionTagSecondary Props\n */\nexport type InteractionTagSecondaryProps = ComponentProps<InteractionTagSecondarySlots>;\n\n/**\n * State used in rendering InteractionTagSecondary\n */\nexport type InteractionTagSecondaryState = ComponentState<InteractionTagSecondarySlots> &\n Required<Pick<InteractionTagContextValue, 'appearance' | 'disabled' | 'selected' | 'shape' | 'size'>>;\n\n/**\n * InteractionTagSecondary Base Props - same as InteractionTagSecondaryProps (no design-only own props)\n */\nexport type InteractionTagSecondaryBaseProps = InteractionTagSecondaryProps;\n\n/**\n * InteractionTagSecondary Base State - omits design-only state derived from context\n */\nexport type InteractionTagSecondaryBaseState = Omit<InteractionTagSecondaryState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAuBA;;CAEC,GACD,WAAmH"}
@@ -1,4 +1,4 @@
1
1
  export { InteractionTagSecondary } from './InteractionTagSecondary';
2
2
  export { renderInteractionTagSecondary_unstable } from './renderInteractionTagSecondary';
3
- export { useInteractionTagSecondary_unstable } from './useInteractionTagSecondary';
3
+ export { useInteractionTagSecondaryBase_unstable, useInteractionTagSecondary_unstable } from './useInteractionTagSecondary';
4
4
  export { interactionTagSecondaryClassNames, useInteractionTagSecondaryStyles_unstable } from './useInteractionTagSecondaryStyles.styles';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagSecondary/index.ts"],"sourcesContent":["export { InteractionTagSecondary } from './InteractionTagSecondary';\nexport type {\n InteractionTagSecondaryProps,\n InteractionTagSecondarySlots,\n InteractionTagSecondaryState,\n} from './InteractionTagSecondary.types';\nexport { renderInteractionTagSecondary_unstable } from './renderInteractionTagSecondary';\nexport { useInteractionTagSecondary_unstable } from './useInteractionTagSecondary';\nexport {\n interactionTagSecondaryClassNames,\n useInteractionTagSecondaryStyles_unstable,\n} from './useInteractionTagSecondaryStyles.styles';\n"],"names":["InteractionTagSecondary","renderInteractionTagSecondary_unstable","useInteractionTagSecondary_unstable","interactionTagSecondaryClassNames","useInteractionTagSecondaryStyles_unstable"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,4BAA4B;AAMpE,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SAASC,mCAAmC,QAAQ,+BAA+B;AACnF,SACEC,iCAAiC,EACjCC,yCAAyC,QACpC,4CAA4C"}
1
+ {"version":3,"sources":["../src/components/InteractionTagSecondary/index.ts"],"sourcesContent":["export { InteractionTagSecondary } from './InteractionTagSecondary';\nexport type {\n InteractionTagSecondaryBaseProps,\n InteractionTagSecondaryBaseState,\n InteractionTagSecondaryProps,\n InteractionTagSecondarySlots,\n InteractionTagSecondaryState,\n} from './InteractionTagSecondary.types';\nexport { renderInteractionTagSecondary_unstable } from './renderInteractionTagSecondary';\nexport {\n useInteractionTagSecondaryBase_unstable,\n useInteractionTagSecondary_unstable,\n} from './useInteractionTagSecondary';\nexport {\n interactionTagSecondaryClassNames,\n useInteractionTagSecondaryStyles_unstable,\n} from './useInteractionTagSecondaryStyles.styles';\n"],"names":["InteractionTagSecondary","renderInteractionTagSecondary_unstable","useInteractionTagSecondaryBase_unstable","useInteractionTagSecondary_unstable","interactionTagSecondaryClassNames","useInteractionTagSecondaryStyles_unstable"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,4BAA4B;AAQpE,SAASC,sCAAsC,QAAQ,kCAAkC;AACzF,SACEC,uCAAuC,EACvCC,mCAAmC,QAC9B,+BAA+B;AACtC,SACEC,iCAAiC,EACjCC,yCAAyC,QACpC,4CAA4C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/InteractionTagSecondary/renderInteractionTagSecondary.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InteractionTagSecondaryState, InteractionTagSecondarySlots } from './InteractionTagSecondary.types';\n\n/**\n * Render the final JSX of InteractionTagSecondary\n */\nexport const renderInteractionTagSecondary_unstable = (state: InteractionTagSecondaryState): JSXElement => {\n assertSlots<InteractionTagSecondarySlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderInteractionTagSecondary_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,yCAAyC,CAACC;IACrDF,YAA0CE;IAE1C,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/InteractionTagSecondary/renderInteractionTagSecondary.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { InteractionTagSecondaryBaseState, InteractionTagSecondarySlots } from './InteractionTagSecondary.types';\n\n/**\n * Render the final JSX of InteractionTagSecondary\n */\nexport const renderInteractionTagSecondary_unstable = (state: InteractionTagSecondaryBaseState): JSXElement => {\n assertSlots<InteractionTagSecondarySlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderInteractionTagSecondary_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AACjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,yCAAyC,CAACC;IACrDF,YAA0CE;IAE1C,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}