useInteractionTagPrimaryBase_unstable (InteractionTagPrimary/useInteractionTagPrimary.ts)

fluentui · packages/react-components/react-tags/library/src/components/InteractionTagPrimary/useInteractionTagPrimary.ts · typescript · MIT
ui

Hook building state for InteractionTagPrimary component.

// Source: https://github.com/microsoft/fluentui | License: MIT | Copyright Microsoft Corporation
// Provided via justclaw.it.com; keep this notice with the code.
'use client';

import type * as React from 'react';
import { getIntrinsicElementProps, mergeCallbacks, slot, useEventCallback } from '@fluentui/react-utilities';
import type {
  InteractionTagPrimaryBaseProps,
  InteractionTagPrimaryBaseState,
  InteractionTagPrimaryProps,
  InteractionTagPrimaryState,
} from './InteractionTagPrimary.types';
import { useInteractionTagContext_unstable } from '../../contexts/interactionTagContext';

const avatarSizeMap = {
  medium: 28,
  small: 20,
  'extra-small': 16,
} as const;

const avatarShapeMap = {
  rounded: 'square',
  circular: 'circular',
} as const;

/**
 * Create the base state requi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key