@ringpublishing/mui-components-mcp 1.16.5 → 1.16.6

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "generated": "2026-08-20T11:58:30.526Z",
2
+ "generated": "2026-08-21T07:09:39.651Z",
3
3
  "importPath": "@ringpublishing/mui-components",
4
4
  "componentCount": 35,
5
5
  "components": {
@@ -1212,7 +1212,7 @@
1212
1212
  "WithNoActions",
1213
1213
  "WithImage"
1214
1214
  ],
1215
- "docs": "# FeatureTooltip\n\nA feature announcement tooltip that automatically manages its display state using `localStorage`. It extends MUI's [Tooltip](https://mui.com/material-ui/react-tooltip/) with a rich card layout, supporting media content, configurable action buttons, and frequency-capping logic.\n\n- Displays automatically on mount based on `capping` count and `endDate` expiration\n- Persists display history in `localStorage` to control re-display frequency\n- Supports text messages, embedded videos (`videoEmbed`), and images (`image`)\n- Configurable action buttons — up to two: primary and optional secondary\n- Close button always available for the user\n\n## Default\n\nShows two tooltip configurations side by side: a **standard tooltip** (displayed only once per user) and a **capping tooltip** (displayed up to 3 times). Both use `localStorage` to track display history.\n\n> **Note:** If you don't see the tooltip, click **Clear tooltip data** to reset the `localStorage` state and reload the page.\n\n```tsx\n// DefaultExample.tsx\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip, FeatureTooltipProps } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nconst actions: FeatureTooltipProps['actions'] = [\n { label: 'Default action', href: 'https://ringpublishing.com/' },\n { label: 'Secondary action', onClick: (): void => console.log('Secondary action clicked') },\n];\n\nexport default function DefaultExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-1\"\n title=\"Standard tooltip\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip shown only once, after closing not visible</div>\n </FeatureTooltip>\n\n <FeatureTooltip\n id=\"ring-feature-tooltip-capping\"\n title=\"Tooltip with capping\"\n capping={3}\n message=\"\"\n videoEmbed=\"https://www.youtube.com/embed/KRphOlc8tKg?si=xUR6gOpAPDcR74Dk\"\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with capping (should be visible 3 times)</div>\n </FeatureTooltip>\n </Box>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With One Action\n\nA tooltip with a **single primary action** button and an embedded YouTube video. Use this when you want to direct users to a specific resource without offering a secondary option.\n\n```tsx\n// WithOneActionExample.tsx\nimport React from 'react';\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nexport default function WithOneActionExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-2\"\n title=\"Tooltip with one action\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n actions={[{ label: 'Default action', href: 'https://ringpublishing.com/' }]}\n videoEmbed=\"https://www.youtube.com/embed/KRphOlc8tKg?si=xUR6gOpAPDcR74Dk\"\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with one action and video embed</div>\n </FeatureTooltip>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With No Actions\n\nA tooltip displaying only a title and message body — without any action buttons. Ideal for purely informational announcements where no user interaction is needed beyond dismissal.\n\n```tsx\n// WithNoActionsExample.tsx\nimport React from 'react';\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nexport default function WithNoActionsExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-3\"\n title=\"Tooltip with no actions\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip without action buttons</div>\n </FeatureTooltip>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With Image\n\nA tooltip enriched with an **image**. Shown side by side: one variant with two action buttons, another without actions — both using the same image URL.\n\n> **Note:** If both `image` and `videoEmbed` are passed, the **video takes priority** and the image is not rendered.\n\n```tsx\n// WithImageExample.tsx\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip, FeatureTooltipProps } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nconst IMAGE_URL = 'https://design.ringpublishing.com/images/sea_large.jpg';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nconst actions: FeatureTooltipProps['actions'] = [\n { label: 'Default action', href: 'https://ringpublishing.com/' },\n { label: 'Secondary action', onClick: (): void => console.log('Secondary action clicked') },\n];\n\nexport default function WithImageExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-4\"\n title=\"Tooltip with image and actions\"\n message=\"\"\n image={IMAGE_URL}\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with image and two actions</div>\n </FeatureTooltip>\n\n <FeatureTooltip\n id=\"ring-feature-tooltip-4b\"\n title=\"Tooltip with image, no actions\"\n message=\"\"\n image={IMAGE_URL}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with image and no actions</div>\n </FeatureTooltip>\n </Box>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```"
1215
+ "docs": "# FeatureTooltip\n\nA feature announcement tooltip that automatically manages its display state using `localStorage`. It extends MUI's [Tooltip](https://mui.com/material-ui/react-tooltip/) with a rich card layout, supporting media content, configurable action buttons, and frequency-capping logic.\n\n- Displays automatically on mount based on `capping` count and `endDate` expiration\n- Persists display history in `localStorage` to control re-display frequency\n- Supports text messages, embedded videos (`videoEmbed`), and images (`image`)\n- Configurable action buttons — up to two: primary and optional secondary\n- Close button always available for the user\n\n## Default\n\nShows two tooltip configurations side by side: a **standard tooltip** (displayed only once per user) and a **capping tooltip** (displayed up to 3 times). Both use `localStorage` to track display history.\n\n> **Note:** If you don't see the tooltip, click **Clear tooltip data** to reset the `localStorage` state and reload the page.\n\n```tsx\n// DefaultExample.tsx\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip, FeatureTooltipProps } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nconst actions: FeatureTooltipProps['actions'] = [\n { label: 'Default action', href: 'https://ringpublishing.com/' },\n { label: 'Secondary action', onClick: (): void => undefined },\n];\n\nexport default function DefaultExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-1\"\n title=\"Standard tooltip\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip shown only once, after closing not visible</div>\n </FeatureTooltip>\n\n <FeatureTooltip\n id=\"ring-feature-tooltip-capping\"\n title=\"Tooltip with capping\"\n capping={3}\n message=\"\"\n videoEmbed=\"https://www.youtube.com/embed/KRphOlc8tKg?si=xUR6gOpAPDcR74Dk\"\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with capping (should be visible 3 times)</div>\n </FeatureTooltip>\n </Box>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With One Action\n\nA tooltip with a **single primary action** button and an embedded YouTube video. Use this when you want to direct users to a specific resource without offering a secondary option.\n\n```tsx\n// WithOneActionExample.tsx\nimport React from 'react';\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nexport default function WithOneActionExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-2\"\n title=\"Tooltip with one action\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n actions={[{ label: 'Default action', href: 'https://ringpublishing.com/' }]}\n videoEmbed=\"https://www.youtube.com/embed/KRphOlc8tKg?si=xUR6gOpAPDcR74Dk\"\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with one action and video embed</div>\n </FeatureTooltip>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With No Actions\n\nA tooltip displaying only a title and message body — without any action buttons. Ideal for purely informational announcements where no user interaction is needed beyond dismissal.\n\n```tsx\n// WithNoActionsExample.tsx\nimport React from 'react';\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nexport default function WithNoActionsExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-3\"\n title=\"Tooltip with no actions\"\n message=\"There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form\"\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip without action buttons</div>\n </FeatureTooltip>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```\n\n## With Image\n\nA tooltip enriched with an **image**. Shown side by side: one variant with two action buttons, another without actions — both using the same image URL.\n\n> **Note:** If both `image` and `videoEmbed` are passed, the **video takes priority** and the image is not rendered.\n\n```tsx\n// WithImageExample.tsx\nimport { Box, Button } from '@mui/material';\nimport { FeatureTooltip, FeatureTooltipProps } from '@ringpublishing/mui-components';\nimport dayjs from 'dayjs';\nimport React from 'react';\n\nconst IMAGE_URL = 'https://design.ringpublishing.com/images/sea_large.jpg';\n\nconst endDate = dayjs().add(1, 'year').toISOString();\n\nconst actions: FeatureTooltipProps['actions'] = [\n { label: 'Default action', href: 'https://ringpublishing.com/' },\n { label: 'Secondary action', onClick: (): void => undefined },\n];\n\nexport default function WithImageExample(): React.JSX.Element {\n const clearTooltipData = (): void => {\n try {\n localStorage.removeItem('FeatureTooltips');\n location.reload();\n } catch (error) {\n console.warn(error);\n }\n };\n\n return (\n <Box sx={{ width: '80%' }}>\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <FeatureTooltip\n id=\"ring-feature-tooltip-4\"\n title=\"Tooltip with image and actions\"\n message=\"\"\n image={IMAGE_URL}\n actions={actions}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with image and two actions</div>\n </FeatureTooltip>\n\n <FeatureTooltip\n id=\"ring-feature-tooltip-4b\"\n title=\"Tooltip with image, no actions\"\n message=\"\"\n image={IMAGE_URL}\n endDate={endDate}\n >\n <div style={{ width: '200px' }}>Tooltip with image and no actions</div>\n </FeatureTooltip>\n </Box>\n\n <Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', mt: 2 }}>\n If you do not see tooltip:\n <Button onClick={clearTooltipData} variant=\"outlined\" color=\"primary\" sx={{ ml: 1 }}>\n Clear tooltip data\n </Button>\n </Box>\n </Box>\n );\n}\n```"
1216
1216
  },
