doom-design-system 0.6.0 → 0.7.0
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/components/A2UI/catalog.js +98 -0
- package/dist/components/A2UI/mapping.js +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.js +20 -4
- package/dist/components/FileUpload/FileUpload.js +2 -1
- package/dist/components/FileUpload/FileUpload.module.css +18 -14
- package/dist/components/Page/Page.module.css +9 -3
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.js +53 -23
- package/dist/components/Rating/Rating.d.ts +17 -0
- package/dist/components/Rating/Rating.js +126 -0
- package/dist/components/Rating/Rating.module.css +131 -0
- package/dist/components/Rating/index.d.ts +1 -0
- package/dist/components/Rating/index.js +1 -0
- package/dist/components/Table/Table.d.ts +2 -3
- package/dist/components/Table/Table.js +2 -20
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +22 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +157 -0
- package/dist/components/ToggleGroup/ToggleGroup.module.css +81 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -0
- package/dist/components/ToggleGroup/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/filter/ast/array-filter.d.ts +7 -0
- package/dist/lib/filter/ast/array-filter.js +16 -0
- package/dist/lib/filter/ast/evaluate.d.ts +6 -0
- package/dist/lib/filter/ast/evaluate.js +35 -0
- package/dist/lib/filter/ast/index.d.ts +5 -0
- package/dist/lib/filter/ast/index.js +4 -0
- package/dist/lib/filter/ast/operators.d.ts +7 -0
- package/dist/{components/Table/utils/filterAst.js → lib/filter/ast/operators.js} +0 -52
- package/dist/lib/filter/ast/simple.d.ts +7 -0
- package/dist/lib/filter/ast/simple.js +26 -0
- package/dist/lib/filter/ast/types.d.ts +24 -0
- package/dist/lib/filter/ast/types.js +1 -0
- package/dist/lib/filter/index.d.ts +7 -0
- package/dist/lib/filter/index.js +7 -0
- package/dist/lib/filter/ui/FilterBuilder.d.ts +25 -0
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterBuilder.js +3 -3
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterConditionRow.d.ts +1 -1
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterConditionRow.js +4 -4
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterGroup.d.ts +9 -9
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterGroup.js +7 -7
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterSheetNested.d.ts +3 -3
- package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterSheetNested.js +4 -4
- package/dist/lib/filter/ui/convert.d.ts +16 -0
- package/dist/lib/filter/ui/convert.js +60 -0
- package/dist/lib/filter/ui/index.d.ts +5 -0
- package/dist/lib/filter/ui/index.js +5 -0
- package/dist/lib/filter/ui/utils/tree-utils.d.ts +15 -0
- package/dist/styles/globals.css +3 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/vitest.config.js +6 -1
- package/package.json +10 -3
- package/dist/components/Table/FilterBuilder/FilterBuilder.d.ts +0 -20
- package/dist/components/Table/FilterBuilder/utils/tree-utils.d.ts +0 -15
- package/dist/components/Table/utils/arrayFilter.d.ts +0 -7
- package/dist/components/Table/utils/arrayFilter.js +0 -21
- package/dist/components/Table/utils/filterAst.d.ts +0 -33
- /package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterBuilder.module.css +0 -0
- /package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterConditionRow.module.css +0 -0
- /package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterGroup.module.css +0 -0
- /package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterSheet.module.css +0 -0
- /package/dist/{components/Table/FilterBuilder → lib/filter/ui}/utils/tree-utils.js +0 -0
package/dist/vitest.config.js
CHANGED
|
@@ -4,6 +4,11 @@ export default defineConfig({
|
|
|
4
4
|
environment: "happy-dom",
|
|
5
5
|
globals: true,
|
|
6
6
|
setupFiles: ["./vitest.setup.ts"],
|
|
7
|
-
exclude: [
|
|
7
|
+
exclude: [
|
|
8
|
+
"**/node_modules/**",
|
|
9
|
+
"**/dist/**",
|
|
10
|
+
"tests/**",
|
|
11
|
+
"**/.worktrees/**",
|
|
12
|
+
],
|
|
8
13
|
},
|
|
9
14
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doom-design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Neubrutalist and comic book inspired design system",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css",
|
|
@@ -10,14 +10,21 @@
|
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./filter": {
|
|
18
|
+
"types": "./dist/lib/filter/index.d.ts",
|
|
19
|
+
"import": "./dist/lib/filter/index.js"
|
|
20
|
+
},
|
|
14
21
|
"./package.json": "./package.json"
|
|
15
22
|
},
|
|
16
23
|
"files": [
|
|
17
24
|
"dist"
|
|
18
25
|
],
|
|
19
26
|
"scripts": {
|
|
20
|
-
"build": "rimraf dist && tsc -p tsconfig.build.json && sass components:dist/components styles:dist/styles --no-source-map && node scripts/fix-imports.cjs",
|
|
27
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json && sass components:dist/components styles:dist/styles lib:dist/lib --no-source-map && node scripts/fix-imports.cjs",
|
|
21
28
|
"verify": "npm run validate:build && npm run lint:package && npm run test:integration",
|
|
22
29
|
"prepack": "npm run build && npm run verify",
|
|
23
30
|
"storybook": "storybook dev -p 6006",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FilterConditionItem, FilterGroupItem } from "./FilterGroup";
|
|
2
|
-
export type FilterOperatorKey = "eq" | "neq" | "contains" | "gt" | "lt" | "gte" | "lte" | "startsWith" | "endsWith";
|
|
3
|
-
export interface FilterField {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
type: "select" | "text" | "number";
|
|
7
|
-
options?: {
|
|
8
|
-
value: string;
|
|
9
|
-
label: string;
|
|
10
|
-
}[];
|
|
11
|
-
operators?: FilterOperatorKey[];
|
|
12
|
-
}
|
|
13
|
-
export interface FilterBuilderProps {
|
|
14
|
-
fields: FilterField[];
|
|
15
|
-
value: FilterGroupItem | null;
|
|
16
|
-
onChange: (value: FilterGroupItem) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare function countConditions(group: FilterGroupItem): number;
|
|
19
|
-
export declare function flattenConditions(group: FilterGroupItem): FilterConditionItem[];
|
|
20
|
-
export declare function FilterBuilder({ fields, value, onChange }: FilterBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FilterGroupItem, FilterItem } from "../FilterGroup";
|
|
2
|
-
export declare const MAX_DEPTH = 3;
|
|
3
|
-
export type DropPosition = "before" | "after" | "inside";
|
|
4
|
-
export declare function getItemDepth(root: FilterGroupItem, id: string, currentDepth?: number): number;
|
|
5
|
-
export declare function getMaxRelativeDepth(item: FilterItem): number;
|
|
6
|
-
export declare function findItemPath(root: FilterGroupItem, targetId: string, path?: {
|
|
7
|
-
group: FilterGroupItem;
|
|
8
|
-
index: number;
|
|
9
|
-
}[]): {
|
|
10
|
-
group: FilterGroupItem;
|
|
11
|
-
index: number;
|
|
12
|
-
}[] | null;
|
|
13
|
-
export declare function removeItem(root: FilterGroupItem, id: string): FilterGroupItem;
|
|
14
|
-
export declare function findItem(root: FilterItem, id: string): FilterItem | null;
|
|
15
|
-
export declare function insertItem(root: FilterGroupItem, item: FilterItem, targetId: string, position: DropPosition): FilterGroupItem;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FilterFn } from "@tanstack/react-table";
|
|
2
|
-
/**
|
|
3
|
-
* Custom filter function for array-based column filters.
|
|
4
|
-
* When filterValue is an array, row passes if its value is in the array.
|
|
5
|
-
* Handles typed data by converting values to strings for comparison.
|
|
6
|
-
*/
|
|
7
|
-
export declare const arrayIncludesFilter: FilterFn<unknown>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom filter function for array-based column filters.
|
|
3
|
-
* When filterValue is an array, row passes if its value is in the array.
|
|
4
|
-
* Handles typed data by converting values to strings for comparison.
|
|
5
|
-
*/
|
|
6
|
-
export const arrayIncludesFilter = (row, columnId, filterValue, _addMeta) => {
|
|
7
|
-
// No filter = show all
|
|
8
|
-
if (!filterValue || !Array.isArray(filterValue) || filterValue.length === 0) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
const cellValue = row.getValue(columnId);
|
|
12
|
-
// Handle null/undefined
|
|
13
|
-
if (cellValue === null || cellValue === undefined) {
|
|
14
|
-
return filterValue.includes("");
|
|
15
|
-
}
|
|
16
|
-
// Convert to string for comparison (supports typed data)
|
|
17
|
-
const stringValue = String(cellValue);
|
|
18
|
-
return filterValue.includes(stringValue);
|
|
19
|
-
};
|
|
20
|
-
// Make filter function auto-removable when value is empty array
|
|
21
|
-
arrayIncludesFilter.autoRemove = (val) => !val || !Array.isArray(val) || val.length === 0;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export type FilterNode = FilterCondition | FilterGroup;
|
|
2
|
-
interface BaseFilterNode {
|
|
3
|
-
id?: string;
|
|
4
|
-
logic?: "and" | "or";
|
|
5
|
-
}
|
|
6
|
-
export interface FilterCondition extends BaseFilterNode {
|
|
7
|
-
type: "condition";
|
|
8
|
-
field: string;
|
|
9
|
-
operator: FilterOperatorKey;
|
|
10
|
-
value: unknown;
|
|
11
|
-
}
|
|
12
|
-
export interface FilterGroup extends BaseFilterNode {
|
|
13
|
-
type: "group";
|
|
14
|
-
conditions: FilterNode[];
|
|
15
|
-
}
|
|
16
|
-
export type FilterOperatorKey = "eq" | "neq" | "contains" | "startsWith" | "endsWith" | "gt" | "gte" | "lt" | "lte" | "in" | "notIn" | "isEmpty" | "isNotEmpty";
|
|
17
|
-
export interface FilterOperatorDef {
|
|
18
|
-
key: FilterOperatorKey;
|
|
19
|
-
label: string;
|
|
20
|
-
fn: (cellValue: unknown, filterValue: unknown) => boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const OPERATORS: Record<FilterOperatorKey, FilterOperatorDef>;
|
|
23
|
-
export declare function evaluateFilter(node: FilterNode, row: Record<string, unknown>): boolean;
|
|
24
|
-
export interface SimpleFilter {
|
|
25
|
-
columnId: string;
|
|
26
|
-
label: string;
|
|
27
|
-
options: {
|
|
28
|
-
value: string;
|
|
29
|
-
label: string;
|
|
30
|
-
}[];
|
|
31
|
-
}
|
|
32
|
-
export declare function simpleFiltersToAST(selections: Record<string, string>): FilterNode | null;
|
|
33
|
-
export {};
|
|
File without changes
|
/package/dist/{components/Table/FilterBuilder → lib/filter/ui}/FilterConditionRow.module.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|