@nimbus-ds/patterns 1.13.0-rc.6 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by dts-bundle-generator v8.0.0
2
2
 
3
- import { DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, DraggableAttributes, PointerSensorOptions, UniqueIdentifier } from '@dnd-kit/core';
3
+ import { DndContextProps, DragEndEvent, DragOverEvent, DragOverlayProps, DragStartEvent, DraggableAttributes, PointerSensorOptions, UniqueIdentifier } from '@dnd-kit/core';
4
4
  import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
5
5
  import { BoxBaseProps, BoxProperties, BoxProps, ButtonProperties, ButtonProps, CheckboxProperties, CheckboxProps, IconButtonProperties, IconButtonProps, InputProperties, InputProps, PaginationProperties, PaginationProps, PopoverProperties, RadioProps, SelectProperties, SelectProps, SidebarProperties, TableCellProps, TableProperties, TableRowProperties, TextareaProperties, TextareaProps, ThumbnailProperties, ThumbnailProps, ToggleProperties, ToggleProps } from '@nimbus-ds/components';
6
6
  import { IconProps } from '@nimbus-ds/icons';
@@ -990,6 +990,7 @@ export type SortableItemType = {
990
990
  /** Unique identifier for the sortable item */
991
991
  id: UniqueIdentifier;
992
992
  };
993
+ export type InternalDndContextSettings = Omit<DndContextProps, "children" | "sensors" | "collisionDetection" | "onDragStart" | "onDragOver" | "onDragEnd">;
993
994
  /**
994
995
  * Properties specific to the Sortable component
995
996
  */
@@ -1028,9 +1029,17 @@ export interface SortableProperties<T extends SortableItemType> {
1028
1029
  sensorOptions?: PointerSensorOptions;
1029
1030
  /** Configuration for the drag overlay appearance and behavior */
1030
1031
  overlaySettings?: Omit<DragOverlayProps, "wrapperElement" | "style">;
1032
+ /** Settings for the DndContext */
1033
+ dndContextSettings?: Omit<InternalDndContextSettings, "accessibility">;
1031
1034
  /** Render function for the dragged item overlay */
1032
1035
  renderOverlay?: (item: T) => ReactNode;
1033
1036
  }
