@douglasneuroinformatics/libui 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/components/ClientTable/ClientTable.d.ts.map +1 -1
- package/dist/components/ClientTable/ClientTable.js +4 -4
- package/dist/components/Drawer/Drawer.d.ts +5 -5
- package/dist/components/Drawer/DrawerContent.d.ts +1 -1
- package/dist/components/Drawer/DrawerDescription.d.ts +1 -1
- package/dist/components/Drawer/DrawerDescription.d.ts.map +1 -1
- package/dist/components/Drawer/DrawerTitle.d.ts +1 -1
- package/dist/components/Drawer/DrawerTitle.d.ts.map +1 -1
- package/package.json +46 -47
- package/src/components/ClientTable/ClientTable.tsx +5 -7
package/README.md
CHANGED
|
@@ -54,6 +54,12 @@ module.exports {
|
|
|
54
54
|
};
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
**main.tsx**
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import '@douglasneuroinformatics/libui/styles/globals.css';
|
|
61
|
+
```
|
|
62
|
+
|
|
57
63
|
## Contributing
|
|
58
64
|
|
|
59
65
|
We welcome contributions! If you're interested in improving the library or adding new features, please refer to our contribution guide.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientTable.d.ts","sourceRoot":"","sources":["../../../src/components/ClientTable/ClientTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0BxC,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;AAErG,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,gBAAgB,IAAI;IAC1D,6CAA6C;IAC7C,KAAK,EAAE,kBAA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BAAgB,IAAI;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAAC;IACtD,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAChC,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,WAAW,mIASrB,iBAAiB,CAAC,CAAC,sBAmGrB,CAAC"}
|
|
@@ -48,9 +48,8 @@ export const ClientTable = ({ className, columnDropdownOptions, columns, data, e
|
|
|
48
48
|
}))))) : (column.label)))))),
|
|
49
49
|
React.createElement(Table.Body, null, range(nRows).map((i) => {
|
|
50
50
|
const entry = currentEntries[i];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} }, columns.map(({ field, formatter }, j) => {
|
|
51
|
+
const onClick = onEntryClick && entry ? () => onEntryClick(entry) : undefined;
|
|
52
|
+
return (React.createElement(Table.Row, { className: cn(onClick && 'cursor-pointer hover:backdrop-brightness-95'), key: i, onClick: onClick }, columns.map(({ field, formatter }, j) => {
|
|
54
53
|
let value;
|
|
55
54
|
if (!entry) {
|
|
56
55
|
value = 'NA';
|
|
@@ -62,7 +61,8 @@ export const ClientTable = ({ className, columnDropdownOptions, columns, data, e
|
|
|
62
61
|
value = entry[field];
|
|
63
62
|
}
|
|
64
63
|
const formattedValue = entry && formatter ? formatter(value) : defaultFormatter(value);
|
|
65
|
-
return (React.createElement(Table.Cell, { className: cn('text-ellipsis leading-none', !entry && '
|
|
64
|
+
return (React.createElement(Table.Cell, { className: cn('text-ellipsis leading-none', !entry && 'opacity-0', // safari does not include borders if invisible
|
|
65
|
+
noWrap && 'max-w-3xl overflow-hidden text-ellipsis whitespace-nowrap'), key: j }, formattedValue));
|
|
66
66
|
})));
|
|
67
67
|
})))),
|
|
68
68
|
React.createElement(ClientTablePagination, { currentPage: currentPage, firstEntry: firstEntry, lastEntry: lastEntry, pageCount: pageCount, setCurrentPage: setCurrentPage, totalEntries: data.length })));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
3
|
export declare const Drawer: (({ shouldScaleBackground, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => React.JSX.Element) & {
|
|
4
|
-
Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog"
|
|
5
|
-
Content: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog"
|
|
4
|
+
Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
Content: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
6
6
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
7
7
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
Description: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog"
|
|
8
|
+
Description: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
9
|
Footer: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
10
10
|
Header: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
11
|
-
Title: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog"
|
|
12
|
-
Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog"
|
|
11
|
+
Title: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
12
|
+
Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog"
|
|
2
|
+
export declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
3
3
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
4
4
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
//# sourceMappingURL=DrawerContent.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog"
|
|
2
|
+
export declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
3
3
|
//# sourceMappingURL=DrawerDescription.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerDescription.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DrawerDescription.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerDescription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB,+LAO5B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog"
|
|
2
|
+
export declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
3
3
|
//# sourceMappingURL=DrawerTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"DrawerTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/DrawerTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,WAAW,qLAWtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douglasneuroinformatics/libui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.5.
|
|
5
|
-
"packageManager": "pnpm@8.15.3",
|
|
4
|
+
"version": "2.5.3",
|
|
6
5
|
"description": "Generic UI components for DNP projects, built using React and TailwindCSS",
|
|
7
6
|
"author": {
|
|
8
7
|
"name": "Douglas Neuroinformatics",
|
|
@@ -57,8 +56,7 @@
|
|
|
57
56
|
"dependencies": {
|
|
58
57
|
"@douglasneuroinformatics/libjs": "^0.3.1",
|
|
59
58
|
"@douglasneuroinformatics/libui-form-types": "^0.7.0",
|
|
60
|
-
"@headlessui/
|
|
61
|
-
"@headlessui/tailwindcss": "^0.2.0",
|
|
59
|
+
"@headlessui/tailwindcss": "^0.2.1",
|
|
62
60
|
"@heroicons/react": "^2.1.3",
|
|
63
61
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
64
62
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
@@ -84,68 +82,69 @@
|
|
|
84
82
|
"@radix-ui/react-tooltip": "^1.0.7",
|
|
85
83
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
86
84
|
"class-variance-authority": "^0.7.0",
|
|
87
|
-
"clsx": "^2.1.
|
|
85
|
+
"clsx": "^2.1.1",
|
|
88
86
|
"cmdk": "^1.0.0",
|
|
89
|
-
"framer-motion": "^11.
|
|
87
|
+
"framer-motion": "^11.2.10",
|
|
90
88
|
"i18next": "23.x",
|
|
91
|
-
"i18next-browser-languagedetector": "^
|
|
89
|
+
"i18next-browser-languagedetector": "^8.0.0",
|
|
92
90
|
"lodash-es": "^4.17.21",
|
|
93
|
-
"lucide-react": "^0.
|
|
91
|
+
"lucide-react": "^0.390.0",
|
|
94
92
|
"react-error-boundary": "^4.0.13",
|
|
95
|
-
"react-i18next": "^14.1.
|
|
96
|
-
"react-resizable-panels": "^2.0.
|
|
97
|
-
"recharts": "^2.12.
|
|
98
|
-
"tailwind-merge": "^2.
|
|
93
|
+
"react-i18next": "^14.1.2",
|
|
94
|
+
"react-resizable-panels": "^2.0.19",
|
|
95
|
+
"recharts": "^2.12.7",
|
|
96
|
+
"tailwind-merge": "^2.3.0",
|
|
99
97
|
"tailwindcss-animate": "^1.0.7",
|
|
100
|
-
"ts-pattern": "^5.1.
|
|
101
|
-
"type-fest": "^4.
|
|
102
|
-
"vaul": "^0.9.
|
|
103
|
-
"zod": "^3.
|
|
98
|
+
"ts-pattern": "^5.1.2",
|
|
99
|
+
"type-fest": "^4.20.0",
|
|
100
|
+
"vaul": "^0.9.1",
|
|
101
|
+
"zod": "^3.23.8",
|
|
104
102
|
"zustand": "^4.5.2"
|
|
105
103
|
},
|
|
106
104
|
"devDependencies": {
|
|
107
|
-
"@commitlint/cli": "^19.
|
|
108
|
-
"@commitlint/config-conventional": "^19.
|
|
105
|
+
"@commitlint/cli": "^19.3.0",
|
|
106
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
109
107
|
"@commitlint/types": "^19.0.3",
|
|
110
|
-
"@douglasneuroinformatics/eslint-config": "^4.2.
|
|
108
|
+
"@douglasneuroinformatics/eslint-config": "^4.2.2",
|
|
111
109
|
"@semantic-release/changelog": "^6.0.3",
|
|
112
110
|
"@semantic-release/git": "^10.0.1",
|
|
113
|
-
"@semantic-release/npm": "^12.0.
|
|
114
|
-
"@storybook/addon-essentials": "^8.
|
|
115
|
-
"@storybook/addon-interactions": "^8.
|
|
116
|
-
"@storybook/addon-links": "^8.
|
|
117
|
-
"@storybook/blocks": "^8.
|
|
118
|
-
"@storybook/components": "^8.
|
|
111
|
+
"@semantic-release/npm": "^12.0.1",
|
|
112
|
+
"@storybook/addon-essentials": "^8.1.6",
|
|
113
|
+
"@storybook/addon-interactions": "^8.1.6",
|
|
114
|
+
"@storybook/addon-links": "^8.1.6",
|
|
115
|
+
"@storybook/blocks": "^8.1.6",
|
|
116
|
+
"@storybook/components": "^8.1.6",
|
|
119
117
|
"@storybook/icons": "^1.2.9",
|
|
120
|
-
"@storybook/manager-api": "^8.
|
|
121
|
-
"@storybook/react": "^8.
|
|
122
|
-
"@storybook/react-vite": "^8.
|
|
123
|
-
"@storybook/theming": "^8.
|
|
124
|
-
"@testing-library/
|
|
125
|
-
"@testing-library/
|
|
118
|
+
"@storybook/manager-api": "^8.1.6",
|
|
119
|
+
"@storybook/react": "^8.1.6",
|
|
120
|
+
"@storybook/react-vite": "^8.1.6",
|
|
121
|
+
"@storybook/theming": "^8.1.6",
|
|
122
|
+
"@testing-library/dom": "^10.1.0",
|
|
123
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
124
|
+
"@testing-library/react": "16.0.0",
|
|
126
125
|
"@testing-library/user-event": "^14.5.2",
|
|
127
126
|
"@types/lodash-es": "^4.17.12",
|
|
128
|
-
"@types/node": "^20.
|
|
129
|
-
"@types/react": "^18.
|
|
130
|
-
"@types/react-dom": "^18.
|
|
131
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
132
|
-
"@vitest/coverage-v8": "^1.
|
|
127
|
+
"@types/node": "^20.14.2",
|
|
128
|
+
"@types/react": "^18.3.3",
|
|
129
|
+
"@types/react-dom": "^18.3.0",
|
|
130
|
+
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
131
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
133
132
|
"autoprefixer": "^10.4.19",
|
|
134
133
|
"eslint": "^8.57.0",
|
|
135
|
-
"happy-dom": "^14.
|
|
134
|
+
"happy-dom": "^14.12.0",
|
|
136
135
|
"husky": "^9.0.11",
|
|
137
|
-
"jsdom": "24.
|
|
136
|
+
"jsdom": "24.1.0",
|
|
138
137
|
"postcss": "^8.4.38",
|
|
139
|
-
"prettier": "^3.
|
|
140
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
141
|
-
"semantic-release": "^
|
|
138
|
+
"prettier": "^3.3.1",
|
|
139
|
+
"prettier-plugin-tailwindcss": "^0.6.2",
|
|
140
|
+
"semantic-release": "^24.0.0",
|
|
142
141
|
"sort-json": "^2.0.1",
|
|
143
|
-
"storybook": "^8.
|
|
144
|
-
"storybook-react-i18next": "^3.
|
|
145
|
-
"tailwindcss": "^3.4.
|
|
146
|
-
"typescript": "~5.4.
|
|
147
|
-
"vite": "5.2.
|
|
148
|
-
"vitest": "^1.
|
|
142
|
+
"storybook": "^8.1.6",
|
|
143
|
+
"storybook-react-i18next": "^3.1.1",
|
|
144
|
+
"tailwindcss": "^3.4.4",
|
|
145
|
+
"typescript": "~5.4.5",
|
|
146
|
+
"vite": "5.2.13",
|
|
147
|
+
"vitest": "^1.6.0"
|
|
149
148
|
},
|
|
150
149
|
"scripts": {
|
|
151
150
|
"build": "rm -rf dist && tsc -b tsconfig.build.json && cp -r src/styles dist",
|
|
@@ -33,7 +33,6 @@ export type ClientTableColumn<T extends ClientTableEntry> = {
|
|
|
33
33
|
field: ClientFieldFactory<T> | keyof T;
|
|
34
34
|
|
|
35
35
|
/** Override the default formatter for this field */
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
36
|
formatter?: (value: any) => string;
|
|
38
37
|
|
|
39
38
|
/** The label to be displayed on the header */
|
|
@@ -123,14 +122,13 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
123
122
|
</Table.Header>
|
|
124
123
|
<Table.Body>
|
|
125
124
|
{range(nRows).map((i) => {
|
|
126
|
-
const entry = currentEntries[i];
|
|
125
|
+
const entry = currentEntries[i] as T | undefined;
|
|
126
|
+
const onClick = onEntryClick && entry ? () => onEntryClick(entry) : undefined;
|
|
127
127
|
return (
|
|
128
128
|
<Table.Row
|
|
129
|
-
className={cn(
|
|
129
|
+
className={cn(onClick && 'cursor-pointer hover:backdrop-brightness-95')}
|
|
130
130
|
key={i}
|
|
131
|
-
onClick={
|
|
132
|
-
onEntryClick?.(entry);
|
|
133
|
-
}}
|
|
131
|
+
onClick={onClick}
|
|
134
132
|
>
|
|
135
133
|
{columns.map(({ field, formatter }, j) => {
|
|
136
134
|
let value: unknown;
|
|
@@ -146,7 +144,7 @@ export const ClientTable = <T extends ClientTableEntry>({
|
|
|
146
144
|
<Table.Cell
|
|
147
145
|
className={cn(
|
|
148
146
|
'text-ellipsis leading-none',
|
|
149
|
-
!entry && '
|
|
147
|
+
!entry && 'opacity-0', // safari does not include borders if invisible
|
|
150
148
|
noWrap && 'max-w-3xl overflow-hidden text-ellipsis whitespace-nowrap'
|
|
151
149
|
)}
|
|
152
150
|
key={j}
|