@brightlocal/ui-components 3.3.0 → 3.5.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/AI_USAGE.md +22 -3
- package/README.md +177 -109
- package/component-meta.json +1307 -113
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +13 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +4 -3
- package/dist/banner.cjs +1 -1
- package/dist/banner.d.ts +47 -11
- package/dist/banner.d.ts.map +1 -1
- package/dist/banner.js +156 -79
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +40 -5
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +59 -52
- package/dist/blocks/input-list.cjs +1 -1
- package/dist/blocks/input-list.d.ts +1 -0
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +39 -39
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +12 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +64 -63
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +47 -43
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +115 -97
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -10
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +281 -296
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +430 -343
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +212 -207
- package/dist/count-indicator.cjs +1 -0
- package/dist/count-indicator.d.ts +85 -0
- package/dist/count-indicator.d.ts.map +1 -0
- package/dist/count-indicator.js +72 -0
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +101 -11
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +593 -523
- package/dist/description-list.cjs +1 -0
- package/dist/description-list.d.ts +142 -0
- package/dist/description-list.d.ts.map +1 -0
- package/dist/description-list.js +173 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +26 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +62 -47
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +8 -4
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +37 -38
- package/dist/file-upload.cjs +1 -0
- package/dist/file-upload.d.ts +546 -0
- package/dist/file-upload.d.ts.map +1 -0
- package/dist/file-upload.js +1103 -0
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +7 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +52 -52
- package/dist/hooks/use-file-dropzone.cjs +1 -0
- package/dist/hooks/use-file-dropzone.d.ts +75 -0
- package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
- package/dist/hooks/use-file-dropzone.js +133 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +29 -16
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +153 -36
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +681 -623
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +30 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -115
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +37 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +131 -114
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +6 -6
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.d.ts +27 -1
- package/dist/lib/empty-canvas.d.ts.map +1 -1
- package/dist/lib/empty-canvas.js +27 -23
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +19 -2
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +14 -9
- package/dist/lib/field-aria.cjs +1 -1
- package/dist/lib/field-aria.d.ts +4 -4
- package/dist/lib/field-aria.d.ts.map +1 -1
- package/dist/lib/field-aria.js +7 -5
- package/dist/lib/media-viewer-content.cjs +1 -1
- package/dist/lib/media-viewer-content.js +1 -1
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +15 -10
- package/dist/lib/table-internal.cjs +1 -1
- package/dist/lib/table-internal.d.ts +19 -0
- package/dist/lib/table-internal.d.ts.map +1 -1
- package/dist/lib/table-internal.js +22 -7
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +230 -40
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +301 -66
- package/dist/logo-mark.cjs +1 -1
- package/dist/logo-mark.d.ts +18 -2
- package/dist/logo-mark.d.ts.map +1 -1
- package/dist/logo-mark.js +159 -79
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.d.ts +50 -7
- package/dist/media-empty.d.ts.map +1 -1
- package/dist/media-empty.js +14 -13
- package/dist/media-viewer.cjs +1 -1
- package/dist/media-viewer.js +6 -6
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +92 -101
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +17 -17
- package/dist/relative-date.d.ts +6 -0
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/result-count.cjs +1 -1
- package/dist/result-count.d.ts +13 -16
- package/dist/result-count.d.ts.map +1 -1
- package/dist/result-count.js +24 -33
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +24 -23
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +22 -3
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +152 -125
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +67 -76
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +77 -76
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +39 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +127 -76
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +34 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +115 -19
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +137 -131
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +6 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +14 -13
- package/package.json +2 -3
- package/src/blocks/empty-state.tsx +108 -48
- package/src/blocks/input-list.tsx +15 -9
- package/src/blocks/sidebar.tsx +39 -16
- package/src/components/alert-dialog.tsx +18 -2
- package/src/components/banner.tsx +247 -68
- package/src/components/button.tsx +27 -10
- package/src/components/card.tsx +89 -7
- package/src/components/chart.tsx +47 -67
- package/src/components/combobox.tsx +221 -12
- package/src/components/command.tsx +83 -37
- package/src/components/count-indicator.tsx +188 -0
- package/src/components/data-table.tsx +506 -159
- package/src/components/description-list.tsx +445 -0
- package/src/components/dialog.tsx +74 -5
- package/src/components/drawer.tsx +52 -32
- package/src/components/file-upload.tsx +2574 -0
- package/src/components/global-layout.tsx +18 -5
- package/src/components/hover-card.tsx +395 -65
- package/src/components/input-chip.tsx +67 -2
- package/src/components/input-group.tsx +89 -6
- package/src/components/list.tsx +720 -72
- package/src/components/logo-mark.tsx +109 -25
- package/src/components/media-empty.tsx +62 -7
- package/src/components/multi-select-filter.tsx +9 -16
- package/src/components/pagination.tsx +15 -2
- package/src/components/relative-date.tsx +6 -0
- package/src/components/result-count.tsx +27 -54
- package/src/components/sheet.tsx +86 -8
- package/src/components/single-select-filter.tsx +9 -16
- package/src/components/table.tsx +16 -1
- package/src/components/tabs.tsx +223 -41
- package/src/components/textarea.tsx +271 -4
- package/src/components/tooltip.tsx +29 -2
- package/src/components/typography-text.tsx +7 -2
- package/src/hooks/use-file-dropzone.ts +325 -0
- package/src/index.ts +4 -0
- package/src/lib/empty-canvas.tsx +47 -20
- package/src/lib/empty-chip.tsx +38 -3
- package/src/lib/field-aria.tsx +11 -6
- package/src/lib/table-internal.ts +38 -0
package/dist/list.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ChevronRight } from '@brightlocal/icons';
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
declare const
|
|
3
|
+
declare const listItemVariants: (props?: ({
|
|
3
4
|
variant?: "default" | "filled" | "outline" | "loading" | null | undefined;
|
|
4
5
|
align?: "start" | "center" | null | undefined;
|
|
5
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -12,6 +13,31 @@ export type ListProps = React.ComponentProps<"ul"> & {
|
|
|
12
13
|
* Data hook for automated testing (required).
|
|
13
14
|
*/
|
|
14
15
|
dataHook: string;
|
|
16
|
+
/**
|
|
17
|
+
* Pulls the list out by the row's own inline padding, so the text of plain
|
|
18
|
+
* (`default`) rows lines up with the content edge of the card around it.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Draws a hairline between rows and drops the gap and the row radius, for
|
|
24
|
+
* plain (`default`) rows such as a drill-down list. For a single break
|
|
25
|
+
* between two groups, use `ListSeparator` instead.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
divided?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Wraps the whole group in one rounded border, for a list that sits on its
|
|
31
|
+
* own as a box (e.g. inside a sheet or dialog). The rows inside stay plain:
|
|
32
|
+
* no gap, no row radius and no row border, so `ListItem variant="outline"`
|
|
33
|
+
* renders as a plain row here instead of doubling the border. Rows get
|
|
34
|
+
* balanced padding inside the box, 16px at the sides and 12px top and
|
|
35
|
+
* bottom (on the ListItemButton / ListItemLink for a pressable row). Pair it with
|
|
36
|
+
* `divided` for a 1px line between rows. For separate bordered rows, use
|
|
37
|
+
* `ListItem variant="outline"` on a list without `bordered`.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
bordered?: boolean;
|
|
15
41
|
/**
|
|
16
42
|
* Tracking element identifier for analytics.
|
|
17
43
|
*/
|
|
@@ -22,28 +48,33 @@ export type ListProps = React.ComponentProps<"ul"> & {
|
|
|
22
48
|
trackingLabel?: string;
|
|
23
49
|
};
|
|
24
50
|
/**
|
|
25
|
-
* Vertical list container for rendering a collection of
|
|
51
|
+
* Vertical list container for rendering a collection of ListItem rows.
|
|
26
52
|
*
|
|
27
53
|
* @example
|
|
28
54
|
* ```tsx
|
|
29
55
|
* <List dataHook="keywords-list">
|
|
30
|
-
* <
|
|
31
|
-
* <
|
|
32
|
-
* <
|
|
33
|
-
* </
|
|
34
|
-
* <
|
|
56
|
+
* <ListItem variant="filled" dataHook="item-1">
|
|
57
|
+
* <ListItemContent>
|
|
58
|
+
* <ListItemTitle>Keyword</ListItemTitle>
|
|
59
|
+
* </ListItemContent>
|
|
60
|
+
* <ListItemActions>
|
|
35
61
|
* <Button variant="ghost" size="icon" dataHook="remove"><XIcon /></Button>
|
|
36
|
-
* </
|
|
37
|
-
* </
|
|
62
|
+
* </ListItemActions>
|
|
63
|
+
* </ListItem>
|
|
38
64
|
* </List>
|
|
39
65
|
* ```
|
|
40
66
|
*/
|
|
67
|
+
declare const listVariants: (props?: ({
|
|
68
|
+
inset?: boolean | null | undefined;
|
|
69
|
+
divided?: boolean | null | undefined;
|
|
70
|
+
bordered?: boolean | null | undefined;
|
|
71
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
41
72
|
declare const List: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
42
73
|
/**
|
|
43
|
-
* Props for an individual
|
|
74
|
+
* Props for an individual ListItem row within a List.
|
|
44
75
|
* Extends native `<li>` props with CVA variant styling and optional testing/analytics attributes.
|
|
45
76
|
*/
|
|
46
|
-
export type
|
|
77
|
+
export type ListItemProps = React.ComponentProps<"li"> & {
|
|
47
78
|
/**
|
|
48
79
|
* Render as the child element instead of `<li>`.
|
|
49
80
|
* Useful when the item is wrapped by another element (e.g. `<motion.li>`).
|
|
@@ -60,7 +91,7 @@ export type ItemProps = React.ComponentProps<"li"> & {
|
|
|
60
91
|
variant?: "default" | "filled" | "outline" | "loading";
|
|
61
92
|
/**
|
|
62
93
|
* Cross-axis alignment of the row's children (media, content, actions).
|
|
63
|
-
* Use `"start"` when
|
|
94
|
+
* Use `"start"` when ListItemMedia (icon, avatar, step number) should pin to the
|
|
64
95
|
* first line of multi-line content instead of centering vertically.
|
|
65
96
|
* @default "center"
|
|
66
97
|
*/
|
|
@@ -80,42 +111,79 @@ export type ItemProps = React.ComponentProps<"li"> & {
|
|
|
80
111
|
};
|
|
81
112
|
/**
|
|
82
113
|
* Row component within a List. Supports `default`, `filled`, `outline`, and `loading` variants.
|
|
83
|
-
* Compose with
|
|
114
|
+
* Compose with ListItemMedia, ListItemContent, ListItemTitle, ListItemDescription, and ListItemActions.
|
|
84
115
|
*/
|
|
85
|
-
declare const
|
|
86
|
-
|
|
87
|
-
|
|
116
|
+
declare const ListItem: React.ForwardRefExoticComponent<Omit<ListItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
117
|
+
declare const listItemMediaVariants: (props?: ({
|
|
118
|
+
variant?: "default" | "image" | "icon" | null | undefined;
|
|
119
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
120
|
+
/** Props for the ListItemMedia sub-component — optional left-side media slot. */
|
|
121
|
+
export type ListItemMediaProps = React.ComponentProps<"div"> & {
|
|
122
|
+
/**
|
|
123
|
+
* How the media is framed.
|
|
124
|
+
* - `default` — the icon or avatar as it is
|
|
125
|
+
* - `icon` — a 40px bordered tile, for brand logos and icons
|
|
126
|
+
* - `image` — a 40px rounded crop, for thumbnails
|
|
127
|
+
* @default "default"
|
|
128
|
+
*/
|
|
129
|
+
variant?: "default" | "icon" | "image";
|
|
130
|
+
};
|
|
88
131
|
/**
|
|
89
|
-
* Optional left-side media slot for icons or
|
|
132
|
+
* Optional left-side media slot for icons, avatars, logo tiles or thumbnails.
|
|
90
133
|
*/
|
|
91
|
-
declare const
|
|
92
|
-
/** Props for the
|
|
93
|
-
export type
|
|
134
|
+
declare const ListItemMedia: React.ForwardRefExoticComponent<Omit<ListItemMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
135
|
+
/** Props for the ListItemContent sub-component — flexible content area within an ListItem. */
|
|
136
|
+
export type ListItemContentProps = React.ComponentProps<"div">;
|
|
94
137
|
/**
|
|
95
138
|
* Flexible content area that grows to fill available space.
|
|
96
|
-
* Place
|
|
139
|
+
* Place ListItemTitle and ListItemDescription inside.
|
|
97
140
|
*/
|
|
98
|
-
declare const
|
|
99
|
-
/** Props for the
|
|
100
|
-
export type
|
|
141
|
+
declare const ListItemContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
142
|
+
/** Props for the ListItemTitle sub-component — primary text label within a ListItem. */
|
|
143
|
+
export type ListItemTitleProps = React.ComponentProps<"div"> & {
|
|
144
|
+
/**
|
|
145
|
+
* Render as the child element, e.g. a `<label>` that names the row's Switch.
|
|
146
|
+
* Works together with `truncate`.
|
|
147
|
+
*/
|
|
148
|
+
asChild?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Wrap the title to at most two lines and clamp the rest with an ellipsis.
|
|
151
|
+
* When it is clamped, hovering it (or focusing the row's ListItemButton /
|
|
152
|
+
* ListItemLink) shows the full title in a Tooltip. Two lines that fit get
|
|
153
|
+
* no tooltip.
|
|
154
|
+
* @default false
|
|
155
|
+
*/
|
|
156
|
+
truncate?: boolean;
|
|
157
|
+
};
|
|
101
158
|
/**
|
|
102
|
-
* Primary text label within
|
|
159
|
+
* Primary text label within a ListItem.
|
|
103
160
|
*/
|
|
104
|
-
declare const
|
|
105
|
-
/** Props for the
|
|
106
|
-
export type
|
|
161
|
+
declare const ListItemTitle: React.ForwardRefExoticComponent<Omit<ListItemTitleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
162
|
+
/** Props for the ListItemDescription sub-component — supporting text beneath ListItemTitle. */
|
|
163
|
+
export type ListItemDescriptionProps = React.ComponentProps<"div"> & {
|
|
164
|
+
/**
|
|
165
|
+
* Wrap the description to at most two lines and clamp the rest with an
|
|
166
|
+
* ellipsis. When it is clamped, hovering it (or focusing the row's
|
|
167
|
+
* ListItemButton / ListItemLink) shows the full text in a Tooltip. Two lines
|
|
168
|
+
* that fit get no tooltip.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
truncate?: boolean;
|
|
172
|
+
};
|
|
107
173
|
/**
|
|
108
|
-
* Supporting description text beneath
|
|
174
|
+
* Supporting description text beneath ListItemTitle.
|
|
109
175
|
*/
|
|
110
|
-
declare const
|
|
111
|
-
/** Props for the
|
|
112
|
-
export type
|
|
176
|
+
declare const ListItemDescription: React.ForwardRefExoticComponent<Omit<ListItemDescriptionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
177
|
+
/** Props for the ListItemActions sub-component — right-side slot for action controls. */
|
|
178
|
+
export type ListItemActionsProps = React.ComponentProps<"div">;
|
|
113
179
|
/**
|
|
114
|
-
* Right-side slot for
|
|
180
|
+
* Right-side slot for trailing content: an icon button, a menu, a Switch, a
|
|
181
|
+
* Badge or Status, a text Button, or several of them side by side. It is at
|
|
182
|
+
* least 36px square, so a single icon button keeps its place.
|
|
115
183
|
*/
|
|
116
|
-
declare const
|
|
117
|
-
/** Props for the
|
|
118
|
-
export type
|
|
184
|
+
declare const ListItemActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
185
|
+
/** Props for the ListSubheader sub-component — section heading within a List. */
|
|
186
|
+
export type ListSubheaderProps = React.ComponentProps<"li"> & {
|
|
119
187
|
/**
|
|
120
188
|
* Data hook for automated testing.
|
|
121
189
|
*/
|
|
@@ -128,11 +196,133 @@ export type ItemSubheaderProps = React.ComponentProps<"li"> & {
|
|
|
128
196
|
* @example
|
|
129
197
|
* ```tsx
|
|
130
198
|
* <List dataHook="actions-list">
|
|
131
|
-
* <
|
|
132
|
-
* <
|
|
199
|
+
* <ListSubheader>Suggestions</ListSubheader>
|
|
200
|
+
* <ListItem variant="default" dataHook="item-1">...</ListItem>
|
|
133
201
|
* </List>
|
|
134
202
|
* ```
|
|
135
203
|
*/
|
|
136
|
-
declare const
|
|
137
|
-
|
|
204
|
+
declare const ListSubheader: React.ForwardRefExoticComponent<Omit<ListSubheaderProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
205
|
+
/** Props for ListItemButton — a row that runs an action (opens a sheet, a drill-down level). */
|
|
206
|
+
export type ListItemButtonProps = React.ComponentProps<"button"> & {
|
|
207
|
+
/**
|
|
208
|
+
* Data hook for automated testing.
|
|
209
|
+
*/
|
|
210
|
+
dataHook?: string;
|
|
211
|
+
/**
|
|
212
|
+
* Tracking element identifier for analytics.
|
|
213
|
+
*/
|
|
214
|
+
trackingEl?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Tracking label for analytics context.
|
|
217
|
+
*/
|
|
218
|
+
trackingLabel?: string;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Makes the whole row a button. Place it as the only child of an ListItem and put
|
|
222
|
+
* the row's parts (ListItemMedia, ListItemContent, ListItemValue, ListItemChevron) inside it.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```tsx
|
|
226
|
+
* <ListItem variant="default" dataHook="location">
|
|
227
|
+
* <ListItemButton dataHook="location-row" onClick={open}>
|
|
228
|
+
* <ListItemContent><ListItemTitle>Location</ListItemTitle></ListItemContent>
|
|
229
|
+
* <ListItemValue>London, UK</ListItemValue>
|
|
230
|
+
* <ListItemChevron />
|
|
231
|
+
* </ListItemButton>
|
|
232
|
+
* </ListItem>
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
declare const ListItemButton: React.ForwardRefExoticComponent<Omit<ListItemButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
236
|
+
/** Props for ListItemLink — a row that navigates. */
|
|
237
|
+
export type ListItemLinkProps = React.ComponentProps<"a"> & {
|
|
238
|
+
/**
|
|
239
|
+
* Render as the child element, e.g. a router `<Link>`.
|
|
240
|
+
*/
|
|
241
|
+
asChild?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Data hook for automated testing.
|
|
244
|
+
*/
|
|
245
|
+
dataHook?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Tracking element identifier for analytics.
|
|
248
|
+
*/
|
|
249
|
+
trackingEl?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Tracking label for analytics context.
|
|
252
|
+
*/
|
|
253
|
+
trackingLabel?: string;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Makes the whole row a link. Place it as the only child of an ListItem; use
|
|
257
|
+
* `asChild` to render a router link.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```tsx
|
|
261
|
+
* <ListItem variant="outline" dataHook="billing">
|
|
262
|
+
* <ListItemLink asChild dataHook="billing-link">
|
|
263
|
+
* <NextLink href="/settings/billing">
|
|
264
|
+
* <ListItemContent><ListItemTitle>Billing</ListItemTitle></ListItemContent>
|
|
265
|
+
* <ListItemChevron />
|
|
266
|
+
* </NextLink>
|
|
267
|
+
* </ListItemLink>
|
|
268
|
+
* </ListItem>
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
declare const ListItemLink: React.ForwardRefExoticComponent<Omit<ListItemLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
272
|
+
/** Props for ListItemValue — the current value shown at the end of a drill-down row. */
|
|
273
|
+
export type ListItemValueProps = React.ComponentProps<"span">;
|
|
274
|
+
/**
|
|
275
|
+
* The row's current value, before the chevron: muted, right-aligned, and cut
|
|
276
|
+
* off with an ellipsis past half the row so the title always keeps its room.
|
|
277
|
+
*/
|
|
278
|
+
declare const ListItemValue: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
279
|
+
/** Props for ListItemChevron — the trailing arrow of a row that opens something. */
|
|
280
|
+
export type ListItemChevronProps = React.ComponentProps<typeof ChevronRight>;
|
|
281
|
+
/**
|
|
282
|
+
* Trailing chevron for a row that navigates or drills down. Decorative: the
|
|
283
|
+
* row's button or link carries the meaning.
|
|
284
|
+
*/
|
|
285
|
+
declare const ListItemChevron: React.ForwardRefExoticComponent<Omit<import('@brightlocal/icons').WrappedLucideProps & React.RefAttributes<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
286
|
+
/** Props for ListSeparator — a hairline between two rows or groups. */
|
|
287
|
+
export type ListSeparatorProps = React.ComponentProps<"li">;
|
|
288
|
+
/**
|
|
289
|
+
* A hairline between rows. Hidden from assistive tech so the list's item
|
|
290
|
+
* count stays the number of rows. For a line between every row, use
|
|
291
|
+
* `<List divided>` instead.
|
|
292
|
+
*/
|
|
293
|
+
declare const ListSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
294
|
+
/** @deprecated Use `ListItem`. Removed in 4.0. */
|
|
295
|
+
declare const Item: React.ForwardRefExoticComponent<Omit<ListItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
296
|
+
/** @deprecated Use `ListItemMedia`. Removed in 4.0. */
|
|
297
|
+
declare const ItemMedia: React.ForwardRefExoticComponent<Omit<ListItemMediaProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
298
|
+
/** @deprecated Use `ListItemContent`. Removed in 4.0. */
|
|
299
|
+
declare const ItemContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
300
|
+
/** @deprecated Use `ListItemTitle`. Removed in 4.0. */
|
|
301
|
+
declare const ItemTitle: React.ForwardRefExoticComponent<Omit<ListItemTitleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
302
|
+
/** @deprecated Use `ListItemDescription`. Removed in 4.0. */
|
|
303
|
+
declare const ItemDescription: React.ForwardRefExoticComponent<Omit<ListItemDescriptionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
304
|
+
/** @deprecated Use `ListItemActions`. Removed in 4.0. */
|
|
305
|
+
declare const ItemActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
306
|
+
/** @deprecated Use `ListSubheader`. Removed in 4.0. */
|
|
307
|
+
declare const ItemSubheader: React.ForwardRefExoticComponent<Omit<ListSubheaderProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
308
|
+
/** @deprecated Use `listItemVariants`. Removed in 4.0. */
|
|
309
|
+
declare const itemVariants: (props?: ({
|
|
310
|
+
variant?: "default" | "filled" | "outline" | "loading" | null | undefined;
|
|
311
|
+
align?: "start" | "center" | null | undefined;
|
|
312
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
313
|
+
/** @deprecated Use `ListItemProps`. Removed in 4.0. */
|
|
314
|
+
export type ItemProps = ListItemProps;
|
|
315
|
+
/** @deprecated Use `ListItemMediaProps`. Removed in 4.0. */
|
|
316
|
+
export type ItemMediaProps = ListItemMediaProps;
|
|
317
|
+
/** @deprecated Use `ListItemContentProps`. Removed in 4.0. */
|
|
318
|
+
export type ItemContentProps = ListItemContentProps;
|
|
319
|
+
/** @deprecated Use `ListItemTitleProps`. Removed in 4.0. */
|
|
320
|
+
export type ItemTitleProps = ListItemTitleProps;
|
|
321
|
+
/** @deprecated Use `ListItemDescriptionProps`. Removed in 4.0. */
|
|
322
|
+
export type ItemDescriptionProps = ListItemDescriptionProps;
|
|
323
|
+
/** @deprecated Use `ListItemActionsProps`. Removed in 4.0. */
|
|
324
|
+
export type ItemActionsProps = ListItemActionsProps;
|
|
325
|
+
/** @deprecated Use `ListSubheaderProps`. Removed in 4.0. */
|
|
326
|
+
export type ItemSubheaderProps = ListSubheaderProps;
|
|
327
|
+
export { List, ListItem, ListItemButton, ListItemLink, ListItemMedia, ListItemContent, ListItemTitle, ListItemDescription, ListItemValue, ListItemChevron, ListItemActions, ListSubheader, ListSeparator, listVariants, listItemVariants, listItemMediaVariants, Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, ItemSubheader, itemVariants, };
|
|
138
328
|
//# sourceMappingURL=list.d.ts.map
|
package/dist/list.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAalD,QAAA,MAAM,gBAAgB;;;8EAmCrB,CAAC;AAMF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IACnD;;OAEG;IACH,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