File size: 1,465 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "type": "composition",
  "npmDependencies": [],
  "fileDependencies": [
    "compositions/ui/close-button"
  ],
  "id": "action-bar",
  "file": {
    "name": "action-bar.tsx",
    "content": "import { ActionBar, Portal } from \"@chakra-ui/react\"\nimport { CloseButton } from \"./close-button\"\nimport * as React from \"react\"\n\ninterface ActionBarContentProps extends ActionBar.ContentProps {\n  portalled?: boolean\n  portalRef?: React.RefObject<HTMLElement>\n}\n\nexport const ActionBarContent = React.forwardRef<\n  HTMLDivElement,\n  ActionBarContentProps\n>(function ActionBarContent(props, ref) {\n  const { children, portalled = true, portalRef, ...rest } = props\n\n  return (\n    <Portal disabled={!portalled} container={portalRef}>\n      <ActionBar.Positioner>\n        <ActionBar.Content ref={ref} {...rest} asChild={false}>\n          {children}\n        </ActionBar.Content>\n      </ActionBar.Positioner>\n    </Portal>\n  )\n})\n\nexport const ActionBarCloseTrigger = React.forwardRef<\n  HTMLButtonElement,\n  ActionBar.CloseTriggerProps\n>(function ActionBarCloseTrigger(props, ref) {\n  return (\n    <ActionBar.CloseTrigger {...props} asChild ref={ref}>\n      <CloseButton size=\"sm\" />\n    </ActionBar.CloseTrigger>\n  )\n})\n\nexport const ActionBarRoot = ActionBar.Root\nexport const ActionBarSelectionTrigger = ActionBar.SelectionTrigger\nexport const ActionBarSeparator = ActionBar.Separator\n"
  },
  "component": "ActionBar"
}