@dbcdk/react-components 0.0.2 → 0.0.4
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/assets/logo.cjs +87 -0
- package/dist/assets/logo.d.ts +2 -0
- package/dist/assets/logo.js +85 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.d.ts +5 -0
- package/dist/components/app-header/AppHeader.js +8 -0
- package/dist/components/app-header/AppHeader.module.css +73 -0
- package/dist/components/avatar/Avatar.cjs +67 -0
- package/dist/components/avatar/Avatar.d.ts +15 -0
- package/dist/components/avatar/Avatar.js +42 -0
- package/dist/components/avatar/Avatar.module.css +43 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +23 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +12 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +16 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +84 -0
- package/dist/components/button/Button.cjs +79 -0
- package/dist/components/button/Button.d.ts +13 -0
- package/dist/components/button/Button.js +54 -0
- package/dist/components/button/Button.module.css +156 -0
- package/dist/components/card/Card.cjs +29 -0
- package/dist/components/card/Card.d.ts +11 -0
- package/dist/components/card/Card.js +23 -0
- package/dist/components/card/Card.module.css +69 -0
- package/dist/components/card-container/CardContainer.cjs +23 -0
- package/dist/components/card-container/CardContainer.d.ts +8 -0
- package/dist/components/card-container/CardContainer.js +17 -0
- package/dist/components/card-container/CardContainer.module.css +18 -0
- package/dist/components/checkbox/Checkbox.cjs +43 -0
- package/dist/components/checkbox/Checkbox.d.ts +12 -0
- package/dist/components/checkbox/Checkbox.js +37 -0
- package/dist/components/checkbox/Checkbox.module.css +63 -0
- package/dist/components/chip/Chip.cjs +49 -0
- package/dist/components/chip/Chip.d.ts +13 -0
- package/dist/components/chip/Chip.js +43 -0
- package/dist/components/chip/Chip.module.css +97 -0
- package/dist/components/circle/Circle.cjs +18 -0
- package/dist/components/circle/Circle.d.ts +8 -0
- package/dist/components/circle/Circle.js +12 -0
- package/dist/components/circle/Circle.module.css +62 -0
- package/dist/components/clear-button/ClearButton.cjs +26 -0
- package/dist/components/clear-button/ClearButton.d.ts +6 -0
- package/dist/components/clear-button/ClearButton.js +20 -0
- package/dist/components/clear-button/ClearButton.module.css +16 -0
- package/dist/components/data-summary/DataSummary.cjs +49 -0
- package/dist/components/data-summary/DataSummary.d.ts +19 -0
- package/dist/components/data-summary/DataSummary.js +43 -0
- package/dist/components/data-summary/DataSummary.module.css +51 -0
- package/dist/components/filter-field/FilterField.cjs +174 -0
- package/dist/components/filter-field/FilterField.d.ts +28 -0
- package/dist/components/filter-field/FilterField.js +167 -0
- package/dist/components/filter-field/FilterField.module.css +109 -0
- package/dist/components/headline/Headline.cjs +47 -0
- package/dist/components/headline/Headline.d.ts +14 -0
- package/dist/components/headline/Headline.js +41 -0
- package/dist/components/headline/Headline.module.css +35 -0
- package/dist/components/icon/Icon.cjs +27 -0
- package/dist/components/icon/Icon.d.ts +9 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.module.css +34 -0
- package/dist/components/input/Input.cjs +48 -0
- package/dist/components/input/Input.d.ts +13 -0
- package/dist/components/input/Input.js +42 -0
- package/dist/components/input/Input.module.css +112 -0
- package/dist/components/menu/Menu.cjs +96 -0
- package/dist/components/menu/Menu.d.ts +12 -0
- package/dist/components/menu/Menu.js +71 -0
- package/dist/components/menu/Menu.module.css +95 -0
- package/dist/components/multi-select/MultiSelect.cjs +48 -0
- package/dist/components/multi-select/MultiSelect.d.ts +18 -0
- package/dist/components/multi-select/MultiSelect.js +46 -0
- package/dist/components/nav-bar/NavBar.cjs +55 -0
- package/dist/components/nav-bar/NavBar.d.ts +20 -0
- package/dist/components/nav-bar/NavBar.js +49 -0
- package/dist/components/nav-bar/NavBar.module.css +101 -0
- package/dist/components/page/Page.cjs +30 -0
- package/dist/components/page/Page.d.ts +13 -0
- package/dist/components/page/Page.js +24 -0
- package/dist/components/page/Page.module.css +26 -0
- package/dist/components/page-layout/PageLayout.cjs +101 -0
- package/dist/components/page-layout/PageLayout.d.ts +35 -0
- package/dist/components/page-layout/PageLayout.js +95 -0
- package/dist/components/page-layout/PageLayout.module.css +142 -0
- package/dist/components/pagination/Pagination.cjs +117 -0
- package/dist/components/pagination/Pagination.d.ts +17 -0
- package/dist/components/pagination/Pagination.js +111 -0
- package/dist/components/pagination/Pagination.module.css +17 -0
- package/dist/components/panel/Panel.cjs +18 -0
- package/dist/components/panel/Panel.d.ts +10 -0
- package/dist/components/panel/Panel.js +12 -0
- package/dist/components/panel/Panel.module.css +29 -0
- package/dist/components/popover/Popover.cjs +132 -0
- package/dist/components/popover/Popover.d.ts +15 -0
- package/dist/components/popover/Popover.js +126 -0
- package/dist/components/popover/Popover.module.css +25 -0
- package/dist/components/search-box/SearchBox.cjs +162 -0
- package/dist/components/search-box/SearchBox.d.ts +22 -0
- package/dist/components/search-box/SearchBox.js +156 -0
- package/dist/components/search-box/SearchBox.module.css +20 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +97 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +24 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +91 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +55 -0
- package/dist/components/select/Select.cjs +52 -0
- package/dist/components/select/Select.d.ts +11 -0
- package/dist/components/select/Select.js +50 -0
- package/dist/components/sidebar/Sidebar.cjs +38 -0
- package/dist/components/sidebar/Sidebar.d.ts +12 -0
- package/dist/components/sidebar/Sidebar.js +31 -0
- package/dist/components/sidebar/Sidebar.module.css +66 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +16 -0
- package/dist/components/sidebar/components/SidebarItem.d.ts +9 -0
- package/dist/components/sidebar/components/SidebarItem.js +14 -0
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +74 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +9 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +68 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +61 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +27 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +8 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +21 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +62 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +28 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +4 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +26 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +25 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.d.ts +3 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +23 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +81 -0
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +24 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +78 -0
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +270 -0
- package/dist/components/skeleton-loader/SkeletonLoader.d.ts +9 -0
- package/dist/components/skeleton-loader/SkeletonLoader.js +268 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.d.ts +11 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +63 -0
- package/dist/components/split-button/SplitButton.cjs +37 -0
- package/dist/components/split-button/SplitButton.d.ts +14 -0
- package/dist/components/split-button/SplitButton.js +31 -0
- package/dist/components/split-button/SplitButton.module.css +32 -0
- package/dist/components/table/Table.cjs +181 -0
- package/dist/components/table/Table.d.ts +45 -0
- package/dist/components/table/Table.js +175 -0
- package/dist/components/table/Table.module.css +143 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +22 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.d.ts +7 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +16 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +13 -0
- package/dist/components/tabs/Tabs.cjs +74 -0
- package/dist/components/tabs/Tabs.d.ts +18 -0
- package/dist/components/tabs/Tabs.js +68 -0
- package/dist/components/tabs/Tabs.module.css +113 -0
- package/dist/components/text-area/Textarea.cjs +62 -0
- package/dist/components/text-area/Textarea.d.ts +14 -0
- package/dist/components/text-area/Textarea.js +56 -0
- package/dist/components/text-area/Textarea.module.css +3 -0
- package/dist/components/tooltip/Tooltip.cjs +78 -0
- package/dist/components/tooltip/Tooltip.d.ts +11 -0
- package/dist/components/tooltip/Tooltip.js +72 -0
- package/dist/components/tooltip/Tooltip.module.css +84 -0
- package/dist/components/user-display/UserDisplay.cjs +28 -0
- package/dist/components/user-display/UserDisplay.d.ts +9 -0
- package/dist/components/user-display/UserDisplay.js +22 -0
- package/dist/components/user-display/UserDisplay.module.css +25 -0
- package/dist/constants/severity.cjs +21 -0
- package/dist/constants/severity.d.ts +3 -0
- package/dist/constants/severity.js +18 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.d.ts +1 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +10 -0
- package/dist/constants/sizes.d.ts +2 -0
- package/dist/constants/sizes.js +8 -0
- package/dist/hooks/useTheme.cjs +58 -0
- package/dist/hooks/useTheme.d.ts +9 -0
- package/dist/hooks/useTheme.js +55 -0
- package/dist/hooks/useViewportFill.cjs +52 -0
- package/dist/hooks/useViewportFill.d.ts +15 -0
- package/dist/hooks/useViewportFill.js +50 -0
- package/dist/index.cjs +264 -2
- package/dist/index.d.ts +37 -12
- package/dist/index.js +37 -2
- package/dist/src/styles/styles.css +124 -0
- package/dist/styles/css-helper-classes/spacing.css +291 -0
- package/dist/styles/fonts/Roboto/OFL.txt +93 -0
- package/dist/styles/fonts/Roboto/README.txt +118 -0
- package/dist/styles/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Tajawal/OFL.txt +93 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Black.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Bold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Light.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Medium.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Regular.ttf +0 -0
- package/dist/styles/styles.css +124 -0
- package/dist/styles/themes/dbc/dark.css +240 -0
- package/dist/styles/themes/dbc/light.css +245 -0
- package/dist/styles/themes/forfatterweb/light.css +104 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.d.ts +16 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/tanstack.cjs +231 -0
- package/dist/tanstack.d.ts +25 -0
- package/dist/tanstack.js +206 -0
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.d.ts +8 -0
- package/dist/types/a11y-props.types.js +1 -0
- package/dist/types/assets.d.cjs +2 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/css.d.cjs +2 -0
- package/dist/types/css.d.js +1 -0
- package/dist/types/sizes.types.cjs +2 -0
- package/dist/types/sizes.types.d.ts +2 -0
- package/dist/types/sizes.types.js +1 -0
- package/dist/utils/arrays/nested-filtering.cjs +40 -0
- package/dist/utils/arrays/nested-filtering.d.ts +9 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/date/formatDate.cjs +19 -0
- package/dist/utils/date/formatDate.d.ts +12 -0
- package/dist/utils/date/formatDate.js +17 -0
- package/package.json +53 -12
- package/dist/index.cjs.map +0 -1
- package/dist/index.css +0 -2
- package/dist/index.css.map +0 -1
- package/dist/index.d.cts +0 -12
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-primary: #0c3ee3;
|
|
3
|
+
--color-primary-hover: #0932b6;
|
|
4
|
+
--color-secondary: #6b7280;
|
|
5
|
+
--color-secondary-hover: #4b5563;
|
|
6
|
+
--color-accent: #ec4899;
|
|
7
|
+
--color-accent-hover: #be185d;
|
|
8
|
+
|
|
9
|
+
--color-highlight: #3b6ff5;
|
|
10
|
+
--color-hover: var(--opac-bg-light);
|
|
11
|
+
|
|
12
|
+
--color-bg-selected: #e8edfd;
|
|
13
|
+
--color-bg-selected-hover: #dce5fc;
|
|
14
|
+
--color-border-selected: var(--color-primary);
|
|
15
|
+
|
|
16
|
+
--color-background: #ffffff;
|
|
17
|
+
--color-surface: #ffffff;
|
|
18
|
+
--color-surface-hover: var(--opac-bg-light);
|
|
19
|
+
--color-surface-pressed: var(--opac-bg-default);
|
|
20
|
+
--color-surface-selected: var(--color-bg-selected);
|
|
21
|
+
|
|
22
|
+
/* Text */
|
|
23
|
+
--color-text: #1a1a1a;
|
|
24
|
+
--color-text-secondary: #374151;
|
|
25
|
+
--color-text-muted: #5f6368;
|
|
26
|
+
--color-text-inverse: #ffffff;
|
|
27
|
+
--color-text-on-primary: var(--color-text-inverse);
|
|
28
|
+
--color-text-on-secondary: var(--color-text-inverse);
|
|
29
|
+
--color-text-on-highlight: var(--color-text-inverse);
|
|
30
|
+
|
|
31
|
+
/* Links */
|
|
32
|
+
--color-link: #0c3ee3;
|
|
33
|
+
--color-link-hover: #0932b6;
|
|
34
|
+
--color-link-visited: #5b3ee3;
|
|
35
|
+
|
|
36
|
+
/* Borders */
|
|
37
|
+
--color-border: rgba(0, 0, 0, 0.12);
|
|
38
|
+
--color-border-strong: rgba(0, 0, 0, 0.24);
|
|
39
|
+
--border-width-thin: 1px;
|
|
40
|
+
--border-width-thick: 2px;
|
|
41
|
+
|
|
42
|
+
/* Opacities (light) */
|
|
43
|
+
--opac-bg-light: rgba(0, 0, 0, 0.025);
|
|
44
|
+
--opac-bg-default: rgba(0, 0, 0, 0.05);
|
|
45
|
+
--opac-bg-dark: rgba(0, 0, 0, 0.1);
|
|
46
|
+
--opac-bg-brand: rgba(49, 94, 251, 0.05);
|
|
47
|
+
--opac-bg-light-invert: rgba(255, 255, 255, 0.025);
|
|
48
|
+
--opac-bg-default-invert: rgba(255, 255, 255, 0.05);
|
|
49
|
+
--opac-bg-dark-invert: rgba(255, 255, 255, 0.1);
|
|
50
|
+
|
|
51
|
+
/* Semantic (Status) */
|
|
52
|
+
--color-success: #166534;
|
|
53
|
+
--color-warning: #a05a00;
|
|
54
|
+
--color-error: #b91c1c;
|
|
55
|
+
--color-info: #075985;
|
|
56
|
+
|
|
57
|
+
--color-bg-success: #ecfdf5;
|
|
58
|
+
--color-bg-warning: #fff3d1;
|
|
59
|
+
--color-bg-error: #fef2f2;
|
|
60
|
+
--color-bg-info: #e0f2fe;
|
|
61
|
+
|
|
62
|
+
--color-text-success: #166534;
|
|
63
|
+
--color-text-warning: #a05a00;
|
|
64
|
+
--color-text-error: #b91c1c;
|
|
65
|
+
--color-text-info: #075985;
|
|
66
|
+
|
|
67
|
+
--color-border-success: #16a34a;
|
|
68
|
+
--color-border-warning: #d97706;
|
|
69
|
+
--color-border-error: #ef4444;
|
|
70
|
+
--color-border-info: #0284c7;
|
|
71
|
+
|
|
72
|
+
/* Disabled */
|
|
73
|
+
--color-disabled-bg: #f3f4f6;
|
|
74
|
+
--color-disabled-text: #9ca3af;
|
|
75
|
+
--color-disabled-border: #e5e7eb;
|
|
76
|
+
|
|
77
|
+
/* Focus */
|
|
78
|
+
--focus-ring-color: #7ea5ff; /* tuned for light backgrounds */
|
|
79
|
+
--focus-ring: 0 0 0 3px rgba(12, 62, 227, 0.25);
|
|
80
|
+
|
|
81
|
+
/* ===== Spacing & Layout ===== */
|
|
82
|
+
/* 4px base scale */
|
|
83
|
+
--spacing-2xs: 2px;
|
|
84
|
+
--spacing-xxs: 4px;
|
|
85
|
+
--spacing-xs: 8px;
|
|
86
|
+
--spacing-sm: 12px;
|
|
87
|
+
--spacing-md: 16px;
|
|
88
|
+
--spacing-lg: 24px;
|
|
89
|
+
--spacing-xl: 32px;
|
|
90
|
+
--spacing-2xl: 48px;
|
|
91
|
+
--spacing-3xl: 64px;
|
|
92
|
+
--spacing-4xl: 96px;
|
|
93
|
+
|
|
94
|
+
/* Gutters */
|
|
95
|
+
--gutter-sm: 12px;
|
|
96
|
+
--gutter-md: 16px;
|
|
97
|
+
--gutter-lg: 24px;
|
|
98
|
+
|
|
99
|
+
/* Breakpoints & Containers */
|
|
100
|
+
--bp-xs: 480px;
|
|
101
|
+
--bp-sm: 640px;
|
|
102
|
+
--bp-md: 768px;
|
|
103
|
+
--bp-lg: 1024px;
|
|
104
|
+
--bp-xl: 1280px;
|
|
105
|
+
|
|
106
|
+
--container-xs: 480px;
|
|
107
|
+
--container-sm: 640px;
|
|
108
|
+
--container-md: 768px;
|
|
109
|
+
--container-lg: 1024px;
|
|
110
|
+
--container-xl: 1280px;
|
|
111
|
+
|
|
112
|
+
/* ===== Sizing ===== */
|
|
113
|
+
--icon-size: 20px;
|
|
114
|
+
--component-size-xs: 20px;
|
|
115
|
+
--component-size-sm: 30px;
|
|
116
|
+
--component-size-md: 40px;
|
|
117
|
+
--component-size-lg: 48px;
|
|
118
|
+
--component-size-xl: 64px;
|
|
119
|
+
|
|
120
|
+
/* Control paddings (horizontal/vertical) */
|
|
121
|
+
--control-padding-x: 12px;
|
|
122
|
+
--control-padding-y: 8px;
|
|
123
|
+
|
|
124
|
+
/* Border Radius */
|
|
125
|
+
--border-radius-none: 0;
|
|
126
|
+
--border-radius-default: 0.25rem;
|
|
127
|
+
--border-radius-rounded: 2rem;
|
|
128
|
+
--border-radius-round: 50%;
|
|
129
|
+
--border-radius-sm: 0.125rem;
|
|
130
|
+
--border-radius-md: 0.375rem;
|
|
131
|
+
--border-radius-lg: 0.5rem;
|
|
132
|
+
--border-radius-xl: 0.75rem;
|
|
133
|
+
|
|
134
|
+
/* Density presets (add/subtract from heights/paddings) */
|
|
135
|
+
--density-compact: -2px;
|
|
136
|
+
--density-comfortable: 0px;
|
|
137
|
+
--density-spacious: 4px;
|
|
138
|
+
|
|
139
|
+
/* ===== Typography ===== */
|
|
140
|
+
--font-family:
|
|
141
|
+
Roboto, Inter, ui-sans-serif, system-ui, 'Segoe UI', 'Helvetica Neue', Arial,
|
|
142
|
+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
|
|
143
|
+
--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
|
|
144
|
+
|
|
145
|
+
--font-size-xs: 12px;
|
|
146
|
+
--font-size-sm: 14px;
|
|
147
|
+
--font-size-md: 16px;
|
|
148
|
+
--font-size-lg: 18px;
|
|
149
|
+
--font-size-xl: 24px;
|
|
150
|
+
--font-size-2xl: 30px;
|
|
151
|
+
|
|
152
|
+
/* Fluid helpers (optional) */
|
|
153
|
+
--font-size-fluid-sm: clamp(14px, 1.2vw, 16px);
|
|
154
|
+
--font-size-fluid-lg: clamp(18px, 1.6vw, 22px);
|
|
155
|
+
|
|
156
|
+
--font-weight-regular: 400;
|
|
157
|
+
--font-weight-medium: 500;
|
|
158
|
+
--font-weight-semibold: 600;
|
|
159
|
+
--font-weight-bold: 700;
|
|
160
|
+
--font-weight-extrabold: 800;
|
|
161
|
+
|
|
162
|
+
--line-height-tight: 1.25;
|
|
163
|
+
--line-height-normal: 1.5;
|
|
164
|
+
--line-height-relaxed: 1.75;
|
|
165
|
+
|
|
166
|
+
--letter-spacing-tight: -0.01em;
|
|
167
|
+
--letter-spacing-normal: 0;
|
|
168
|
+
--letter-spacing-wide: 0.02em;
|
|
169
|
+
|
|
170
|
+
--nav-link-transform: none;
|
|
171
|
+
--breadcrumb-transform: none;
|
|
172
|
+
--tab-label-transform: none;
|
|
173
|
+
|
|
174
|
+
/* ===== Motion ===== */
|
|
175
|
+
--transition-fast: 150ms;
|
|
176
|
+
--transition-normal: 250ms;
|
|
177
|
+
--transition-slow: 400ms;
|
|
178
|
+
|
|
179
|
+
--ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
|
|
180
|
+
--ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
|
|
181
|
+
--ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
|
|
182
|
+
--ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
|
|
183
|
+
|
|
184
|
+
/* ===== Elevation & Overlay ===== */
|
|
185
|
+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
186
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
187
|
+
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
188
|
+
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
|
|
189
|
+
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
|
|
190
|
+
|
|
191
|
+
--overlay-scrim: rgba(0, 0, 0, 0.5);
|
|
192
|
+
--backdrop-blur: 8px;
|
|
193
|
+
|
|
194
|
+
/* ===== Layers ===== */
|
|
195
|
+
--z-base: 0;
|
|
196
|
+
--z-dropdown: 1000;
|
|
197
|
+
--z-sticky: 1100;
|
|
198
|
+
--z-banner: 1150;
|
|
199
|
+
--z-modal: 1200;
|
|
200
|
+
--z-drawer: 1250;
|
|
201
|
+
--z-popover: 1300;
|
|
202
|
+
--z-tooltip: 1400;
|
|
203
|
+
--z-toast: 1500;
|
|
204
|
+
|
|
205
|
+
/* ===== Data Visualization (optional but handy for tags/charts) ===== */
|
|
206
|
+
--viz-cat-1: #2563eb;
|
|
207
|
+
--viz-cat-2: #16a34a;
|
|
208
|
+
--viz-cat-3: #f59e0b;
|
|
209
|
+
--viz-cat-4: #ef4444;
|
|
210
|
+
--viz-cat-5: #8b5cf6;
|
|
211
|
+
--viz-cat-6: #14b8a6;
|
|
212
|
+
|
|
213
|
+
--viz-seq-start: #dbeafe;
|
|
214
|
+
--viz-seq-mid: #60a5fa;
|
|
215
|
+
--viz-seq-end: #1d4ed8;
|
|
216
|
+
|
|
217
|
+
/* ===== Components: Skeletons & Loaders ===== */
|
|
218
|
+
--skeleton-base: #e5e7eb;
|
|
219
|
+
--skeleton-pulse: #f3f4f6;
|
|
220
|
+
--spinner-size: 16px;
|
|
221
|
+
--spinner-stroke: 2px;
|
|
222
|
+
|
|
223
|
+
/* ===== Directionality / Logical Spacing ===== */
|
|
224
|
+
--space-inline-sm: 8px; /* use with margin-inline, padding-inline, etc. */
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* ===== Accessibility: Reduced Motion (light only) ===== */
|
|
228
|
+
@media (prefers-reduced-motion: reduce) {
|
|
229
|
+
:root {
|
|
230
|
+
--transition-fast: 1ms;
|
|
231
|
+
--transition-normal: 1ms;
|
|
232
|
+
--transition-slow: 1ms;
|
|
233
|
+
}
|
|
234
|
+
* {
|
|
235
|
+
animation: none !important;
|
|
236
|
+
transition-duration: 1ms !important;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* ===== Optional: High-Contrast Variant (still light) ===== */
|
|
241
|
+
:root[data-contrast='high'] {
|
|
242
|
+
--color-border: #4b5563;
|
|
243
|
+
--color-border-strong: #111827;
|
|
244
|
+
--focus-ring: 0 0 0 3px #111827;
|
|
245
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Colors */
|
|
3
|
+
--color-primary: #1e88e5;
|
|
4
|
+
--color-primary-hover: #007bb0;
|
|
5
|
+
--color-highlight: #3b99e0;
|
|
6
|
+
--focus-ring: 0 0 0 2px #3b99e0;
|
|
7
|
+
--color-primary-hover: #0932b6;
|
|
8
|
+
--color-secondary: #6b7280;
|
|
9
|
+
--color-secondary-hover: #4b5563;
|
|
10
|
+
--color-accent: #ec4899;
|
|
11
|
+
--color-accent-hover: #be185d;
|
|
12
|
+
|
|
13
|
+
--color-highlight: #0932b6;
|
|
14
|
+
--color-hover: var(--opac-bg-light);
|
|
15
|
+
|
|
16
|
+
--color-background: #ffffff;
|
|
17
|
+
|
|
18
|
+
--color-text: #111827;
|
|
19
|
+
--color-text-on-primary: var(--color-text-inverse);
|
|
20
|
+
--color-text-on-highlight: var(--color-text-inverse);
|
|
21
|
+
--color-text-on-secondary: var(--color-text-inverse);
|
|
22
|
+
--color-text-muted: #6b7280;
|
|
23
|
+
--color-text-inverse: #ffffff;
|
|
24
|
+
|
|
25
|
+
--color-border: #e5e7eb;
|
|
26
|
+
--color-border-strong: #d1d5db;
|
|
27
|
+
|
|
28
|
+
--color-success: #16a34a;
|
|
29
|
+
--color-warning: #f59e0b;
|
|
30
|
+
--color-error: #dc2626;
|
|
31
|
+
--color-info: #0ea5e9;
|
|
32
|
+
|
|
33
|
+
--opac-bg-light: rgba(0, 0, 0, 0.025);
|
|
34
|
+
--opac-bg-default: rgba(0, 0, 0, 0.05);
|
|
35
|
+
--opac-bg-dark: rgba(0, 0, 0, 0.1);
|
|
36
|
+
--opac-bg-dark-inverse: rgba(255, 255, 255, 0.1);
|
|
37
|
+
|
|
38
|
+
/* Spacing */
|
|
39
|
+
--spacing-xxs: 0.25rem;
|
|
40
|
+
--spacing-xs: 0.5rem;
|
|
41
|
+
--spacing-sm: 0.75rem;
|
|
42
|
+
--spacing-md: 1rem;
|
|
43
|
+
--spacing-lg: 1.5rem;
|
|
44
|
+
--spacing-xl: 2rem;
|
|
45
|
+
--spacing-2xl: 3rem;
|
|
46
|
+
|
|
47
|
+
--icon-size: 20px;
|
|
48
|
+
|
|
49
|
+
--component-size-xs: 1.5rem;
|
|
50
|
+
--component-size-sm: 2rem;
|
|
51
|
+
--component-size-md: 2.5rem;
|
|
52
|
+
--component-size-lg: 3rem;
|
|
53
|
+
--component-size-xl: 4rem;
|
|
54
|
+
|
|
55
|
+
/* Borders */
|
|
56
|
+
|
|
57
|
+
--border-width-thin: 1px;
|
|
58
|
+
--border-width-thick: 2px;
|
|
59
|
+
|
|
60
|
+
--border-radius-none: 0;
|
|
61
|
+
--border-radius-default: 0.25rem;
|
|
62
|
+
--border-radius-rounded: 2rem;
|
|
63
|
+
--border-radius-round: 50%;
|
|
64
|
+
|
|
65
|
+
/* Typography */
|
|
66
|
+
--font-family: Roboto, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
67
|
+
--font-family-mono: ui-monospace, SFMono-Regular, monospace;
|
|
68
|
+
|
|
69
|
+
--font-size-xs: 0.75rem;
|
|
70
|
+
--font-size-sm: 0.875rem;
|
|
71
|
+
--font-size-md: 1rem;
|
|
72
|
+
--font-size-lg: 1.25rem;
|
|
73
|
+
--font-size-xl: 2rem;
|
|
74
|
+
--font-size-2xl: 3rem;
|
|
75
|
+
|
|
76
|
+
--font-weight-regular: 400;
|
|
77
|
+
--font-weight-medium: 500;
|
|
78
|
+
--font-weight-bold: 700;
|
|
79
|
+
|
|
80
|
+
--line-height-tight: 1.25;
|
|
81
|
+
--line-height-normal: 1.5;
|
|
82
|
+
--line-height-relaxed: 1.75;
|
|
83
|
+
|
|
84
|
+
/* Overlay */
|
|
85
|
+
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
86
|
+
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
87
|
+
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
88
|
+
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
|
|
89
|
+
--shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
|
|
90
|
+
|
|
91
|
+
/* Transitions */
|
|
92
|
+
--transition-fast: 150ms ease-in-out;
|
|
93
|
+
--transition-normal: 250ms ease-in-out;
|
|
94
|
+
--transition-slow: 400ms ease-in-out;
|
|
95
|
+
|
|
96
|
+
--focus-ring: 0 0 0 2px var(--color-primary);
|
|
97
|
+
|
|
98
|
+
/* Layers */
|
|
99
|
+
--z-dropdown: 1000;
|
|
100
|
+
--z-sticky: 1100;
|
|
101
|
+
--z-modal: 1200;
|
|
102
|
+
--z-popover: 1300;
|
|
103
|
+
--z-tooltip: 1400;
|
|
104
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ThemeId = string;
|
|
2
|
+
export type ThemeUrls = Record<ThemeId, string>;
|
|
3
|
+
export type ResolveThemeHref = (id: ThemeId) => string | null;
|
|
4
|
+
export type ThemeControllerOptions = {
|
|
5
|
+
/** Provide either `urls` OR `resolveHref` */
|
|
6
|
+
urls?: ThemeUrls;
|
|
7
|
+
resolveHref?: ResolveThemeHref;
|
|
8
|
+
/** DOM id for the <link> we manage */
|
|
9
|
+
linkId?: string;
|
|
10
|
+
/** Preload other themes once the first theme is set */
|
|
11
|
+
preloadOthers?: boolean;
|
|
12
|
+
/** Persist selection in localStorage */
|
|
13
|
+
persist?: boolean;
|
|
14
|
+
/** LocalStorage key */
|
|
15
|
+
storageKey?: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactTable = require('@tanstack/react-table');
|
|
6
|
+
var Table = require('./components/table/Table');
|
|
7
|
+
var ColumnResizer = require('./components/table/components/column-resizer/ColumnResizer');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
function _interopNamespace(e) {
|
|
12
|
+
if (e && e.__esModule) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var ColumnResizer__default = /*#__PURE__*/_interopDefault(ColumnResizer);
|
|
31
|
+
|
|
32
|
+
function mapDefsToColumnItems(defs) {
|
|
33
|
+
if (!(defs == null ? void 0 : defs.length)) return [];
|
|
34
|
+
return defs.map((def) => {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
36
|
+
const header = typeof def.header === "string" ? def.header : String((_b = (_a = def.accessorKey) != null ? _a : def.id) != null ? _b : "");
|
|
37
|
+
const accessor = def.accessorKey;
|
|
38
|
+
const accessorFn = def.accessorFn;
|
|
39
|
+
const cell = def.cell;
|
|
40
|
+
let render;
|
|
41
|
+
if (typeof cell === "function") {
|
|
42
|
+
render = (row) => cell({
|
|
43
|
+
row: { original: row },
|
|
44
|
+
getValue: () => accessor != null ? row[accessor] : accessorFn ? accessorFn(row) : void 0
|
|
45
|
+
});
|
|
46
|
+
} else if (accessorFn) {
|
|
47
|
+
render = (row) => accessorFn(row);
|
|
48
|
+
} else if (accessor != null) {
|
|
49
|
+
render = (row) => row[accessor];
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
header,
|
|
53
|
+
accessor,
|
|
54
|
+
sortable: (_c = def.enableSorting) != null ? _c : !!accessor,
|
|
55
|
+
render,
|
|
56
|
+
hidden: (_e = (_d = def.meta) == null ? void 0 : _d.hidden) != null ? _e : false,
|
|
57
|
+
align: (_g = (_f = def.meta) == null ? void 0 : _f.align) != null ? _g : void 0,
|
|
58
|
+
fitContent: (_i = (_h = def.meta) == null ? void 0 : _h.fitContent) != null ? _i : false,
|
|
59
|
+
fillWidth: (_k = (_j = def.meta) == null ? void 0 : _j.fillWidth) != null ? _k : false
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function TanstackTable({
|
|
64
|
+
data,
|
|
65
|
+
dataKey,
|
|
66
|
+
columns,
|
|
67
|
+
filterable = [],
|
|
68
|
+
loading,
|
|
69
|
+
onRowClick,
|
|
70
|
+
striped,
|
|
71
|
+
fillViewport = false,
|
|
72
|
+
viewportBottomOffset = 0,
|
|
73
|
+
viewportMin = 120,
|
|
74
|
+
viewportIncludeMarginTop = false,
|
|
75
|
+
pageSize,
|
|
76
|
+
skip,
|
|
77
|
+
totalItemsCount,
|
|
78
|
+
onPageChange,
|
|
79
|
+
variant,
|
|
80
|
+
size
|
|
81
|
+
}) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const [sorting, setSorting] = React__namespace.useState([]);
|
|
84
|
+
const [columnFilters, setColumnFilters] = React__namespace.useState([]);
|
|
85
|
+
const [columnSizing, setColumnSizing] = React__namespace.useState({});
|
|
86
|
+
const table = reactTable.useReactTable({
|
|
87
|
+
data,
|
|
88
|
+
columns,
|
|
89
|
+
state: { sorting, columnFilters, columnSizing },
|
|
90
|
+
onSortingChange: setSorting,
|
|
91
|
+
onColumnFiltersChange: setColumnFilters,
|
|
92
|
+
onColumnSizingChange: setColumnSizing,
|
|
93
|
+
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
94
|
+
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
95
|
+
getFilteredRowModel: reactTable.getFilteredRowModel(),
|
|
96
|
+
enableColumnResizing: true,
|
|
97
|
+
columnResizeMode: "onChange",
|
|
98
|
+
defaultColumn: {
|
|
99
|
+
enableResizing: true,
|
|
100
|
+
minSize: 80,
|
|
101
|
+
size: 180,
|
|
102
|
+
maxSize: 800
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const columnItems = React__namespace.useMemo(() => mapDefsToColumnItems(columns), [columns]);
|
|
106
|
+
const visibleData = React__namespace.useMemo(
|
|
107
|
+
() => table.getRowModel().rows.map((r) => r.original),
|
|
108
|
+
[table, data]
|
|
109
|
+
);
|
|
110
|
+
const s = (_a = table.getState().sorting) == null ? void 0 : _a[0];
|
|
111
|
+
const sortBy = (_b = s == null ? void 0 : s.id) != null ? _b : void 0;
|
|
112
|
+
const sortDirection = s ? s.desc ? "desc" : "asc" : null;
|
|
113
|
+
const gridTemplateColumns = React__namespace.useMemo(() => {
|
|
114
|
+
return columnItems.filter((ci) => !ci.hidden).map((ci) => {
|
|
115
|
+
var _a2, _b2;
|
|
116
|
+
const id = String((_a2 = ci.accessor) != null ? _a2 : "");
|
|
117
|
+
const col = id ? table.getColumn(id) : void 0;
|
|
118
|
+
const w = (_b2 = col == null ? void 0 : col.getSize) == null ? void 0 : _b2.call(col);
|
|
119
|
+
if (ci.fillWidth) return "1fr";
|
|
120
|
+
if (ci.fitContent) return "1%";
|
|
121
|
+
return `${w != null ? w : 180}px`;
|
|
122
|
+
}).join(" ");
|
|
123
|
+
}, [columnItems, table, table.getState().columnSizing]);
|
|
124
|
+
const columnStyles = React__namespace.useMemo(() => {
|
|
125
|
+
var _a2;
|
|
126
|
+
const styles = {};
|
|
127
|
+
for (const c of table.getAllLeafColumns()) {
|
|
128
|
+
const id = c.id;
|
|
129
|
+
const key = (_a2 = c.columnDef.accessorKey) != null ? _a2 : id;
|
|
130
|
+
const ci = columnItems.find((x) => {
|
|
131
|
+
var _a3;
|
|
132
|
+
return String((_a3 = x.accessor) != null ? _a3 : "") === String(key);
|
|
133
|
+
});
|
|
134
|
+
if (ci == null ? void 0 : ci.fillWidth) {
|
|
135
|
+
styles[String(key)] = {
|
|
136
|
+
width: "auto",
|
|
137
|
+
minWidth: 0
|
|
138
|
+
};
|
|
139
|
+
} else if (ci == null ? void 0 : ci.fitContent) {
|
|
140
|
+
styles[String(key)] = {
|
|
141
|
+
width: "1%",
|
|
142
|
+
whiteSpace: "nowrap"
|
|
143
|
+
};
|
|
144
|
+
} else {
|
|
145
|
+
const w = c.getSize();
|
|
146
|
+
styles[String(key)] = { width: w, minWidth: w, maxWidth: w };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return styles;
|
|
150
|
+
}, [table, table.getState().columnSizing, columnItems]);
|
|
151
|
+
const headerExtras = React__namespace.useCallback(
|
|
152
|
+
({ index }) => {
|
|
153
|
+
var _a2, _b2, _c, _d;
|
|
154
|
+
const headerGroups = table.getHeaderGroups();
|
|
155
|
+
const leafHeaders = headerGroups.length > 0 ? headerGroups[headerGroups.length - 1].headers : [];
|
|
156
|
+
const header = leafHeaders[index];
|
|
157
|
+
if (!header) return null;
|
|
158
|
+
const canResize = (_c = (_b2 = (_a2 = header.column).getCanResize) == null ? void 0 : _b2.call(_a2)) != null ? _c : false;
|
|
159
|
+
const handler = (_d = header.getResizeHandler) == null ? void 0 : _d.call(header);
|
|
160
|
+
if (!canResize || !handler) return null;
|
|
161
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ColumnResizer__default.default, { id: header.column.id, handler });
|
|
162
|
+
},
|
|
163
|
+
[table]
|
|
164
|
+
);
|
|
165
|
+
const headerBelowRow = React__namespace.useMemo(() => {
|
|
166
|
+
if (!(filterable == null ? void 0 : filterable.length)) return null;
|
|
167
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
style: {
|
|
171
|
+
display: "grid",
|
|
172
|
+
gridTemplateColumns,
|
|
173
|
+
gap: 8
|
|
174
|
+
},
|
|
175
|
+
children: columnItems.map((ci) => {
|
|
176
|
+
var _a2, _b2;
|
|
177
|
+
const id = String((_a2 = ci.accessor) != null ? _a2 : "");
|
|
178
|
+
const isFilterable = id && filterable.includes(id);
|
|
179
|
+
if (!isFilterable) return /* @__PURE__ */ jsxRuntime.jsx("div", {}, id);
|
|
180
|
+
const col = table.getColumn(id);
|
|
181
|
+
const value = (_b2 = col == null ? void 0 : col.getFilterValue()) != null ? _b2 : "";
|
|
182
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
+
"input",
|
|
184
|
+
{
|
|
185
|
+
value,
|
|
186
|
+
placeholder: `Filter ${ci.header}`,
|
|
187
|
+
onChange: (e) => col == null ? void 0 : col.setFilterValue(e.target.value),
|
|
188
|
+
style: { width: "100%", padding: "4px 6px" }
|
|
189
|
+
},
|
|
190
|
+
id
|
|
191
|
+
);
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}, [columnItems, filterable, table, table.getState().columnFilters, gridTemplateColumns]);
|
|
196
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
Table.Table,
|
|
198
|
+
{
|
|
199
|
+
dataKey,
|
|
200
|
+
variant,
|
|
201
|
+
data: visibleData,
|
|
202
|
+
columns: columnItems,
|
|
203
|
+
sortBy,
|
|
204
|
+
sortDirection,
|
|
205
|
+
onSortChange: (col, dir) => {
|
|
206
|
+
var _a2;
|
|
207
|
+
const id = String((_a2 = col.accessor) != null ? _a2 : "");
|
|
208
|
+
if (!id) return;
|
|
209
|
+
if (!dir) table.setSorting([]);
|
|
210
|
+
else table.setSorting([{ id, desc: dir === "desc" }]);
|
|
211
|
+
},
|
|
212
|
+
headerExtras,
|
|
213
|
+
columnStyles,
|
|
214
|
+
headerBelowRow,
|
|
215
|
+
loading,
|
|
216
|
+
onRowClick,
|
|
217
|
+
striped,
|
|
218
|
+
fillViewport,
|
|
219
|
+
viewportBottomOffset,
|
|
220
|
+
viewportMin,
|
|
221
|
+
viewportIncludeMarginTop,
|
|
222
|
+
take: pageSize,
|
|
223
|
+
skip,
|
|
224
|
+
totalItemsCount,
|
|
225
|
+
onPageChange,
|
|
226
|
+
size
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
exports.TanstackTable = TanstackTable;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ColumnDef } from '@tanstack/react-table';
|
|
3
|
+
import { TableVariant } from './components/table/Table';
|
|
4
|
+
import { PageChangeEvent } from './components/pagination/Pagination';
|
|
5
|
+
type Filterable<T> = Array<keyof T>;
|
|
6
|
+
export declare function TanstackTable<T extends Record<string, any>>({ data, dataKey, columns, filterable, loading, onRowClick, striped, fillViewport, viewportBottomOffset, viewportMin, viewportIncludeMarginTop, pageSize, skip, totalItemsCount, onPageChange, variant, size, }: {
|
|
7
|
+
data: T[];
|
|
8
|
+
dataKey: keyof T;
|
|
9
|
+
columns: ReadonlyArray<ColumnDef<T, any>>;
|
|
10
|
+
filterable?: Filterable<T>;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
onRowClick?: (row: T) => void;
|
|
13
|
+
striped?: boolean;
|
|
14
|
+
fillViewport?: boolean;
|
|
15
|
+
viewportBottomOffset?: number;
|
|
16
|
+
viewportMin?: number;
|
|
17
|
+
viewportIncludeMarginTop?: boolean;
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
skip?: number;
|
|
20
|
+
totalItemsCount?: number;
|
|
21
|
+
onPageChange?: (e: PageChangeEvent) => void;
|
|
22
|
+
variant?: TableVariant;
|
|
23
|
+
size?: 'sm' | 'md';
|
|
24
|
+
}): React.ReactNode;
|
|
25
|
+
export {};
|