@mohasinac/appkit 3.5.1 → 3.5.3
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/_internal/server/features/checkout/actions.d.ts +0 -13
- package/dist/_internal/server/features/checkout/actions.js +88 -67
- package/dist/_internal/server/jobs/core/jobRunners.d.ts +3 -2
- package/dist/_internal/server/jobs/core/onJobCreated.js +2 -2
- package/dist/features/admin/components/AdminNotificationsView.js +30 -5
- package/dist/features/admin/components/AdminUsersView.js +102 -26
- package/dist/features/homepage/components/CustomCardsSection.js +1 -1
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/jobs/actions/enqueue-job.d.ts +2 -1
- package/dist/features/jobs/repository/jobs.repository.js +3 -3
- package/dist/features/jobs/schemas/firestore.d.ts +20 -2
- package/dist/features/jobs/schemas/firestore.js +12 -0
- package/dist/seed/addresses-seed-data.js +8 -99
- package/dist/seed/categories-seed-data.js +103 -2082
- package/dist/seed/homepage-sections-seed-data.js +9 -9
- package/dist/seed/products-art-seed-data.d.ts +1 -10
- package/dist/seed/products-art-seed-data.js +13 -122
- package/dist/seed/products-auctions-seed-data.js +39 -747
- package/dist/seed/products-classifieds-seed-data.d.ts +1 -9
- package/dist/seed/products-classifieds-seed-data.js +13 -195
- package/dist/seed/products-digital-codes-seed-data.d.ts +1 -9
- package/dist/seed/products-digital-codes-seed-data.js +13 -202
- package/dist/seed/products-live-items-seed-data.d.ts +1 -12
- package/dist/seed/products-live-items-seed-data.js +13 -188
- package/dist/seed/products-preorders-seed-data.js +18 -149
- package/dist/seed/products-prize-draws-seed-data.d.ts +1 -16
- package/dist/seed/products-prize-draws-seed-data.js +13 -385
- package/dist/seed/products-standard-seed-data.js +152 -1331
- package/dist/seed/products-stickers-seed-data.d.ts +1 -10
- package/dist/seed/products-stickers-seed-data.js +13 -122
- package/dist/seed/site-settings-seed-data.js +106 -108
- package/dist/seed/store-addresses-seed-data.js +14 -46
- package/dist/seed/stores-seed-data.js +13 -205
- package/dist/styles.css +19 -18
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/BulkActionBar.style.css +4 -4
- package/dist/ui/components/Button.style.css +14 -13
- package/dist/ui/components/HorizontalScroller.js +93 -18
- package/dist/ui/components/ListingToolbar.js +4 -4
- package/package.json +1 -1
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
|
|
161
161
|
/* dark */
|
|
162
162
|
.dark .appkit-bulk-bar {
|
|
163
|
-
border-color:
|
|
163
|
+
border-color: color-mix(in srgb, var(--appkit-color-primary) 30%, transparent);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.dark .appkit-bulk-bar__stripe {
|
|
@@ -168,13 +168,13 @@
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.dark .appkit-bulk-bar__count-pill {
|
|
171
|
-
border-color:
|
|
172
|
-
background:
|
|
171
|
+
border-color: color-mix(in srgb, var(--appkit-color-primary) 35%, transparent);
|
|
172
|
+
background: color-mix(in srgb, var(--appkit-color-primary) 10%, transparent);
|
|
173
173
|
color: var(--appkit-color-primary-300);
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.dark .appkit-bulk-bar__count-pill:hover {
|
|
177
|
-
background:
|
|
177
|
+
background: color-mix(in srgb, var(--appkit-color-primary) 18%, transparent);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.dark .appkit-bulk-bar__picker-trigger {
|
|
@@ -115,60 +115,61 @@
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.appkit-button.appkit-button--secondary {
|
|
118
|
-
background: var(--appkit-color-
|
|
118
|
+
background: var(--appkit-color-primary-50);
|
|
119
119
|
border-color: var(--appkit-color-primary-700);
|
|
120
120
|
color: var(--appkit-color-primary-700);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.appkit-button.appkit-button--secondary:hover:not(:disabled) {
|
|
124
|
-
background:
|
|
124
|
+
background: var(--appkit-color-primary-100);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.dark .appkit-button.appkit-button--secondary {
|
|
128
|
-
background: transparent;
|
|
128
|
+
background: color-mix(in srgb, var(--appkit-color-secondary) 16%, transparent);
|
|
129
129
|
border-color: var(--appkit-color-secondary);
|
|
130
130
|
color: var(--appkit-color-secondary);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
.dark .appkit-button.appkit-button--secondary:hover:not(:disabled) {
|
|
134
|
-
background: color-mix(in srgb, var(--appkit-color-secondary)
|
|
134
|
+
background: color-mix(in srgb, var(--appkit-color-secondary) 26%, transparent);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
.appkit-button--outline {
|
|
138
|
-
background: var(--appkit-color-surface);
|
|
139
|
-
border-color: var(--appkit-color-
|
|
138
|
+
background: color-mix(in srgb, var(--appkit-color-primary-700) 6%, var(--appkit-color-surface));
|
|
139
|
+
border-color: var(--appkit-color-primary-300);
|
|
140
140
|
color: var(--appkit-color-text);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
.appkit-button--outline:hover:not(:disabled) {
|
|
144
|
-
background: var(--appkit-color-
|
|
144
|
+
background: color-mix(in srgb, var(--appkit-color-primary-700) 12%, var(--appkit-color-surface));
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
.dark .appkit-button--outline {
|
|
148
|
-
background: transparent;
|
|
149
|
-
border-color: var(--appkit-color-
|
|
148
|
+
background: color-mix(in srgb, var(--appkit-color-secondary) 10%, transparent);
|
|
149
|
+
border-color: color-mix(in srgb, var(--appkit-color-secondary) 40%, transparent);
|
|
150
150
|
color: var(--appkit-color-text);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.dark .appkit-button--outline:hover:not(:disabled) {
|
|
154
|
-
background:
|
|
154
|
+
background: color-mix(in srgb, var(--appkit-color-secondary) 18%, transparent);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.appkit-button--ghost {
|
|
158
|
-
background:
|
|
158
|
+
background: var(--appkit-color-border-subtle);
|
|
159
159
|
color: var(--appkit-color-text);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.appkit-button--ghost:hover:not(:disabled) {
|
|
163
|
-
background: var(--appkit-color-border
|
|
163
|
+
background: var(--appkit-color-border);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.dark .appkit-button--ghost {
|
|
167
|
+
background: rgba(255, 255, 255, 0.06);
|
|
167
168
|
color: var(--appkit-color-text-muted);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
.dark .appkit-button--ghost:hover:not(:disabled) {
|
|
171
|
-
background: rgba(
|
|
172
|
+
background: rgba(255, 255, 255, 0.12);
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
.appkit-button.appkit-button--danger {
|
|
@@ -40,9 +40,20 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
40
40
|
const itemCount = normalizedItems.length;
|
|
41
41
|
// Number of clone slots on each side — fixed size, computed once from perView hint.
|
|
42
42
|
// Using Math.min so tiny lists don't double-render more slots than they have items.
|
|
43
|
-
const loopCloneCount = loop && itemsMode && itemCount > 0
|
|
43
|
+
const loopCloneCount = loop && itemsMode && rows <= 1 && itemCount > 0
|
|
44
44
|
? Math.min(itemCount, typeof perView === "number" ? perView : 3)
|
|
45
45
|
: 0;
|
|
46
|
+
// Grid mode (rows > 1): items are grouped into full-width "slides". Looping here
|
|
47
|
+
// clones exactly one slide on each side (the slide itself is the full stride, so a
|
|
48
|
+
// single buffer slide is enough) and teleports across a full cycle at the boundary —
|
|
49
|
+
// same technique as the single-item loop above, just at slide granularity.
|
|
50
|
+
const gridMode = itemsMode && rows > 1;
|
|
51
|
+
const gridCols = colCount > 0 ? colCount : 3;
|
|
52
|
+
const gridCardsPerSlide = rows * gridCols;
|
|
53
|
+
const gridSlideCount = gridMode
|
|
54
|
+
? Math.ceil(itemCount / gridCardsPerSlide)
|
|
55
|
+
: 0;
|
|
56
|
+
const gridLoopActive = loop && gridMode && gridSlideCount > 1;
|
|
46
57
|
// On first paint after itemWidth resolves, scroll to the first *real* item
|
|
47
58
|
// (skipping the left clone slots that provide backward-wrap buffer).
|
|
48
59
|
useEffect(() => {
|
|
@@ -92,6 +103,53 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
92
103
|
});
|
|
93
104
|
}
|
|
94
105
|
}, [loop, loopCloneCount, itemWidth, gap, itemCount, containerRef]);
|
|
106
|
+
// Prevents re-running the initial scroll-to-real-start on every resize in grid loop mode
|
|
107
|
+
const gridLoopInitialized = useRef(false);
|
|
108
|
+
// On first paint, scroll past the prepended clone slide to the first *real* slide.
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!gridLoopActive)
|
|
111
|
+
return;
|
|
112
|
+
const el = containerRef.current;
|
|
113
|
+
if (!el || gridLoopInitialized.current)
|
|
114
|
+
return;
|
|
115
|
+
gridLoopInitialized.current = true;
|
|
116
|
+
const stride = el.clientWidth + gap;
|
|
117
|
+
el.style.scrollBehavior = "auto";
|
|
118
|
+
el.scrollLeft = stride;
|
|
119
|
+
requestAnimationFrame(() => {
|
|
120
|
+
el.style.scrollBehavior = "";
|
|
121
|
+
});
|
|
122
|
+
}, [gridLoopActive, gap, containerRef]);
|
|
123
|
+
// Circular teleporter for grid mode — same idea as handleScrollLoop, at slide granularity.
|
|
124
|
+
const handleGridScrollLoop = useCallback(() => {
|
|
125
|
+
if (!gridLoopActive)
|
|
126
|
+
return;
|
|
127
|
+
const el = containerRef.current;
|
|
128
|
+
if (!el || isJumping.current)
|
|
129
|
+
return;
|
|
130
|
+
const stride = el.clientWidth + gap;
|
|
131
|
+
const cycleWidth = gridSlideCount * stride;
|
|
132
|
+
const realStart = stride; // after the 1 prepended clone slide
|
|
133
|
+
const realEnd = realStart + cycleWidth;
|
|
134
|
+
if (el.scrollLeft < realStart - stride * 0.5) {
|
|
135
|
+
isJumping.current = true;
|
|
136
|
+
el.style.scrollBehavior = "auto";
|
|
137
|
+
el.scrollLeft += cycleWidth;
|
|
138
|
+
requestAnimationFrame(() => {
|
|
139
|
+
isJumping.current = false;
|
|
140
|
+
el.style.scrollBehavior = "";
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
else if (el.scrollLeft > realEnd - el.clientWidth + stride * 0.5) {
|
|
144
|
+
isJumping.current = true;
|
|
145
|
+
el.style.scrollBehavior = "auto";
|
|
146
|
+
el.scrollLeft -= cycleWidth;
|
|
147
|
+
requestAnimationFrame(() => {
|
|
148
|
+
isJumping.current = false;
|
|
149
|
+
el.style.scrollBehavior = "";
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}, [gridLoopActive, gap, gridSlideCount, containerRef]);
|
|
95
153
|
const scrollBy = useCallback((direction) => {
|
|
96
154
|
const el = containerRef.current;
|
|
97
155
|
if (!el)
|
|
@@ -158,27 +216,35 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
158
216
|
updateExtents();
|
|
159
217
|
}, [updateExtents, itemWidth, itemCount]);
|
|
160
218
|
const content = itemsMode ? (rows > 1 ? (
|
|
161
|
-
// Grid mode: group items into slides of (rows × colCount) cards
|
|
219
|
+
// Grid mode: group items into slides of (rows × colCount) cards.
|
|
220
|
+
// Loop mode prepends a clone of the last slide and appends a clone of the
|
|
221
|
+
// first slide; handleGridScrollLoop teleports across a full cycle at the
|
|
222
|
+
// boundary so the strip appears to scroll infinitely.
|
|
162
223
|
(() => {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const slideCount = Math.ceil(normalizedItems.length / cardsPerSlide);
|
|
166
|
-
return Array.from({ length: slideCount }, (_, slideIndex) => {
|
|
167
|
-
const slideItems = normalizedItems.slice(slideIndex * cardsPerSlide, (slideIndex + 1) * cardsPerSlide);
|
|
224
|
+
const renderSlide = (slideIndex, key, isClone) => {
|
|
225
|
+
const slideItems = normalizedItems.slice(slideIndex * gridCardsPerSlide, (slideIndex + 1) * gridCardsPerSlide);
|
|
168
226
|
return (_jsx("div", { className: "appkit-hscroller__slide", style: {
|
|
169
227
|
display: "grid",
|
|
170
|
-
gridTemplateColumns: `repeat(${
|
|
228
|
+
gridTemplateColumns: `repeat(${gridCols}, 1fr)`,
|
|
171
229
|
gap: `${gap}px`,
|
|
172
230
|
width: "100%",
|
|
173
231
|
flexShrink: 0,
|
|
174
|
-
}, children: slideItems.map((item, idx) => (_jsx("div", { className: [
|
|
232
|
+
}, "aria-hidden": isClone ? true : undefined, children: slideItems.map((item, idx) => (_jsx("div", { className: [
|
|
175
233
|
"appkit-hscroller__item",
|
|
176
234
|
snapToItems ? "appkit-hscroller__item--snap" : "",
|
|
177
235
|
itemClassName,
|
|
178
236
|
]
|
|
179
237
|
.filter(Boolean)
|
|
180
|
-
.join(" "), style: minItemWidth ? { minWidth: minItemWidth } : undefined, children: renderItem(item, slideIndex *
|
|
181
|
-
}
|
|
238
|
+
.join(" "), style: minItemWidth ? { minWidth: minItemWidth } : undefined, children: renderItem(item, slideIndex * gridCardsPerSlide + idx) }, keyExtractor ? keyExtractor(item, slideIndex * gridCardsPerSlide + idx) : slideIndex * gridCardsPerSlide + idx))) }, key));
|
|
239
|
+
};
|
|
240
|
+
const realSlides = Array.from({ length: gridSlideCount }, (_, slideIndex) => renderSlide(slideIndex, `slide-${slideIndex}`, false));
|
|
241
|
+
if (!gridLoopActive)
|
|
242
|
+
return realSlides;
|
|
243
|
+
return [
|
|
244
|
+
renderSlide(gridSlideCount - 1, "slide-clone-start", true),
|
|
245
|
+
...realSlides,
|
|
246
|
+
renderSlide(0, "slide-clone-end", true),
|
|
247
|
+
];
|
|
182
248
|
})()) : loop && itemCount > 0 ? (
|
|
183
249
|
// Circular loop: fixed (itemCount + 2×loopCloneCount) DOM slots.
|
|
184
250
|
// Each slot maps to a real item via modulo — no array cloning, no list growth.
|
|
@@ -220,16 +286,25 @@ export function HorizontalScroller({ children, className = "", gap = 16, snapToI
|
|
|
220
286
|
}
|
|
221
287
|
: {};
|
|
222
288
|
const combinedOnScroll = () => {
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
289
|
+
if (gridMode) {
|
|
290
|
+
if (gridLoopActive)
|
|
291
|
+
handleGridScrollLoop();
|
|
292
|
+
else
|
|
293
|
+
updateExtents();
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
if (loop)
|
|
297
|
+
handleScrollLoop();
|
|
298
|
+
if (!loop)
|
|
299
|
+
updateExtents();
|
|
300
|
+
}
|
|
227
301
|
onScroll?.();
|
|
228
302
|
};
|
|
229
303
|
if (showArrows) {
|
|
230
|
-
const
|
|
231
|
-
const
|
|
232
|
-
const
|
|
304
|
+
const effectiveLoop = gridMode ? gridLoopActive : loop;
|
|
305
|
+
const prevDisabled = !effectiveLoop && atStart;
|
|
306
|
+
const nextDisabled = !effectiveLoop && atEnd;
|
|
307
|
+
const arrowsHidden = !effectiveLoop && atStart && atEnd; // no scrollable overflow
|
|
233
308
|
return (_jsxs("div", { className: ["appkit-hscroller appkit-hscroller--with-arrows", className]
|
|
234
309
|
.filter(Boolean)
|
|
235
310
|
.join(" "), tabIndex: 0, onKeyDown: handleKeyDown, ...hoverHandlers, "data-section": "horizontalscroller-div-511", children: [showFadeEdges && (_jsxs(_Fragment, { children: [_jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--left" }), _jsx("div", { className: "appkit-hscroller__fade appkit-hscroller__fade--right" })] })), !arrowsHidden && (_jsx("button", { type: "button", onClick: () => scrollBy(-1), "aria-label": "Previous", "aria-disabled": prevDisabled || undefined, disabled: prevDisabled, className: `appkit-hscroller__arrow appkit-hscroller__arrow--prev appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronLeft, { className: "w-4 h-4" }) })), _jsx("div", { ref: containerRef, onScroll: combinedOnScroll, className: scrollerCls(snapToItems, showScrollbar), style: { gap: `${gap}px`, paddingLeft: 36, paddingRight: 36 }, "data-section": "horizontalscroller-div-512", children: content }), !arrowsHidden && (_jsx("button", { type: "button", onClick: () => scrollBy(1), "aria-label": "Next", "aria-disabled": nextDisabled || undefined, disabled: nextDisabled, className: `appkit-hscroller__arrow appkit-hscroller__arrow--next appkit-hscroller__arrow--${arrowSize}`, children: _jsx(ChevronRight, { className: "w-4 h-4" }) }))] }));
|
|
@@ -20,7 +20,7 @@ const DEFAULT_LABELS = {
|
|
|
20
20
|
clearSelection: "Clear",
|
|
21
21
|
};
|
|
22
22
|
const VIEW_BTN_BASE = "p-1.5 sm:p-2 transition-colors";
|
|
23
|
-
const VIEW_BTN_ACTIVE = "bg-[var(--appkit-color-primary
|
|
23
|
+
const VIEW_BTN_ACTIVE = "bg-[var(--appkit-color-primary)] text-white";
|
|
24
24
|
const VIEW_BTN_INACTIVE = "text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)] text-[var(--appkit-color-text-muted)]";
|
|
25
25
|
export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue = "", searchPlaceholder = "Search…", onSearchChange, onSearchCommit, onSearchKeyDown, sortValue, sortOptions, onSortChange, view = "grid", onViewChange, hideViewToggle = false, showTableView = false, onResetAll, hasActiveState = false, bulkMode = false, bulkSelectedCount = 0, bulkTotalCount = 0, onBulkSelectAll, onBulkClear, toggles, extra, labels, className = "", }) {
|
|
26
26
|
const l = { ...DEFAULT_LABELS, ...labels };
|
|
@@ -34,8 +34,8 @@ export function ListingToolbar({ filterCount = 0, onFiltersClick, searchValue =
|
|
|
34
34
|
};
|
|
35
35
|
const allSelected = bulkTotalCount > 0 && bulkSelectedCount === bulkTotalCount;
|
|
36
36
|
return (_jsx("div", { "data-testid": "listing-toolbar", className: `sticky top-[var(--header-height,0px)] z-20 border-b border-[var(--appkit-color-border)] bg-white/95 bg-[var(--appkit-color-surface)]/95 backdrop-blur-sm py-2 px-3 sm:py-2.5 sm:px-4 ${className}`, children: _jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-2.5", children: [bulkMode ? (_jsxs("div", { className: "flex flex-1 items-center gap-2", children: [_jsxs("button", { type: "button", onClick: onBulkSelectAll, className: "flex items-center gap-1.5 rounded-lg border border-[var(--appkit-color-border)] px-3 py-1.5 text-sm font-medium text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)] transition-colors", children: [allSelected
|
|
37
|
-
? _jsx(CheckSquare, { className: "h-4 w-4 text-[var(--appkit-color-primary
|
|
38
|
-
: _jsx(Square, { className: "h-4 w-4" }), allSelected ? l.deselectAll : l.selectAll(bulkTotalCount)] }), _jsx(Span, { size: "sm", color: "muted", children: l.selected(bulkSelectedCount) }), _jsx("button", { type: "button", onClick: onBulkClear, className: CLS_CLEAR_LINK, children: l.clearSelection })] })) : onSearchChange ? (_jsxs("div", { className: "flex flex-1 items-center overflow-hidden rounded-lg border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] min-w-0", children: [_jsx("input", { type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: "min-w-0 flex-1 bg-transparent px-3 py-2 text-sm text-[var(--appkit-color-text)] placeholder-zinc-400 outline-none" }), _jsx("button", { type: "button", onClick: onSearchCommit, className: "flex shrink-0 items-center justify-center px-2.5 py-2 text-zinc-400 hover:text-[var(--appkit-color-primary
|
|
39
|
-
? "border-transparent bg-[var(--appkit-color-primary
|
|
37
|
+
? _jsx(CheckSquare, { className: "h-4 w-4 text-[var(--appkit-color-primary)]" })
|
|
38
|
+
: _jsx(Square, { className: "h-4 w-4" }), allSelected ? l.deselectAll : l.selectAll(bulkTotalCount)] }), _jsx(Span, { size: "sm", color: "muted", children: l.selected(bulkSelectedCount) }), _jsx("button", { type: "button", onClick: onBulkClear, className: CLS_CLEAR_LINK, children: l.clearSelection })] })) : onSearchChange ? (_jsxs("div", { className: "flex flex-1 items-center overflow-hidden rounded-lg border border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] min-w-0", children: [_jsx("input", { type: "text", value: searchValue, onChange: (e) => onSearchChange(e.target.value), onKeyDown: handleKeyDown, placeholder: searchPlaceholder, className: "min-w-0 flex-1 bg-transparent px-3 py-2 text-sm text-[var(--appkit-color-text)] placeholder-zinc-400 outline-none" }), _jsx("button", { type: "button", onClick: onSearchCommit, className: "flex shrink-0 items-center justify-center px-2.5 py-2 text-zinc-400 hover:text-[var(--appkit-color-primary)] transition-colors", "aria-label": l.search, children: _jsx(Search, { className: "h-4 w-4" }) })] })) : null, _jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2 shrink-0", children: [onFiltersClick && (_jsxs("button", { type: "button", onClick: onFiltersClick, className: "relative flex shrink-0 items-center gap-1.5 rounded-lg border border-[var(--appkit-color-border)] px-2.5 py-1.5 sm:px-3.5 sm:py-2 text-sm font-medium text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)] transition-colors", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "hidden sm:inline", children: l.filters }), filterCount > 0 && (_jsx(Span, { weight: "bold", className: "absolute -top-1.5 -right-1.5 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--appkit-color-primary)] text-[10px] text-white", children: filterCount }))] })), sortOptions && sortValue !== undefined && onSortChange && (_jsxs(Div, { className: "flex items-center gap-1.5 text-[var(--appkit-color-text-muted)]", children: [_jsx(Span, { size: "xs", className: "hidden md:inline whitespace-nowrap", children: l.sort }), _jsx(SortDropdown, { value: sortValue, onChange: onSortChange, options: sortOptions })] })), !hideViewToggle && onViewChange && (_jsxs("div", { className: "flex items-center rounded-lg border border-[var(--appkit-color-border)] overflow-hidden", children: [_jsx("button", { type: "button", onClick: () => onViewChange("grid"), "aria-label": l.gridView, className: `${VIEW_BTN_BASE} ${view === "grid" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(LayoutGrid, { className: "h-4 w-4" }) }), _jsx("button", { type: "button", onClick: () => onViewChange("list"), "aria-label": l.listView, className: `${VIEW_BTN_BASE} ${view === "list" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(List, { className: "h-4 w-4" }) }), showTableView && (_jsx("button", { type: "button", onClick: () => onViewChange("table"), "aria-label": l.tableView, className: `${VIEW_BTN_BASE} ${view === "table" ? VIEW_BTN_ACTIVE : VIEW_BTN_INACTIVE}`, children: _jsx(Table2, { className: "h-4 w-4" }) }))] })), onResetAll && hasActiveState && (_jsx("button", { type: "button", onClick: onResetAll, "aria-label": l.resetAll, title: l.resetAll, className: CLS_CLEAR_ICON_BTN, children: _jsx(RotateCcw, { className: "h-4 w-4" }) })), toggles && toggles.length > 0 && (_jsx("div", { className: "flex items-center gap-1", children: toggles.map((t) => (_jsx("button", { type: "button", role: "switch", "aria-checked": t.active, onClick: () => t.onChange(!t.active), className: `rounded-full border px-2.5 py-1 text-xs font-medium transition-colors whitespace-nowrap ${t.active
|
|
39
|
+
? "border-transparent bg-[var(--appkit-color-primary)] text-white"
|
|
40
40
|
: "border-[var(--appkit-color-border)] text-[var(--appkit-color-text-muted)] hover:bg-zinc-50 hover:bg-[var(--appkit-color-surface-elevated)]"}`, children: t.label }, t.label))) })), extra] })] }) }));
|
|
41
41
|
}
|