1037
+ export type SortableProps<T extends SortableItemType> = SortableProperties<T> & {
1038
+ /** Configuration for the drag overlay appearance and behavior */
1039
+ overlaySettings?: DragOverlayProps;
1040
+ /** Settings for the DndContext */
1041
+ dndContextSettings?: InternalDndContextSettings;
1042
+ };
1034
1043
  export interface RenderItemProps {
1035
1044
  /** Drag attributes required for drag functionality */
1036
1045
  attributes: DraggableAttributes;
@@ -1087,7 +1096,7 @@ export type SortableItemHandleProperties = {
1087
1096
  * );
1088
1097
  * ```
1089
1098
  */
1090
- export declare function Sortable<T extends SortableItemType>({ items, onReorder, orientation, sensorOptions, onDragStart, onDragOver, onDragEnd, disabled, children, overlaySettings, renderOverlay, }: SortableProperties<T>): React.ReactElement;
1099
+ export declare function Sortable<T extends SortableItemType>({ items, onReorder, orientation, sensorOptions, onDragStart, onDragOver, onDragEnd, disabled, children, overlaySettings, renderOverlay, dndContextSettings, }: SortableProps<T>): React.ReactElement;
1091
1100
  export declare namespace Sortable {
1092
1101
  var Item: React.FC<SortableItemProps>;
1093
1102
  var ItemHandle: {
@@ -1096,5 +1105,130 @@ export declare namespace Sortable {
1096
1105
  };
1097
1106
  var displayName: string;
1098
1107
  }
1108
+ /**
1109
+ * Properties specific to the ProductDataListItem component
1110
+ */
1111
+ export interface ProductDataListItemProperties {
1112
+ /**
1113
+ * The id of the product
1114
+ */
1115
+ id: string;
1116
+ /**
1117
+ * The title of the product
1118
+ */
1119
+ title: string;
1120
+ /**
1121
+ * The image URL of the product
1122
+ */
1123
+ imageUrl?: string;
1124
+ /**
1125
+ * Alternative text for the product image
1126
+ */
1127
+ imageAlt?: string;
1128
+ /**
1129
+ * Whether the item is draggable
1130
+ */
1131
+ isDraggable?: boolean;
1132
+ /**
1133
+ * Callback fired when remove button is clicked
1134
+ */
1135
+ onRemove?: () => void;
1136
+ /**
1137
+ * Whether the item has a divider
1138
+ */
1139
+ withDivider?: boolean;
1140
+ /**
1141
+ * Additional content to be rendered
1142
+ */
1143
+ children?: ReactNode;
1144
+ }
1145
+ /**
1146
+ * Props that can be passed to the ProductDataListItem component
1147
+ */
1148
+ export type ProductDataListItemProps = ProductDataListItemProperties;
1149
+ declare const ProductDataListItem: React.FC<ProductDataListItemProps>;
1150
+ /**
1151
+ * Properties specific to the ProductDataListProducts component
1152
+ *
1153
+ * @template T - The type of each sortable item in the list
1154
+ */
1155
+ export interface ProductDataListProductsProperties<T extends SortableItemType> {
1156
+ /**
1157
+ * The array of items to be rendered and sorted in the list.
1158
+ */
1159
+ items: T[];
1160
+ /**
1161
+ * Callback fired when the order of items changes.
1162
+ *
1163
+ * @param items - The reordered array of items
1164
+ */
1165
+ onReorder: (items: T[]) => void;
1166
+ /**
1167
+ * If true, enables drag-and-drop sorting for the list items.
1168
+ * @default false
1169
+ */
1170
+ sortable?: boolean;
1171
+ /**
1172
+ * Function to render each item in the list.
1173
+ *
1174
+ * @param item - The item to render
1175
+ * @param index - The index of the item in the list
1176
+ * @returns The rendered node for the item
1177
+ */
1178
+ renderItem: (item: T, index: number) => ReactNode;
1179
+ /**
1180
+ * Additional properties to pass to the sortable container.
1181
+ */
1182
+ sortableProps?: object;
1183
+ }
1184
+ /**
1185
+ * Props that can be passed to the ProductDataListProducts component, including sortable and layout properties.
1186
+ *
1187
+ * @template T - The type of each sortable item in the list
1188
+ */
1189
+ export type ProductDataListProductsProps<T extends SortableItemType> = ProductDataListProductsProperties<T> & {
1190
+ /**
1191
+ * Additional properties for the sortable container, omitting core sortable and layout props.
1192
+ */
1193
+ sortableProps?: Omit<SortableProps<T>, "items" | "onReorder" | "orientation" | "disabled" | "renderOverlay" | "children">;
1194
+ } & Omit<BoxProps, "my" | "display" | "flexDirection" | "gap">;
1195
+ declare function ProductDataListProducts<T extends SortableItemType>({ sortable, items, onReorder, renderItem, sortableProps, children, ...props }: ProductDataListProductsProps<T>): React.ReactElement;
1196
+ declare namespace ProductDataListProducts {
1197
+ var displayName: string;
1198
+ }
1199
+ export type ProductDataListSectionProperties = PropsWithChildren<{
1200
+ title?: ReactNode;
1201
+ description?: ReactNode;
1202
+ content?: ReactNode;
1203
+ link: ReactNode;
1204
+ }>;
1205
+ export type ProductDataListSectionProps = ProductDataListSectionProperties & Omit<BoxProps, "padding" | "display" | "flexDirection" | "gap">;
1206
+ declare const ProductDataListSection: React.FC<ProductDataListSectionProps>;
1207
+ export type ProductDataListItemDividerProperties = Pick<BoxProps, "borderTopWidth" | "borderBottomWidth" | "borderColor" | "borderStyle" | "width" | "id">;
1208
+ declare const ProductDataListItemDivider: React.FC<ProductDataListItemDividerProperties>;
1209
+ /**
1210
+ * Properties specific to the ProductDataList component
1211
+ */
1212
+ export interface ProductDataListProperties {
1213
+ /**
1214
+ * The content to be rendered inside the list
1215
+ */
1216
+ children: ReactNode;
1217
+ /**
1218
+ * Optional title for the list section
1219
+ */
1220
+ title?: ReactNode;
1221
+ }
1222
+ /**
1223
+ * Props that can be passed to the ProductDataList component
1224
+ */
1225
+ export type ProductDataListProps = ProductDataListProperties & Omit<BoxProps, "padding" | "display" | "flexDirection" | "gap">;
1226
+ export interface ProductDataListComponents {
1227
+ Products: typeof ProductDataListProducts;
1228
+ Item: typeof ProductDataListItem;
1229
+ Section: typeof ProductDataListSection;
1230
+ ItemDivider: typeof ProductDataListItemDivider;
1231
+ }
1232
+ export declare const ProductDataList: React.FC<ProductDataListProps> & ProductDataListComponents;
1099
1233
 
1100
1234
  export {};