1217
1217
  "molecules-media": {
1218
1218
  "id": "molecules-media",
@@ -3224,7 +3224,7 @@
3224
3224
  "Default",
3225
3225
  "WithDragHandle"
3226
3226
  ],
3227
- "docs": "# SortableList\n\nA drag-and-drop sortable list component built on top of the [@dnd-kit/core](https://docs.dndkit.com/) library. It provides a container that manages drag-and-drop functionality while leaving item rendering to the developer.\n\n- Two dragging modes: grab anywhere (default) or grab by drag handle\n- Supports clickable elements inside list items without interfering with drag behavior\n- Provides `useNonDraggableRef` hook to prevent drag on specific elements (e.g., buttons, context menus)\n- Built-in `<SortableList.DragHandle />` component for explicit drag handles\n\n## Default\n\nBy default, the entire list item is draggable. The drag event is triggered only after the user moves the mouse by a small number of pixels, so clickable elements like buttons still work correctly. Use the `useNonDraggableRef` hook to prevent drag behavior on specific interactive elements.\n\n```tsx\n// DefaultExample.tsx\nimport React from 'react';\nimport { Card, CardContent, GridLegacy as Grid, IconButton, Paper, useTheme } from '@mui/material';\nimport { MoreVert } from '@mui/icons-material';\nimport { ActionBox, SortableList, useNonDraggableRef } from '@ringpublishing/mui-components';\n\ninterface Item {\n id: number;\n field: string;\n}\n\nconst initialItems: Item[] = [\n { id: 1, field: 'Pizza' },\n { id: 2, field: 'Cheeseburger' },\n { id: 3, field: 'Pasta' },\n];\n\nfunction CustomListItem(props: { item: Item }): React.JSX.Element {\n const ref = useNonDraggableRef();\n const theme = useTheme();\n\n return (\n <Paper sx={{ marginY: theme.spacing(2) }}>\n <Card>\n <CardContent>\n <Grid container={true} spacing={2} alignItems={'center'}>\n <Grid item={true} xs={11}>\n <span>\n Field (id: {props.item.id}) - {props.item.field}\n </span>\n </Grid>\n <Grid item={true} xs={1}>\n <IconButton\n ref={ref.setRef}\n onClick={(event): void => {\n event.stopPropagation();\n }}\n >\n <MoreVert />\n </IconButton>\n <ActionBox\n actions={[\n {\n label: 'Option 1',\n onClick: () => console.log('Option 1 clicked'),\n },\n ]}\n anchorEl={ref}\n />\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </Paper>\n );\n}\n\nexport default function DefaultExample(): React.JSX.Element {\n const [items, setItems] = React.useState(initialItems);\n\n const onChange = (newItems: Item[]): void => {\n setItems(newItems);\n };\n\n const renderItem = (item: Item): React.JSX.Element => <CustomListItem item={item} />;\n\n return <SortableList items={items} onChange={onChange} renderItem={renderItem} />;\n}\n```\n\n## With DragHandle\n\nWhen `grabByDragHandle` is set to `true`, items can only be dragged by clicking and dragging the `<SortableList.DragHandle />` component. You must incorporate the `DragHandle` component in your item's children for this mode to work.\n\n### Key Features:\n\n- Items are only draggable via the dedicated drag handle icon\n- Other interactive elements work without interference\n- Provides a clear visual affordance for drag interaction\n\n### Usage:\n\n```typescript\n<SortableList\n items={items}\n onChange={handleChange}\n renderItem={(item) => (\n <div>\n <SortableList.DragHandle />\n <span>{item.field}</span>\n </div>\n )}\n grabByDragHandle={true}\n/>\n```\n\n```tsx\n// WithDragHandleExample.tsx\nimport React from 'react';\nimport { Card, CardContent, Chip, GridLegacy as Grid, IconButton, Paper, useTheme } from '@mui/material';\nimport { MoreVert } from '@mui/icons-material';\nimport { ActionBox, SortableList } from '@ringpublishing/mui-components';\n\ninterface Item {\n id: number;\n field: string;\n}\n\nconst initialItems: Item[] = [\n { id: 1, field: 'Pizza' },\n { id: 2, field: 'Cheeseburger' },\n { id: 3, field: 'Pasta' },\n];\n\nfunction CustomListItemWithDragHandle(props: { item: Item }): React.JSX.Element {\n const anchorRef = React.useRef<HTMLButtonElement>(null);\n const theme = useTheme();\n\n return (\n <Paper sx={{ marginY: theme.spacing(2) }}>\n <Card>\n <CardContent>\n <Grid container={true} spacing={2} alignItems={'center'}>\n <Grid item={true} xs={2}>\n <SortableList.DragHandle />\n </Grid>\n <Grid item={true} xs={6}>\n <span>\n Field (id: {props.item.id}) - {props.item.field}\n </span>\n </Grid>\n <Grid item={true} xs={3}>\n <Chip label={'Available'} />\n </Grid>\n <Grid item={true} xs={1}>\n <IconButton\n ref={anchorRef}\n onClick={(): void => {\n /* noop */\n }}\n >\n <MoreVert />\n </IconButton>\n <ActionBox\n actions={[\n {\n label: 'Option 1',\n onClick: () => console.log('Option 1 clicked'),\n },\n ]}\n anchorEl={anchorRef}\n />\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </Paper>\n );\n}\n\nexport default function WithDragHandleExample(): React.JSX.Element {\n const [items, setItems] = React.useState(initialItems);\n\n const onChange = (newItems: Item[]): void => {\n setItems(newItems);\n };\n\n const renderItem = (item: Item): React.JSX.Element => <CustomListItemWithDragHandle item={item} />;\n\n return <SortableList items={items} onChange={onChange} renderItem={renderItem} grabByDragHandle={true} />;\n}\n```"
3227
+ "docs": "# SortableList\n\nA drag-and-drop sortable list component built on top of the [@dnd-kit/core](https://docs.dndkit.com/) library. It provides a container that manages drag-and-drop functionality while leaving item rendering to the developer.\n\n- Two dragging modes: grab anywhere (default) or grab by drag handle\n- Supports clickable elements inside list items without interfering with drag behavior\n- Provides `useNonDraggableRef` hook to prevent drag on specific elements (e.g., buttons, context menus)\n- Built-in `<SortableList.DragHandle />` component for explicit drag handles\n\n## Default\n\nBy default, the entire list item is draggable. The drag event is triggered only after the user moves the mouse by a small number of pixels, so clickable elements like buttons still work correctly. Use the `useNonDraggableRef` hook to prevent drag behavior on specific interactive elements.\n\n```tsx\n// DefaultExample.tsx\nimport React from 'react';\nimport { Card, CardContent, GridLegacy as Grid, IconButton, Paper, useTheme } from '@mui/material';\nimport { MoreVert } from '@mui/icons-material';\nimport { ActionBox, SortableList, useNonDraggableRef } from '@ringpublishing/mui-components';\n\ninterface Item {\n id: number;\n field: string;\n}\n\nconst initialItems: Item[] = [\n { id: 1, field: 'Pizza' },\n { id: 2, field: 'Cheeseburger' },\n { id: 3, field: 'Pasta' },\n];\n\nfunction CustomListItem(props: { item: Item }): React.JSX.Element {\n const iconBtnRef = useNonDraggableRef();\n const theme = useTheme();\n\n return (\n <Paper sx={{ marginY: theme.spacing(2) }}>\n <Card>\n <CardContent>\n <Grid container={true} spacing={2} alignItems={'center'}>\n <Grid item={true} xs={11}>\n <span>\n Field (id: {props.item.id}) - {props.item.field}\n </span>\n </Grid>\n <Grid item={true} xs={1}>\n <IconButton ref={iconBtnRef.setRef}>\n <MoreVert />\n </IconButton>\n <ActionBox\n actions={[\n {\n label: 'Option 1',\n onClick: (): void => undefined,\n },\n ]}\n anchorEl={iconBtnRef}\n />\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </Paper>\n );\n}\n\nexport default function DefaultExample(): React.JSX.Element {\n const [items, setItems] = React.useState(initialItems);\n\n const onChange = (newItems: Item[]): void => {\n setItems(newItems);\n };\n\n const renderItem = (item: Item): React.JSX.Element => <CustomListItem item={item} />;\n\n return <SortableList items={items} onChange={onChange} renderItem={renderItem} />;\n}\n```\n\n## With DragHandle\n\nWhen `grabByDragHandle` is set to `true`, items can only be dragged by clicking and dragging the `<SortableList.DragHandle />` component. You must incorporate the `DragHandle` component in your item's children for this mode to work.\n\n### Key Features:\n\n- Items are only draggable via the dedicated drag handle icon\n- Other interactive elements work without interference\n- Provides a clear visual affordance for drag interaction\n\n### Usage:\n\n```typescript\n<SortableList\n items={items}\n onChange={handleChange}\n renderItem={(item) => (\n <div>\n <SortableList.DragHandle />\n <span>{item.field}</span>\n </div>\n )}\n grabByDragHandle={true}\n/>\n```\n\n```tsx\n// WithDragHandleExample.tsx\nimport React from 'react';\nimport { Card, CardContent, Chip, GridLegacy as Grid, IconButton, Paper, useTheme } from '@mui/material';\nimport { MoreVert } from '@mui/icons-material';\nimport { ActionBox, SortableList } from '@ringpublishing/mui-components';\n\ninterface Item {\n id: number;\n field: string;\n}\n\nconst initialItems: Item[] = [\n { id: 1, field: 'Pizza' },\n { id: 2, field: 'Cheeseburger' },\n { id: 3, field: 'Pasta' },\n];\n\nfunction CustomListItemWithDragHandle(props: { item: Item }): React.JSX.Element {\n const anchorRef = React.useRef<HTMLButtonElement>(null);\n const theme = useTheme();\n\n return (\n <Paper sx={{ marginY: theme.spacing(2) }}>\n <Card>\n <CardContent>\n <Grid container={true} spacing={2} alignItems={'center'}>\n <Grid item={true} xs={2}>\n <SortableList.DragHandle />\n </Grid>\n <Grid item={true} xs={6}>\n <span>\n Field (id: {props.item.id}) - {props.item.field}\n </span>\n </Grid>\n <Grid item={true} xs={3}>\n <Chip label={'Available'} />\n </Grid>\n <Grid item={true} xs={1}>\n <IconButton\n ref={anchorRef}\n onClick={(): void => {\n /* noop */\n }}\n >\n <MoreVert />\n </IconButton>\n <ActionBox\n actions={[\n {\n label: 'Option 1',\n onClick: () => console.log('Option 1 clicked'),\n },\n ]}\n anchorEl={anchorRef}\n />\n </Grid>\n </Grid>\n </CardContent>\n </Card>\n </Paper>\n );\n}\n\nexport default function WithDragHandleExample(): React.JSX.Element {\n const [items, setItems] = React.useState(initialItems);\n\n const onChange = (newItems: Item[]): void => {\n setItems(newItems);\n };\n\n const renderItem = (item: Item): React.JSX.Element => <CustomListItemWithDragHandle item={item} />;\n\n return <SortableList items={items} onChange={onChange} renderItem={renderItem} grabByDragHandle={true} />;\n}\n```"
3228
3228
  },
3229
3229
  "organisms-text-editor": {
3230
3230
  "id": "organisms-text-editor",
package/package.json CHANGED
@@ -29,5 +29,5 @@
29
29
  "engines": {
30
30
  "node": "^18||^20||^22||^24"
31
31
  },
32
- "version": "1.16.5"
32
+ "version": "1.16.6"
33
33
  }