@bricks-toolkit/toolkit 0.1.1 → 0.1.2
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/README.md +9 -9
- package/dist/avatar/index.cjs +11 -1
- package/dist/avatar/index.mjs +2 -1
- package/dist/badge/index.cjs +11 -1
- package/dist/badge/index.mjs +2 -1
- package/dist/breadcrumbs/index.cjs +11 -1
- package/dist/breadcrumbs/index.mjs +2 -1
- package/dist/button/index.cjs +13 -2
- package/dist/button/index.mjs +4 -2
- package/dist/card/index.cjs +31 -1
- package/dist/card/index.mjs +2 -1
- package/dist/checkbox/index.cjs +11 -1
- package/dist/checkbox/index.mjs +2 -1
- package/dist/chunk-2POU3NX4.mjs +192 -0
- package/dist/chunk-32SKYPQW.mjs +156 -0
- package/dist/chunk-446OJWC6.mjs +285 -0
- package/dist/chunk-4DA7CRNV.mjs +376 -0
- package/dist/chunk-4DR57X7U.mjs +182 -0
- package/dist/chunk-4QSDPHPI.mjs +285 -0
- package/dist/chunk-56ILK7Y4.cjs +315 -0
- package/dist/chunk-5J3OMAO4.cjs +222 -0
- package/dist/chunk-5RKET2JO.cjs +287 -0
- package/dist/chunk-65UZC3FK.mjs +312 -0
- package/dist/chunk-6CC5KIA5.cjs +148 -0
- package/dist/chunk-6R3OYBQ6.cjs +209 -0
- package/dist/chunk-6UO72EJA.cjs +2 -0
- package/dist/chunk-6ZCY4O5M.mjs +63 -0
- package/dist/chunk-7364SUK6.mjs +359 -0
- package/dist/chunk-7DDDQ3RH.cjs +66 -0
- package/dist/chunk-7PDGAIC3.cjs +189 -0
- package/dist/chunk-7R5JRJ2W.cjs +255 -0
- package/dist/chunk-7WNJ7L4Z.mjs +335 -0
- package/dist/chunk-AJXVELXK.cjs +218 -0
- package/dist/chunk-ARTXRQO6.mjs +1 -0
- package/dist/chunk-B4OV5GRT.cjs +510 -0
- package/dist/chunk-B5MYGYJY.mjs +122 -0
- package/dist/chunk-BBVWG5GH.cjs +75 -0
- package/dist/chunk-BVBCAAES.mjs +35 -0
- package/dist/chunk-CBA54EY4.mjs +508 -0
- package/dist/chunk-CMER5LO3.mjs +330 -0
- package/dist/chunk-DHC5LI2P.cjs +338 -0
- package/dist/chunk-DMLPA65B.mjs +107 -0
- package/dist/chunk-DN2GFJF4.mjs +175 -0
- package/dist/chunk-ECLNLPOR.cjs +70 -0
- package/dist/chunk-EV463QT5.cjs +53 -0
- package/dist/chunk-FOVJHEWH.mjs +51 -0
- package/dist/chunk-G4HVY6FM.mjs +203 -0
- package/dist/chunk-H77YWN3L.mjs +220 -0
- package/dist/chunk-HIWJDLIS.cjs +124 -0
- package/dist/chunk-HQGDSOSN.mjs +274 -0
- package/dist/chunk-JKPNJ4PZ.mjs +313 -0
- package/dist/chunk-JV6AWBN5.mjs +113 -0
- package/dist/chunk-KA35BV7V.mjs +207 -0
- package/dist/chunk-KLBABQEJ.cjs +378 -0
- package/dist/chunk-L5VQZZVR.cjs +3197 -0
- package/dist/chunk-LTG6YP5I.cjs +69 -0
- package/dist/chunk-MVUNJPGH.cjs +184 -0
- package/dist/chunk-NMJ5CVZH.cjs +2 -0
- package/dist/chunk-NRCNRHXL.cjs +109 -0
- package/dist/chunk-NRZIXK35.cjs +276 -0
- package/dist/chunk-OCPFOFJ4.mjs +3195 -0
- package/dist/chunk-OEU5VG3D.cjs +362 -0
- package/dist/chunk-OPOCCRJG.cjs +193 -0
- package/dist/chunk-OQPCL5XX.mjs +187 -0
- package/dist/chunk-PCYGJNEQ.cjs +280 -0
- package/dist/chunk-PJH2KEWK.mjs +200 -0
- package/dist/chunk-PJWELBN2.cjs +115 -0
- package/dist/chunk-Q3IFXFFD.cjs +202 -0
- package/dist/chunk-R72GDCWE.cjs +314 -0
- package/dist/chunk-RAD5VJHR.mjs +146 -0
- package/dist/chunk-RYWDZHKG.mjs +274 -0
- package/dist/chunk-S7VEND5Z.cjs +162 -0
- package/dist/chunk-SBNNV6FE.mjs +1 -0
- package/dist/chunk-SFUOCZJY.mjs +187 -0
- package/dist/chunk-SHQ2MPBE.mjs +73 -0
- package/dist/chunk-TIVSMCXZ.mjs +253 -0
- package/dist/chunk-TNGW5YHA.cjs +37 -0
- package/dist/chunk-VC7MOPU6.cjs +287 -0
- package/dist/chunk-VHVFRWF5.mjs +64 -0
- package/dist/chunk-VKQDW7C2.mjs +336 -0
- package/dist/chunk-VRZFAKSV.cjs +177 -0
- package/dist/chunk-W2ZAPLQH.cjs +337 -0
- package/dist/chunk-XFNRKHHF.cjs +332 -0
- package/dist/chunk-Y3NTKFUE.mjs +66 -0
- package/dist/chunk-Y6AN7AWX.cjs +205 -0
- package/dist/chunk-YMMNWJT6.cjs +134 -0
- package/dist/chunk-YOTCXSXL.mjs +132 -0
- package/dist/combo-box/index.cjs +11 -1
- package/dist/combo-box/index.mjs +2 -1
- package/dist/date-picker/index.cjs +11 -2
- package/dist/date-picker/index.mjs +2 -2
- package/dist/dialog/index.cjs +27 -1
- package/dist/dialog/index.mjs +2 -1
- package/dist/dropdown-menu/index.cjs +27 -1
- package/dist/dropdown-menu/index.mjs +2 -1
- package/dist/email/index.cjs +11 -2
- package/dist/email/index.mjs +2 -2
- package/dist/file-upload/index.cjs +11 -1
- package/dist/file-upload/index.mjs +2 -1
- package/dist/header/index.cjs +14 -2
- package/dist/header/index.mjs +5 -2
- package/dist/icon-button/index.cjs +13 -2
- package/dist/icon-button/index.mjs +4 -2
- package/dist/image/index.cjs +12 -1
- package/dist/image/index.mjs +3 -1
- package/dist/index.cjs +839 -2
- package/dist/index.d.ts +141 -75
- package/dist/index.mjs +601 -2
- package/dist/link/index.cjs +11 -1
- package/dist/link/index.mjs +2 -1
- package/dist/loader/index.cjs +11 -2
- package/dist/loader/index.mjs +2 -2
- package/dist/modal/index.cjs +27 -1
- package/dist/modal/index.mjs +2 -1
- package/dist/multi-select/index.cjs +11 -2
- package/dist/multi-select/index.mjs +2 -2
- package/dist/otp-input/index.cjs +11 -1
- package/dist/otp-input/index.mjs +2 -1
- package/dist/password-input/index.cjs +11 -2
- package/dist/password-input/index.mjs +2 -2
- package/dist/phone/index.cjs +11 -2
- package/dist/phone/index.mjs +2 -2
- package/dist/radio-button/index.cjs +11 -1
- package/dist/radio-button/index.mjs +2 -1
- package/dist/search-input/index.cjs +12 -2
- package/dist/search-input/index.mjs +3 -2
- package/dist/select/index.cjs +11 -2
- package/dist/select/index.mjs +2 -2
- package/dist/sidebar/index.cjs +11 -1
- package/dist/sidebar/index.mjs +2 -1
- package/dist/skeleton/index.cjs +27 -1
- package/dist/skeleton/index.mjs +2 -1
- package/dist/styles.css +5074 -1
- package/dist/table/index.cjs +15 -1
- package/dist/table/index.mjs +2 -1
- package/dist/tabs/index.cjs +14 -2
- package/dist/tabs/index.mjs +5 -2
- package/dist/text-input/index.cjs +11 -2
- package/dist/text-input/index.mjs +2 -2
- package/dist/theme-provider/index.cjs +14 -1
- package/dist/theme-provider/index.mjs +1 -1
- package/dist/time-picker/index.cjs +11 -2
- package/dist/time-picker/index.mjs +2 -2
- package/dist/toaster/index.cjs +11 -1
- package/dist/toaster/index.mjs +2 -1
- package/dist/tooltip/index.cjs +12 -1
- package/dist/tooltip/index.mjs +3 -1
- package/package.json +122 -141
- package/dist/components/Accordion/Accordion.d.ts +0 -5
- package/dist/components/Accordion/Accordion.types.d.ts +0 -32
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/Avatar/Avatar.d.ts +0 -2
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -11
- package/dist/components/Avatar/Avatar.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.types.d.ts +0 -24
- package/dist/components/Avatar/index.d.ts +0 -2
- package/dist/components/Badge/Badge.d.ts +0 -11
- package/dist/components/Badge/Badge.stories.d.ts +0 -21
- package/dist/components/Badge/Badge.test.d.ts +0 -1
- package/dist/components/Badge/Badge.types.d.ts +0 -43
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.test.d.ts +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +0 -27
- package/dist/components/Breadcrumbs/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.stories.d.ts +0 -20
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/Button.types.d.ts +0 -24
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/Card.d.ts +0 -25
- package/dist/components/Card/Card.stories.d.ts +0 -8
- package/dist/components/Card/Card.test.d.ts +0 -1
- package/dist/components/Card/Card.types.d.ts +0 -14
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/Checkbox/Checkbox.d.ts +0 -2
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -16
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.types.d.ts +0 -31
- package/dist/components/Checkbox/index.d.ts +0 -2
- package/dist/components/ComboBox/ComboBox.d.ts +0 -2
- package/dist/components/ComboBox/ComboBox.stories.d.ts +0 -12
- package/dist/components/ComboBox/ComboBox.test.d.ts +0 -1
- package/dist/components/ComboBox/ComboBox.types.d.ts +0 -57
- package/dist/components/ComboBox/index.d.ts +0 -2
- package/dist/components/DatePicker/DatePicker.d.ts +0 -2
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -25
- package/dist/components/DatePicker/DatePicker.test.d.ts +0 -1
- package/dist/components/DatePicker/DatePicker.types.d.ts +0 -27
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/Dialog/Dialog.d.ts +0 -6
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -9
- package/dist/components/Dialog/Dialog.test.d.ts +0 -1
- package/dist/components/Dialog/Dialog.types.d.ts +0 -52
- package/dist/components/Dialog/index.d.ts +0 -2
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -7
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -9
- package/dist/components/DropdownMenu/DropdownMenu.test.d.ts +0 -1
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +0 -24
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/Email/Email.d.ts +0 -2
- package/dist/components/Email/Email.stories.d.ts +0 -11
- package/dist/components/Email/Email.test.d.ts +0 -1
- package/dist/components/Email/Email.types.d.ts +0 -33
- package/dist/components/Email/index.d.ts +0 -2
- package/dist/components/FileUpload/FileUpload.d.ts +0 -2
- package/dist/components/FileUpload/FileUpload.stories.d.ts +0 -10
- package/dist/components/FileUpload/FileUpload.test.d.ts +0 -1
- package/dist/components/FileUpload/FileUpload.types.d.ts +0 -22
- package/dist/components/FileUpload/index.d.ts +0 -2
- package/dist/components/Header/Header.d.ts +0 -7
- package/dist/components/Header/Header.stories.d.ts +0 -8
- package/dist/components/Header/Header.test.d.ts +0 -1
- package/dist/components/Header/Header.types.d.ts +0 -19
- package/dist/components/Header/index.d.ts +0 -2
- package/dist/components/IconButton/IconButton.d.ts +0 -2
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -17
- package/dist/components/IconButton/IconButton.types.d.ts +0 -10
- package/dist/components/IconButton/index.d.ts +0 -2
- package/dist/components/Image/Image.d.ts +0 -6
- package/dist/components/Image/Image.stories.d.ts +0 -13
- package/dist/components/Image/Image.test.d.ts +0 -1
- package/dist/components/Image/Image.types.d.ts +0 -40
- package/dist/components/Image/index.d.ts +0 -2
- package/dist/components/Link/Link.d.ts +0 -2
- package/dist/components/Link/Link.stories.d.ts +0 -15
- package/dist/components/Link/Link.test.d.ts +0 -1
- package/dist/components/Link/Link.types.d.ts +0 -20
- package/dist/components/Link/index.d.ts +0 -2
- package/dist/components/Loader/Loader.d.ts +0 -2
- package/dist/components/Loader/Loader.stories.d.ts +0 -12
- package/dist/components/Loader/Loader.test.d.ts +0 -1
- package/dist/components/Loader/Loader.types.d.ts +0 -17
- package/dist/components/Loader/index.d.ts +0 -2
- package/dist/components/Modal/Modal.d.ts +0 -14
- package/dist/components/Modal/Modal.stories.d.ts +0 -14
- package/dist/components/Modal/Modal.test.d.ts +0 -1
- package/dist/components/Modal/Modal.types.d.ts +0 -100
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -2
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -15
- package/dist/components/MultiSelect/MultiSelect.test.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +0 -55
- package/dist/components/MultiSelect/index.d.ts +0 -2
- package/dist/components/OtpInput/OtpInput.d.ts +0 -2
- package/dist/components/OtpInput/OtpInput.stories.d.ts +0 -10
- package/dist/components/OtpInput/OtpInput.test.d.ts +0 -1
- package/dist/components/OtpInput/OtpInput.types.d.ts +0 -53
- package/dist/components/OtpInput/index.d.ts +0 -2
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -2
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +0 -23
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +0 -1
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +0 -27
- package/dist/components/PasswordInput/index.d.ts +0 -2
- package/dist/components/Phone/Phone.d.ts +0 -2
- package/dist/components/Phone/Phone.stories.d.ts +0 -11
- package/dist/components/Phone/Phone.test.d.ts +0 -1
- package/dist/components/Phone/Phone.types.d.ts +0 -36
- package/dist/components/Phone/countries.d.ts +0 -8
- package/dist/components/Phone/index.d.ts +0 -2
- package/dist/components/RadioButton/RadioButton.d.ts +0 -2
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -21
- package/dist/components/RadioButton/RadioButton.test.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.types.d.ts +0 -51
- package/dist/components/RadioButton/index.d.ts +0 -2
- package/dist/components/SearchInput/SearchInput.d.ts +0 -6
- package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -8
- package/dist/components/SearchInput/SearchInput.test.d.ts +0 -1
- package/dist/components/SearchInput/SearchInput.types.d.ts +0 -12
- package/dist/components/SearchInput/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/Select.stories.d.ts +0 -12
- package/dist/components/Select/Select.test.d.ts +0 -1
- package/dist/components/Select/Select.types.d.ts +0 -31
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/Sidebar/Sidebar.d.ts +0 -7
- package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -10
- package/dist/components/Sidebar/Sidebar.test.d.ts +0 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +0 -87
- package/dist/components/Sidebar/index.d.ts +0 -2
- package/dist/components/Skeleton/Skeleton.d.ts +0 -26
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -13
- package/dist/components/Skeleton/Skeleton.types.d.ts +0 -47
- package/dist/components/Skeleton/index.d.ts +0 -2
- package/dist/components/Stepper/Stepper.d.ts +0 -2
- package/dist/components/Stepper/Stepper.stories.d.ts +0 -23
- package/dist/components/Stepper/Stepper.test.d.ts +0 -1
- package/dist/components/Stepper/Stepper.types.d.ts +0 -47
- package/dist/components/Stepper/index.d.ts +0 -2
- package/dist/components/Table/Pagination.d.ts +0 -3
- package/dist/components/Table/Table.d.ts +0 -3
- package/dist/components/Table/Table.stories.d.ts +0 -13
- package/dist/components/Table/Table.test.d.ts +0 -1
- package/dist/components/Table/Table.types.d.ts +0 -85
- package/dist/components/Table/index.d.ts +0 -3
- package/dist/components/Tabs/Tabs.d.ts +0 -2
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -17
- package/dist/components/Tabs/Tabs.test.d.ts +0 -1
- package/dist/components/Tabs/Tabs.types.d.ts +0 -21
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/TextInput/TextInput.d.ts +0 -2
- package/dist/components/TextInput/TextInput.stories.d.ts +0 -25
- package/dist/components/TextInput/TextInput.test.d.ts +0 -1
- package/dist/components/TextInput/TextInput.types.d.ts +0 -29
- package/dist/components/TextInput/index.d.ts +0 -2
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +0 -8
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +0 -16
- package/dist/components/ThemeProvider/ThemeProvider.test.d.ts +0 -1
- package/dist/components/ThemeProvider/ThemeProvider.types.d.ts +0 -112
- package/dist/components/ThemeProvider/index.d.ts +0 -2
- package/dist/components/TimePicker/TimePicker.d.ts +0 -2
- package/dist/components/TimePicker/TimePicker.stories.d.ts +0 -23
- package/dist/components/TimePicker/TimePicker.test.d.ts +0 -1
- package/dist/components/TimePicker/TimePicker.types.d.ts +0 -27
- package/dist/components/TimePicker/index.d.ts +0 -2
- package/dist/components/Toaster/Toaster.d.ts +0 -2
- package/dist/components/Toaster/Toaster.stories.d.ts +0 -13
- package/dist/components/Toaster/Toaster.test.d.ts +0 -1
- package/dist/components/Toaster/Toaster.types.d.ts +0 -23
- package/dist/components/Toaster/index.d.ts +0 -2
- package/dist/components/Toggle/Toggle.d.ts +0 -2
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -11
- package/dist/components/Toggle/Toggle.types.d.ts +0 -10
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -13
- package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +0 -33
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/utils/cn.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -1
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkL5VQZZVR_cjs = require('./chunk-L5VQZZVR.cjs');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var solid = require('@heroicons/react/20/solid');
|
|
6
|
+
var outline = require('@heroicons/react/24/outline');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var DEFAULT_PAGE_SIZES = [10, 20, 50];
|
|
10
|
+
function Pagination({
|
|
11
|
+
total,
|
|
12
|
+
page,
|
|
13
|
+
pageSize,
|
|
14
|
+
totalPages: propTotalPages,
|
|
15
|
+
hasNextPage: propHasNextPage,
|
|
16
|
+
hasPrevPage: propHasPrevPage,
|
|
17
|
+
onPageChange,
|
|
18
|
+
onPageSizeChange,
|
|
19
|
+
pageSizeOptions = DEFAULT_PAGE_SIZES,
|
|
20
|
+
showSizeChanger,
|
|
21
|
+
className
|
|
22
|
+
}) {
|
|
23
|
+
const totalPages = propTotalPages ?? Math.max(1, Math.ceil(total / pageSize));
|
|
24
|
+
const canPrev = propHasPrevPage ?? page > 1;
|
|
25
|
+
const canNext = propHasNextPage ?? page < totalPages;
|
|
26
|
+
const pageNumbers = buildPageNumbers(page, totalPages);
|
|
27
|
+
const from = Math.min((page - 1) * pageSize + 1, total);
|
|
28
|
+
const to = Math.min(page * pageSize, total);
|
|
29
|
+
const showPicker = showSizeChanger ?? onPageSizeChange != null;
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
34
|
+
"flex flex-col sm:flex-row items-center justify-between gap-3 py-3 px-4 border-t border-border bg-surface-secondary/50 rounded-b-xl text-sm",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-text-secondary shrink-0", children: total === 0 ? "No items" : `${String(from)}\u2013${String(to)} of ${String(total)} items` }),
|
|
39
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap justify-center", children: [
|
|
40
|
+
showPicker && onPageSizeChange != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-muted", children: "Rows:" }),
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"select",
|
|
44
|
+
{
|
|
45
|
+
value: pageSize,
|
|
46
|
+
"aria-label": "Rows per page",
|
|
47
|
+
onChange: (e) => {
|
|
48
|
+
onPageSizeChange(Number(e.target.value));
|
|
49
|
+
},
|
|
50
|
+
className: "border border-border rounded-sm py-1 pl-2 pr-6 text-sm text-text bg-surface focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary cursor-pointer transition-all duration-normal",
|
|
51
|
+
children: pageSizeOptions.map((s) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: s, children: s }, s))
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsxs("nav", { "aria-label": "Pagination", className: "flex items-center gap-1", children: [
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
PageButton,
|
|
58
|
+
{
|
|
59
|
+
onClick: () => {
|
|
60
|
+
onPageChange(1);
|
|
61
|
+
},
|
|
62
|
+
disabled: !canPrev,
|
|
63
|
+
"aria-label": "First page",
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.ChevronDoubleLeftIcon, { className: "w-3.5 h-3.5" })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
68
|
+
PageButton,
|
|
69
|
+
{
|
|
70
|
+
onClick: () => {
|
|
71
|
+
onPageChange(page - 1);
|
|
72
|
+
},
|
|
73
|
+
disabled: !canPrev,
|
|
74
|
+
"aria-label": "Previous page",
|
|
75
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.ChevronLeftIcon, { className: "w-3.5 h-3.5" })
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
pageNumbers.map(
|
|
79
|
+
(num, idx) => num === "\u2026" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
className: "w-8 text-center text-text-muted/60 select-none",
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
children: "\u2026"
|
|
85
|
+
},
|
|
86
|
+
`ellipsis-${String(idx)}`
|
|
87
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
PageButton,
|
|
89
|
+
{
|
|
90
|
+
onClick: () => {
|
|
91
|
+
onPageChange(num);
|
|
92
|
+
},
|
|
93
|
+
active: num === page,
|
|
94
|
+
"aria-label": `Page ${String(num)}`,
|
|
95
|
+
"aria-current": num === page ? "page" : void 0,
|
|
96
|
+
children: num
|
|
97
|
+
},
|
|
98
|
+
num
|
|
99
|
+
)
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
+
PageButton,
|
|
103
|
+
{
|
|
104
|
+
onClick: () => {
|
|
105
|
+
onPageChange(page + 1);
|
|
106
|
+
},
|
|
107
|
+
disabled: !canNext,
|
|
108
|
+
"aria-label": "Next page",
|
|
109
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.ChevronRightIcon, { className: "w-3.5 h-3.5" })
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
113
|
+
PageButton,
|
|
114
|
+
{
|
|
115
|
+
onClick: () => {
|
|
116
|
+
onPageChange(totalPages);
|
|
117
|
+
},
|
|
118
|
+
disabled: !canNext,
|
|
119
|
+
"aria-label": "Last page",
|
|
120
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.ChevronDoubleRightIcon, { className: "w-3.5 h-3.5" })
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function PageButton({
|
|
130
|
+
children,
|
|
131
|
+
active = false,
|
|
132
|
+
disabled = false,
|
|
133
|
+
className,
|
|
134
|
+
...rest
|
|
135
|
+
}) {
|
|
136
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
"button",
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
disabled,
|
|
141
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
142
|
+
"min-w-[32px] h-8 px-2 rounded-sm font-medium transition-all duration-normal text-sm flex items-center justify-center",
|
|
143
|
+
active ? "bg-primary text-text-inverse shadow-sm" : "text-text-secondary hover:bg-hover active:bg-active",
|
|
144
|
+
disabled && "opacity-40 cursor-not-allowed pointer-events-none",
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
...rest,
|
|
148
|
+
children
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
function buildPageNumbers(current, total) {
|
|
153
|
+
if (total <= 7) return Array.from({ length: total }, (_, i) => i + 1);
|
|
154
|
+
const pages = [1];
|
|
155
|
+
if (current > 3) pages.push("\u2026");
|
|
156
|
+
const start = Math.max(2, current - 1);
|
|
157
|
+
const end = Math.min(total - 1, current + 1);
|
|
158
|
+
for (let i = start; i <= end; i++) pages.push(i);
|
|
159
|
+
if (current < total - 2) pages.push("\u2026");
|
|
160
|
+
pages.push(total);
|
|
161
|
+
return pages;
|
|
162
|
+
}
|
|
163
|
+
var cellPadding = {
|
|
164
|
+
sm: "px-3 py-1.5 text-xs",
|
|
165
|
+
md: "px-4 py-3 text-sm",
|
|
166
|
+
lg: "px-5 py-4 text-base"
|
|
167
|
+
};
|
|
168
|
+
var headerPadding = {
|
|
169
|
+
sm: "px-3 py-2 text-xs",
|
|
170
|
+
md: "px-4 py-3 text-sm",
|
|
171
|
+
lg: "px-5 py-4 text-base"
|
|
172
|
+
};
|
|
173
|
+
function SortIcon({ direction }) {
|
|
174
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": "true", className: "inline-flex flex-col ml-1 -space-y-1.5", children: [
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
+
solid.ChevronUpIcon,
|
|
177
|
+
{
|
|
178
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
179
|
+
"w-3.5 h-3.5 transition-all duration-normal",
|
|
180
|
+
direction === "asc" ? "text-primary" : "text-text-muted/30"
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
+
solid.ChevronDownIcon,
|
|
186
|
+
{
|
|
187
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
188
|
+
"w-3.5 h-3.5 transition-all duration-normal",
|
|
189
|
+
direction === "desc" ? "text-primary" : "text-text-muted/30"
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
function SkeletonRows({ cols, size }) {
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: 5 }).map((_, ri) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: Array.from({ length: cols }).map((__, ci) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: cellPadding[size], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
className: "h-4 bg-surface-secondary rounded-sm animate-pulse",
|
|
200
|
+
style: { width: `${String(Math.floor(60 + Math.random() * 30))}%` }
|
|
201
|
+
}
|
|
202
|
+
) }, ci)) }, ri)) });
|
|
203
|
+
}
|
|
204
|
+
function Table({
|
|
205
|
+
data,
|
|
206
|
+
columns,
|
|
207
|
+
rowKey,
|
|
208
|
+
loading = false,
|
|
209
|
+
emptyMessage = "No data",
|
|
210
|
+
striped = false,
|
|
211
|
+
bordered = false,
|
|
212
|
+
hoverable = true,
|
|
213
|
+
stickyHeader = false,
|
|
214
|
+
size = "md",
|
|
215
|
+
sortState: externalSort,
|
|
216
|
+
onSortChange,
|
|
217
|
+
className,
|
|
218
|
+
tableClassName,
|
|
219
|
+
pagination,
|
|
220
|
+
headerVariant = "light"
|
|
221
|
+
}) {
|
|
222
|
+
const [internalSort, setInternalSort] = react.useState(null);
|
|
223
|
+
const activeSort = externalSort ?? internalSort;
|
|
224
|
+
const handleHeaderClick = react.useCallback(
|
|
225
|
+
(col) => {
|
|
226
|
+
if (!col.sortable) return;
|
|
227
|
+
const next = {
|
|
228
|
+
key: col.key,
|
|
229
|
+
direction: activeSort?.key === col.key && activeSort.direction === "asc" ? "desc" : "asc"
|
|
230
|
+
};
|
|
231
|
+
if (onSortChange) {
|
|
232
|
+
onSortChange(next);
|
|
233
|
+
} else {
|
|
234
|
+
setInternalSort(next);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
[activeSort, onSortChange]
|
|
238
|
+
);
|
|
239
|
+
const sortedData = react.useMemo(() => {
|
|
240
|
+
if (!activeSort || onSortChange) return data;
|
|
241
|
+
return [...data].sort((a, b) => {
|
|
242
|
+
const aVal = a[activeSort.key];
|
|
243
|
+
const bVal = b[activeSort.key];
|
|
244
|
+
const cmp = typeof aVal === "string" && typeof bVal === "string" ? aVal.localeCompare(bVal) : String(aVal).localeCompare(String(bVal));
|
|
245
|
+
return activeSort.direction === "asc" ? cmp : -cmp;
|
|
246
|
+
});
|
|
247
|
+
}, [data, activeSort, onSortChange]);
|
|
248
|
+
const isEmpty = !loading && sortedData.length === 0;
|
|
249
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
253
|
+
"w-full overflow-hidden rounded-xl border border-border bg-surface shadow-sm transition-colors duration-normal",
|
|
254
|
+
bordered && "border",
|
|
255
|
+
className
|
|
256
|
+
),
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: chunkL5VQZZVR_cjs.cn("w-full border-collapse", tableClassName), children: [
|
|
259
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { className: chunkL5VQZZVR_cjs.cn(stickyHeader && "sticky top-0 z-dropdown"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
260
|
+
"tr",
|
|
261
|
+
{
|
|
262
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
263
|
+
"border-b border-border transition-colors duration-normal",
|
|
264
|
+
headerVariant === "light" ? "bg-surface-secondary" : "bg-black"
|
|
265
|
+
),
|
|
266
|
+
children: columns.map((col) => {
|
|
267
|
+
const isSorted = activeSort?.key === col.key;
|
|
268
|
+
const dir = isSorted ? activeSort.direction : null;
|
|
269
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
|
+
"th",
|
|
271
|
+
{
|
|
272
|
+
scope: "col",
|
|
273
|
+
style: { width: col.width },
|
|
274
|
+
"aria-sort": isSorted ? dir === "asc" ? "ascending" : "descending" : col.sortable ? "none" : void 0,
|
|
275
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
276
|
+
headerPadding[size],
|
|
277
|
+
"font-black tracking-widest uppercase whitespace-nowrap select-none transition-all duration-normal",
|
|
278
|
+
headerVariant === "light" ? "text-text-secondary" : "text-white",
|
|
279
|
+
col.align === "center" && "text-center",
|
|
280
|
+
col.align === "right" && "text-right",
|
|
281
|
+
col.sortable && "cursor-pointer hover:bg-hover",
|
|
282
|
+
headerVariant === "dark" && col.sortable && "hover:bg-white/10",
|
|
283
|
+
bordered && "border border-border",
|
|
284
|
+
col.headerClassName
|
|
285
|
+
),
|
|
286
|
+
onClick: col.sortable ? () => {
|
|
287
|
+
handleHeaderClick(col);
|
|
288
|
+
} : void 0,
|
|
289
|
+
onKeyDown: col.sortable ? (e) => {
|
|
290
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
291
|
+
e.preventDefault();
|
|
292
|
+
handleHeaderClick(col);
|
|
293
|
+
}
|
|
294
|
+
} : void 0,
|
|
295
|
+
tabIndex: col.sortable ? 0 : void 0,
|
|
296
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
297
|
+
"span",
|
|
298
|
+
{
|
|
299
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
300
|
+
"flex items-center gap-1",
|
|
301
|
+
col.align === "center" && "justify-center",
|
|
302
|
+
col.align === "right" && "justify-end"
|
|
303
|
+
),
|
|
304
|
+
children: [
|
|
305
|
+
col.header,
|
|
306
|
+
col.sortable && /* @__PURE__ */ jsxRuntime.jsx(SortIcon, { direction: dir })
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
},
|
|
311
|
+
col.key
|
|
312
|
+
);
|
|
313
|
+
})
|
|
314
|
+
}
|
|
315
|
+
) }),
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(SkeletonRows, { cols: columns.length, size }) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
317
|
+
"td",
|
|
318
|
+
{
|
|
319
|
+
colSpan: columns.length,
|
|
320
|
+
className: "py-16 text-center text-text-muted text-sm font-medium",
|
|
321
|
+
children: emptyMessage
|
|
322
|
+
}
|
|
323
|
+
) }) : sortedData.map((row, ri) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
324
|
+
"tr",
|
|
325
|
+
{
|
|
326
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
327
|
+
"border-b border-border-light last:border-0 transition-colors duration-fast",
|
|
328
|
+
striped && ri % 2 !== 0 && "bg-surface-secondary/40",
|
|
329
|
+
hoverable && "hover:bg-hover/60"
|
|
330
|
+
),
|
|
331
|
+
children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
332
|
+
"td",
|
|
333
|
+
{
|
|
334
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
335
|
+
cellPadding[size],
|
|
336
|
+
"text-text font-medium",
|
|
337
|
+
col.align === "center" && "text-center",
|
|
338
|
+
col.align === "right" && "text-right",
|
|
339
|
+
bordered && "border border-border",
|
|
340
|
+
col.cellClassName
|
|
341
|
+
),
|
|
342
|
+
children: col.render ? col.render(row, ri) : (() => {
|
|
343
|
+
const v = row[col.key];
|
|
344
|
+
if (v === null || v === void 0) return "";
|
|
345
|
+
if (typeof v === "object") return JSON.stringify(v);
|
|
346
|
+
return String(v);
|
|
347
|
+
})()
|
|
348
|
+
},
|
|
349
|
+
col.key
|
|
350
|
+
))
|
|
351
|
+
},
|
|
352
|
+
rowKey(row)
|
|
353
|
+
)) })
|
|
354
|
+
] }) }),
|
|
355
|
+
pagination && /* @__PURE__ */ jsxRuntime.jsx(Pagination, { ...pagination })
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
exports.Pagination = Pagination;
|
|
362
|
+
exports.Table = Table;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkL5VQZZVR_cjs = require('./chunk-L5VQZZVR.cjs');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var outline = require('@heroicons/react/24/outline');
|
|
6
|
+
var reactDom = require('react-dom');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var sizeClasses = {
|
|
10
|
+
xs: "max-w-xs",
|
|
11
|
+
sm: "max-w-sm",
|
|
12
|
+
md: "max-w-md",
|
|
13
|
+
lg: "max-w-lg",
|
|
14
|
+
xl: "max-w-xl",
|
|
15
|
+
"2xl": "max-w-2xl",
|
|
16
|
+
"3xl": "max-w-3xl",
|
|
17
|
+
"4xl": "max-w-4xl",
|
|
18
|
+
"5xl": "max-w-5xl",
|
|
19
|
+
"6xl": "max-w-6xl",
|
|
20
|
+
"7xl": "max-w-7xl",
|
|
21
|
+
full: "max-w-full m-0 rounded-none h-full"
|
|
22
|
+
};
|
|
23
|
+
function Dialog({
|
|
24
|
+
isOpen,
|
|
25
|
+
onClose,
|
|
26
|
+
children,
|
|
27
|
+
size = "md",
|
|
28
|
+
isCentered = false,
|
|
29
|
+
closeOnOverlayClick = true,
|
|
30
|
+
closeOnEsc = true,
|
|
31
|
+
trapFocus = true,
|
|
32
|
+
lockScroll = true,
|
|
33
|
+
contentClassName,
|
|
34
|
+
overlayClassName,
|
|
35
|
+
showBackdrop = true,
|
|
36
|
+
isModal = true,
|
|
37
|
+
ariaLabel,
|
|
38
|
+
ariaLabelledby,
|
|
39
|
+
ariaDescribedby
|
|
40
|
+
}) {
|
|
41
|
+
const dialogRef = react.useRef(null);
|
|
42
|
+
const previousFocusRef = react.useRef(null);
|
|
43
|
+
const handleClose = react.useCallback(() => {
|
|
44
|
+
onClose();
|
|
45
|
+
}, [onClose]);
|
|
46
|
+
react.useEffect(() => {
|
|
47
|
+
if (isOpen) {
|
|
48
|
+
previousFocusRef.current = document.activeElement;
|
|
49
|
+
if (isModal && lockScroll) {
|
|
50
|
+
document.body.style.overflow = "hidden";
|
|
51
|
+
}
|
|
52
|
+
const handleKeyDown = (e) => {
|
|
53
|
+
if (closeOnEsc && e.key === "Escape") {
|
|
54
|
+
handleClose();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (isModal && trapFocus && e.key === "Tab") {
|
|
58
|
+
const focusableElements = dialogRef.current?.querySelectorAll(
|
|
59
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
60
|
+
);
|
|
61
|
+
if (!focusableElements || focusableElements.length === 0) return;
|
|
62
|
+
const firstElement = focusableElements[0];
|
|
63
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
64
|
+
if (e.shiftKey) {
|
|
65
|
+
if (document.activeElement === firstElement) {
|
|
66
|
+
lastElement.focus();
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
}
|
|
69
|
+
} else {
|
|
70
|
+
if (document.activeElement === lastElement) {
|
|
71
|
+
firstElement.focus();
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
78
|
+
if (isModal) {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
const firstFocusable = dialogRef.current?.querySelector(
|
|
81
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
82
|
+
);
|
|
83
|
+
if (firstFocusable != null) {
|
|
84
|
+
firstFocusable.focus();
|
|
85
|
+
} else {
|
|
86
|
+
dialogRef.current?.focus();
|
|
87
|
+
}
|
|
88
|
+
}, 0);
|
|
89
|
+
}
|
|
90
|
+
return () => {
|
|
91
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
92
|
+
if (isModal && lockScroll) {
|
|
93
|
+
document.body.style.overflow = "";
|
|
94
|
+
}
|
|
95
|
+
previousFocusRef.current?.focus();
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return void 0;
|
|
99
|
+
}, [isOpen, closeOnEsc, handleClose, lockScroll, trapFocus, isModal]);
|
|
100
|
+
if (!isOpen) return null;
|
|
101
|
+
return reactDom.createPortal(
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
role: "presentation",
|
|
106
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
107
|
+
"fixed inset-0 z-50 flex items-start justify-center p-4 sm:p-6 overflow-y-auto transition-opacity duration-300",
|
|
108
|
+
showBackdrop && "bg-black/60 backdrop-blur-sm",
|
|
109
|
+
!isModal && "pointer-events-none",
|
|
110
|
+
isCentered && "items-center",
|
|
111
|
+
overlayClassName
|
|
112
|
+
),
|
|
113
|
+
onClick: (e) => {
|
|
114
|
+
if (closeOnOverlayClick && e.target === e.currentTarget) {
|
|
115
|
+
handleClose();
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
ref: dialogRef,
|
|
122
|
+
role: "dialog",
|
|
123
|
+
tabIndex: -1,
|
|
124
|
+
"aria-modal": isModal ? "true" : "false",
|
|
125
|
+
"aria-label": ariaLabel,
|
|
126
|
+
"aria-labelledby": ariaLabelledby,
|
|
127
|
+
"aria-describedby": ariaDescribedby,
|
|
128
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
129
|
+
"relative w-full mx-auto bg-surface rounded-xl shadow-lg border border-border transition-all duration-300 transform scale-100 opacity-100 flex flex-col",
|
|
130
|
+
size !== "full" && "max-h-[90vh]",
|
|
131
|
+
!isModal && "pointer-events-auto",
|
|
132
|
+
sizeClasses[size],
|
|
133
|
+
contentClassName
|
|
134
|
+
),
|
|
135
|
+
children
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
document.body
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function DialogHeader({ children, className }) {
|
|
144
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkL5VQZZVR_cjs.cn("px-6 py-5 border-b border-border/60", className), children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-text uppercase tracking-wider", children }) });
|
|
145
|
+
}
|
|
146
|
+
function DialogBody({ children, className }) {
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
151
|
+
"px-6 py-6 overflow-y-auto flex-1 text-text-secondary leading-relaxed font-medium",
|
|
152
|
+
className
|
|
153
|
+
),
|
|
154
|
+
children
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function DialogFooter({ children, className }) {
|
|
159
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
163
|
+
"px-6 py-4 bg-surface-secondary border-t border-border flex items-center justify-end gap-3 rounded-b-xl",
|
|
164
|
+
className
|
|
165
|
+
),
|
|
166
|
+
children
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function DialogCloseButton({
|
|
171
|
+
onClick,
|
|
172
|
+
className
|
|
173
|
+
}) {
|
|
174
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
"button",
|
|
176
|
+
{
|
|
177
|
+
type: "button",
|
|
178
|
+
onClick,
|
|
179
|
+
className: chunkL5VQZZVR_cjs.cn(
|
|
180
|
+
"absolute top-4 right-4 p-2 text-text-muted hover:text-text hover:bg-hover rounded-lg transition-all duration-fast",
|
|
181
|
+
className
|
|
182
|
+
),
|
|
183
|
+
"aria-label": "Close dialog",
|
|
184
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "w-5 h-5" })
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
exports.Dialog = Dialog;
|
|
190
|
+
exports.DialogBody = DialogBody;
|
|
191
|
+
exports.DialogCloseButton = DialogCloseButton;
|
|
192
|
+
exports.DialogFooter = DialogFooter;
|
|
193
|
+
exports.DialogHeader = DialogHeader;
|