@fluentui/react-tag-picker 9.7.0 → 9.7.2
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 +40 -2
- package/lib/TagPicker.js.map +1 -1
- package/lib/TagPickerButton.js.map +1 -1
- package/lib/TagPickerControl.js.map +1 -1
- package/lib/TagPickerGroup.js.map +1 -1
- package/lib/TagPickerInput.js.map +1 -1
- package/lib/TagPickerList.js.map +1 -1
- package/lib/TagPickerOption.js.map +1 -1
- package/lib/TagPickerOptionGroup.js.map +1 -1
- package/lib/components/TagPicker/TagPicker.js.map +1 -1
- package/lib/components/TagPicker/TagPicker.types.js.map +1 -1
- package/lib/components/TagPicker/index.js.map +1 -1
- package/lib/components/TagPicker/renderTagPicker.js.map +1 -1
- package/lib/components/TagPicker/useTagPicker.js.map +1 -1
- package/lib/components/TagPicker/useTagPickerContextValues.js.map +1 -1
- package/lib/components/TagPickerButton/TagPickerButton.js.map +1 -1
- package/lib/components/TagPickerButton/TagPickerButton.types.js.map +1 -1
- package/lib/components/TagPickerButton/index.js.map +1 -1
- package/lib/components/TagPickerButton/renderTagPickerButton.js.map +1 -1
- package/lib/components/TagPickerButton/useTagPickerButton.js.map +1 -1
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerControl/TagPickerControl.js.map +1 -1
- package/lib/components/TagPickerControl/TagPickerControl.types.js.map +1 -1
- package/lib/components/TagPickerControl/index.js.map +1 -1
- package/lib/components/TagPickerControl/renderTagPickerControl.js.map +1 -1
- package/lib/components/TagPickerControl/useTagPickerControl.js.map +1 -1
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerGroup/TagPickerGroup.js.map +1 -1
- package/lib/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -1
- package/lib/components/TagPickerGroup/index.js.map +1 -1
- package/lib/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -1
- package/lib/components/TagPickerGroup/useTagPickerGroup.js.map +1 -1
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerInput/TagPickerInput.js.map +1 -1
- package/lib/components/TagPickerInput/TagPickerInput.types.js.map +1 -1
- package/lib/components/TagPickerInput/index.js.map +1 -1
- package/lib/components/TagPickerInput/renderTagPickerInput.js.map +1 -1
- package/lib/components/TagPickerInput/useTagPickerInput.js.map +1 -1
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerList/TagPickerList.js.map +1 -1
- package/lib/components/TagPickerList/TagPickerList.types.js.map +1 -1
- package/lib/components/TagPickerList/index.js.map +1 -1
- package/lib/components/TagPickerList/renderTagPickerList.js.map +1 -1
- package/lib/components/TagPickerList/useTagPickerList.js.map +1 -1
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerOption/TagPickerOption.js.map +1 -1
- package/lib/components/TagPickerOption/TagPickerOption.types.js.map +1 -1
- package/lib/components/TagPickerOption/index.js.map +1 -1
- package/lib/components/TagPickerOption/renderTagPickerOption.js.map +1 -1
- package/lib/components/TagPickerOption/useTagPickerOption.js.map +1 -1
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/index.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -1
- package/lib/contexts/TagPickerContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/tagPicker2Tag.js.map +1 -1
- package/lib/utils/tokens.js.map +1 -1
- package/lib/utils/useExpandLabel.js.map +1 -1
- package/lib/utils/useResizeObserverRef.js.map +1 -1
- package/lib/utils/useTagPickerFilter.js.map +1 -1
- package/lib-commonjs/TagPicker.js.map +1 -1
- package/lib-commonjs/TagPickerButton.js.map +1 -1
- package/lib-commonjs/TagPickerControl.js.map +1 -1
- package/lib-commonjs/TagPickerGroup.js.map +1 -1
- package/lib-commonjs/TagPickerInput.js.map +1 -1
- package/lib-commonjs/TagPickerList.js.map +1 -1
- package/lib-commonjs/TagPickerOption.js.map +1 -1
- package/lib-commonjs/TagPickerOptionGroup.js.map +1 -1
- package/lib-commonjs/components/TagPicker/TagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/TagPicker.types.js.map +1 -1
- package/lib-commonjs/components/TagPicker/index.js.map +1 -1
- package/lib-commonjs/components/TagPicker/renderTagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/useTagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/renderTagPickerButton.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/renderTagPickerControl.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/renderTagPickerInput.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/TagPickerList.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/TagPickerList.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/renderTagPickerList.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/renderTagPickerOption.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/index.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/contexts/TagPickerContext.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/tagPicker2Tag.js.map +1 -1
- package/lib-commonjs/utils/tokens.js.map +1 -1
- package/lib-commonjs/utils/useExpandLabel.js.map +1 -1
- package/lib-commonjs/utils/useResizeObserverRef.js.map +1 -1
- package/lib-commonjs/utils/useTagPickerFilter.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerGroup/useTagPickerGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerGroupProps, TagPickerGroupState } from './TagPickerGroup.types';\nimport { useTagGroup_unstable } from '@fluentui/react-tags';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport { isHTMLElement, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { tagPickerAppearanceToTagAppearance, tagPickerSizeToTagSize } from '../../utils/tagPicker2Tag';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ArrowRight } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render TagPickerGroup.\n *\n * The returned state can be modified with hooks such as usePickerTagGroupStyles_unstable,\n * before being passed to renderPickerTagGroup_unstable.\n *\n * @param props - props from this instance of TagPickerGroup\n * @param ref - reference to root HTMLDivElement of TagPickerGroup\n */\nexport const useTagPickerGroup_unstable = (\n props: TagPickerGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerGroupState => {\n const hasSelectedOptions = useTagPickerContext_unstable(ctx => ctx.selectedOptions.length > 0);\n const hasOneSelectedOption = useTagPickerContext_unstable(ctx => ctx.selectedOptions.length === 1);\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const tagPickerGroupRef = useTagPickerContext_unstable(ctx => ctx.tagPickerGroupRef);\n const selectOption = useTagPickerContext_unstable(ctx => ctx.selectOption);\n const size = useTagPickerContext_unstable(ctx => tagPickerSizeToTagSize(ctx.size));\n const appearance = useTagPickerContext_unstable(ctx => ctx.appearance);\n const disabled = useTagPickerContext_unstable(ctx => ctx.disabled);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: false,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const state = useTagGroup_unstable(\n {\n role: 'listbox',\n disabled,\n ...props,\n ...arrowNavigationProps,\n size,\n appearance: tagPickerAppearanceToTagAppearance(appearance),\n dismissible: true,\n onKeyDown: useEventCallback(event => {\n props.onKeyDown?.(event);\n if (isHTMLElement(event.target) && event.key === ArrowRight) {\n triggerRef.current?.focus();\n }\n }),\n onDismiss: useEventCallback((event, data) => {\n selectOption(event as React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, {\n value: data.value,\n // These values no longer exist because the option has unregistered itself\n // for the purposes of selection - these values aren't actually used\n id: 'ERROR_DO_NOT_USE',\n text: 'ERROR_DO_NOT_USE',\n });\n if (hasOneSelectedOption && !event.isDefaultPrevented()) {\n triggerRef.current?.focus();\n }\n }),\n },\n useMergedRefs(ref, tagPickerGroupRef),\n );\n\n return {\n ...state,\n hasSelectedOptions,\n };\n};\n"],"names":["React","useTagGroup_unstable","useTagPickerContext_unstable","isHTMLElement","useEventCallback","useMergedRefs","tagPickerAppearanceToTagAppearance","tagPickerSizeToTagSize","useArrowNavigationGroup","ArrowRight","useTagPickerGroup_unstable","props","ref","hasSelectedOptions","ctx","selectedOptions","length","hasOneSelectedOption","triggerRef","tagPickerGroupRef","selectOption","size","appearance","disabled","arrowNavigationProps","circular","axis","memorizeCurrent","state","role","dismissible","onKeyDown","event","target","key","current","focus","onDismiss","data","value","id","text","isDefaultPrevented"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerGroup/useTagPickerGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerGroupProps, TagPickerGroupState } from './TagPickerGroup.types';\nimport { useTagGroup_unstable } from '@fluentui/react-tags';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport { isHTMLElement, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { tagPickerAppearanceToTagAppearance, tagPickerSizeToTagSize } from '../../utils/tagPicker2Tag';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { ArrowRight } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render TagPickerGroup.\n *\n * The returned state can be modified with hooks such as usePickerTagGroupStyles_unstable,\n * before being passed to renderPickerTagGroup_unstable.\n *\n * @param props - props from this instance of TagPickerGroup\n * @param ref - reference to root HTMLDivElement of TagPickerGroup\n */\nexport const useTagPickerGroup_unstable = (\n props: TagPickerGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerGroupState => {\n const hasSelectedOptions = useTagPickerContext_unstable(ctx => ctx.selectedOptions.length > 0);\n const hasOneSelectedOption = useTagPickerContext_unstable(ctx => ctx.selectedOptions.length === 1);\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const tagPickerGroupRef = useTagPickerContext_unstable(ctx => ctx.tagPickerGroupRef);\n const selectOption = useTagPickerContext_unstable(ctx => ctx.selectOption);\n const size = useTagPickerContext_unstable(ctx => tagPickerSizeToTagSize(ctx.size));\n const appearance = useTagPickerContext_unstable(ctx => ctx.appearance);\n const disabled = useTagPickerContext_unstable(ctx => ctx.disabled);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: false,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const state = useTagGroup_unstable(\n {\n role: 'listbox',\n disabled,\n ...props,\n ...arrowNavigationProps,\n size,\n appearance: tagPickerAppearanceToTagAppearance(appearance),\n dismissible: true,\n onKeyDown: useEventCallback(event => {\n props.onKeyDown?.(event);\n if (isHTMLElement(event.target) && event.key === ArrowRight) {\n triggerRef.current?.focus();\n }\n }),\n onDismiss: useEventCallback((event, data) => {\n selectOption(event as React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, {\n value: data.value,\n // These values no longer exist because the option has unregistered itself\n // for the purposes of selection - these values aren't actually used\n id: 'ERROR_DO_NOT_USE',\n text: 'ERROR_DO_NOT_USE',\n });\n if (hasOneSelectedOption && !event.isDefaultPrevented()) {\n triggerRef.current?.focus();\n }\n }),\n },\n useMergedRefs(ref, tagPickerGroupRef),\n );\n\n return {\n ...state,\n hasSelectedOptions,\n };\n};\n"],"names":["React","useTagGroup_unstable","useTagPickerContext_unstable","isHTMLElement","useEventCallback","useMergedRefs","tagPickerAppearanceToTagAppearance","tagPickerSizeToTagSize","useArrowNavigationGroup","ArrowRight","useTagPickerGroup_unstable","props","ref","hasSelectedOptions","ctx","selectedOptions","length","hasOneSelectedOption","triggerRef","tagPickerGroupRef","selectOption","size","appearance","disabled","arrowNavigationProps","circular","axis","memorizeCurrent","state","role","dismissible","onKeyDown","event","target","key","current","focus","onDismiss","data","value","id","text","isDefaultPrevented"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,uBAAuB;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WiB,OAAO,cAAlBjB,0CAAAA,oBAAoBkB,KAAK;YAC3B;QACF;QACAC,WAAWjC,iBAAiB,CAAC4B,OAAOM;YAClClB,aAAaY,OAAiF;gBAC5FO,OAAOD,KAAKC,KAAK;gBACjB,0EAA0E;gBAC1E,oEAAoE;gBACpEC,IAAI;gBACJC,MAAM;YACR;YACA,IAAIxB,wBAAwB,CAACe,MAAMU,kBAAkB,IAAI;oBACvDxB;iBAAAA,sBAAAA,WAAWiB,OAAO,cAAlBjB,0CAAAA,oBAAoBkB,KAAK;YAC3B;QACF;IACF,GACA/B,cAAcO,KAAKO;IAGrB,OAAO;QACL,GAAGS,KAAK;QACRf;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerGroup/useTagPickerGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerGroupSlots, TagPickerGroupState } from './TagPickerGroup.types';\nimport { useTagGroupStyles_unstable } from '@fluentui/react-tags';\nimport { tokens } from '@fluentui/react-theme';\nimport { tagSizeToTagPickerSize } from '../../utils/tagPicker2Tag';\n\nexport const tagPickerGroupClassNames: SlotClassNames<TagPickerGroupSlots> = {\n root: 'fui-TagPickerGroup',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n flexWrap: 'wrap',\n boxSizing: 'border-box',\n cursor: 'text',\n },\n // size variants\n medium: {\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n gap: tokens.spacingHorizontalXS,\n },\n large: {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n 'extra-large': {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n});\n\n/**\n * Apply styling to the TagPickerGroup slots based on the state\n */\nexport const useTagPickerGroupStyles_unstable = (state: TagPickerGroupState): TagPickerGroupState => {\n 'use no memo';\n\n useTagGroupStyles_unstable(state);\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerGroupClassNames.root,\n styles[tagSizeToTagPickerSize(state.size)],\n styles.root,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useTagGroupStyles_unstable","tokens","tagSizeToTagPickerSize","tagPickerGroupClassNames","root","useStyles","flexWrap","boxSizing","cursor","medium","padding","spacingVerticalSNudge","gap","spacingHorizontalXS","large","spacingVerticalS","spacingHorizontalSNudge","useTagPickerGroupStyles_unstable","state","styles","className","size"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerGroup/useTagPickerGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerGroupSlots, TagPickerGroupState } from './TagPickerGroup.types';\nimport { useTagGroupStyles_unstable } from '@fluentui/react-tags';\nimport { tokens } from '@fluentui/react-theme';\nimport { tagSizeToTagPickerSize } from '../../utils/tagPicker2Tag';\n\nexport const tagPickerGroupClassNames: SlotClassNames<TagPickerGroupSlots> = {\n root: 'fui-TagPickerGroup',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n flexWrap: 'wrap',\n boxSizing: 'border-box',\n cursor: 'text',\n },\n // size variants\n medium: {\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n gap: tokens.spacingHorizontalXS,\n },\n large: {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n 'extra-large': {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n});\n\n/**\n * Apply styling to the TagPickerGroup slots based on the state\n */\nexport const useTagPickerGroupStyles_unstable = (state: TagPickerGroupState): TagPickerGroupState => {\n 'use no memo';\n\n useTagGroupStyles_unstable(state);\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerGroupClassNames.root,\n styles[tagSizeToTagPickerSize(state.size)],\n styles.root,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useTagGroupStyles_unstable","tokens","tagSizeToTagPickerSize","tagPickerGroupClassNames","root","useStyles","flexWrap","boxSizing","cursor","medium","padding","spacingVerticalSNudge","gap","spacingHorizontalXS","large","spacingVerticalS","spacingHorizontalSNudge","useTagPickerGroupStyles_unstable","state","styles","className","size"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,SAASC,0BAA0B,QAAQ,uBAAuB;AAClE,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,sBAAsB,QAAQ,4BAA4B;AAEnE,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BM,MAAM;QACJE,UAAU;QACVC,WAAW;QACXC,QAAQ;IACV;IACA,gBAAgB;IAChBC,QAAQ;QACNC,SAAS,GAAGT,OAAOU,qBAAqB,CAAC,GAAG,EAAEV,OAAOU,qBAAqB,CAAC,EAAE,CAAC;QAC9EC,KAAKX,OAAOY,mBAAmB;IACjC;IACAC,OAAO;QACLJ,SAAS,GAAGT,OAAOc,gBAAgB,CAAC,GAAG,EAAEd,OAAOc,gBAAgB,CAAC,EAAE,CAAC;QACpEH,KAAKX,OAAOe,uBAAuB;IACrC;IACA,eAAe;QACbN,SAAS,GAAGT,OAAOc,gBAAgB,CAAC,GAAG,EAAEd,OAAOc,gBAAgB,CAAC,EAAE,CAAC;QACpEH,KAAKX,OAAOe,uBAAuB;IACrC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C;IAEAlB,2BAA2BkB;IAC3B,MAAMC,SAASd;IACfa,MAAMd,IAAI,CAACgB,SAAS,GAAGrB,aACrBI,yBAAyBC,IAAI,EAC7Be,MAAM,CAACjB,uBAAuBgB,MAAMG,IAAI,EAAE,EAC1CF,OAAOf,IAAI,EACXc,MAAMd,IAAI,CAACgB,SAAS;IAGtB,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerInput/TagPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerInput_unstable } from './useTagPickerInput';\nimport { renderTagPickerInput_unstable } from './renderTagPickerInput';\nimport { useTagPickerInputStyles_unstable } from './useTagPickerInputStyles.styles';\nimport type { TagPickerInputProps } from './TagPickerInput.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerInput component -\n * A TagPickerInput is a composite component that allows users to query tags.\n */\nexport const TagPickerInput: ForwardRefComponent<TagPickerInputProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerInput_unstable(props, ref);\n\n useTagPickerInputStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerInputStyles_unstable')(state);\n\n return renderTagPickerInput_unstable(state);\n});\n\nTagPickerInput.displayName = 'TagPickerInput';\n"],"names":["React","useTagPickerInput_unstable","renderTagPickerInput_unstable","useTagPickerInputStyles_unstable","useCustomStyleHook_unstable","TagPickerInput","forwardRef","props","ref","state","displayName"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/TagPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerInput_unstable } from './useTagPickerInput';\nimport { renderTagPickerInput_unstable } from './renderTagPickerInput';\nimport { useTagPickerInputStyles_unstable } from './useTagPickerInputStyles.styles';\nimport type { TagPickerInputProps } from './TagPickerInput.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerInput component -\n * A TagPickerInput is a composite component that allows users to query tags.\n */\nexport const TagPickerInput: ForwardRefComponent<TagPickerInputProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerInput_unstable(props, ref);\n\n useTagPickerInputStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerInputStyles_unstable')(state);\n\n return renderTagPickerInput_unstable(state);\n});\n\nTagPickerInput.displayName = 'TagPickerInput';\n"],"names":["React","useTagPickerInput_unstable","renderTagPickerInput_unstable","useTagPickerInputStyles_unstable","useCustomStyleHook_unstable","TagPickerInput","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAEpF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQR,2BAA2BM,OAAOC;IAEhDL,iCAAiCM;IACjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,8BAA8BO;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerInput/TagPickerInput.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ComboboxProps } from '@fluentui/react-combobox';\nimport { TagPickerContextValue } from '../../contexts/TagPickerContext';\n\nexport type TagPickerInputSlots = {\n root: NonNullable<Slot<'input'>>;\n};\n\n/**\n * TagPickerInput Props\n */\nexport type TagPickerInputProps = Omit<\n ComponentProps<Partial<TagPickerInputSlots>>,\n 'children' | 'size' | 'defaultValue'\n> &\n Pick<ComboboxProps, 'clearable' | 'appearance'> & {\n disabled?: boolean;\n value?: string;\n };\n\n/**\n * State used in rendering TagPickerInput\n */\nexport type TagPickerInputState = ComponentState<TagPickerInputSlots> &\n Pick<TagPickerContextValue, 'size' | 'disabled'>;\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/TagPickerInput.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ComboboxProps } from '@fluentui/react-combobox';\nimport { TagPickerContextValue } from '../../contexts/TagPickerContext';\n\nexport type TagPickerInputSlots = {\n root: NonNullable<Slot<'input'>>;\n};\n\n/**\n * TagPickerInput Props\n */\nexport type TagPickerInputProps = Omit<\n ComponentProps<Partial<TagPickerInputSlots>>,\n 'children' | 'size' | 'defaultValue'\n> &\n Pick<ComboboxProps, 'clearable' | 'appearance'> & {\n disabled?: boolean;\n value?: string;\n };\n\n/**\n * State used in rendering TagPickerInput\n */\nexport type TagPickerInputState = ComponentState<TagPickerInputSlots> &\n Pick<TagPickerContextValue, 'size' | 'disabled'>;\n"],"names":[],"mappings":"AAoBA;;CAEC,GACD,WACmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerInput/index.ts"],"sourcesContent":["export { TagPickerInput } from './TagPickerInput';\nexport type { TagPickerInputProps, TagPickerInputSlots, TagPickerInputState } from './TagPickerInput.types';\nexport { renderTagPickerInput_unstable } from './renderTagPickerInput';\nexport { useTagPickerInput_unstable } from './useTagPickerInput';\nexport { tagPickerInputClassNames, useTagPickerInputStyles_unstable } from './useTagPickerInputStyles.styles';\n"],"names":["TagPickerInput","renderTagPickerInput_unstable","useTagPickerInput_unstable","tagPickerInputClassNames","useTagPickerInputStyles_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/index.ts"],"sourcesContent":["export { TagPickerInput } from './TagPickerInput';\nexport type { TagPickerInputProps, TagPickerInputSlots, TagPickerInputState } from './TagPickerInput.types';\nexport { renderTagPickerInput_unstable } from './renderTagPickerInput';\nexport { useTagPickerInput_unstable } from './useTagPickerInput';\nexport { tagPickerInputClassNames, useTagPickerInputStyles_unstable } from './useTagPickerInputStyles.styles';\n"],"names":["TagPickerInput","renderTagPickerInput_unstable","useTagPickerInput_unstable","tagPickerInputClassNames","useTagPickerInputStyles_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,mBAAmB;AAElD,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,mCAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState) => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState) => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerInput/useTagPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport type { TagPickerInputProps, TagPickerInputState } from './TagPickerInput.types';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport {\n useMergedRefs,\n getIntrinsicElementProps,\n useEventCallback,\n useIsomorphicLayoutEffect,\n} from '@fluentui/react-utilities';\nimport { ArrowLeft, Backspace, Enter, Space } from '@fluentui/keyboard-keys';\nimport { useInputTriggerSlot } from '@fluentui/react-combobox';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { tagPickerInputCSSRules } from '../../utils/tokens';\nimport { useFocusFinders } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TagPickerInput.\n *\n * The returned state can be modified with hooks such as useTagPickerInputStyles_unstable,\n * before being passed to renderTagPickerInput_unstable.\n *\n * @param props - props from this instance of TagPickerInput\n * @param ref - reference to root HTMLDivElement of TagPickerInput\n */\nexport const useTagPickerInput_unstable = (\n propsArg: TagPickerInputProps,\n ref: React.Ref<HTMLInputElement>,\n): TagPickerInputState => {\n const props = useFieldControlProps_unstable(propsArg, {\n supportsLabelFor: true,\n supportsRequired: true,\n supportsSize: true,\n });\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const size = useTagPickerContext_unstable(ctx => ctx.size);\n const contextDisabled = useTagPickerContext_unstable(ctx => ctx.disabled);\n const tagPickerGroupRef = useTagPickerContext_unstable(ctx => ctx.tagPickerGroupRef);\n\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef as React.RefObject<HTMLInputElement>);\n const selectedOptions = useTagPickerContext_unstable(ctx => ctx.selectedOptions);\n const setValue = useTagPickerContext_unstable(ctx => ctx.setValue);\n const setOpen = useTagPickerContext_unstable(ctx => ctx.setOpen);\n const setHasFocus = useTagPickerContext_unstable(ctx => ctx.setHasFocus);\n const clearSelection = useTagPickerContext_unstable(ctx => ctx.clearSelection);\n const open = useTagPickerContext_unstable(ctx => ctx.open);\n const popoverId = useTagPickerContext_unstable(ctx => (ctx.noPopover ? undefined : ctx.popoverId));\n const selectOption = useTagPickerContext_unstable(ctx => ctx.selectOption);\n const getOptionById = useTagPickerContext_unstable(ctx => ctx.getOptionById);\n const contextValue = useTagPickerContext_unstable(ctx => ctx.value);\n\n useIsomorphicLayoutEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n setTagPickerInputStretchStyle(triggerRef.current);\n }, [selectedOptions, triggerRef]);\n\n useIsomorphicLayoutEffect(() => {\n if (triggerRef.current) {\n const input = triggerRef.current;\n const cb = () => setTagPickerInputStretchStyle(input);\n input.addEventListener('input', cb);\n return () => {\n input.removeEventListener('input', cb);\n };\n }\n }, [triggerRef]);\n\n const { value = contextValue, disabled = contextDisabled } = props;\n const { findLastFocusable } = useFocusFinders();\n\n const isTypingRef = React.useRef(false);\n\n const root = useInputTriggerSlot(\n {\n type: 'text',\n value: value ?? '',\n 'aria-controls': open ? popoverId : undefined,\n disabled,\n ...getIntrinsicElementProps('input', props),\n onKeyDown: useEventCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n props.onKeyDown?.(event);\n if (\n (event.key === ArrowLeft || event.key === Backspace) &&\n event.currentTarget.selectionStart === 0 &&\n event.currentTarget.selectionEnd === 0 &&\n tagPickerGroupRef.current\n ) {\n findLastFocusable(tagPickerGroupRef.current)?.focus();\n } else if (event.key === Space) {\n if (open && !isTypingRef.current) {\n setOpen(event, false);\n }\n } else if (event.key === Enter) {\n if (open) {\n ReactDOM.unstable_batchedUpdates(() => {\n setValue(undefined);\n setOpen(event, false);\n });\n } else {\n setOpen(event, true);\n }\n }\n isTypingRef.current =\n event.key.length === 1 && event.code !== Space && !event.altKey && !event.ctrlKey && !event.metaKey;\n }),\n },\n useMergedRefs(triggerRef, ref),\n {\n activeDescendantController,\n freeform: false,\n state: {\n clearSelection,\n getOptionById,\n open,\n selectedOptions,\n selectOption,\n setHasFocus,\n setOpen,\n setValue,\n multiselect: true,\n value: props.value,\n },\n },\n );\n\n const state: TagPickerInputState = {\n components: {\n root: 'input',\n },\n root,\n disabled,\n size,\n };\n\n return state;\n};\n\n/**\n * while typing the user might need a bit more of space to see the text,\n * which means the input should stretch to 100% width\n * occupying a whole new line.\n *\n * This function will set the CSS variable `--width` to `100%` if the scrollWidth is greater than the offsetWidth,\n * meaning the text is overflowing the input.\n *\n * @param input - input element to apply the style\n * @returns void\n */\nconst setTagPickerInputStretchStyle = (input: HTMLInputElement) => {\n // first we need to remove the CSS variable\n // to properly calculate the difference between scrollWidth and offsetWidth\n input.style.removeProperty(tagPickerInputCSSRules.width);\n if (input.scrollWidth > input.offsetWidth + 1) {\n input.style.setProperty(tagPickerInputCSSRules.width, '100%');\n } else {\n input.style.removeProperty(tagPickerInputCSSRules.width);\n }\n};\n"],"names":["React","ReactDOM","useActiveDescendantContext","useTagPickerContext_unstable","useMergedRefs","getIntrinsicElementProps","useEventCallback","useIsomorphicLayoutEffect","ArrowLeft","Backspace","Enter","Space","useInputTriggerSlot","useFieldControlProps_unstable","tagPickerInputCSSRules","useFocusFinders","useTagPickerInput_unstable","propsArg","ref","props","supportsLabelFor","supportsRequired","supportsSize","controller","activeDescendantController","size","ctx","contextDisabled","disabled","tagPickerGroupRef","triggerRef","selectedOptions","setValue","setOpen","setHasFocus","clearSelection","open","popoverId","noPopover","undefined","selectOption","getOptionById","contextValue","value","current","setTagPickerInputStretchStyle","input","cb","addEventListener","removeEventListener","findLastFocusable","isTypingRef","useRef","root","type","onKeyDown","event","key","currentTarget","selectionStart","selectionEnd","focus","unstable_batchedUpdates","length","code","altKey","ctrlKey","metaKey","freeform","state","multiselect","components","style","removeProperty","width","scrollWidth","offsetWidth","setProperty"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M0B,KAAK,CAACC,cAAc,CAAC3D,uBAAuB4D,KAAK;IACzD;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/useTagPickerInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport type { TagPickerInputProps, TagPickerInputState } from './TagPickerInput.types';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport {\n useMergedRefs,\n getIntrinsicElementProps,\n useEventCallback,\n useIsomorphicLayoutEffect,\n} from '@fluentui/react-utilities';\nimport { ArrowLeft, Backspace, Enter, Space } from '@fluentui/keyboard-keys';\nimport { useInputTriggerSlot } from '@fluentui/react-combobox';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { tagPickerInputCSSRules } from '../../utils/tokens';\nimport { useFocusFinders } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render TagPickerInput.\n *\n * The returned state can be modified with hooks such as useTagPickerInputStyles_unstable,\n * before being passed to renderTagPickerInput_unstable.\n *\n * @param props - props from this instance of TagPickerInput\n * @param ref - reference to root HTMLDivElement of TagPickerInput\n */\nexport const useTagPickerInput_unstable = (\n propsArg: TagPickerInputProps,\n ref: React.Ref<HTMLInputElement>,\n): TagPickerInputState => {\n const props = useFieldControlProps_unstable(propsArg, {\n supportsLabelFor: true,\n supportsRequired: true,\n supportsSize: true,\n });\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const size = useTagPickerContext_unstable(ctx => ctx.size);\n const contextDisabled = useTagPickerContext_unstable(ctx => ctx.disabled);\n const tagPickerGroupRef = useTagPickerContext_unstable(ctx => ctx.tagPickerGroupRef);\n\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef as React.RefObject<HTMLInputElement>);\n const selectedOptions = useTagPickerContext_unstable(ctx => ctx.selectedOptions);\n const setValue = useTagPickerContext_unstable(ctx => ctx.setValue);\n const setOpen = useTagPickerContext_unstable(ctx => ctx.setOpen);\n const setHasFocus = useTagPickerContext_unstable(ctx => ctx.setHasFocus);\n const clearSelection = useTagPickerContext_unstable(ctx => ctx.clearSelection);\n const open = useTagPickerContext_unstable(ctx => ctx.open);\n const popoverId = useTagPickerContext_unstable(ctx => (ctx.noPopover ? undefined : ctx.popoverId));\n const selectOption = useTagPickerContext_unstable(ctx => ctx.selectOption);\n const getOptionById = useTagPickerContext_unstable(ctx => ctx.getOptionById);\n const contextValue = useTagPickerContext_unstable(ctx => ctx.value);\n\n useIsomorphicLayoutEffect(() => {\n if (!triggerRef.current) {\n return;\n }\n setTagPickerInputStretchStyle(triggerRef.current);\n }, [selectedOptions, triggerRef]);\n\n useIsomorphicLayoutEffect(() => {\n if (triggerRef.current) {\n const input = triggerRef.current;\n const cb = () => setTagPickerInputStretchStyle(input);\n input.addEventListener('input', cb);\n return () => {\n input.removeEventListener('input', cb);\n };\n }\n }, [triggerRef]);\n\n const { value = contextValue, disabled = contextDisabled } = props;\n const { findLastFocusable } = useFocusFinders();\n\n const isTypingRef = React.useRef(false);\n\n const root = useInputTriggerSlot(\n {\n type: 'text',\n value: value ?? '',\n 'aria-controls': open ? popoverId : undefined,\n disabled,\n ...getIntrinsicElementProps('input', props),\n onKeyDown: useEventCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n props.onKeyDown?.(event);\n if (\n (event.key === ArrowLeft || event.key === Backspace) &&\n event.currentTarget.selectionStart === 0 &&\n event.currentTarget.selectionEnd === 0 &&\n tagPickerGroupRef.current\n ) {\n findLastFocusable(tagPickerGroupRef.current)?.focus();\n } else if (event.key === Space) {\n if (open && !isTypingRef.current) {\n setOpen(event, false);\n }\n } else if (event.key === Enter) {\n if (open) {\n ReactDOM.unstable_batchedUpdates(() => {\n setValue(undefined);\n setOpen(event, false);\n });\n } else {\n setOpen(event, true);\n }\n }\n isTypingRef.current =\n event.key.length === 1 && event.code !== Space && !event.altKey && !event.ctrlKey && !event.metaKey;\n }),\n },\n useMergedRefs(triggerRef, ref),\n {\n activeDescendantController,\n freeform: false,\n state: {\n clearSelection,\n getOptionById,\n open,\n selectedOptions,\n selectOption,\n setHasFocus,\n setOpen,\n setValue,\n multiselect: true,\n value: props.value,\n },\n },\n );\n\n const state: TagPickerInputState = {\n components: {\n root: 'input',\n },\n root,\n disabled,\n size,\n };\n\n return state;\n};\n\n/**\n * while typing the user might need a bit more of space to see the text,\n * which means the input should stretch to 100% width\n * occupying a whole new line.\n *\n * This function will set the CSS variable `--width` to `100%` if the scrollWidth is greater than the offsetWidth,\n * meaning the text is overflowing the input.\n *\n * @param input - input element to apply the style\n * @returns void\n */\nconst setTagPickerInputStretchStyle = (input: HTMLInputElement) => {\n // first we need to remove the CSS variable\n // to properly calculate the difference between scrollWidth and offsetWidth\n input.style.removeProperty(tagPickerInputCSSRules.width);\n if (input.scrollWidth > input.offsetWidth + 1) {\n input.style.setProperty(tagPickerInputCSSRules.width, '100%');\n } else {\n input.style.removeProperty(tagPickerInputCSSRules.width);\n }\n};\n"],"names":["React","ReactDOM","useActiveDescendantContext","useTagPickerContext_unstable","useMergedRefs","getIntrinsicElementProps","useEventCallback","useIsomorphicLayoutEffect","ArrowLeft","Backspace","Enter","Space","useInputTriggerSlot","useFieldControlProps_unstable","tagPickerInputCSSRules","useFocusFinders","useTagPickerInput_unstable","propsArg","ref","props","supportsLabelFor","supportsRequired","supportsSize","controller","activeDescendantController","size","ctx","contextDisabled","disabled","tagPickerGroupRef","triggerRef","selectedOptions","setValue","setOpen","setHasFocus","clearSelection","open","popoverId","noPopover","undefined","selectOption","getOptionById","contextValue","value","current","setTagPickerInputStretchStyle","input","cb","addEventListener","removeEventListener","findLastFocusable","isTypingRef","useRef","root","type","onKeyDown","event","key","currentTarget","selectionStart","selectionEnd","focus","unstable_batchedUpdates","length","code","altKey","ctrlKey","metaKey","freeform","state","multiselect","components","style","removeProperty","width","scrollWidth","offsetWidth","setProperty"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,YAAYC,cAAc,YAAY;AA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erInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles, tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerInputSlots, TagPickerInputState } from './TagPickerInput.types';\nimport { tagPickerInputTokens } from '../../utils/tokens';\n\nexport const tagPickerInputClassNames: SlotClassNames<TagPickerInputSlots> = {\n root: 'fui-TagPickerInput',\n};\n\nconst useBaseStyle = makeResetStyles({\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n boxSizing: 'border-box',\n\n '&:focus': {\n outlineStyle: 'none',\n },\n '&::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1,\n },\n '&::after': {\n visibility: 'hidden',\n whiteSpace: 'pre-wrap',\n },\n border: 'none',\n minWidth: '24px',\n maxWidth: '100%',\n // by default width is 0,\n // it will be calculated based on the requirement of stretching the component to 100% width\n // see setTagPickerInputStretchStyle method for more details\n width: tagPickerInputTokens.width,\n flexGrow: 1,\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n // size variants\n medium: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n },\n large: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalMNudge} 0 ${tokens.spacingVerticalMNudge} 0`,\n },\n 'extra-large': {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalM} 0 ${tokens.spacingVerticalM} 0`,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/**\n * Apply styling to the TagPickerInput slots based on the state\n */\nexport const useTagPickerInputStyles_unstable = (state: TagPickerInputState): TagPickerInputState => {\n 'use no memo';\n\n const baseStyle = useBaseStyle();\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerInputClassNames.root,\n baseStyle,\n styles[state.size],\n state.disabled && styles.disabled,\n state.root.className,\n );\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","typographyStyles","tokens","tagPickerInputTokens","tagPickerInputClassNames","root","useBaseStyle","backgroundColor","colorTransparentBackground","color","colorNeutralForeground1","fontFamily","fontFamilyBase","boxSizing","outlineStyle","colorNeutralForeground4","opacity","visibility","whiteSpace","border","minWidth","maxWidth","width","flexGrow","useStyles","medium","body1","padding","spacingVerticalSNudge","large","spacingVerticalMNudge","spacingVerticalM","disabled","colorNeutralForegroundDisabled","cursor","useTagPickerInputStyles_unstable","state","baseStyle","styles","className","size"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/useTagPickerInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles, tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerInputSlots, TagPickerInputState } from './TagPickerInput.types';\nimport { tagPickerInputTokens } from '../../utils/tokens';\n\nexport const tagPickerInputClassNames: SlotClassNames<TagPickerInputSlots> = {\n root: 'fui-TagPickerInput',\n};\n\nconst useBaseStyle = makeResetStyles({\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n boxSizing: 'border-box',\n\n '&:focus': {\n outlineStyle: 'none',\n },\n '&::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1,\n },\n '&::after': {\n visibility: 'hidden',\n whiteSpace: 'pre-wrap',\n },\n border: 'none',\n minWidth: '24px',\n maxWidth: '100%',\n // by default width is 0,\n // it will be calculated based on the requirement of stretching the component to 100% width\n // see setTagPickerInputStretchStyle method for more details\n width: tagPickerInputTokens.width,\n flexGrow: 1,\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n // size variants\n medium: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n },\n large: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalMNudge} 0 ${tokens.spacingVerticalMNudge} 0`,\n },\n 'extra-large': {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalM} 0 ${tokens.spacingVerticalM} 0`,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/**\n * Apply styling to the TagPickerInput slots based on the state\n */\nexport const useTagPickerInputStyles_unstable = (state: TagPickerInputState): TagPickerInputState => {\n 'use no memo';\n\n const baseStyle = useBaseStyle();\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerInputClassNames.root,\n baseStyle,\n styles[state.size],\n state.disabled && styles.disabled,\n state.root.className,\n );\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","typographyStyles","tokens","tagPickerInputTokens","tagPickerInputClassNames","root","useBaseStyle","backgroundColor","colorTransparentBackground","color","colorNeutralForeground1","fontFamily","fontFamilyBase","boxSizing","outlineStyle","colorNeutralForeground4","opacity","visibility","whiteSpace","border","minWidth","maxWidth","width","flexGrow","useStyles","medium","body1","padding","spacingVerticalSNudge","large","spacingVerticalMNudge","spacingVerticalM","disabled","colorNeutralForegroundDisabled","cursor","useTagPickerInputStyles_unstable","state","baseStyle","styles","className","size"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC3E,SAASC,gBAAgB,EAAEC,MAAM,QAAQ,wBAAwB;AAGjE,SAASC,oBAAoB,QAAQ,qBAAqB;AAE1D,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF,MAAMC,eAAeR,gBAAgB;IACnCS,iBAAiBL,OAAOM,0BAA0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MAAM/B,IAAI,CAACkC,SAAS;IAEtB,OAAOH;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/TagPickerList.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerList_unstable } from './useTagPickerList';\nimport { renderTagPickerList_unstable } from './renderTagPickerList';\nimport { useTagPickerListStyles_unstable } from './useTagPickerListStyles.styles';\nimport type { TagPickerListProps } from './TagPickerList.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerList component -\n * A TagPickerList is a composite component that allows users to display a list of tag options to be selected.\n */\nexport const TagPickerList: ForwardRefComponent<TagPickerListProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerList_unstable(props, ref);\n\n useTagPickerListStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerListStyles_unstable')(state);\n return renderTagPickerList_unstable(state);\n});\n\nTagPickerList.displayName = 'TagPickerList';\n"],"names":["React","useTagPickerList_unstable","renderTagPickerList_unstable","useTagPickerListStyles_unstable","useCustomStyleHook_unstable","TagPickerList","forwardRef","props","ref","state","displayName"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/TagPickerList.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerList_unstable } from './useTagPickerList';\nimport { renderTagPickerList_unstable } from './renderTagPickerList';\nimport { useTagPickerListStyles_unstable } from './useTagPickerListStyles.styles';\nimport type { TagPickerListProps } from './TagPickerList.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerList component -\n * A TagPickerList is a composite component that allows users to display a list of tag options to be selected.\n */\nexport const TagPickerList: ForwardRefComponent<TagPickerListProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerList_unstable(props, ref);\n\n useTagPickerListStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerListStyles_unstable')(state);\n return renderTagPickerList_unstable(state);\n});\n\nTagPickerList.displayName = 'TagPickerList';\n"],"names":["React","useTagPickerList_unstable","renderTagPickerList_unstable","useTagPickerListStyles_unstable","useCustomStyleHook_unstable","TagPickerList","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAElF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQR,0BAA0BM,OAAOC;IAE/CL,gCAAgCM;IAChCL,4BAA4B,mCAAmCK;IAC/D,OAAOP,6BAA6BO;AACtC,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/TagPickerList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { Listbox } from '@fluentui/react-combobox';\nimport { TagPickerContextValue } from '../../contexts/TagPickerContext';\n\nexport type TagPickerListSlots = {\n root: Slot<typeof Listbox>;\n};\n\n/**\n * TagPickerList Props\n */\nexport type TagPickerListProps = ComponentProps<TagPickerListSlots>;\n\n/**\n * State used in rendering TagPickerList\n */\nexport type TagPickerListState = ComponentState<TagPickerListSlots> & Pick<TagPickerContextValue, 'open'>;\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/TagPickerList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { Listbox } from '@fluentui/react-combobox';\nimport { TagPickerContextValue } from '../../contexts/TagPickerContext';\n\nexport type TagPickerListSlots = {\n root: Slot<typeof Listbox>;\n};\n\n/**\n * TagPickerList Props\n */\nexport type TagPickerListProps = ComponentProps<TagPickerListSlots>;\n\n/**\n * State used in rendering TagPickerList\n */\nexport type TagPickerListState = ComponentState<TagPickerListSlots> & Pick<TagPickerContextValue, 'open'>;\n"],"names":[],"mappings":"AAaA;;CAEC,GACD,WAA0G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/index.ts"],"sourcesContent":["export { TagPickerList } from './TagPickerList';\nexport type { TagPickerListProps, TagPickerListSlots, TagPickerListState } from './TagPickerList.types';\nexport { renderTagPickerList_unstable } from './renderTagPickerList';\nexport { useTagPickerList_unstable } from './useTagPickerList';\nexport { tagPickerListClassNames, useTagPickerListStyles_unstable } from './useTagPickerListStyles.styles';\n"],"names":["TagPickerList","renderTagPickerList_unstable","useTagPickerList_unstable","tagPickerListClassNames","useTagPickerListStyles_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/index.ts"],"sourcesContent":["export { TagPickerList } from './TagPickerList';\nexport type { TagPickerListProps, TagPickerListSlots, TagPickerListState } from './TagPickerList.types';\nexport { renderTagPickerList_unstable } from './renderTagPickerList';\nexport { useTagPickerList_unstable } from './useTagPickerList';\nexport { tagPickerListClassNames, useTagPickerListStyles_unstable } from './useTagPickerListStyles.styles';\n"],"names":["TagPickerList","renderTagPickerList_unstable","useTagPickerList_unstable","tagPickerListClassNames","useTagPickerListStyles_unstable"],"mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,uBAAuB,EAAEC,+BAA+B,QAAQ,kCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState) => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState) => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAChC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/useTagPickerList.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerListProps, TagPickerListState } from './TagPickerList.types';\nimport { Listbox } from '@fluentui/react-combobox';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useListboxSlot } from '@fluentui/react-combobox';\n\n/**\n * Create the state required to render TagPickerList.\n *\n * The returned state can be modified with hooks such as useTagPickerListStyles_unstable,\n * before being passed to renderTagPickerList_unstable.\n *\n * @param props - props from this instance of TagPickerList\n * @param ref - reference to root HTMLDivElement of TagPickerList\n */\nexport const useTagPickerList_unstable = (\n props: TagPickerListProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerListState => {\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef) as\n | React.RefObject<HTMLInputElement>\n | React.RefObject<HTMLButtonElement>;\n const popoverRef = useTagPickerContext_unstable(ctx => ctx.popoverRef);\n const popoverId = useTagPickerContext_unstable(ctx => ctx.popoverId);\n const open = useTagPickerContext_unstable(ctx => ctx.open);\n\n return {\n open,\n components: {\n root: Listbox,\n },\n root: slot.always(\n {\n ...useListboxSlot(props, useMergedRefs(popoverRef, ref), {\n state: { multiselect: true },\n triggerRef,\n defaultProps: { id: popoverId },\n }),\n role: 'listbox',\n },\n { elementType: Listbox },\n ),\n };\n};\n"],"names":["React","Listbox","useTagPickerContext_unstable","slot","useMergedRefs","useListboxSlot","useTagPickerList_unstable","props","ref","triggerRef","ctx","popoverRef","popoverId","open","components","root","always","state","multiselect","defaultProps","id","role","elementType"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/useTagPickerList.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerListProps, TagPickerListState } from './TagPickerList.types';\nimport { Listbox } from '@fluentui/react-combobox';\nimport { useTagPickerContext_unstable } from '../../contexts/TagPickerContext';\nimport { slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useListboxSlot } from '@fluentui/react-combobox';\n\n/**\n * Create the state required to render TagPickerList.\n *\n * The returned state can be modified with hooks such as useTagPickerListStyles_unstable,\n * before being passed to renderTagPickerList_unstable.\n *\n * @param props - props from this instance of TagPickerList\n * @param ref - reference to root HTMLDivElement of TagPickerList\n */\nexport const useTagPickerList_unstable = (\n props: TagPickerListProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerListState => {\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef) as\n | React.RefObject<HTMLInputElement>\n | React.RefObject<HTMLButtonElement>;\n const popoverRef = useTagPickerContext_unstable(ctx => ctx.popoverRef);\n const popoverId = useTagPickerContext_unstable(ctx => ctx.popoverId);\n const open = useTagPickerContext_unstable(ctx => ctx.open);\n\n return {\n open,\n components: {\n root: Listbox,\n },\n root: slot.always(\n {\n ...useListboxSlot(props, useMergedRefs(popoverRef, ref), {\n state: { multiselect: true },\n triggerRef,\n defaultProps: { id: popoverId },\n }),\n role: 'listbox',\n },\n { elementType: Listbox },\n ),\n };\n};\n"],"names":["React","Listbox","useTagPickerContext_unstable","slot","useMergedRefs","useListboxSlot","useTagPickerList_unstable","props","ref","triggerRef","ctx","popoverRef","popoverId","open","components","root","always","state","multiselect","defaultProps","id","role","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,OAAO,QAAQ,2BAA2B;AACnD,SAASC,4BAA4B,QAAQ,kCAAkC;AAC/E,SAASC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAChE,SAASC,cAAc,QAAQ,2BAA2B;AAE1D;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,aAAaP,6BAA6BQ,CAAAA,MAAOA,IAAID,UAAU;IAGrE,MAAME,aAAaT,6BAA6BQ,CAAAA,MAAOA,IAAIC,UAAU;IACrE,MAAMC,YAAYV,6BAA6BQ,CAAAA,MAAOA,IAAIE,SAAS;IACnE,MAAMC,OAAOX,6BAA6BQ,CAAAA,MAAOA,IAAIG,IAAI;IAEzD,OAAO;QACLA;QACAC,YAAY;YACVC,MAAMd;QACR;QACAc,MAAMZ,KAAKa,MAAM,CACf;YACE,GAAGX,eAAeE,OAAOH,cAAcO,YAAYH,MAAM;gBACvDS,OAAO;oBAAEC,aAAa;gBAAK;gBAC3BT;gBACAU,cAAc;oBAAEC,IAAIR;gBAAU;YAChC,EAAE;YACFS,MAAM;QACR,GACA;YAAEC,aAAarB;QAAQ;IAE3B;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerList/useTagPickerListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerListSlots, TagPickerListState } from './TagPickerList.types';\n\nexport const tagPickerListClassNames: SlotClassNames<TagPickerListSlots> = {\n root: 'fui-TagPickerList',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n boxShadow: `${tokens.shadow16}`,\n borderRadius: tokens.borderRadiusMedium,\n maxHeight: '80vh',\n boxSizing: 'border-box',\n },\n\n collapsed: {\n display: 'none',\n },\n});\n\n/**\n * Apply styling to the TagPickerList slots based on the state\n */\nexport const useTagPickerListStyles_unstable = (state: TagPickerListState): TagPickerListState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerListClassNames.root,\n styles.root,\n !state.open && styles.collapsed,\n state.root.className,\n );\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","tagPickerListClassNames","root","useStyles","boxShadow","shadow16","borderRadius","borderRadiusMedium","maxHeight","boxSizing","collapsed","display","useTagPickerListStyles_unstable","state","styles","className","open"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerList/useTagPickerListStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerListSlots, TagPickerListState } from './TagPickerList.types';\n\nexport const tagPickerListClassNames: SlotClassNames<TagPickerListSlots> = {\n root: 'fui-TagPickerList',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n boxShadow: `${tokens.shadow16}`,\n borderRadius: tokens.borderRadiusMedium,\n maxHeight: '80vh',\n boxSizing: 'border-box',\n },\n\n collapsed: {\n display: 'none',\n },\n});\n\n/**\n * Apply styling to the TagPickerList slots based on the state\n */\nexport const useTagPickerListStyles_unstable = (state: TagPickerListState): TagPickerListState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerListClassNames.root,\n styles.root,\n !state.open && styles.collapsed,\n state.root.className,\n );\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","tagPickerListClassNames","root","useStyles","boxShadow","shadow16","borderRadius","borderRadiusMedium","maxHeight","boxSizing","collapsed","display","useTagPickerListStyles_unstable","state","styles","className","open"],"mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,MAAM,QAAQ,wBAAwB;AAI/C,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYL,WAAW;IAC3BI,MAAM;QACJE,WAAW,GAAGJ,OAAOK,QAAQ,EAAE;QAC/BC,cAAcN,OAAOO,kBAAkB;QACvCC,WAAW;QACXC,WAAW;IACb;IAEAC,WAAW;QACTC,SAAS;IACX;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAMC,SAASX;IACfU,MAAMX,IAAI,CAACa,SAAS,GAAGhB,aACrBE,wBAAwBC,IAAI,EAC5BY,OAAOZ,IAAI,EACX,CAACW,MAAMG,IAAI,IAAIF,OAAOJ,SAAS,EAC/BG,MAAMX,IAAI,CAACa,SAAS;IAEtB,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/TagPickerOption.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerOption_unstable } from './useTagPickerOption';\nimport { renderTagPickerOption_unstable } from './renderTagPickerOption';\nimport { useTagPickerOptionStyles_unstable } from './useTagPickerOptionStyles.styles';\nimport type { TagPickerOptionProps } from './TagPickerOption.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerOption component -\n * A TagPickerOption is a composite component that allows users to select tags.\n */\nexport const TagPickerOption: ForwardRefComponent<TagPickerOptionProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerOption_unstable(props, ref);\n\n useTagPickerOptionStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerOptionStyles_unstable')(state);\n return renderTagPickerOption_unstable(state);\n});\n\nTagPickerOption.displayName = 'TagPickerOption';\n"],"names":["React","useTagPickerOption_unstable","renderTagPickerOption_unstable","useTagPickerOptionStyles_unstable","useCustomStyleHook_unstable","TagPickerOption","forwardRef","props","ref","state","displayName"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/TagPickerOption.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerOption_unstable } from './useTagPickerOption';\nimport { renderTagPickerOption_unstable } from './renderTagPickerOption';\nimport { useTagPickerOptionStyles_unstable } from './useTagPickerOptionStyles.styles';\nimport type { TagPickerOptionProps } from './TagPickerOption.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerOption component -\n * A TagPickerOption is a composite component that allows users to select tags.\n */\nexport const TagPickerOption: ForwardRefComponent<TagPickerOptionProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerOption_unstable(props, ref);\n\n useTagPickerOptionStyles_unstable(state);\n useCustomStyleHook_unstable('useTagPickerOptionStyles_unstable')(state);\n return renderTagPickerOption_unstable(state);\n});\n\nTagPickerOption.displayName = 'TagPickerOption';\n"],"names":["React","useTagPickerOption_unstable","renderTagPickerOption_unstable","useTagPickerOptionStyles_unstable","useCustomStyleHook_unstable","TagPickerOption","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,oCAAoC;AAEtF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,gCAA6DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQR,4BAA4BM,OAAOC;IAEjDL,kCAAkCM;IAClCL,4BAA4B,qCAAqCK;IACjE,OAAOP,+BAA+BO;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/TagPickerOption.types.ts"],"sourcesContent":["import { OptionSlots, OptionState } from '@fluentui/react-combobox';\nimport { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type TagPickerOptionSlots = Pick<OptionSlots, 'root'> & {\n media?: Slot<'div'>;\n secondaryContent?: Slot<'span'>;\n};\n\n/**\n * TagPickerOption Props\n */\nexport type TagPickerOptionProps = ComponentProps<TagPickerOptionSlots> & {\n value: string;\n} & (\n | {\n /**\n * An optional override the string value of the Option's display text,\n * defaulting to the Option's child content.\n * This is used as the Dropdown button's or Combobox input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text?: string;\n children: string;\n }\n | {\n /**\n * The string value of the Option's display text when the Option's children are not a string.\n * This is used as the Dropdown button's or Combobox input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text: string;\n children?: React.ReactNode;\n }\n );\n\n/**\n * State used in rendering TagPickerOption\n */\nexport type TagPickerOptionState = ComponentState<TagPickerOptionSlots> & Pick<OptionState, 'components' | 'root'>;\n"],"names":["React"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/TagPickerOption.types.ts"],"sourcesContent":["import { OptionSlots, OptionState } from '@fluentui/react-combobox';\nimport { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type TagPickerOptionSlots = Pick<OptionSlots, 'root'> & {\n media?: Slot<'div'>;\n secondaryContent?: Slot<'span'>;\n};\n\n/**\n * TagPickerOption Props\n */\nexport type TagPickerOptionProps = ComponentProps<TagPickerOptionSlots> & {\n value: string;\n} & (\n | {\n /**\n * An optional override the string value of the Option's display text,\n * defaulting to the Option's child content.\n * This is used as the Dropdown button's or Combobox input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text?: string;\n children: string;\n }\n | {\n /**\n * The string value of the Option's display text when the Option's children are not a string.\n * This is used as the Dropdown button's or Combobox input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text: string;\n children?: React.ReactNode;\n }\n );\n\n/**\n * State used in rendering TagPickerOption\n */\nexport type TagPickerOptionState = ComponentState<TagPickerOptionSlots> & Pick<OptionState, 'components' | 'root'>;\n"],"names":["React"],"mappings":"AAEA,YAAYA,WAAW,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/index.ts"],"sourcesContent":["export { TagPickerOption } from './TagPickerOption';\nexport type { TagPickerOptionProps, TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nexport { renderTagPickerOption_unstable } from './renderTagPickerOption';\nexport { useTagPickerOption_unstable } from './useTagPickerOption';\nexport { tagPickerOptionClassNames, useTagPickerOptionStyles_unstable } from './useTagPickerOptionStyles.styles';\n"],"names":["TagPickerOption","renderTagPickerOption_unstable","useTagPickerOption_unstable","tagPickerOptionClassNames","useTagPickerOptionStyles_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/index.ts"],"sourcesContent":["export { TagPickerOption } from './TagPickerOption';\nexport type { TagPickerOptionProps, TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nexport { renderTagPickerOption_unstable } from './renderTagPickerOption';\nexport { useTagPickerOption_unstable } from './useTagPickerOption';\nexport { tagPickerOptionClassNames, useTagPickerOptionStyles_unstable } from './useTagPickerOptionStyles.styles';\n"],"names":["TagPickerOption","renderTagPickerOption_unstable","useTagPickerOption_unstable","tagPickerOptionClassNames","useTagPickerOptionStyles_unstable"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AAEpD,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,yBAAyB,EAAEC,iCAAiC,QAAQ,oCAAoC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState) => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState) => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,KAAK,kBAAI,KAACF,MAAME,KAAK;YAC3BF,MAAMC,IAAI,CAACE,QAAQ;YACnBH,MAAMI,gBAAgB,kBAAI,KAACJ,MAAMI,gBAAgB;;;AAGxD,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOption.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useOption_unstable } from '@fluentui/react-combobox';\nimport type { TagPickerOptionProps, TagPickerOptionState } from './TagPickerOption.types';\n\n/**\n * Create the state required to render TagPickerOption.\n *\n * The returned state can be modified with hooks such as useTagPickerOptionStyles_unstable,\n * before being passed to renderTagPickerOption_unstable.\n *\n * @param props - props from this instance of TagPickerOption\n * @param ref - reference to root HTMLDivElement of TagPickerOption\n */\nexport const useTagPickerOption_unstable = (\n props: TagPickerOptionProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerOptionState => {\n const optionState = useOption_unstable(props, ref);\n const state: TagPickerOptionState = {\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...optionState.components,\n media: 'div',\n secondaryContent: 'span',\n },\n media: slot.optional(props.media, {\n elementType: 'div',\n }),\n secondaryContent: slot.optional(props.secondaryContent, {\n elementType: 'span',\n }),\n root: slot.always(\n { ...optionState.root, role: 'option', 'aria-checked': props['aria-checked'] },\n {\n elementType: 'div',\n },\n ),\n };\n\n return state;\n};\n"],"names":["React","slot","useOption_unstable","useTagPickerOption_unstable","props","ref","optionState","state","components","media","secondaryContent","optional","elementType","root","always","role"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOption.ts"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport { useOption_unstable } from '@fluentui/react-combobox';\nimport type { TagPickerOptionProps, TagPickerOptionState } from './TagPickerOption.types';\n\n/**\n * Create the state required to render TagPickerOption.\n *\n * The returned state can be modified with hooks such as useTagPickerOptionStyles_unstable,\n * before being passed to renderTagPickerOption_unstable.\n *\n * @param props - props from this instance of TagPickerOption\n * @param ref - reference to root HTMLDivElement of TagPickerOption\n */\nexport const useTagPickerOption_unstable = (\n props: TagPickerOptionProps,\n ref: React.Ref<HTMLDivElement>,\n): TagPickerOptionState => {\n const optionState = useOption_unstable(props, ref);\n const state: TagPickerOptionState = {\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...optionState.components,\n media: 'div',\n secondaryContent: 'span',\n },\n media: slot.optional(props.media, {\n elementType: 'div',\n }),\n secondaryContent: slot.optional(props.secondaryContent, {\n elementType: 'span',\n }),\n root: slot.always(\n { ...optionState.root, role: 'option', 'aria-checked': props['aria-checked'] },\n {\n elementType: 'div',\n },\n ),\n };\n\n return state;\n};\n"],"names":["React","slot","useOption_unstable","useTagPickerOption_unstable","props","ref","optionState","state","components","media","secondaryContent","optional","elementType","root","always","role"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,kBAAkB,QAAQ,2BAA2B;AAG9D;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAMC,cAAcJ,mBAAmBE,OAAOC;IAC9C,MAAME,QAA8B;QAClCC,YAAY;YACV,4DAA4D;YAC5D,GAAGF,YAAYE,UAAU;YACzBC,OAAO;YACPC,kBAAkB;QACpB;QACAD,OAAOR,KAAKU,QAAQ,CAACP,MAAMK,KAAK,EAAE;YAChCG,aAAa;QACf;QACAF,kBAAkBT,KAAKU,QAAQ,CAACP,MAAMM,gBAAgB,EAAE;YACtDE,aAAa;QACf;QACAC,MAAMZ,KAAKa,MAAM,CACf;YAAE,GAAGR,YAAYO,IAAI;YAAEE,MAAM;YAAU,gBAAgBX,KAAK,CAAC,eAAe;QAAC,GAC7E;YACEQ,aAAa;QACf;IAEJ;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOptionStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nimport { useOptionStyles_unstable } from '@fluentui/react-combobox';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tagPickerOptionClassNames: SlotClassNames<TagPickerOptionSlots> = {\n root: 'fui-TagPickerOption',\n media: 'fui-TagPickerOption__media',\n secondaryContent: 'fui-TagPickerOption__secondaryContent',\n};\n\nconst useRootBaseStyle = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst useRootStyles = makeStyles({\n secondaryContent: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n },\n});\n\nconst useSecondaryContentBaseStyle = makeResetStyles({\n gridColumnStart: 2,\n gridRowStart: 2,\n ...typographyStyles.caption1,\n});\n\nconst useMediaBaseStyle = makeResetStyles({\n gridRowStart: 'span 2',\n});\n\n/**\n * Apply styling to the TagPickerOption slots based on the state\n */\nexport const useTagPickerOptionStyles_unstable = (state: TagPickerOptionState): TagPickerOptionState => {\n 'use no memo';\n\n const rootBaseStyle = useRootBaseStyle();\n const rootStyles = useRootStyles();\n const secondaryContentBaseStyle = useSecondaryContentBaseStyle();\n const mediaBaseStyle = useMediaBaseStyle();\n\n state.root.className = mergeClasses(\n tagPickerOptionClassNames.root,\n rootBaseStyle,\n state.secondaryContent && rootStyles.secondaryContent,\n state.root.className,\n );\n useOptionStyles_unstable({\n ...state,\n active: false,\n disabled: false,\n focusVisible: false,\n checkIcon: undefined,\n selected: false,\n });\n if (state.media) {\n state.media.className = mergeClasses(tagPickerOptionClassNames.media, mediaBaseStyle, state.media.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n tagPickerOptionClassNames.secondaryContent,\n secondaryContentBaseStyle,\n state.secondaryContent.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","useOptionStyles_unstable","typographyStyles","tagPickerOptionClassNames","root","media","secondaryContent","useRootBaseStyle","display","alignItems","useRootStyles","gridTemplateColumns","useSecondaryContentBaseStyle","gridColumnStart","gridRowStart","caption1","useMediaBaseStyle","useTagPickerOptionStyles_unstable","state","rootBaseStyle","rootStyles","secondaryContentBaseStyle","mediaBaseStyle","className","active","disabled","focusVisible","checkIcon","undefined","selected"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOptionStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nimport { useOptionStyles_unstable } from '@fluentui/react-combobox';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tagPickerOptionClassNames: SlotClassNames<TagPickerOptionSlots> = {\n root: 'fui-TagPickerOption',\n media: 'fui-TagPickerOption__media',\n secondaryContent: 'fui-TagPickerOption__secondaryContent',\n};\n\nconst useRootBaseStyle = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst useRootStyles = makeStyles({\n secondaryContent: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n },\n});\n\nconst useSecondaryContentBaseStyle = makeResetStyles({\n gridColumnStart: 2,\n gridRowStart: 2,\n ...typographyStyles.caption1,\n});\n\nconst useMediaBaseStyle = makeResetStyles({\n gridRowStart: 'span 2',\n});\n\n/**\n * Apply styling to the TagPickerOption slots based on the state\n */\nexport const useTagPickerOptionStyles_unstable = (state: TagPickerOptionState): TagPickerOptionState => {\n 'use no memo';\n\n const rootBaseStyle = useRootBaseStyle();\n const rootStyles = useRootStyles();\n const secondaryContentBaseStyle = useSecondaryContentBaseStyle();\n const mediaBaseStyle = useMediaBaseStyle();\n\n state.root.className = mergeClasses(\n tagPickerOptionClassNames.root,\n rootBaseStyle,\n state.secondaryContent && rootStyles.secondaryContent,\n state.root.className,\n );\n useOptionStyles_unstable({\n ...state,\n active: false,\n disabled: false,\n focusVisible: false,\n checkIcon: undefined,\n selected: false,\n });\n if (state.media) {\n state.media.className = mergeClasses(tagPickerOptionClassNames.media, mediaBaseStyle, state.media.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n tagPickerOptionClassNames.secondaryContent,\n secondaryContentBaseStyle,\n state.secondaryContent.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","useOptionStyles_unstable","typographyStyles","tagPickerOptionClassNames","root","media","secondaryContent","useRootBaseStyle","display","alignItems","useRootStyles","gridTemplateColumns","useSecondaryContentBaseStyle","gridColumnStart","gridRowStart","caption1","useMediaBaseStyle","useTagPickerOptionStyles_unstable","state","rootBaseStyle","rootStyles","secondaryContentBaseStyle","mediaBaseStyle","className","active","disabled","focusVisible","checkIcon","undefined","selected"],"mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,gBAAgB,QAAQ,wBAAwB;AAEzD,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,OAAO;IACPC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,mBAAmBT,gBAAgB;IACvCU,SAAS;IACTC,YAAY;AACd;AAEA,MAAMC,gBAAgBX,WAAW;IAC/BO,kBAAkB;QAChBE,SAAS;QACTG,qBAAqB;IACvB;AACF;AAEA,MAAMC,+BAA+Bd,gBAAgB;IACnDe,iBAAiB;IACjBC,cAAc;IACd,GAAGZ,iBAAiBa,QAAQ;AAC9B;AAEA,MAAMC,oBAAoBlB,gBAAgB;IACxCgB,cAAc;AAChB;AAEA;;CAEC,GACD,OAAO,MAAMG,oCAAoC,CAACC;IAChD;IAEA,MAAMC,gBAAgBZ;IACtB,MAAMa,aAAaV;IACnB,MAAMW,4BAA4BT;IAClC,MAAMU,iBAAiBN;IAEvBE,MAAMd,IAAI,CAACmB,SAAS,GAAGvB,aACrBG,0BAA0BC,IAAI,EAC9Be,eACAD,MAAMZ,gBAAgB,IAAIc,WAAWd,gBAAgB,EACrDY,MAAMd,IAAI,CAACmB,SAAS;IAEtBtB,yBAAyB;QACvB,GAAGiB,KAAK;QACRM,QAAQ;QACRC,UAAU;QACVC,cAAc;QACdC,WAAWC;QACXC,UAAU;IACZ;IACA,IAAIX,MAAMb,KAAK,EAAE;QACfa,MAAMb,KAAK,CAACkB,SAAS,GAAGvB,aAAaG,0BAA0BE,KAAK,EAAEiB,gBAAgBJ,MAAMb,KAAK,CAACkB,SAAS;IAC7G;IAEA,IAAIL,MAAMZ,gBAAgB,EAAE;QAC1BY,MAAMZ,gBAAgB,CAACiB,SAAS,GAAGvB,aACjCG,0BAA0BG,gBAAgB,EAC1Ce,2BACAH,MAAMZ,gBAAgB,CAACiB,SAAS;IAEpC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerOptionGroup } from './useTagPickerOptionGroup';\nimport { renderTagPickerOptionGroup } from './renderTagPickerOptionGroup';\nimport { useTagPickerOptionGroupStyles } from './useTagPickerOptionGroupStyles.styles';\nimport type { TagPickerOptionGroupProps } from './TagPickerOptionGroup.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerOptionGroup component -\n * A TagPickerOptionGroup is a composite component that allows users to group TagPickerOptions.\n */\nexport const TagPickerOptionGroup: ForwardRefComponent<TagPickerOptionGroupProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerOptionGroup(props, ref);\n\n useTagPickerOptionGroupStyles(state);\n useCustomStyleHook_unstable('useTagPickerOptionGroupStyles_unstable')(state);\n return renderTagPickerOptionGroup(state);\n});\n\nTagPickerOptionGroup.displayName = 'TagPickerOptionGroup';\n"],"names":["React","useTagPickerOptionGroup","renderTagPickerOptionGroup","useTagPickerOptionGroupStyles","useCustomStyleHook_unstable","TagPickerOptionGroup","forwardRef","props","ref","state","displayName"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerOptionGroup } from './useTagPickerOptionGroup';\nimport { renderTagPickerOptionGroup } from './renderTagPickerOptionGroup';\nimport { useTagPickerOptionGroupStyles } from './useTagPickerOptionGroupStyles.styles';\nimport type { TagPickerOptionGroupProps } from './TagPickerOptionGroup.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerOptionGroup component -\n * A TagPickerOptionGroup is a composite component that allows users to group TagPickerOptions.\n */\nexport const TagPickerOptionGroup: ForwardRefComponent<TagPickerOptionGroupProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerOptionGroup(props, ref);\n\n useTagPickerOptionGroupStyles(state);\n useCustomStyleHook_unstable('useTagPickerOptionGroupStyles_unstable')(state);\n return renderTagPickerOptionGroup(state);\n});\n\nTagPickerOptionGroup.displayName = 'TagPickerOptionGroup';\n"],"names":["React","useTagPickerOptionGroup","renderTagPickerOptionGroup","useTagPickerOptionGroupStyles","useCustomStyleHook_unstable","TagPickerOptionGroup","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,4BAA4B;AACpE,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,SAASC,6BAA6B,QAAQ,yCAAyC;AAEvF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,qCAAuEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3G,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,0CAA0CK;IACtE,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,qBAAqBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.types.ts"],"sourcesContent":["import { OptionGroupProps, OptionGroupSlots, OptionGroupState } from '@fluentui/react-combobox';\n\nexport type TagPickerOptionGroupSlots = OptionGroupSlots;\n\n/**\n * TagPickerOptionGroup Props\n */\nexport type TagPickerOptionGroupProps = OptionGroupProps;\n\n/**\n * State used in rendering TagPickerOptionGroup\n */\nexport type TagPickerOptionGroupState = OptionGroupState;\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.types.ts"],"sourcesContent":["import { OptionGroupProps, OptionGroupSlots, OptionGroupState } from '@fluentui/react-combobox';\n\nexport type TagPickerOptionGroupSlots = OptionGroupSlots;\n\n/**\n * TagPickerOptionGroup Props\n */\nexport type TagPickerOptionGroupProps = OptionGroupProps;\n\n/**\n * State used in rendering TagPickerOptionGroup\n */\nexport type TagPickerOptionGroupState = OptionGroupState;\n"],"names":[],"mappings":"AASA;;CAEC,GACD,WAAyD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/index.ts"],"sourcesContent":["export { TagPickerOptionGroup } from './TagPickerOptionGroup';\nexport type {\n TagPickerOptionGroupProps,\n TagPickerOptionGroupSlots,\n TagPickerOptionGroupState,\n} from './TagPickerOptionGroup.types';\nexport { renderTagPickerOptionGroup } from './renderTagPickerOptionGroup';\nexport { useTagPickerOptionGroup } from './useTagPickerOptionGroup';\nexport { tagPickerOptionGroupClassNames, useTagPickerOptionGroupStyles } from './useTagPickerOptionGroupStyles.styles';\n"],"names":["TagPickerOptionGroup","renderTagPickerOptionGroup","useTagPickerOptionGroup","tagPickerOptionGroupClassNames","useTagPickerOptionGroupStyles"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/index.ts"],"sourcesContent":["export { TagPickerOptionGroup } from './TagPickerOptionGroup';\nexport type {\n TagPickerOptionGroupProps,\n TagPickerOptionGroupSlots,\n TagPickerOptionGroupState,\n} from './TagPickerOptionGroup.types';\nexport { renderTagPickerOptionGroup } from './renderTagPickerOptionGroup';\nexport { useTagPickerOptionGroup } from './useTagPickerOptionGroup';\nexport { tagPickerOptionGroupClassNames, useTagPickerOptionGroupStyles } from './useTagPickerOptionGroupStyles.styles';\n"],"names":["TagPickerOptionGroup","renderTagPickerOptionGroup","useTagPickerOptionGroup","tagPickerOptionGroupClassNames","useTagPickerOptionGroupStyles"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,yBAAyB;AAM9D,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,SAASC,uBAAuB,QAAQ,4BAA4B;AACpE,SAASC,8BAA8B,EAAEC,6BAA6B,QAAQ,yCAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/renderTagPickerOptionGroup.tsx"],"sourcesContent":["import type { TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { renderOptionGroup_unstable } from '@fluentui/react-combobox';\n\n/**\n * Render the final JSX of TagPickerOptionGroup\n */\nexport const renderTagPickerOptionGroup: (\n state: TagPickerOptionGroupState,\n) => // eslint-disable-next-line @typescript-eslint/no-deprecated\nJSX.Element = renderOptionGroup_unstable;\n"],"names":["renderOptionGroup_unstable","renderTagPickerOptionGroup"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/renderTagPickerOptionGroup.tsx"],"sourcesContent":["import type { TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { renderOptionGroup_unstable } from '@fluentui/react-combobox';\n\n/**\n * Render the final JSX of TagPickerOptionGroup\n */\nexport const renderTagPickerOptionGroup: (\n state: TagPickerOptionGroupState,\n) => // eslint-disable-next-line @typescript-eslint/no-deprecated\nJSX.Element = renderOptionGroup_unstable;\n"],"names":["renderOptionGroup_unstable","renderTagPickerOptionGroup"],"mappings":"AACA,SAASA,0BAA0B,QAAQ,2BAA2B;AAEtE;;CAEC,GACD,OAAO,MAAMC,6BAGCD,2BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerOptionGroupProps, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroup_unstable } from '@fluentui/react-combobox';\n\n/**\n * Create the state required to render TagPickerOptionGroup.\n *\n * The returned state can be modified with hooks such as useTagPickerOptionGroupStyles_unstable,\n * before being passed to renderTagPickerOptionGroup_unstable.\n *\n * @param props - props from this instance of TagPickerOptionGroup\n * @param ref - reference to root HTMLDivElement of TagPickerOptionGroup\n */\nexport const useTagPickerOptionGroup: (\n props: TagPickerOptionGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => TagPickerOptionGroupState = useOptionGroup_unstable;\n"],"names":["React","useOptionGroup_unstable","useTagPickerOptionGroup"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerOptionGroupProps, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroup_unstable } from '@fluentui/react-combobox';\n\n/**\n * Create the state required to render TagPickerOptionGroup.\n *\n * The returned state can be modified with hooks such as useTagPickerOptionGroupStyles_unstable,\n * before being passed to renderTagPickerOptionGroup_unstable.\n *\n * @param props - props from this instance of TagPickerOptionGroup\n * @param ref - reference to root HTMLDivElement of TagPickerOptionGroup\n */\nexport const useTagPickerOptionGroup: (\n props: TagPickerOptionGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => TagPickerOptionGroupState = useOptionGroup_unstable;\n"],"names":["React","useOptionGroup_unstable","useTagPickerOptionGroup"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,2BAA2B;AAEnE;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAGoBD,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionGroupSlots, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';\n\nexport const tagPickerOptionGroupClassNames: SlotClassNames<TagPickerOptionGroupSlots> = {\n root: 'fui-TagPickerOptionGroup',\n label: 'fui-TagPickerOptionGroup__label',\n};\n\n/**\n * Apply styling to the TagPickerOptionGroup slots based on the state\n */\nexport const useTagPickerOptionGroupStyles = (state: TagPickerOptionGroupState): TagPickerOptionGroupState => {\n 'use no memo';\n\n useOptionGroupStyles_unstable(state);\n state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);\n\n if (state.label) {\n state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);\n }\n\n return state;\n};\n"],"names":["mergeClasses","useOptionGroupStyles_unstable","tagPickerOptionGroupClassNames","root","label","useTagPickerOptionGroupStyles","state","className"],"
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionGroupSlots, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';\n\nexport const tagPickerOptionGroupClassNames: SlotClassNames<TagPickerOptionGroupSlots> = {\n root: 'fui-TagPickerOptionGroup',\n label: 'fui-TagPickerOptionGroup__label',\n};\n\n/**\n * Apply styling to the TagPickerOptionGroup slots based on the state\n */\nexport const useTagPickerOptionGroupStyles = (state: TagPickerOptionGroupState): TagPickerOptionGroupState => {\n 'use no memo';\n\n useOptionGroupStyles_unstable(state);\n state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);\n\n if (state.label) {\n state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);\n }\n\n return state;\n};\n"],"names":["mergeClasses","useOptionGroupStyles_unstable","tagPickerOptionGroupClassNames","root","label","useTagPickerOptionGroupStyles","state","className"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,6BAA6B,QAAQ,2BAA2B;AAEzE,OAAO,MAAMC,iCAA4E;IACvFC,MAAM;IACNC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C;IAEAL,8BAA8BK;IAC9BA,MAAMH,IAAI,CAACI,SAAS,GAAGP,aAAaE,+BAA+BC,IAAI,EAAEG,MAAMH,IAAI,CAACI,SAAS;IAE7F,IAAID,MAAMF,KAAK,EAAE;QACfE,MAAMF,KAAK,CAACG,SAAS,GAAGP,aAAaE,+BAA+BE,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IAClG;IAEA,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement>;\n secondaryActionRef: React.RefObject<HTMLSpanElement>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>) =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"
|
|
1
|
+
{"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement>;\n secondaryActionRef: React.RefObject<HTMLSpanElement>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>) =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA0BC,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AA6BtG;;CAEC,GACD,OAAO,MAAMC,+BAAsD;IACjEC,YAAYJ,MAAMK,SAAS;IAC3BC,YAAYN,MAAMK,SAAS;IAC3BE,WAAWP,MAAMK,SAAS;IAC1BG,mBAAmBR,MAAMK,SAAS;IAClCI,oBAAoBT,MAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,mBAAmBvB,cAAiDY;AAE1E,OAAO,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAClE,OAAO,MAAMC,+BAA+B,CAAIC,WAC9C1B,mBAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { TagPicker, renderTagPicker_unstable, useTagPicker_unstable } from './TagPicker';\nexport type {\n TagPickerContextValues,\n TagPickerProps,\n TagPickerSlots,\n TagPickerState,\n TagPickerOnOpenChangeData,\n TagPickerOnOptionSelectData,\n TagPickerSize,\n} from './TagPicker';\nexport {\n TagPickerInput,\n tagPickerInputClassNames,\n renderTagPickerInput_unstable,\n useTagPickerInputStyles_unstable,\n useTagPickerInput_unstable,\n} from './TagPickerInput';\nexport type { TagPickerInputProps, TagPickerInputSlots, TagPickerInputState } from './TagPickerInput';\nexport {\n TagPickerList,\n tagPickerListClassNames,\n renderTagPickerList_unstable,\n useTagPickerListStyles_unstable,\n useTagPickerList_unstable,\n} from './TagPickerList';\nexport type { TagPickerListProps, TagPickerListSlots, TagPickerListState } from './TagPickerList';\nexport {\n TagPickerButton,\n tagPickerButtonClassNames,\n renderTagPickerButton_unstable,\n useTagPickerButtonStyles_unstable,\n useTagPickerButton_unstable,\n} from './TagPickerButton';\nexport type { TagPickerButtonProps, TagPickerButtonSlots, TagPickerButtonState } from './TagPickerButton';\nexport {\n TagPickerControl,\n tagPickerControlClassNames,\n renderTagPickerControl_unstable,\n useTagPickerControlStyles_unstable,\n useTagPickerControl_unstable,\n} from './TagPickerControl';\nexport type { TagPickerControlProps, TagPickerControlSlots, TagPickerControlState } from './TagPickerControl';\nexport {\n TagPickerOption,\n tagPickerOptionClassNames,\n renderTagPickerOption_unstable,\n useTagPickerOptionStyles_unstable,\n useTagPickerOption_unstable,\n} from './TagPickerOption';\nexport type { TagPickerOptionProps, TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption';\nexport {\n TagPickerGroup,\n tagPickerGroupClassNames,\n renderTagPickerGroup_unstable,\n useTagPickerGroupStyles_unstable,\n useTagPickerGroup_unstable,\n} from './TagPickerGroup';\nexport type { TagPickerGroupProps, TagPickerGroupSlots, TagPickerGroupState } from './TagPickerGroup';\n\nexport {\n TagPickerOptionGroup,\n tagPickerOptionGroupClassNames,\n renderTagPickerOptionGroup,\n useTagPickerOptionGroupStyles,\n useTagPickerOptionGroup,\n} from './TagPickerOptionGroup';\nexport type {\n TagPickerOptionGroupProps,\n TagPickerOptionGroupSlots,\n TagPickerOptionGroupState,\n} from './TagPickerOptionGroup';\n\nexport { useTagPickerFilter } from './utils/useTagPickerFilter';\n\nexport { useTagPickerContext_unstable } from './contexts/TagPickerContext';\nexport type { TagPickerContextValue } from './contexts/TagPickerContext';\n"],"names":["TagPicker","renderTagPicker_unstable","useTagPicker_unstable","TagPickerInput","tagPickerInputClassNames","renderTagPickerInput_unstable","useTagPickerInputStyles_unstable","useTagPickerInput_unstable","TagPickerList","tagPickerListClassNames","renderTagPickerList_unstable","useTagPickerListStyles_unstable","useTagPickerList_unstable","TagPickerButton","tagPickerButtonClassNames","renderTagPickerButton_unstable","useTagPickerButtonStyles_unstable","useTagPickerButton_unstable","TagPickerControl","tagPickerControlClassNames","renderTagPickerControl_unstable","useTagPickerControlStyles_unstable","useTagPickerControl_unstable","TagPickerOption","tagPickerOptionClassNames","renderTagPickerOption_unstable","useTagPickerOptionStyles_unstable","useTagPickerOption_unstable","TagPickerGroup","tagPickerGroupClassNames","renderTagPickerGroup_unstable","useTagPickerGroupStyles_unstable","useTagPickerGroup_unstable","TagPickerOptionGroup","tagPickerOptionGroupClassNames","renderTagPickerOptionGroup","useTagPickerOptionGroupStyles","useTagPickerOptionGroup","useTagPickerFilter","useTagPickerContext_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { TagPicker, renderTagPicker_unstable, useTagPicker_unstable } from './TagPicker';\nexport type {\n TagPickerContextValues,\n TagPickerProps,\n TagPickerSlots,\n TagPickerState,\n TagPickerOnOpenChangeData,\n TagPickerOnOptionSelectData,\n TagPickerSize,\n} from './TagPicker';\nexport {\n TagPickerInput,\n tagPickerInputClassNames,\n renderTagPickerInput_unstable,\n useTagPickerInputStyles_unstable,\n useTagPickerInput_unstable,\n} from './TagPickerInput';\nexport type { TagPickerInputProps, TagPickerInputSlots, TagPickerInputState } from './TagPickerInput';\nexport {\n TagPickerList,\n tagPickerListClassNames,\n renderTagPickerList_unstable,\n useTagPickerListStyles_unstable,\n useTagPickerList_unstable,\n} from './TagPickerList';\nexport type { TagPickerListProps, TagPickerListSlots, TagPickerListState } from './TagPickerList';\nexport {\n TagPickerButton,\n tagPickerButtonClassNames,\n renderTagPickerButton_unstable,\n useTagPickerButtonStyles_unstable,\n useTagPickerButton_unstable,\n} from './TagPickerButton';\nexport type { TagPickerButtonProps, TagPickerButtonSlots, TagPickerButtonState } from './TagPickerButton';\nexport {\n TagPickerControl,\n tagPickerControlClassNames,\n renderTagPickerControl_unstable,\n useTagPickerControlStyles_unstable,\n useTagPickerControl_unstable,\n} from './TagPickerControl';\nexport type { TagPickerControlProps, TagPickerControlSlots, TagPickerControlState } from './TagPickerControl';\nexport {\n TagPickerOption,\n tagPickerOptionClassNames,\n renderTagPickerOption_unstable,\n useTagPickerOptionStyles_unstable,\n useTagPickerOption_unstable,\n} from './TagPickerOption';\nexport type { TagPickerOptionProps, TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption';\nexport {\n TagPickerGroup,\n tagPickerGroupClassNames,\n renderTagPickerGroup_unstable,\n useTagPickerGroupStyles_unstable,\n useTagPickerGroup_unstable,\n} from './TagPickerGroup';\nexport type { TagPickerGroupProps, TagPickerGroupSlots, TagPickerGroupState } from './TagPickerGroup';\n\nexport {\n TagPickerOptionGroup,\n tagPickerOptionGroupClassNames,\n renderTagPickerOptionGroup,\n useTagPickerOptionGroupStyles,\n useTagPickerOptionGroup,\n} from './TagPickerOptionGroup';\nexport type {\n TagPickerOptionGroupProps,\n TagPickerOptionGroupSlots,\n TagPickerOptionGroupState,\n} from './TagPickerOptionGroup';\n\nexport { useTagPickerFilter } from './utils/useTagPickerFilter';\n\nexport { useTagPickerContext_unstable } from './contexts/TagPickerContext';\nexport type { TagPickerContextValue } from './contexts/TagPickerContext';\n"],"names":["TagPicker","renderTagPicker_unstable","useTagPicker_unstable","TagPickerInput","tagPickerInputClassNames","renderTagPickerInput_unstable","useTagPickerInputStyles_unstable","useTagPickerInput_unstable","TagPickerList","tagPickerListClassNames","renderTagPickerList_unstable","useTagPickerListStyles_unstable","useTagPickerList_unstable","TagPickerButton","tagPickerButtonClassNames","renderTagPickerButton_unstable","useTagPickerButtonStyles_unstable","useTagPickerButton_unstable","TagPickerControl","tagPickerControlClassNames","renderTagPickerControl_unstable","useTagPickerControlStyles_unstable","useTagPickerControl_unstable","TagPickerOption","tagPickerOptionClassNames","renderTagPickerOption_unstable","useTagPickerOptionStyles_unstable","useTagPickerOption_unstable","TagPickerGroup","tagPickerGroupClassNames","renderTagPickerGroup_unstable","useTagPickerGroupStyles_unstable","useTagPickerGroup_unstable","TagPickerOptionGroup","tagPickerOptionGroupClassNames","renderTagPickerOptionGroup","useTagPickerOptionGroupStyles","useTagPickerOptionGroup","useTagPickerFilter","useTagPickerContext_unstable"],"mappings":"AAAA,SAASA,SAAS,EAAEC,wBAAwB,EAAEC,qBAAqB,QAAQ,cAAc;AAUzF,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAE1B,SACEC,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAEzB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,QACtB,oBAAoB;AAE3B,SACEC,gBAAgB,EAChBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,kCAAkC,EAClCC,4BAA4B,QACvB,qBAAqB;AAE5B,SACEC,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,QACtB,oBAAoB;AAE3B,SACEC,cAAc,EACdC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,QACrB,mBAAmB;AAG1B,SACEC,oBAAoB,EACpBC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,yBAAyB;AAOhC,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE,SAASC,4BAA4B,QAAQ,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/tagPicker2Tag.ts"],"sourcesContent":["import type { TagAppearance, TagSize } from '@fluentui/react-tags/src/index';\nimport type { TagPickerSize } from '../TagPicker';\nimport { ComboboxBaseProps } from '@fluentui/react-combobox';\n\nexport function tagPickerSizeToTagSize(size: TagPickerSize): TagSize {\n switch (size) {\n case 'medium':\n return 'extra-small';\n case 'large':\n return 'small';\n case 'extra-large':\n return 'medium';\n default:\n return 'extra-small';\n }\n}\n\nexport function tagSizeToTagPickerSize(size: TagSize): TagPickerSize {\n switch (size) {\n case 'extra-small':\n return 'medium';\n case 'small':\n return 'large';\n case 'medium':\n return 'extra-large';\n default:\n return 'medium';\n }\n}\n\nexport function tagPickerAppearanceToTagAppearance(appearance: ComboboxBaseProps['appearance']): TagAppearance {\n switch (appearance) {\n case 'filled-darker':\n return 'outline';\n default:\n return 'filled';\n }\n}\n"],"names":["tagPickerSizeToTagSize","size","tagSizeToTagPickerSize","tagPickerAppearanceToTagAppearance","appearance"],"
|
|
1
|
+
{"version":3,"sources":["../src/utils/tagPicker2Tag.ts"],"sourcesContent":["import type { TagAppearance, TagSize } from '@fluentui/react-tags/src/index';\nimport type { TagPickerSize } from '../TagPicker';\nimport { ComboboxBaseProps } from '@fluentui/react-combobox';\n\nexport function tagPickerSizeToTagSize(size: TagPickerSize): TagSize {\n switch (size) {\n case 'medium':\n return 'extra-small';\n case 'large':\n return 'small';\n case 'extra-large':\n return 'medium';\n default:\n return 'extra-small';\n }\n}\n\nexport function tagSizeToTagPickerSize(size: TagSize): TagPickerSize {\n switch (size) {\n case 'extra-small':\n return 'medium';\n case 'small':\n return 'large';\n case 'medium':\n return 'extra-large';\n default:\n return 'medium';\n }\n}\n\nexport function tagPickerAppearanceToTagAppearance(appearance: ComboboxBaseProps['appearance']): TagAppearance {\n switch (appearance) {\n case 'filled-darker':\n return 'outline';\n default:\n return 'filled';\n }\n}\n"],"names":["tagPickerSizeToTagSize","size","tagSizeToTagPickerSize","tagPickerAppearanceToTagAppearance","appearance"],"mappings":"AAIA,OAAO,SAASA,uBAAuBC,IAAmB;IACxD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASC,uBAAuBD,IAAa;IAClD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASE,mCAAmCC,UAA2C;IAC5F,OAAQA;QACN,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF"}
|
package/lib/utils/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/tokens.ts"],"sourcesContent":["export type TagPickerInputTokens = {\n width: string;\n};\n\nexport const tagPickerInputCSSRules: { [Key in keyof TagPickerInputTokens]: `--fluent-TagPickerInput__${Key}` } = {\n width: '--fluent-TagPickerInput__width',\n};\n\nexport const tagPickerInputTokens: Record<keyof TagPickerInputTokens, string> = {\n width: `var(${tagPickerInputCSSRules.width}, 0)`,\n};\n"],"names":["tagPickerInputCSSRules","width","tagPickerInputTokens"],"
|
|
1
|
+
{"version":3,"sources":["../src/utils/tokens.ts"],"sourcesContent":["export type TagPickerInputTokens = {\n width: string;\n};\n\nexport const tagPickerInputCSSRules: { [Key in keyof TagPickerInputTokens]: `--fluent-TagPickerInput__${Key}` } = {\n width: '--fluent-TagPickerInput__width',\n};\n\nexport const tagPickerInputTokens: Record<keyof TagPickerInputTokens, string> = {\n width: `var(${tagPickerInputCSSRules.width}, 0)`,\n};\n"],"names":["tagPickerInputCSSRules","width","tagPickerInputTokens"],"mappings":"AAIA,OAAO,MAAMA,yBAAqG;IAChHC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,uBAAmE;IAC9ED,OAAO,CAAC,IAAI,EAAED,uBAAuBC,KAAK,CAAC,IAAI,CAAC;AAClD,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: { tagPickerId: string; state: Pick<TagPickerControlState, 'expandIcon'> }) {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"
|
|
1
|
+
{"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: { tagPickerId: string; state: Pick<TagPickerControlState, 'expandIcon'> }) {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,4BAA4B,QAAQ,+BAA+B;AAC5E,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAGlF,OAAO,SAASC,eAAeC,OAAkF;IAC/G,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAE,GA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,MAAMC,uBAAsBxB,uBAAAA,WAAWsB,OAAO,cAAlBtB,2CAAAA,qBAAoBuB,YAAY,CAAC;QAE7D,MAAM,EAAET,eAAe,EAAEE,oBAAoB,EAAEC,QAAQ,EAAE,GAAGP,eAAeW,gBAAgBG;QAE3F,IAAIR,sBAAsB;gBACxBd;aAAAA,yBAAAA,cAAcoB,OAAO,cAArBpB,6CAAAA,uBAAuBuB,YAAY,CAAC,mBAAmBT;QACzD;QACA,IAAIF,iBAAiB;gBACnBZ;aAAAA,0BAAAA,cAAcoB,OAAO,cAArBpB,8CAAAA,wBAAuBuB,YAAY,CAAC,cAAcX;QACpD;QACA,IAAIG,UAAU;gBACZf;aAAAA,0BAAAA,cAAcoB,OAAO,cAArBpB,8CAAAA,wBAAuBuB,YAAY,CAAC,MAAMR;QAC5C;IACF,GAAG;QAACP;QAAgBV;KAAW;IAE/BT,MAAMmC,SAAS,CAAC;QACd,MAAMR,iBAAiBZ,uBAAuBC;QAC9C,IAAI,EAACR,2BAAAA,qCAAAA,eAAgB4B,WAAW,KAAI,CAAC3B,WAAWsB,OAAO,IAAI,CAAClB,iBAAiBc,gBAAgB;YAC3F;QACF;QAEA,MAAMU,MAAM7B,eAAe4B,WAAW;QAEtC,2FAA2F;QAC3FP;QAEA,MAAMS,WAAW,IAAID,IAAIE,gBAAgB,CAACV;QAC1CS,SAASE,OAAO,CAAC/B,WAAWsB,OAAO,EAAE;YACnCU,YAAY;YACZC,iBAAiB;gBAAC;gBAAc;aAAkB;QACpD;QAEA,OAAO,IAAMJ,SAASK,UAAU;IAClC,GAAG;QACDxB;QACAU;QACAd;QACAC;QACAH;QACAP;QACAG;QACAD;KACD;IAED,OAAOG;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useResizeObserverRef.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nexport const useResizeObserverRef = <E extends HTMLElement>(callback: ResizeObserverCallback): React.Ref<E> => {\n const { targetDocument } = useFluent();\n const [observer] = React.useState(() => {\n const ResizeObserverConstructor = targetDocument?.defaultView?.ResizeObserver;\n if (ResizeObserverConstructor) {\n return new ResizeObserverConstructor(callback);\n }\n });\n const ref: React.RefCallback<E> = React.useCallback(\n element => {\n if (element) {\n observer?.observe(element);\n } else {\n observer?.disconnect();\n }\n },\n [observer],\n );\n return ref;\n};\n"],"names":["React","useFluent_unstable","useFluent","useResizeObserverRef","callback","targetDocument","observer","useState","ResizeObserverConstructor","defaultView","ResizeObserver","ref","useCallback","element","observe","disconnect"],"
|
|
1
|
+
{"version":3,"sources":["../src/utils/useResizeObserverRef.ts"],"sourcesContent":["import * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nexport const useResizeObserverRef = <E extends HTMLElement>(callback: ResizeObserverCallback): React.Ref<E> => {\n const { targetDocument } = useFluent();\n const [observer] = React.useState(() => {\n const ResizeObserverConstructor = targetDocument?.defaultView?.ResizeObserver;\n if (ResizeObserverConstructor) {\n return new ResizeObserverConstructor(callback);\n }\n });\n const ref: React.RefCallback<E> = React.useCallback(\n element => {\n if (element) {\n observer?.observe(element);\n } else {\n observer?.disconnect();\n }\n },\n [observer],\n );\n return ref;\n};\n"],"names":["React","useFluent_unstable","useFluent","useResizeObserverRef","callback","targetDocument","observer","useState","ResizeObserverConstructor","defaultView","ResizeObserver","ref","useCallback","element","observe","disconnect"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,OAAO,MAAMC,uBAAuB,CAAwBC;IAC1D,MAAM,EAAEC,cAAc,EAAE,GAAGH;IAC3B,MAAM,CAACI,SAAS,GAAGN,MAAMO,QAAQ,CAAC;YACEF;QAAlC,MAAMG,4BAA4BH,2BAAAA,sCAAAA,8BAAAA,eAAgBI,WAAW,cAA3BJ,kDAAAA,4BAA6BK,cAAc;QAC7E,IAAIF,2BAA2B;YAC7B,OAAO,IAAIA,0BAA0BJ;QACvC;IACF;IACA,MAAMO,MAA4BX,MAAMY,WAAW,CACjDC,CAAAA;QACE,IAAIA,SAAS;YACXP,qBAAAA,+BAAAA,SAAUQ,OAAO,CAACD;QACpB,OAAO;YACLP,qBAAAA,+BAAAA,SAAUS,UAAU;QACtB;IACF,GACA;QAACT;KAAS;IAEZ,OAAOK;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig) {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element[]\n >((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"
|
|
1
|
+
{"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig) {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n JSX.Element[]\n >((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,qBAAqB;AAoBrD,SAASC,oBAAoBC,MAAc;IACzC,qBACE,oBAACF;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEA,OAAO,SAASG,mBAAmB,EACjCC,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,MAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,2BAAAA,4BAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,MAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAGZ,CAACC,aAAanB,QAAQoB;YACtB,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,iCAAmBT,MAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/TagPicker.ts"],"sourcesContent":["export type {\n TagPickerContextValues,\n TagPickerOnOpenChangeData,\n TagPickerOnOptionSelectData,\n TagPickerProps,\n TagPickerSize,\n TagPickerSlots,\n TagPickerState,\n} from './components/TagPicker/index';\nexport { TagPicker, renderTagPicker_unstable, useTagPicker_unstable } from './components/TagPicker/index';\n"],"names":["TagPicker","renderTagPicker_unstable","useTagPicker_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/TagPicker.ts"],"sourcesContent":["export type {\n TagPickerContextValues,\n TagPickerOnOpenChangeData,\n TagPickerOnOptionSelectData,\n TagPickerProps,\n TagPickerSize,\n TagPickerSlots,\n TagPickerState,\n} from './components/TagPicker/index';\nexport { TagPicker, renderTagPicker_unstable, useTagPicker_unstable } from './components/TagPicker/index';\n"],"names":["TagPicker","renderTagPicker_unstable","useTagPicker_unstable"],"mappings":";;;;;;;;;;;;eASSA,gBAAS;;;eAAEC,+BAAwB;;;eAAEC,4BAAqB;;;uBAAQ,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/TagPickerButton.ts"],"sourcesContent":["export type {\n TagPickerButtonProps,\n TagPickerButtonSlots,\n TagPickerButtonState,\n} from './components/TagPickerButton/index';\nexport {\n TagPickerButton,\n renderTagPickerButton_unstable,\n tagPickerButtonClassNames,\n useTagPickerButtonStyles_unstable,\n useTagPickerButton_unstable,\n} from './components/TagPickerButton/index';\n"],"names":["TagPickerButton","renderTagPickerButton_unstable","tagPickerButtonClassNames","useTagPickerButtonStyles_unstable","useTagPickerButton_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/TagPickerButton.ts"],"sourcesContent":["export type {\n TagPickerButtonProps,\n TagPickerButtonSlots,\n TagPickerButtonState,\n} from './components/TagPickerButton/index';\nexport {\n TagPickerButton,\n renderTagPickerButton_unstable,\n tagPickerButtonClassNames,\n useTagPickerButtonStyles_unstable,\n useTagPickerButton_unstable,\n} from './components/TagPickerButton/index';\n"],"names":["TagPickerButton","renderTagPickerButton_unstable","tagPickerButtonClassNames","useTagPickerButtonStyles_unstable","useTagPickerButton_unstable"],"mappings":";;;;;;;;;;;;eAMEA,sBAAe;;;eACfC,qCAA8B;;;eAC9BC,gCAAyB;;;eACzBC,wCAAiC;;;eACjCC,kCAA2B;;;uBACtB,qCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/TagPickerControl.ts"],"sourcesContent":["export type {\n TagPickerControlCSSProperties,\n TagPickerControlInternalSlots,\n TagPickerControlProps,\n TagPickerControlSlots,\n TagPickerControlState,\n} from './components/TagPickerControl/index';\nexport {\n TagPickerControl,\n iconSizes,\n renderTagPickerControl_unstable,\n tagPickerControlAsideWidthToken,\n tagPickerControlClassNames,\n useTagPickerControlStyles_unstable,\n useTagPickerControl_unstable,\n} from './components/TagPickerControl/index';\n"],"names":["TagPickerControl","iconSizes","renderTagPickerControl_unstable","tagPickerControlAsideWidthToken","tagPickerControlClassNames","useTagPickerControlStyles_unstable","useTagPickerControl_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/TagPickerControl.ts"],"sourcesContent":["export type {\n TagPickerControlCSSProperties,\n TagPickerControlInternalSlots,\n TagPickerControlProps,\n TagPickerControlSlots,\n TagPickerControlState,\n} from './components/TagPickerControl/index';\nexport {\n TagPickerControl,\n iconSizes,\n renderTagPickerControl_unstable,\n tagPickerControlAsideWidthToken,\n tagPickerControlClassNames,\n useTagPickerControlStyles_unstable,\n useTagPickerControl_unstable,\n} from './components/TagPickerControl/index';\n"],"names":["TagPickerControl","iconSizes","renderTagPickerControl_unstable","tagPickerControlAsideWidthToken","tagPickerControlClassNames","useTagPickerControlStyles_unstable","useTagPickerControl_unstable"],"mappings":";;;;;;;;;;;;eAQEA,uBAAgB;;;eAChBC,gBAAS;;;eACTC,sCAA+B;;;eAC/BC,sCAA+B;;;eAC/BC,iCAA0B;;;eAC1BC,yCAAkC;;;eAClCC,mCAA4B;;;uBACvB,sCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/TagPickerGroup.ts"],"sourcesContent":["export type { TagPickerGroupProps, TagPickerGroupSlots, TagPickerGroupState } from './components/TagPickerGroup/index';\nexport {\n TagPickerGroup,\n renderTagPickerGroup_unstable,\n tagPickerGroupClassNames,\n useTagPickerGroupStyles_unstable,\n useTagPickerGroup_unstable,\n} from './components/TagPickerGroup/index';\n"],"names":["TagPickerGroup","renderTagPickerGroup_unstable","tagPickerGroupClassNames","useTagPickerGroupStyles_unstable","useTagPickerGroup_unstable"],"
|
|
1
|
+
{"version":3,"sources":["../src/TagPickerGroup.ts"],"sourcesContent":["export type { TagPickerGroupProps, TagPickerGroupSlots, TagPickerGroupState } from './components/TagPickerGroup/index';\nexport {\n TagPickerGroup,\n renderTagPickerGroup_unstable,\n tagPickerGroupClassNames,\n useTagPickerGroupStyles_unstable,\n useTagPickerGroup_unstable,\n} from './components/TagPickerGroup/index';\n"],"names":["TagPickerGroup","renderTagPickerGroup_unstable","tagPickerGroupClassNames","useTagPickerGroupStyles_unstable","useTagPickerGroup_unstable"],"mappings":";;;;;;;;;;;;eAEEA,qBAAc;;;eACdC,oCAA6B;;;eAC7BC,+BAAwB;;;eACxBC,uCAAgC;;;eAChCC,iCAA0B;;;uBACrB,oCAAoC"}
|