@expcat/tigercat-react 0.0.1
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/LICENSE +21 -0
- package/dist/chunk-2DOPHSZP.js +32 -0
- package/dist/chunk-2TS6X5RA.js +73 -0
- package/dist/chunk-2Y327ZU4.js +493 -0
- package/dist/chunk-3GD3LOII.mjs +23 -0
- package/dist/chunk-3OF7XPIQ.js +90 -0
- package/dist/chunk-3WPKVV4N.js +140 -0
- package/dist/chunk-3XXXM4OB.mjs +203 -0
- package/dist/chunk-427CM2U6.mjs +76 -0
- package/dist/chunk-472D2S4R.mjs +23 -0
- package/dist/chunk-5FRENLDC.js +194 -0
- package/dist/chunk-5HUYCSA4.mjs +77 -0
- package/dist/chunk-5QKMQRCW.js +89 -0
- package/dist/chunk-5ZVSFIZD.js +50 -0
- package/dist/chunk-6575DOCV.mjs +117 -0
- package/dist/chunk-672SCJWZ.mjs +88 -0
- package/dist/chunk-6MGEGOYJ.js +108 -0
- package/dist/chunk-6PUSRC6S.js +68 -0
- package/dist/chunk-6YDIBMCM.mjs +33 -0
- package/dist/chunk-72ZRDBXN.js +25 -0
- package/dist/chunk-77D7VQMG.js +43 -0
- package/dist/chunk-7CAJK2ZK.mjs +54 -0
- package/dist/chunk-7JQ7LURS.mjs +25 -0
- package/dist/chunk-7KRBDT2Z.mjs +269 -0
- package/dist/chunk-7O2OQKVY.mjs +10 -0
- package/dist/chunk-7OLWGHUR.mjs +169 -0
- package/dist/chunk-7P6PHSFM.js +548 -0
- package/dist/chunk-ADOPAXPG.mjs +301 -0
- package/dist/chunk-AG6GVQ5O.js +271 -0
- package/dist/chunk-ALP3KYYY.mjs +47 -0
- package/dist/chunk-AQ6DHCP6.js +53 -0
- package/dist/chunk-AQQRWISY.js +184 -0
- package/dist/chunk-C52ZCGYG.mjs +313 -0
- package/dist/chunk-C5EFBJBR.js +540 -0
- package/dist/chunk-CES6LGQ7.mjs +546 -0
- package/dist/chunk-CKUSQR2H.mjs +41 -0
- package/dist/chunk-CR4QK2AB.mjs +88 -0
- package/dist/chunk-CTAMMQBC.mjs +297 -0
- package/dist/chunk-D3I2SY7X.js +301 -0
- package/dist/chunk-DCRVIDMY.mjs +41 -0
- package/dist/chunk-DIZNY6N4.mjs +71 -0
- package/dist/chunk-DZJUFU55.js +300 -0
- package/dist/chunk-EB6EDLJZ.mjs +50 -0
- package/dist/chunk-EI2GHMQS.js +37 -0
- package/dist/chunk-ENR3RIMM.js +205 -0
- package/dist/chunk-EQWQXURG.js +18 -0
- package/dist/chunk-EUHWE7MN.js +267 -0
- package/dist/chunk-FAKTU64M.js +67 -0
- package/dist/chunk-FQ6UHRAO.js +499 -0
- package/dist/chunk-G6FSHN2I.mjs +111 -0
- package/dist/chunk-GIYBVWR4.mjs +213 -0
- package/dist/chunk-HDDBBZQH.js +321 -0
- package/dist/chunk-HQLZL3XQ.mjs +48 -0
- package/dist/chunk-HQXZVTP4.mjs +199 -0
- package/dist/chunk-HUMGEP7S.mjs +17 -0
- package/dist/chunk-IFY46RWU.js +25 -0
- package/dist/chunk-IQINYCU6.js +99 -0
- package/dist/chunk-IWENGARY.mjs +32 -0
- package/dist/chunk-IY4LEJYF.js +78 -0
- package/dist/chunk-JW64IJP2.js +210 -0
- package/dist/chunk-K7ZMB2TH.mjs +696 -0
- package/dist/chunk-KAEHFMTQ.mjs +537 -0
- package/dist/chunk-KMQOLVWP.mjs +65 -0
- package/dist/chunk-KUCFT2OA.js +43 -0
- package/dist/chunk-LADCWARG.mjs +97 -0
- package/dist/chunk-LAZGEMA2.mjs +176 -0
- package/dist/chunk-LNKI6HQ3.js +152 -0
- package/dist/chunk-LXA2YBAO.js +38 -0
- package/dist/chunk-MKWXJZ3T.js +74 -0
- package/dist/chunk-MQXBU5YX.mjs +87 -0
- package/dist/chunk-NEULKOYJ.js +48 -0
- package/dist/chunk-NI2WNZRT.js +38 -0
- package/dist/chunk-NOOPXNR4.mjs +36 -0
- package/dist/chunk-NSGDRTSQ.mjs +138 -0
- package/dist/chunk-O3EUFIOS.mjs +142 -0
- package/dist/chunk-OCVQ3LOT.mjs +45 -0
- package/dist/chunk-OFCKGWTS.js +12 -0
- package/dist/chunk-OQTPXPAP.mjs +10 -0
- package/dist/chunk-OTRGVENC.js +305 -0
- package/dist/chunk-P273E6XE.js +219 -0
- package/dist/chunk-PAD2DX5M.mjs +331 -0
- package/dist/chunk-PUDU34R4.mjs +106 -0
- package/dist/chunk-Q3DPJHNM.js +407 -0
- package/dist/chunk-QEAC4MIG.mjs +295 -0
- package/dist/chunk-QFVE7GKD.js +109 -0
- package/dist/chunk-QL6OBKEN.js +84 -0
- package/dist/chunk-QL6UEG3U.js +27 -0
- package/dist/chunk-QN7NIX7D.mjs +82 -0
- package/dist/chunk-QORSSZX4.js +144 -0
- package/dist/chunk-R4JSBXGG.js +12 -0
- package/dist/chunk-R5BQHZWB.js +698 -0
- package/dist/chunk-R7MS42PL.js +90 -0
- package/dist/chunk-RTQNWZN4.mjs +405 -0
- package/dist/chunk-SIVJX7VU.mjs +16 -0
- package/dist/chunk-SJ5RFU2O.mjs +17 -0
- package/dist/chunk-T4TJJMLM.mjs +34 -0
- package/dist/chunk-TB2UHDOZ.js +19 -0
- package/dist/chunk-TBIEWDY5.js +175 -0
- package/dist/chunk-TJFS44SH.js +48 -0
- package/dist/chunk-TR246HQP.mjs +69 -0
- package/dist/chunk-TZ26HQAW.js +85 -0
- package/dist/chunk-U4ZVEPYD.js +71 -0
- package/dist/chunk-UFAXJVMD.js +120 -0
- package/dist/chunk-V2HVHLBY.mjs +83 -0
- package/dist/chunk-VD3IK5XT.mjs +35 -0
- package/dist/chunk-VEGBO77D.mjs +20 -0
- package/dist/chunk-VJJ76I7U.js +19 -0
- package/dist/chunk-VO4WDK4K.js +37 -0
- package/dist/chunk-VSF4DF7N.js +84 -0
- package/dist/chunk-VVO4V4IK.js +56 -0
- package/dist/chunk-W7HUFFPJ.mjs +263 -0
- package/dist/chunk-WDAMDVLU.mjs +106 -0
- package/dist/chunk-WEGU7O4J.mjs +66 -0
- package/dist/chunk-WK5HN4OH.js +113 -0
- package/dist/chunk-WSCSDSV7.mjs +145 -0
- package/dist/chunk-WSJO2PIE.mjs +72 -0
- package/dist/chunk-XDKXL2BP.mjs +188 -0
- package/dist/chunk-XS5JP2KO.mjs +491 -0
- package/dist/chunk-XZDJ5FRB.js +333 -0
- package/dist/chunk-YE2M2HNM.js +168 -0
- package/dist/chunk-YYGTJKP5.js +39 -0
- package/dist/chunk-YYKJ63LD.mjs +497 -0
- package/dist/chunk-Z4Z3I74Q.mjs +166 -0
- package/dist/chunk-ZO4XVOHU.mjs +45 -0
- package/dist/chunk-ZREFCRX3.js +52 -0
- package/dist/components/Alert.d.mts +24 -0
- package/dist/components/Alert.d.ts +24 -0
- package/dist/components/Alert.js +10 -0
- package/dist/components/Alert.mjs +1 -0
- package/dist/components/Avatar.d.mts +12 -0
- package/dist/components/Avatar.d.ts +12 -0
- package/dist/components/Avatar.js +10 -0
- package/dist/components/Avatar.mjs +1 -0
- package/dist/components/Badge.d.mts +12 -0
- package/dist/components/Badge.d.ts +12 -0
- package/dist/components/Badge.js +10 -0
- package/dist/components/Badge.mjs +1 -0
- package/dist/components/Breadcrumb.d.mts +13 -0
- package/dist/components/Breadcrumb.d.ts +13 -0
- package/dist/components/Breadcrumb.js +14 -0
- package/dist/components/Breadcrumb.mjs +1 -0
- package/dist/components/BreadcrumbItem.d.mts +21 -0
- package/dist/components/BreadcrumbItem.d.ts +21 -0
- package/dist/components/BreadcrumbItem.js +11 -0
- package/dist/components/BreadcrumbItem.mjs +2 -0
- package/dist/components/Button.d.mts +8 -0
- package/dist/components/Button.d.ts +8 -0
- package/dist/components/Button.js +10 -0
- package/dist/components/Button.mjs +1 -0
- package/dist/components/Card.d.mts +33 -0
- package/dist/components/Card.d.ts +33 -0
- package/dist/components/Card.js +10 -0
- package/dist/components/Card.mjs +1 -0
- package/dist/components/Checkbox.d.mts +48 -0
- package/dist/components/Checkbox.d.ts +48 -0
- package/dist/components/Checkbox.js +11 -0
- package/dist/components/Checkbox.mjs +2 -0
- package/dist/components/CheckboxGroup.d.mts +39 -0
- package/dist/components/CheckboxGroup.d.ts +39 -0
- package/dist/components/CheckboxGroup.js +14 -0
- package/dist/components/CheckboxGroup.mjs +1 -0
- package/dist/components/Col.d.mts +7 -0
- package/dist/components/Col.d.ts +7 -0
- package/dist/components/Col.js +11 -0
- package/dist/components/Col.mjs +2 -0
- package/dist/components/ConfigProvider.d.mts +14 -0
- package/dist/components/ConfigProvider.d.ts +14 -0
- package/dist/components/ConfigProvider.js +14 -0
- package/dist/components/ConfigProvider.mjs +1 -0
- package/dist/components/Container.d.mts +13 -0
- package/dist/components/Container.d.ts +13 -0
- package/dist/components/Container.js +10 -0
- package/dist/components/Container.mjs +1 -0
- package/dist/components/Content.d.mts +9 -0
- package/dist/components/Content.d.ts +9 -0
- package/dist/components/Content.js +10 -0
- package/dist/components/Content.mjs +1 -0
- package/dist/components/DatePicker.d.mts +24 -0
- package/dist/components/DatePicker.d.ts +24 -0
- package/dist/components/DatePicker.js +10 -0
- package/dist/components/DatePicker.mjs +1 -0
- package/dist/components/Descriptions.d.mts +53 -0
- package/dist/components/Descriptions.d.ts +53 -0
- package/dist/components/Descriptions.js +16 -0
- package/dist/components/Descriptions.mjs +1 -0
- package/dist/components/Divider.d.mts +12 -0
- package/dist/components/Divider.d.ts +12 -0
- package/dist/components/Divider.js +10 -0
- package/dist/components/Divider.mjs +1 -0
- package/dist/components/Drawer.d.mts +19 -0
- package/dist/components/Drawer.d.ts +19 -0
- package/dist/components/Drawer.js +11 -0
- package/dist/components/Drawer.mjs +2 -0
- package/dist/components/Dropdown.d.mts +22 -0
- package/dist/components/Dropdown.d.ts +22 -0
- package/dist/components/Dropdown.js +16 -0
- package/dist/components/Dropdown.mjs +3 -0
- package/dist/components/DropdownItem.d.mts +17 -0
- package/dist/components/DropdownItem.d.ts +17 -0
- package/dist/components/DropdownItem.js +13 -0
- package/dist/components/DropdownItem.mjs +4 -0
- package/dist/components/DropdownMenu.d.mts +13 -0
- package/dist/components/DropdownMenu.d.ts +13 -0
- package/dist/components/DropdownMenu.js +10 -0
- package/dist/components/DropdownMenu.mjs +1 -0
- package/dist/components/Footer.d.mts +9 -0
- package/dist/components/Footer.d.ts +9 -0
- package/dist/components/Footer.js +10 -0
- package/dist/components/Footer.mjs +1 -0
- package/dist/components/Form.d.mts +56 -0
- package/dist/components/Form.d.ts +56 -0
- package/dist/components/Form.js +14 -0
- package/dist/components/Form.mjs +1 -0
- package/dist/components/FormItem.d.mts +16 -0
- package/dist/components/FormItem.d.ts +16 -0
- package/dist/components/FormItem.js +11 -0
- package/dist/components/FormItem.mjs +2 -0
- package/dist/components/Header.d.mts +9 -0
- package/dist/components/Header.d.ts +9 -0
- package/dist/components/Header.js +10 -0
- package/dist/components/Header.mjs +1 -0
- package/dist/components/Icon.d.mts +9 -0
- package/dist/components/Icon.d.ts +9 -0
- package/dist/components/Icon.js +10 -0
- package/dist/components/Icon.mjs +1 -0
- package/dist/components/Input.d.mts +28 -0
- package/dist/components/Input.d.ts +28 -0
- package/dist/components/Input.js +10 -0
- package/dist/components/Input.mjs +1 -0
- package/dist/components/Layout.d.mts +9 -0
- package/dist/components/Layout.d.ts +9 -0
- package/dist/components/Layout.js +10 -0
- package/dist/components/Layout.mjs +1 -0
- package/dist/components/Link.d.mts +10 -0
- package/dist/components/Link.d.ts +10 -0
- package/dist/components/Link.js +10 -0
- package/dist/components/Link.mjs +1 -0
- package/dist/components/List.d.mts +94 -0
- package/dist/components/List.d.ts +94 -0
- package/dist/components/List.js +12 -0
- package/dist/components/List.mjs +3 -0
- package/dist/components/Loading.d.mts +8 -0
- package/dist/components/Loading.d.ts +8 -0
- package/dist/components/Loading.js +10 -0
- package/dist/components/Loading.mjs +1 -0
- package/dist/components/Menu.d.mts +35 -0
- package/dist/components/Menu.d.ts +35 -0
- package/dist/components/Menu.js +14 -0
- package/dist/components/Menu.mjs +1 -0
- package/dist/components/MenuItem.d.mts +20 -0
- package/dist/components/MenuItem.d.ts +20 -0
- package/dist/components/MenuItem.js +11 -0
- package/dist/components/MenuItem.mjs +2 -0
- package/dist/components/MenuItemGroup.d.mts +16 -0
- package/dist/components/MenuItemGroup.d.ts +16 -0
- package/dist/components/MenuItemGroup.js +12 -0
- package/dist/components/MenuItemGroup.mjs +3 -0
- package/dist/components/Message.d.mts +44 -0
- package/dist/components/Message.d.ts +44 -0
- package/dist/components/Message.js +20 -0
- package/dist/components/Message.mjs +1 -0
- package/dist/components/Modal.d.mts +41 -0
- package/dist/components/Modal.d.ts +41 -0
- package/dist/components/Modal.js +11 -0
- package/dist/components/Modal.mjs +2 -0
- package/dist/components/Notification.d.mts +40 -0
- package/dist/components/Notification.d.ts +40 -0
- package/dist/components/Notification.js +20 -0
- package/dist/components/Notification.mjs +1 -0
- package/dist/components/Pagination.d.mts +11 -0
- package/dist/components/Pagination.d.ts +11 -0
- package/dist/components/Pagination.js +16 -0
- package/dist/components/Pagination.mjs +1 -0
- package/dist/components/Popconfirm.d.mts +34 -0
- package/dist/components/Popconfirm.d.ts +34 -0
- package/dist/components/Popconfirm.js +10 -0
- package/dist/components/Popconfirm.mjs +1 -0
- package/dist/components/Popover.d.mts +14 -0
- package/dist/components/Popover.d.ts +14 -0
- package/dist/components/Popover.js +10 -0
- package/dist/components/Popover.mjs +1 -0
- package/dist/components/Progress.d.mts +8 -0
- package/dist/components/Progress.d.ts +8 -0
- package/dist/components/Progress.js +10 -0
- package/dist/components/Progress.mjs +1 -0
- package/dist/components/Radio.d.mts +20 -0
- package/dist/components/Radio.d.ts +20 -0
- package/dist/components/Radio.js +11 -0
- package/dist/components/Radio.mjs +2 -0
- package/dist/components/RadioGroup.d.mts +28 -0
- package/dist/components/RadioGroup.d.ts +28 -0
- package/dist/components/RadioGroup.js +14 -0
- package/dist/components/RadioGroup.mjs +1 -0
- package/dist/components/Row.d.mts +11 -0
- package/dist/components/Row.d.ts +11 -0
- package/dist/components/Row.js +14 -0
- package/dist/components/Row.mjs +1 -0
- package/dist/components/Select.d.mts +23 -0
- package/dist/components/Select.d.ts +23 -0
- package/dist/components/Select.js +10 -0
- package/dist/components/Select.mjs +1 -0
- package/dist/components/Sidebar.d.mts +9 -0
- package/dist/components/Sidebar.d.ts +9 -0
- package/dist/components/Sidebar.js +10 -0
- package/dist/components/Sidebar.mjs +1 -0
- package/dist/components/Skeleton.d.mts +7 -0
- package/dist/components/Skeleton.d.ts +7 -0
- package/dist/components/Skeleton.js +10 -0
- package/dist/components/Skeleton.mjs +1 -0
- package/dist/components/Slider.d.mts +12 -0
- package/dist/components/Slider.d.ts +12 -0
- package/dist/components/Slider.js +10 -0
- package/dist/components/Slider.mjs +1 -0
- package/dist/components/Space.d.mts +11 -0
- package/dist/components/Space.d.ts +11 -0
- package/dist/components/Space.js +10 -0
- package/dist/components/Space.mjs +1 -0
- package/dist/components/Steps.d.mts +31 -0
- package/dist/components/Steps.d.ts +31 -0
- package/dist/components/Steps.js +14 -0
- package/dist/components/Steps.mjs +1 -0
- package/dist/components/StepsItem.d.mts +36 -0
- package/dist/components/StepsItem.d.ts +36 -0
- package/dist/components/StepsItem.js +10 -0
- package/dist/components/StepsItem.mjs +1 -0
- package/dist/components/SubMenu.d.mts +20 -0
- package/dist/components/SubMenu.d.ts +20 -0
- package/dist/components/SubMenu.js +13 -0
- package/dist/components/SubMenu.mjs +4 -0
- package/dist/components/Switch.d.mts +12 -0
- package/dist/components/Switch.d.ts +12 -0
- package/dist/components/Switch.js +10 -0
- package/dist/components/Switch.mjs +1 -0
- package/dist/components/TabPane.d.mts +42 -0
- package/dist/components/TabPane.d.ts +42 -0
- package/dist/components/TabPane.js +10 -0
- package/dist/components/TabPane.mjs +1 -0
- package/dist/components/Table.d.mts +46 -0
- package/dist/components/Table.d.ts +46 -0
- package/dist/components/Table.js +10 -0
- package/dist/components/Table.mjs +1 -0
- package/dist/components/Tabs.d.mts +43 -0
- package/dist/components/Tabs.d.ts +43 -0
- package/dist/components/Tabs.js +14 -0
- package/dist/components/Tabs.mjs +1 -0
- package/dist/components/Tag.d.mts +16 -0
- package/dist/components/Tag.d.ts +16 -0
- package/dist/components/Tag.js +10 -0
- package/dist/components/Tag.mjs +1 -0
- package/dist/components/Text.d.mts +9 -0
- package/dist/components/Text.d.ts +9 -0
- package/dist/components/Text.js +10 -0
- package/dist/components/Text.mjs +1 -0
- package/dist/components/Textarea.d.mts +13 -0
- package/dist/components/Textarea.d.ts +13 -0
- package/dist/components/Textarea.js +10 -0
- package/dist/components/Textarea.mjs +1 -0
- package/dist/components/TimePicker.d.mts +28 -0
- package/dist/components/TimePicker.d.ts +28 -0
- package/dist/components/TimePicker.js +10 -0
- package/dist/components/TimePicker.mjs +1 -0
- package/dist/components/Timeline.d.mts +47 -0
- package/dist/components/Timeline.d.ts +47 -0
- package/dist/components/Timeline.js +10 -0
- package/dist/components/Timeline.mjs +1 -0
- package/dist/components/Tooltip.d.mts +15 -0
- package/dist/components/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip.js +10 -0
- package/dist/components/Tooltip.mjs +1 -0
- package/dist/components/Tree.d.mts +154 -0
- package/dist/components/Tree.d.ts +154 -0
- package/dist/components/Tree.js +16 -0
- package/dist/components/Tree.mjs +1 -0
- package/dist/components/Upload.d.mts +16 -0
- package/dist/components/Upload.d.ts +16 -0
- package/dist/components/Upload.js +11 -0
- package/dist/components/Upload.mjs +2 -0
- package/dist/index.d.mts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.js +359 -0
- package/dist/index.mjs +67 -0
- package/package.json +60 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { classNames, notificationContainerBaseClasses, notificationPositionClasses, getNotificationTypeClasses, defaultNotificationThemeColors, notificationBaseClasses, getNotificationIconPath, notificationIconClasses, notificationContentClasses, notificationTitleClasses, notificationDescriptionClasses, notificationCloseButtonClasses, notificationCloseIconClasses, notificationCloseIconPath, icon24StrokeWidth, icon24ViewBox, icon24PathStrokeLinejoin, icon24PathStrokeLinecap, isBrowser } from '@expcat/tigercat-core';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/components/Notification.tsx
|
|
7
|
+
var NOTIFICATION_CONTAINER_ID_PREFIX = "tiger-notification-container";
|
|
8
|
+
var notificationInstancesByPosition = {
|
|
9
|
+
"top-left": [],
|
|
10
|
+
"top-right": [],
|
|
11
|
+
"bottom-left": [],
|
|
12
|
+
"bottom-right": []
|
|
13
|
+
};
|
|
14
|
+
var instanceIdCounter = 0;
|
|
15
|
+
var containerRoots = {
|
|
16
|
+
"top-left": null,
|
|
17
|
+
"top-right": null,
|
|
18
|
+
"bottom-left": null,
|
|
19
|
+
"bottom-right": null
|
|
20
|
+
};
|
|
21
|
+
var updateCallbacks = {
|
|
22
|
+
"top-left": null,
|
|
23
|
+
"top-right": null,
|
|
24
|
+
"bottom-left": null,
|
|
25
|
+
"bottom-right": null
|
|
26
|
+
};
|
|
27
|
+
function getNextInstanceId() {
|
|
28
|
+
return ++instanceIdCounter;
|
|
29
|
+
}
|
|
30
|
+
var Icon = ({ path, className }) => {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"svg",
|
|
33
|
+
{
|
|
34
|
+
className,
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
fill: "none",
|
|
37
|
+
viewBox: icon24ViewBox,
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
strokeWidth: icon24StrokeWidth,
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
focusable: "false",
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
strokeLinecap: icon24PathStrokeLinecap,
|
|
46
|
+
strokeLinejoin: icon24PathStrokeLinejoin,
|
|
47
|
+
d: path
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
var NotificationItem = ({ notification: notification2, onClose }) => {
|
|
54
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setTimeout(() => setIsVisible(true), 10);
|
|
57
|
+
}, []);
|
|
58
|
+
const colorScheme = getNotificationTypeClasses(notification2.type, defaultNotificationThemeColors);
|
|
59
|
+
const notificationClasses = classNames(
|
|
60
|
+
notificationBaseClasses,
|
|
61
|
+
colorScheme.bg,
|
|
62
|
+
colorScheme.border,
|
|
63
|
+
notification2.className,
|
|
64
|
+
isVisible ? "opacity-100 translate-x-0" : "opacity-0 translate-x-full"
|
|
65
|
+
);
|
|
66
|
+
const iconPath = notification2.icon || getNotificationIconPath(notification2.type);
|
|
67
|
+
const iconClass = classNames(notificationIconClasses, colorScheme.icon);
|
|
68
|
+
const handleClose = () => {
|
|
69
|
+
setIsVisible(false);
|
|
70
|
+
setTimeout(() => onClose(notification2.id), 300);
|
|
71
|
+
};
|
|
72
|
+
const a11yRole = notification2.type === "error" ? "alert" : "status";
|
|
73
|
+
const ariaLive = notification2.type === "error" ? "assertive" : "polite";
|
|
74
|
+
return /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: notificationClasses,
|
|
78
|
+
role: a11yRole,
|
|
79
|
+
"aria-live": ariaLive,
|
|
80
|
+
"aria-atomic": "true",
|
|
81
|
+
onClick: notification2.onClick,
|
|
82
|
+
onKeyDown: (e) => {
|
|
83
|
+
if (!notification2.onClick) return;
|
|
84
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
notification2.onClick();
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
tabIndex: notification2.onClick ? 0 : void 0,
|
|
90
|
+
style: notification2.onClick ? { cursor: "pointer" } : void 0,
|
|
91
|
+
"data-tiger-notification": "",
|
|
92
|
+
"data-tiger-notification-type": notification2.type,
|
|
93
|
+
"data-tiger-notification-id": String(notification2.id),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Icon, { path: iconPath, className: iconClass }),
|
|
96
|
+
/* @__PURE__ */ jsxs("div", { className: notificationContentClasses, children: [
|
|
97
|
+
/* @__PURE__ */ jsx("div", { className: classNames(notificationTitleClasses, colorScheme.titleText), children: notification2.title }),
|
|
98
|
+
notification2.description && /* @__PURE__ */ jsx("div", { className: classNames(notificationDescriptionClasses, colorScheme.descriptionText), children: notification2.description })
|
|
99
|
+
] }),
|
|
100
|
+
notification2.closable && /* @__PURE__ */ jsx(
|
|
101
|
+
"button",
|
|
102
|
+
{
|
|
103
|
+
className: notificationCloseButtonClasses,
|
|
104
|
+
onClick: (e) => {
|
|
105
|
+
e.stopPropagation();
|
|
106
|
+
handleClose();
|
|
107
|
+
},
|
|
108
|
+
"aria-label": "Close notification",
|
|
109
|
+
type: "button",
|
|
110
|
+
children: /* @__PURE__ */ jsx(Icon, { path: notificationCloseIconPath, className: notificationCloseIconClasses })
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
var NotificationContainer = ({
|
|
118
|
+
position = "top-right"
|
|
119
|
+
}) => {
|
|
120
|
+
const [notifications, setNotifications] = useState([]);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
updateCallbacks[position] = () => {
|
|
123
|
+
setNotifications([...notificationInstancesByPosition[position]]);
|
|
124
|
+
};
|
|
125
|
+
updateCallbacks[position]();
|
|
126
|
+
return () => {
|
|
127
|
+
updateCallbacks[position] = null;
|
|
128
|
+
};
|
|
129
|
+
}, [position]);
|
|
130
|
+
const containerClasses = classNames(
|
|
131
|
+
notificationContainerBaseClasses,
|
|
132
|
+
notificationPositionClasses[position]
|
|
133
|
+
);
|
|
134
|
+
const handleRemove = (id) => {
|
|
135
|
+
const instances = notificationInstancesByPosition[position];
|
|
136
|
+
const index = instances.findIndex((notif) => notif.id === id);
|
|
137
|
+
if (index !== -1) {
|
|
138
|
+
const instance = instances[index];
|
|
139
|
+
instances.splice(index, 1);
|
|
140
|
+
if (instance.onClose) {
|
|
141
|
+
instance.onClose();
|
|
142
|
+
}
|
|
143
|
+
updateCallbacks[position]?.();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: containerClasses,
|
|
150
|
+
id: `${NOTIFICATION_CONTAINER_ID_PREFIX}-${position}`,
|
|
151
|
+
"aria-live": "polite",
|
|
152
|
+
"aria-relevant": "additions",
|
|
153
|
+
"data-tiger-notification-container": "",
|
|
154
|
+
"data-tiger-notification-position": position,
|
|
155
|
+
children: notifications.map((notification2) => /* @__PURE__ */ jsx(
|
|
156
|
+
NotificationItem,
|
|
157
|
+
{
|
|
158
|
+
notification: notification2,
|
|
159
|
+
onClose: handleRemove
|
|
160
|
+
},
|
|
161
|
+
notification2.id
|
|
162
|
+
))
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
function ensureContainer(position) {
|
|
167
|
+
if (!isBrowser()) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const containerId = `${NOTIFICATION_CONTAINER_ID_PREFIX}-${position}`;
|
|
171
|
+
const rootId = `${containerId}-root`;
|
|
172
|
+
const existingRootEl = document.getElementById(rootId);
|
|
173
|
+
if (containerRoots[position] && !existingRootEl) {
|
|
174
|
+
containerRoots[position] = null;
|
|
175
|
+
updateCallbacks[position] = null;
|
|
176
|
+
}
|
|
177
|
+
if (containerRoots[position]) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
let rootEl = existingRootEl;
|
|
181
|
+
if (!rootEl) {
|
|
182
|
+
rootEl = document.createElement("div");
|
|
183
|
+
rootEl.id = rootId;
|
|
184
|
+
document.body.appendChild(rootEl);
|
|
185
|
+
}
|
|
186
|
+
containerRoots[position] = createRoot(rootEl);
|
|
187
|
+
containerRoots[position].render(/* @__PURE__ */ jsx(NotificationContainer, { position }));
|
|
188
|
+
}
|
|
189
|
+
function addNotification(config) {
|
|
190
|
+
const position = config.position || "top-right";
|
|
191
|
+
ensureContainer(position);
|
|
192
|
+
const id = getNextInstanceId();
|
|
193
|
+
const instance = {
|
|
194
|
+
id,
|
|
195
|
+
type: config.type || "info",
|
|
196
|
+
title: config.title,
|
|
197
|
+
description: config.description,
|
|
198
|
+
duration: config.duration !== void 0 ? config.duration : 4500,
|
|
199
|
+
closable: config.closable !== void 0 ? config.closable : true,
|
|
200
|
+
onClose: config.onClose,
|
|
201
|
+
onClick: config.onClick,
|
|
202
|
+
icon: config.icon,
|
|
203
|
+
className: config.className,
|
|
204
|
+
position
|
|
205
|
+
};
|
|
206
|
+
notificationInstancesByPosition[position].push(instance);
|
|
207
|
+
if (updateCallbacks[position]) {
|
|
208
|
+
updateCallbacks[position]();
|
|
209
|
+
}
|
|
210
|
+
if (instance.duration > 0) {
|
|
211
|
+
setTimeout(() => {
|
|
212
|
+
removeNotification(id, position);
|
|
213
|
+
}, instance.duration);
|
|
214
|
+
}
|
|
215
|
+
return () => removeNotification(id, position);
|
|
216
|
+
}
|
|
217
|
+
function removeNotification(id, position) {
|
|
218
|
+
const instances = notificationInstancesByPosition[position];
|
|
219
|
+
const index = instances.findIndex((notif) => notif.id === id);
|
|
220
|
+
if (index !== -1) {
|
|
221
|
+
const instance = instances[index];
|
|
222
|
+
instances.splice(index, 1);
|
|
223
|
+
if (instance.onClose) {
|
|
224
|
+
instance.onClose();
|
|
225
|
+
}
|
|
226
|
+
if (updateCallbacks[position]) {
|
|
227
|
+
updateCallbacks[position]();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function clearAll(position) {
|
|
232
|
+
if (position) {
|
|
233
|
+
notificationInstancesByPosition[position].forEach((instance) => {
|
|
234
|
+
if (instance.onClose) {
|
|
235
|
+
instance.onClose();
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
notificationInstancesByPosition[position] = [];
|
|
239
|
+
if (updateCallbacks[position]) {
|
|
240
|
+
updateCallbacks[position]();
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
Object.keys(notificationInstancesByPosition).forEach((pos) => {
|
|
244
|
+
const p = pos;
|
|
245
|
+
notificationInstancesByPosition[p].forEach((instance) => {
|
|
246
|
+
if (instance.onClose) {
|
|
247
|
+
instance.onClose();
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
notificationInstancesByPosition[p] = [];
|
|
251
|
+
if (updateCallbacks[p]) {
|
|
252
|
+
updateCallbacks[p]();
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function normalizeOptions(options) {
|
|
258
|
+
if (typeof options === "string") {
|
|
259
|
+
return { title: options };
|
|
260
|
+
}
|
|
261
|
+
return options;
|
|
262
|
+
}
|
|
263
|
+
var notification = {
|
|
264
|
+
/**
|
|
265
|
+
* Show an info notification
|
|
266
|
+
*/
|
|
267
|
+
info(options) {
|
|
268
|
+
const config = normalizeOptions(options);
|
|
269
|
+
return addNotification({ ...config, type: "info" });
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* Show a success notification
|
|
273
|
+
*/
|
|
274
|
+
success(options) {
|
|
275
|
+
const config = normalizeOptions(options);
|
|
276
|
+
return addNotification({ ...config, type: "success" });
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* Show a warning notification
|
|
280
|
+
*/
|
|
281
|
+
warning(options) {
|
|
282
|
+
const config = normalizeOptions(options);
|
|
283
|
+
return addNotification({ ...config, type: "warning" });
|
|
284
|
+
},
|
|
285
|
+
/**
|
|
286
|
+
* Show an error notification
|
|
287
|
+
*/
|
|
288
|
+
error(options) {
|
|
289
|
+
const config = normalizeOptions(options);
|
|
290
|
+
return addNotification({ ...config, type: "error" });
|
|
291
|
+
},
|
|
292
|
+
/**
|
|
293
|
+
* Clear all notifications
|
|
294
|
+
*/
|
|
295
|
+
clear(position) {
|
|
296
|
+
clearAll(position);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
var Notification_default = notification;
|
|
300
|
+
|
|
301
|
+
export { NotificationContainer, Notification_default, notification };
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkFQ6UHRAO_js = require('./chunk-FQ6UHRAO.js');
|
|
4
|
+
var chunkFAKTU64M_js = require('./chunk-FAKTU64M.js');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var tigercatCore = require('@expcat/tigercat-core');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var spinnerSvg = tigercatCore.getSpinnerSVG("spinner");
|
|
10
|
+
var LoadingSpinner = () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
className: tigercatCore.getLoadingOverlaySpinnerClasses(),
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
fill: "none",
|
|
16
|
+
viewBox: spinnerSvg.viewBox,
|
|
17
|
+
children: spinnerSvg.elements.map((el, index) => {
|
|
18
|
+
if (el.type === "circle") return /* @__PURE__ */ jsxRuntime.jsx("circle", { ...el.attrs }, index);
|
|
19
|
+
if (el.type === "path") return /* @__PURE__ */ jsxRuntime.jsx("path", { ...el.attrs }, index);
|
|
20
|
+
return null;
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
var List = ({
|
|
25
|
+
dataSource = [],
|
|
26
|
+
size = "md",
|
|
27
|
+
bordered = "divided",
|
|
28
|
+
loading = false,
|
|
29
|
+
emptyText = "No data",
|
|
30
|
+
split = true,
|
|
31
|
+
itemLayout = "horizontal",
|
|
32
|
+
header,
|
|
33
|
+
footer,
|
|
34
|
+
pagination = false,
|
|
35
|
+
grid,
|
|
36
|
+
rowKey = "key",
|
|
37
|
+
hoverable = false,
|
|
38
|
+
renderItem,
|
|
39
|
+
onItemClick,
|
|
40
|
+
onPageChange,
|
|
41
|
+
className,
|
|
42
|
+
...divProps
|
|
43
|
+
}) => {
|
|
44
|
+
const [currentPage, setCurrentPage] = react.useState(
|
|
45
|
+
pagination && typeof pagination === "object" ? pagination.current || 1 : 1
|
|
46
|
+
);
|
|
47
|
+
const [currentPageSize, setCurrentPageSize] = react.useState(
|
|
48
|
+
pagination && typeof pagination === "object" ? pagination.pageSize || 10 : 10
|
|
49
|
+
);
|
|
50
|
+
const paginatedData = react.useMemo(() => {
|
|
51
|
+
if (pagination === false) {
|
|
52
|
+
return dataSource;
|
|
53
|
+
}
|
|
54
|
+
return tigercatCore.paginateData(dataSource, currentPage, currentPageSize);
|
|
55
|
+
}, [dataSource, currentPage, currentPageSize, pagination]);
|
|
56
|
+
const paginationInfo = react.useMemo(() => {
|
|
57
|
+
if (pagination === false) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const total = dataSource.length;
|
|
61
|
+
return tigercatCore.calculatePagination(total, currentPage, currentPageSize);
|
|
62
|
+
}, [dataSource.length, currentPage, currentPageSize, pagination]);
|
|
63
|
+
const listClasses = react.useMemo(() => {
|
|
64
|
+
return tigercatCore.classNames(tigercatCore.getListClasses(bordered), tigercatCore.listSizeClasses[size], className);
|
|
65
|
+
}, [bordered, size, className]);
|
|
66
|
+
const gridClasses = react.useMemo(() => {
|
|
67
|
+
if (!grid) return "";
|
|
68
|
+
return tigercatCore.classNames(
|
|
69
|
+
tigercatCore.listGridContainerClasses,
|
|
70
|
+
tigercatCore.getGridColumnClasses(grid.column, grid.xs, grid.sm, grid.md, grid.lg, grid.xl, grid.xxl)
|
|
71
|
+
);
|
|
72
|
+
}, [grid]);
|
|
73
|
+
const handlePageChange = (page) => {
|
|
74
|
+
setCurrentPage(page);
|
|
75
|
+
onPageChange?.({ current: page, pageSize: currentPageSize });
|
|
76
|
+
};
|
|
77
|
+
const handlePageSizeChange = (pageSize) => {
|
|
78
|
+
setCurrentPageSize(pageSize);
|
|
79
|
+
setCurrentPage(1);
|
|
80
|
+
onPageChange?.({ current: 1, pageSize });
|
|
81
|
+
};
|
|
82
|
+
const handleItemClick = (item, index) => {
|
|
83
|
+
onItemClick?.(item, index);
|
|
84
|
+
};
|
|
85
|
+
const getItemKey = (item, index) => {
|
|
86
|
+
if (typeof rowKey === "function") {
|
|
87
|
+
return rowKey(item, index);
|
|
88
|
+
}
|
|
89
|
+
return item[rowKey] || index;
|
|
90
|
+
};
|
|
91
|
+
const renderListHeader = () => {
|
|
92
|
+
if (!header) return null;
|
|
93
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.getListHeaderFooterClasses(size, false), children: header });
|
|
94
|
+
};
|
|
95
|
+
const renderListFooter = () => {
|
|
96
|
+
if (!footer) return null;
|
|
97
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.getListHeaderFooterClasses(size, true), children: footer });
|
|
98
|
+
};
|
|
99
|
+
const renderDefaultListItem = (item, _index) => {
|
|
100
|
+
const itemContent = [];
|
|
101
|
+
const metaContent = [];
|
|
102
|
+
if (item.avatar) {
|
|
103
|
+
metaContent.push(
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemAvatarClasses, children: typeof item.avatar === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
"img",
|
|
106
|
+
{
|
|
107
|
+
src: item.avatar,
|
|
108
|
+
alt: item.title || "Avatar",
|
|
109
|
+
className: "w-10 h-10 rounded-full object-cover"
|
|
110
|
+
}
|
|
111
|
+
) : item.avatar }, "avatar")
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const contentChildren = [];
|
|
115
|
+
if (item.title) {
|
|
116
|
+
contentChildren.push(
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemTitleClasses, children: item.title }, "title")
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
if (item.description) {
|
|
121
|
+
contentChildren.push(
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemDescriptionClasses, children: item.description }, "description")
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
if (contentChildren.length > 0) {
|
|
126
|
+
metaContent.push(
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemContentClasses, children: contentChildren }, "content")
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
if (metaContent.length > 0) {
|
|
131
|
+
itemContent.push(
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemMetaClasses, children: metaContent }, "meta")
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
if (item.extra) {
|
|
136
|
+
itemContent.push(
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listItemExtraClasses, children: item.extra }, "extra")
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
return itemContent;
|
|
141
|
+
};
|
|
142
|
+
const renderListItem = (item, index) => {
|
|
143
|
+
const key = getItemKey(item, index);
|
|
144
|
+
const itemClasses = tigercatCore.getListItemClasses(
|
|
145
|
+
size,
|
|
146
|
+
itemLayout,
|
|
147
|
+
split && bordered === "divided" && !grid,
|
|
148
|
+
hoverable
|
|
149
|
+
);
|
|
150
|
+
const clickable = typeof onItemClick === "function";
|
|
151
|
+
const handleClick = clickable ? () => handleItemClick(item, index) : void 0;
|
|
152
|
+
const handleKeyDown = clickable ? (e) => {
|
|
153
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
handleItemClick(item, index);
|
|
156
|
+
}
|
|
157
|
+
} : void 0;
|
|
158
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
className: tigercatCore.classNames(itemClasses, clickable && "cursor-pointer"),
|
|
162
|
+
role: "listitem",
|
|
163
|
+
tabIndex: clickable ? 0 : void 0,
|
|
164
|
+
onClick: handleClick,
|
|
165
|
+
onKeyDown: handleKeyDown,
|
|
166
|
+
children: renderItem ? renderItem(item, index) : renderDefaultListItem(item)
|
|
167
|
+
},
|
|
168
|
+
key
|
|
169
|
+
);
|
|
170
|
+
};
|
|
171
|
+
const renderListItems = () => {
|
|
172
|
+
if (loading) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
if (paginatedData.length === 0) {
|
|
176
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listEmptyStateClasses, role: "status", "aria-live": "polite", children: emptyText });
|
|
177
|
+
}
|
|
178
|
+
const items = paginatedData.map((item, index) => renderListItem(item, index));
|
|
179
|
+
if (grid) {
|
|
180
|
+
const gutter = grid.gutter;
|
|
181
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
className: gridClasses,
|
|
185
|
+
style: gutter ? { gap: `${gutter}px` } : void 0,
|
|
186
|
+
children: items
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
return items;
|
|
191
|
+
};
|
|
192
|
+
const renderPagination = () => {
|
|
193
|
+
if (pagination === false || !paginationInfo) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
const { totalPages, startIndex, endIndex, hasNext, hasPrev } = paginationInfo;
|
|
197
|
+
const total = dataSource.length;
|
|
198
|
+
const paginationConfig = pagination;
|
|
199
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.listPaginationContainerClasses, children: [
|
|
200
|
+
paginationConfig.showTotal !== false && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-[var(--tiger-text,#111827)]", children: paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : `Showing ${startIndex} to ${endIndex} of ${total} items` }),
|
|
201
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
202
|
+
paginationConfig.showSizeChanger !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
203
|
+
chunkFQ6UHRAO_js.Select,
|
|
204
|
+
{
|
|
205
|
+
size: "sm",
|
|
206
|
+
value: currentPageSize,
|
|
207
|
+
onChange: (value) => {
|
|
208
|
+
if (value == null) return;
|
|
209
|
+
const nextSize = typeof value === "number" ? value : Number(value);
|
|
210
|
+
if (!Number.isFinite(nextSize)) return;
|
|
211
|
+
handlePageSizeChange(nextSize);
|
|
212
|
+
},
|
|
213
|
+
options: (paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map((size2) => ({
|
|
214
|
+
label: `${size2} / page`,
|
|
215
|
+
value: size2
|
|
216
|
+
}))
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1", children: [
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
chunkFAKTU64M_js.Button,
|
|
222
|
+
{
|
|
223
|
+
size: "sm",
|
|
224
|
+
variant: "outline",
|
|
225
|
+
disabled: !hasPrev,
|
|
226
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
227
|
+
className: tigercatCore.classNames(
|
|
228
|
+
!hasPrev && "cursor-not-allowed",
|
|
229
|
+
hasPrev && "hover:bg-[var(--tiger-surface-muted,#f9fafb)]"
|
|
230
|
+
),
|
|
231
|
+
children: "Previous"
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-3 py-1 text-sm text-[var(--tiger-text,#111827)]", children: [
|
|
235
|
+
"Page ",
|
|
236
|
+
currentPage,
|
|
237
|
+
" of ",
|
|
238
|
+
totalPages
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
241
|
+
chunkFAKTU64M_js.Button,
|
|
242
|
+
{
|
|
243
|
+
size: "sm",
|
|
244
|
+
variant: "outline",
|
|
245
|
+
disabled: !hasNext,
|
|
246
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
247
|
+
className: tigercatCore.classNames(
|
|
248
|
+
!hasNext && "cursor-not-allowed",
|
|
249
|
+
hasNext && "hover:bg-[var(--tiger-surface-muted,#f9fafb)]"
|
|
250
|
+
),
|
|
251
|
+
children: "Next"
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
] })
|
|
255
|
+
] })
|
|
256
|
+
] });
|
|
257
|
+
};
|
|
258
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.listWrapperClasses, children: [
|
|
259
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
260
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ...divProps, className: listClasses, role: "list", "aria-busy": loading || void 0, children: [
|
|
261
|
+
renderListHeader(),
|
|
262
|
+
renderListItems(),
|
|
263
|
+
renderListFooter()
|
|
264
|
+
] }),
|
|
265
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.listLoadingOverlayClasses, role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, {}) })
|
|
266
|
+
] }),
|
|
267
|
+
renderPagination()
|
|
268
|
+
] });
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
exports.List = List;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { classNames, iconWrapperClasses, iconSvgBaseClasses, iconSizeClasses } from '@expcat/tigercat-core';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/Icon.tsx
|
|
6
|
+
var Icon = ({
|
|
7
|
+
size = "md",
|
|
8
|
+
color = "currentColor",
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
const iconStyle = { ...props.style, color };
|
|
14
|
+
const iconClasses = classNames(iconWrapperClasses, className);
|
|
15
|
+
const ariaLabel = props["aria-label"];
|
|
16
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
17
|
+
const isDecorative = ariaLabel == null && ariaLabelledBy == null && props.role == null;
|
|
18
|
+
const processedChildren = React.Children.map(children, (child) => {
|
|
19
|
+
if (!React.isValidElement(child) || child.type !== "svg") {
|
|
20
|
+
return child;
|
|
21
|
+
}
|
|
22
|
+
const svgProps = child.props;
|
|
23
|
+
return React.cloneElement(child, {
|
|
24
|
+
...svgProps,
|
|
25
|
+
className: classNames(iconSvgBaseClasses, iconSizeClasses[size], svgProps.className),
|
|
26
|
+
xmlns: svgProps.xmlns ?? "http://www.w3.org/2000/svg",
|
|
27
|
+
viewBox: svgProps.viewBox ?? "0 0 24 24",
|
|
28
|
+
fill: svgProps.fill ?? "none",
|
|
29
|
+
stroke: svgProps.stroke ?? "currentColor",
|
|
30
|
+
strokeWidth: svgProps.strokeWidth ?? 2,
|
|
31
|
+
strokeLinecap: svgProps.strokeLinecap ?? "round",
|
|
32
|
+
strokeLinejoin: svgProps.strokeLinejoin ?? "round"
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
...props,
|
|
39
|
+
className: iconClasses,
|
|
40
|
+
style: iconStyle,
|
|
41
|
+
...isDecorative ? { "aria-hidden": true } : { role: props.role ?? "img" },
|
|
42
|
+
children: processedChildren
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { Icon };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var tigercatCore = require('@expcat/tigercat-core');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
10
|
+
|
|
11
|
+
// src/components/Icon.tsx
|
|
12
|
+
var Icon = ({
|
|
13
|
+
size = "md",
|
|
14
|
+
color = "currentColor",
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
}) => {
|
|
19
|
+
const iconStyle = { ...props.style, color };
|
|
20
|
+
const iconClasses = tigercatCore.classNames(tigercatCore.iconWrapperClasses, className);
|
|
21
|
+
const ariaLabel = props["aria-label"];
|
|
22
|
+
const ariaLabelledBy = props["aria-labelledby"];
|
|
23
|
+
const isDecorative = ariaLabel == null && ariaLabelledBy == null && props.role == null;
|
|
24
|
+
const processedChildren = React__default.default.Children.map(children, (child) => {
|
|
25
|
+
if (!React__default.default.isValidElement(child) || child.type !== "svg") {
|
|
26
|
+
return child;
|
|
27
|
+
}
|
|
28
|
+
const svgProps = child.props;
|
|
29
|
+
return React__default.default.cloneElement(child, {
|
|
30
|
+
...svgProps,
|
|
31
|
+
className: tigercatCore.classNames(tigercatCore.iconSvgBaseClasses, tigercatCore.iconSizeClasses[size], svgProps.className),
|
|
32
|
+
xmlns: svgProps.xmlns ?? "http://www.w3.org/2000/svg",
|
|
33
|
+
viewBox: svgProps.viewBox ?? "0 0 24 24",
|
|
34
|
+
fill: svgProps.fill ?? "none",
|
|
35
|
+
stroke: svgProps.stroke ?? "currentColor",
|
|
36
|
+
strokeWidth: svgProps.strokeWidth ?? 2,
|
|
37
|
+
strokeLinecap: svgProps.strokeLinecap ?? "round",
|
|
38
|
+
strokeLinejoin: svgProps.strokeLinejoin ?? "round"
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
...props,
|
|
45
|
+
className: iconClasses,
|
|
46
|
+
style: iconStyle,
|
|
47
|
+
...isDecorative ? { "aria-hidden": true } : { role: props.role ?? "img" },
|
|
48
|
+
children: processedChildren
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.Icon = Icon;
|