@sproutsocial/seeds-react-list 0.3.40 → 0.4.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.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { TypeStyledComponentsCommonProps } from '@sproutsocial/seeds-react-system-props';
3
+ import { TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps } from '@sproutsocial/seeds-react-system-props';
4
4
  import { TypeIconName } from '@sproutsocial/seeds-react-icon';
5
5
  import { TypePaginationConfig } from '@sproutsocial/seeds-react-pagination';
6
6
 
7
7
  type TypeListElement = "ul" | "ol";
8
- interface TypeListProps extends TypeStyledComponentsCommonProps {
8
+ interface TypeListProps extends Omit<React.HTMLAttributes<HTMLUListElement | HTMLOListElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
9
9
  /** The HTML element to render as - either "ul" or "ol" */
10
10
  as?: TypeListElement;
11
11
  /** Array of elements to render as list items */
@@ -14,12 +14,23 @@ interface TypeListProps extends TypeStyledComponentsCommonProps {
14
14
  style?: React.CSSProperties;
15
15
  }
16
16
 
17
+ /**
18
+ * List automatically routes between the Tailwind implementation (preferred)
19
+ * and the styled-components implementation (for consumers using system props
20
+ * or a styled() extension).
21
+ *
22
+ * @example
23
+ * <List as="ul">
24
+ * <ListItem>First</ListItem>
25
+ * <ListItem>Second</ListItem>
26
+ * </List>
27
+ */
17
28
  declare const List: {
18
- ({ as, children, ...rest }: TypeListProps): react_jsx_runtime.JSX.Element;
29
+ (props: TypeListProps): react_jsx_runtime.JSX.Element;
19
30
  displayName: string;
20
31
  };
21
32
 
22
- interface TypeListItemProps extends TypeStyledComponentsCommonProps {
33
+ interface TypeListItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
23
34
  /** If true, adds a border and padding around the list item which looks like a card or button */
24
35
  isBordered?: boolean;
25
36
  /** Children to display inside the list item */
@@ -27,7 +38,7 @@ interface TypeListItemProps extends TypeStyledComponentsCommonProps {
27
38
  /** Inline styles to apply to the list item element */
28
39
  style?: React.CSSProperties;
29
40
  }
30
- interface TypeListItemContentProps extends TypeStyledComponentsCommonProps {
41
+ interface TypeListItemContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
31
42
  /** Main text displayed as SmallSubheadline */
32
43
  text: React.ReactNode;
33
44
  /** Details text displayed as Byline below the main text */
@@ -42,10 +53,20 @@ interface TypeListItemContentProps extends TypeStyledComponentsCommonProps {
42
53
  actions?: React.ReactNode;
43
54
  }
44
55
 
56
+ /**
57
+ * ListItem automatically routes between the Tailwind implementation (preferred)
58
+ * and the styled-components implementation (for consumers using system props
59
+ * or a styled() extension).
60
+ */
45
61
  declare const ListItem: React.ForwardRefExoticComponent<Omit<TypeListItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
46
62
 
63
+ /**
64
+ * ListItemContent automatically routes between the Tailwind implementation
65
+ * (preferred) and the styled-components implementation (for consumers using
66
+ * system props or a styled() extension).
67
+ */
47
68
  declare const ListItemContent: {
48
- ({ text, details, aside, iconName, iconLabel, actions, ...rest }: TypeListItemContentProps): react_jsx_runtime.JSX.Element;
69
+ (props: TypeListItemContentProps): react_jsx_runtime.JSX.Element;
49
70
  displayName: string;
50
71
  };
51
72
 
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { TypeStyledComponentsCommonProps } from '@sproutsocial/seeds-react-system-props';
3
+ import { TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps } from '@sproutsocial/seeds-react-system-props';
4
4
  import { TypeIconName } from '@sproutsocial/seeds-react-icon';
5
5
  import { TypePaginationConfig } from '@sproutsocial/seeds-react-pagination';
6
6
 
7
7
  type TypeListElement = "ul" | "ol";
8
- interface TypeListProps extends TypeStyledComponentsCommonProps {
8
+ interface TypeListProps extends Omit<React.HTMLAttributes<HTMLUListElement | HTMLOListElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
9
9
  /** The HTML element to render as - either "ul" or "ol" */
10
10
  as?: TypeListElement;
11
11
  /** Array of elements to render as list items */
@@ -14,12 +14,23 @@ interface TypeListProps extends TypeStyledComponentsCommonProps {
14
14
  style?: React.CSSProperties;
15
15
  }
16
16
 
17
+ /**
18
+ * List automatically routes between the Tailwind implementation (preferred)
19
+ * and the styled-components implementation (for consumers using system props
20
+ * or a styled() extension).
21
+ *
22
+ * @example
23
+ * <List as="ul">
24
+ * <ListItem>First</ListItem>
25
+ * <ListItem>Second</ListItem>
26
+ * </List>
27
+ */
17
28
  declare const List: {
18
- ({ as, children, ...rest }: TypeListProps): react_jsx_runtime.JSX.Element;
29
+ (props: TypeListProps): react_jsx_runtime.JSX.Element;
19
30
  displayName: string;
20
31
  };
21
32
 
22
- interface TypeListItemProps extends TypeStyledComponentsCommonProps {
33
+ interface TypeListItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
23
34
  /** If true, adds a border and padding around the list item which looks like a card or button */
24
35
  isBordered?: boolean;
25
36
  /** Children to display inside the list item */
@@ -27,7 +38,7 @@ interface TypeListItemProps extends TypeStyledComponentsCommonProps {
27
38
  /** Inline styles to apply to the list item element */
28
39
  style?: React.CSSProperties;
29
40
  }
30
- interface TypeListItemContentProps extends TypeStyledComponentsCommonProps {
41
+ interface TypeListItemContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps {
31
42
  /** Main text displayed as SmallSubheadline */
32
43
  text: React.ReactNode;
33
44
  /** Details text displayed as Byline below the main text */
@@ -42,10 +53,20 @@ interface TypeListItemContentProps extends TypeStyledComponentsCommonProps {
42
53
  actions?: React.ReactNode;
43
54
  }
44
55
 
56
+ /**
57
+ * ListItem automatically routes between the Tailwind implementation (preferred)
58
+ * and the styled-components implementation (for consumers using system props
59
+ * or a styled() extension).
60
+ */
45
61
  declare const ListItem: React.ForwardRefExoticComponent<Omit<TypeListItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
46
62
 
63
+ /**
64
+ * ListItemContent automatically routes between the Tailwind implementation
65
+ * (preferred) and the styled-components implementation (for consumers using
66
+ * system props or a styled() extension).
67
+ */
47
68
  declare const ListItemContent: {
48
- ({ text, details, aside, iconName, iconLabel, actions, ...rest }: TypeListItemContentProps): react_jsx_runtime.JSX.Element;
69
+ (props: TypeListItemContentProps): react_jsx_runtime.JSX.Element;
49
70
  displayName: string;
50
71
  };
51
72
 
package/dist/index.js CHANGED
@@ -39,6 +39,9 @@ __export(index_exports, {
39
39
  });
40
40
  module.exports = __toCommonJS(index_exports);
41
41
 
42
+ // src/ListHybrid.tsx
43
+ var import_seeds_react_system_props = require("@sproutsocial/seeds-react-system-props");
44
+
42
45
  // src/styles.tsx
43
46
  var import_styled_components = __toESM(require("styled-components"));
44
47
  var Container = import_styled_components.default.ul`
@@ -48,21 +51,85 @@ var Container = import_styled_components.default.ul`
48
51
  `;
49
52
  var styles_default = Container;
50
53
 
51
- // src/List.tsx
54
+ // src/ListStyled.tsx
52
55
  var import_jsx_runtime = require("react/jsx-runtime");
53
- var List = ({ as = "ul", children, ...rest }) => {
56
+ var ListStyled = ({ as = "ul", children, ...rest }) => {
54
57
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(styles_default, { as, ...rest, children });
55
58
  };
59
+ ListStyled.displayName = "List";
60
+ var ListStyled_default = ListStyled;
61
+
62
+ // src/ListTailwind.tsx
63
+ var React = require("react");
64
+
65
+ // src/cn.ts
66
+ function cn(...inputs) {
67
+ const classes = [];
68
+ for (const input of inputs) {
69
+ if (!input) continue;
70
+ if (typeof input === "string") {
71
+ classes.push(input);
72
+ } else if (typeof input === "object") {
73
+ for (const [key, value] of Object.entries(input)) {
74
+ if (value) {
75
+ classes.push(key);
76
+ }
77
+ }
78
+ }
79
+ }
80
+ return classes.join(" ");
81
+ }
82
+
83
+ // src/ListTailwind.tsx
84
+ var import_jsx_runtime2 = require("react/jsx-runtime");
85
+ var ListTailwind = ({
86
+ as: Element = "ul",
87
+ children,
88
+ className,
89
+ ...rest
90
+ }) => {
91
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
92
+ Element,
93
+ {
94
+ className: cn("seeds-list", className),
95
+ ...rest,
96
+ children
97
+ }
98
+ );
99
+ };
100
+ ListTailwind.displayName = "List";
101
+ var ListTailwind_default = ListTailwind;
102
+
103
+ // src/ListHybrid.tsx
104
+ var import_jsx_runtime3 = require("react/jsx-runtime");
105
+ var ListHybrid = (props) => {
106
+ if ((0, import_seeds_react_system_props.hasStyledProps)(props) || (0, import_seeds_react_system_props.isStyledExtension)(props)) {
107
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ListStyled_default, { ...props });
108
+ }
109
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ListTailwind_default, { ...props });
110
+ };
111
+ ListHybrid.displayName = "List";
112
+ var ListHybrid_default = ListHybrid;
113
+
114
+ // src/List.tsx
115
+ var List = ListHybrid_default;
56
116
  List.displayName = "List";
57
117
  var List_default = List;
58
118
 
59
119
  // src/ListItem.tsx
60
- var React = __toESM(require("react"));
120
+ var React5 = __toESM(require("react"));
121
+
122
+ // src/ListItemHybrid.tsx
123
+ var React4 = __toESM(require("react"));
124
+ var import_seeds_react_system_props2 = require("@sproutsocial/seeds-react-system-props");
125
+
126
+ // src/ListItemStyled.tsx
127
+ var React2 = __toESM(require("react"));
61
128
  var import_seeds_react_box = __toESM(require("@sproutsocial/seeds-react-box"));
62
- var import_jsx_runtime2 = require("react/jsx-runtime");
63
- var ListItem = React.forwardRef(
129
+ var import_jsx_runtime4 = require("react/jsx-runtime");
130
+ var ListItemStyled = React2.forwardRef(
64
131
  ({ isBordered, children, ...rest }, ref) => {
65
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
132
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
66
133
  import_seeds_react_box.default,
67
134
  {
68
135
  as: "li",
@@ -80,16 +147,64 @@ var ListItem = React.forwardRef(
80
147
  );
81
148
  }
82
149
  );
150
+ ListItemStyled.displayName = "ListItem";
151
+ var ListItemStyled_default = ListItemStyled;
152
+
153
+ // src/ListItemTailwind.tsx
154
+ var React3 = __toESM(require("react"));
155
+ var import_jsx_runtime5 = require("react/jsx-runtime");
156
+ var ListItemTailwind = React3.forwardRef(
157
+ ({ isBordered, children, className, ...rest }, ref) => {
158
+ const classes = cn(
159
+ "seeds-list-item",
160
+ { "seeds-list-item-bordered": !!isBordered },
161
+ className
162
+ );
163
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
164
+ "li",
165
+ {
166
+ ref,
167
+ className: classes,
168
+ ...rest,
169
+ children
170
+ }
171
+ );
172
+ }
173
+ );
174
+ ListItemTailwind.displayName = "ListItem";
175
+ var ListItemTailwind_default = ListItemTailwind;
176
+
177
+ // src/ListItemHybrid.tsx
178
+ var import_jsx_runtime6 = require("react/jsx-runtime");
179
+ var ListItemHybrid = React4.forwardRef(
180
+ (props, ref) => {
181
+ if ((0, import_seeds_react_system_props2.hasStyledProps)(props) || (0, import_seeds_react_system_props2.isStyledExtension)(props)) {
182
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemStyled_default, { ...props, ref });
183
+ }
184
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListItemTailwind_default, { ...props, ref });
185
+ }
186
+ );
187
+ ListItemHybrid.displayName = "ListItem";
188
+ var ListItemHybrid_default = ListItemHybrid;
189
+
190
+ // src/ListItem.tsx
191
+ var import_jsx_runtime7 = require("react/jsx-runtime");
192
+ var ListItem = React5.forwardRef(
193
+ (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ListItemHybrid_default, { ...props, ref })
194
+ );
83
195
  ListItem.displayName = "ListItem";
84
196
  var ListItem_default = ListItem;
85
197
 
86
- // src/ListItemContent.tsx
87
- var React2 = require("react");
198
+ // src/ListItemContentHybrid.tsx
199
+ var import_seeds_react_system_props3 = require("@sproutsocial/seeds-react-system-props");
200
+
201
+ // src/ListItemContentStyled.tsx
202
+ var React6 = require("react");
88
203
  var import_seeds_react_box2 = __toESM(require("@sproutsocial/seeds-react-box"));
89
204
  var import_seeds_react_text = __toESM(require("@sproutsocial/seeds-react-text"));
90
205
  var import_seeds_react_icon = require("@sproutsocial/seeds-react-icon");
91
- var import_jsx_runtime3 = require("react/jsx-runtime");
92
- var ListItemContent = ({
206
+ var import_jsx_runtime8 = require("react/jsx-runtime");
207
+ var ListItemContentStyled = ({
93
208
  text,
94
209
  details,
95
210
  aside,
@@ -98,7 +213,7 @@ var ListItemContent = ({
98
213
  actions,
99
214
  ...rest
100
215
  }) => {
101
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
216
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
102
217
  import_seeds_react_box2.default,
103
218
  {
104
219
  display: "flex",
@@ -107,39 +222,94 @@ var ListItemContent = ({
107
222
  alignItems: "baseline",
108
223
  ...rest,
109
224
  children: [
110
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_seeds_react_box2.default, { display: "flex", flex: "1", children: [
111
- iconName && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_icon.Icon, { mr: 300, name: iconName, size: "small", ariaLabel: iconLabel }) }),
112
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_seeds_react_box2.default, { flex: "1", children: [
113
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_text.default.SmallSubHeadline, { as: "div", children: text }),
114
- details && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_text.default.Byline, { as: "div", mt: 200, children: details })
225
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_seeds_react_box2.default, { display: "flex", flex: "1", children: [
226
+ iconName && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_seeds_react_icon.Icon, { mr: 300, name: iconName, size: "small", ariaLabel: iconLabel }) }),
227
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_seeds_react_box2.default, { flex: "1", children: [
228
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_seeds_react_text.default.SmallSubHeadline, { as: "div", children: text }),
229
+ details && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_seeds_react_text.default.Byline, { as: "div", mt: 200, children: details })
115
230
  ] })
116
231
  ] }),
117
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_seeds_react_box2.default, { display: "flex", alignItems: "center", gap: 300, flexShrink: 0, children: [
118
- aside && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_text.default.Byline, { as: "div", children: aside }),
119
- actions && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_seeds_react_box2.default, { display: "flex", alignItems: "center", children: actions })
232
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_seeds_react_box2.default, { display: "flex", alignItems: "center", gap: 300, flexShrink: 0, children: [
233
+ aside && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_seeds_react_text.default.Byline, { as: "div", children: aside }),
234
+ actions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_seeds_react_box2.default, { display: "flex", alignItems: "center", children: actions })
120
235
  ] })
121
236
  ]
122
237
  }
123
238
  );
124
239
  };
240
+ ListItemContentStyled.displayName = "ListItemContent";
241
+ var ListItemContentStyled_default = ListItemContentStyled;
242
+
243
+ // src/ListItemContentTailwind.tsx
244
+ var React7 = require("react");
245
+ var import_seeds_react_text2 = __toESM(require("@sproutsocial/seeds-react-text"));
246
+ var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
247
+ var import_jsx_runtime9 = require("react/jsx-runtime");
248
+ var ListItemContentTailwind = ({
249
+ text,
250
+ details,
251
+ aside,
252
+ iconName,
253
+ iconLabel,
254
+ actions,
255
+ className,
256
+ ...rest
257
+ }) => {
258
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
259
+ "div",
260
+ {
261
+ className: cn("seeds-list-item-content", className),
262
+ ...rest,
263
+ children: [
264
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "seeds-list-item-content-main", children: [
265
+ iconName && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "seeds-list-item-content-icon", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_seeds_react_icon2.Icon, { name: iconName, size: "small", ariaLabel: iconLabel }) }),
266
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "seeds-list-item-content-text", children: [
267
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_seeds_react_text2.default.SmallSubHeadline, { as: "div", children: text }),
268
+ details && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_seeds_react_text2.default.Byline, { as: "div", className: "seeds-list-item-content-details", children: details })
269
+ ] })
270
+ ] }),
271
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "seeds-list-item-content-aside", children: [
272
+ aside && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_seeds_react_text2.default.Byline, { as: "div", children: aside }),
273
+ actions && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "seeds-list-item-content-actions", children: actions })
274
+ ] })
275
+ ]
276
+ }
277
+ );
278
+ };
279
+ ListItemContentTailwind.displayName = "ListItemContent";
280
+ var ListItemContentTailwind_default = ListItemContentTailwind;
281
+
282
+ // src/ListItemContentHybrid.tsx
283
+ var import_jsx_runtime10 = require("react/jsx-runtime");
284
+ var ListItemContentHybrid = (props) => {
285
+ if ((0, import_seeds_react_system_props3.hasStyledProps)(props) || (0, import_seeds_react_system_props3.isStyledExtension)(props)) {
286
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ListItemContentStyled_default, { ...props });
287
+ }
288
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ListItemContentTailwind_default, { ...props });
289
+ };
290
+ ListItemContentHybrid.displayName = "ListItemContent";
291
+ var ListItemContentHybrid_default = ListItemContentHybrid;
292
+
293
+ // src/ListItemContent.tsx
294
+ var ListItemContent = ListItemContentHybrid_default;
125
295
  ListItemContent.displayName = "ListItemContent";
126
296
  var ListItemContent_default = ListItemContent;
127
297
 
128
298
  // src/DataList.tsx
129
- var React4 = __toESM(require("react"));
299
+ var React9 = __toESM(require("react"));
130
300
  var import_react = require("react");
131
301
 
132
302
  // src/DataItemSkeleton.tsx
133
- var React3 = require("react");
303
+ var React8 = require("react");
134
304
  var import_seeds_react_box3 = __toESM(require("@sproutsocial/seeds-react-box"));
135
305
  var import_seeds_react_skeleton = __toESM(require("@sproutsocial/seeds-react-skeleton"));
136
- var import_jsx_runtime4 = require("react/jsx-runtime");
306
+ var import_jsx_runtime11 = require("react/jsx-runtime");
137
307
  var DataItemSkeleton = ({
138
308
  hasIcon = false,
139
309
  hasAside = false,
140
310
  hasSubtext = false
141
311
  }) => {
142
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
312
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
143
313
  import_seeds_react_box3.default,
144
314
  {
145
315
  display: "flex",
@@ -148,14 +318,14 @@ var DataItemSkeleton = ({
148
318
  alignItems: "flex-start",
149
319
  mb: 100,
150
320
  children: [
151
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_seeds_react_box3.default, { display: "flex", flex: "1", children: [
152
- hasIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_box3.default, { mr: 300, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_skeleton.default, { width: 21, height: 21, borderRadius: "pill" }) }),
153
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_seeds_react_box3.default, { flex: "1", children: [
154
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_skeleton.default, { width: "80%", height: 21, borderRadius: "inner" }),
155
- hasSubtext && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_skeleton.default, { width: "60%", height: 16, mt: 300, borderRadius: "inner" })
321
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_seeds_react_box3.default, { display: "flex", flex: "1", children: [
322
+ hasIcon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_box3.default, { mr: 300, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_skeleton.default, { width: 21, height: 21, borderRadius: "pill" }) }),
323
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_seeds_react_box3.default, { flex: "1", children: [
324
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_skeleton.default, { width: "80%", height: 21, borderRadius: "inner" }),
325
+ hasSubtext && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_skeleton.default, { width: "60%", height: 16, mt: 300, borderRadius: "inner" })
156
326
  ] })
157
327
  ] }),
158
- hasAside && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_box3.default, { display: "flex", alignItems: "center", gap: 300, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_seeds_react_skeleton.default, { width: 60, height: 21, borderRadius: "inner" }) })
328
+ hasAside && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_box3.default, { display: "flex", alignItems: "center", gap: 300, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_seeds_react_skeleton.default, { width: 60, height: 21, borderRadius: "inner" }) })
159
329
  ]
160
330
  }
161
331
  );
@@ -167,7 +337,7 @@ var DataItemSkeleton_default = DataItemSkeleton;
167
337
  var import_seeds_react_box4 = __toESM(require("@sproutsocial/seeds-react-box"));
168
338
  var import_styled_components2 = __toESM(require("styled-components"));
169
339
  var import_seeds_react_pagination = require("@sproutsocial/seeds-react-pagination");
170
- var import_jsx_runtime5 = require("react/jsx-runtime");
340
+ var import_jsx_runtime12 = require("react/jsx-runtime");
171
341
  var HeaderContent = (0, import_styled_components2.default)(import_seeds_react_box4.default)`
172
342
  width: 100%;
173
343
  transition: transform 0.4s ease-in-out;
@@ -199,7 +369,7 @@ var DataList = ({
199
369
  const pageSize = controlledPageSize ?? internalPageSize;
200
370
  const handlePageChange = onPageChange ?? setInternalPageIndex;
201
371
  const handlePageSizeChange = onPageSizeChange ?? setInternalPageSize;
202
- const displayData = React4.useMemo(() => {
372
+ const displayData = React9.useMemo(() => {
203
373
  if (!paginationConfig) {
204
374
  return data;
205
375
  }
@@ -209,8 +379,8 @@ var DataList = ({
209
379
  }, [data, paginationConfig, currentPageIndex, pageSize]);
210
380
  const totalRows = totalItems !== void 0 ? totalItems : data.length;
211
381
  if (isLoading) {
212
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
213
- Header && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
382
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
383
+ Header && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
214
384
  HeaderContent,
215
385
  {
216
386
  style: {
@@ -224,11 +394,11 @@ var DataList = ({
224
394
  children: Header
225
395
  }
226
396
  ),
227
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(List_default, { as, ...rest, children: loadingItems.map((index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ListItem_default, { ...listItemProps, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingComponent, {}) }, index)) })
397
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(List_default, { as, ...rest, children: loadingItems.map((index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ListItem_default, { ...listItemProps, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingComponent, {}) }, index)) })
228
398
  ] });
229
399
  }
230
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
231
- Header && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
400
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
401
+ Header && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
232
402
  HeaderContent,
233
403
  {
234
404
  style: {
@@ -242,8 +412,8 @@ var DataList = ({
242
412
  children: Header
243
413
  }
244
414
  ),
245
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(List_default, { as, ...rest, children: displayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ListItem_default, { ...listItemProps, children: renderItem(item, index) }, index)) }),
246
- paginationConfig && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
415
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(List_default, { as, ...rest, children: displayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ListItem_default, { ...listItemProps, children: renderItem(item, index) }, index)) }),
416
+ paginationConfig && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
247
417
  import_seeds_react_pagination.Pagination,
248
418
  {
249
419
  paginationConfig,
@@ -260,13 +430,13 @@ DataList.displayName = "DataList";
260
430
  var DataList_default = DataList;
261
431
 
262
432
  // src/VirtualizedDataList.tsx
263
- var React5 = __toESM(require("react"));
433
+ var React10 = __toESM(require("react"));
264
434
  var import_seeds_react_box5 = __toESM(require("@sproutsocial/seeds-react-box"));
265
435
  var import_seeds_react_loader = __toESM(require("@sproutsocial/seeds-react-loader"));
266
436
  var import_react_virtual = require("@tanstack/react-virtual");
267
437
  var import_react_intersection_observer = require("react-intersection-observer");
268
438
  var import_styled_components3 = __toESM(require("styled-components"));
269
- var import_jsx_runtime6 = require("react/jsx-runtime");
439
+ var import_jsx_runtime13 = require("react/jsx-runtime");
270
440
  var HeaderContent2 = (0, import_styled_components3.default)(import_seeds_react_box5.default)`
271
441
  width: 100%;
272
442
  transition: transform 0.4s ease-in-out;
@@ -286,7 +456,7 @@ var Experimental_VirtualizedDataList = ({
286
456
  ...rest
287
457
  }) => {
288
458
  const afterInView = (0, import_react_intersection_observer.useInView)();
289
- const parentRef = React5.useRef(null);
459
+ const parentRef = React10.useRef(null);
290
460
  const count = data.length;
291
461
  const virtualizer = (0, import_react_virtual.useVirtualizer)({
292
462
  count,
@@ -296,9 +466,9 @@ var Experimental_VirtualizedDataList = ({
296
466
  });
297
467
  const items = virtualizer.getVirtualItems();
298
468
  const offset = virtualizer.scrollOffset ?? 0;
299
- const prevOffsetRef = React5.useRef(offset);
300
- const [headerVisible, setHeaderVisible] = React5.useState(true);
301
- React5.useEffect(() => {
469
+ const prevOffsetRef = React10.useRef(offset);
470
+ const [headerVisible, setHeaderVisible] = React10.useState(true);
471
+ React10.useEffect(() => {
302
472
  const prev = prevOffsetRef.current;
303
473
  const scrollingUp = offset < prev;
304
474
  prevOffsetRef.current = offset;
@@ -309,12 +479,12 @@ var Experimental_VirtualizedDataList = ({
309
479
  }
310
480
  }, [offset, removeHeaderDepth]);
311
481
  const transform = headerVisible ? "translateY(0px)" : `translateY(-${headerHeight}px)`;
312
- React5.useEffect(() => {
482
+ React10.useEffect(() => {
313
483
  if (afterInView.inView) {
314
484
  onEndReached?.();
315
485
  }
316
486
  }, [onEndReached, afterInView.inView]);
317
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
487
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
318
488
  "div",
319
489
  {
320
490
  ref: parentRef,
@@ -326,7 +496,7 @@ var Experimental_VirtualizedDataList = ({
326
496
  contain: "strict"
327
497
  },
328
498
  children: [
329
- Header && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
499
+ Header && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
330
500
  HeaderContent2,
331
501
  {
332
502
  style: {
@@ -341,7 +511,7 @@ var Experimental_VirtualizedDataList = ({
341
511
  children: Header
342
512
  }
343
513
  ),
344
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
514
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
345
515
  List_default,
346
516
  {
347
517
  as,
@@ -351,7 +521,7 @@ var Experimental_VirtualizedDataList = ({
351
521
  position: "relative"
352
522
  },
353
523
  children: items.map((virtualRow) => {
354
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
524
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
355
525
  ListItem_default,
356
526
  {
357
527
  "data-index": virtualRow.index,
@@ -370,7 +540,7 @@ var Experimental_VirtualizedDataList = ({
370
540
  })
371
541
  }
372
542
  ),
373
- hasNextPage && !isFetchingNextPage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: afterInView.ref, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_seeds_react_loader.default, { delay: false }) })
543
+ hasNextPage && !isFetchingNextPage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref: afterInView.ref, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_seeds_react_loader.default, { delay: false }) })
374
544
  ]
375
545
  }
376
546
  );
@@ -379,13 +549,13 @@ Experimental_VirtualizedDataList.displayName = "Experimental_VirtualizedDataList
379
549
  var VirtualizedDataList_default = Experimental_VirtualizedDataList;
380
550
 
381
551
  // src/ListTypes.ts
382
- var React6 = require("react");
552
+ var React11 = require("react");
383
553
 
384
554
  // src/ListItemTypes.ts
385
- var React7 = require("react");
555
+ var React12 = require("react");
386
556
 
387
557
  // src/DataListTypes.ts
388
- var React8 = require("react");
558
+ var React13 = require("react");
389
559
  // Annotate the CommonJS export names for ESM import in node:
390
560
  0 && (module.exports = {
391
561
  DataItemSkeleton,