@flux-ui/types 3.0.0-next.6 → 3.0.0-next.61
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 +27 -33
- package/package.json +13 -18
- package/src/common.ts +7 -5
- package/src/components.ts +44 -0
- package/src/filter.ts +50 -5
- package/src/form.ts +26 -0
- package/src/index.ts +27 -4
- package/src/statistics.ts +7 -0
- package/src/font-awesome.ts +0 -4838
- package/src/material-symbols.ts +0 -3508
- package/tsconfig.json +0 -45
package/README.md
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@flux-ui/types`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
targets Vue 3+. Please read the following instructions and checks in order to proceed.
|
|
3
|
+
Public TypeScript types shared across the Flux UI packages.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
This package has **no build step** — it ships its TypeScript sources directly.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- The Dashboard library package is available under `@flux-ui/dashboard`.
|
|
10
|
-
- The internal package is available under `@flux-ui/internals`.
|
|
7
|
+
## Highlights
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
| File | Contents |
|
|
10
|
+
|-----------------|-------------------------------------------------------------------------|
|
|
11
|
+
| `common.ts` | Cross-cutting types — `FluxColor`, `FluxSize`, `FluxIconName`, `FluxTo` |
|
|
12
|
+
| `components.ts` | Per-component `Props`, `Emits`, and `Slots` types |
|
|
13
|
+
| `form.ts` | Form-related types |
|
|
14
|
+
| `filter.ts` | Filter component types |
|
|
15
|
+
| `notify.ts` | Snackbar, alert, confirm, and prompt types |
|
|
16
|
+
| `statistics.ts` | Types for `@flux-ui/statistics` |
|
|
13
17
|
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
- Configure a new environment variable `FONTAWESOME_NPM_AUTH_TOKEN`. This should be a valid Font Awesome private npm auth token.
|
|
17
|
-
- Use `pnpm install` to install the required packages.
|
|
18
|
-
- Use `pnpm dev` to start a build watcher for both targets.
|
|
19
|
-
- Use `pnpm build` to build a production bundle.
|
|
20
|
-
- Use `pnpm link` to link the dist folder of flux to your global node_modules.
|
|
18
|
+
> Component-owned types live next to their component as inline `defineProps` / `defineEmits` / `defineSlots`.
|
|
19
|
+
> Only types with cross-package or cross-component reuse belong here.
|
|
21
20
|
|
|
22
|
-
##
|
|
21
|
+
## ⭐️ Prerequisites
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
- Bun >= 1.2.13
|
|
24
|
+
- Node >= 23
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## 🚀 Getting started
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- **Feature branches** — Any feature should have its own feature branch. Once complete, the branch should be merged into the _develop_ branch and the feature branch should be deleted.
|
|
31
|
-
- **Bugfix branches** — When a bug is found, it should be fixed within a bugfix branch. Once complete the branch should be merged into the _develop_ branch and the feature branch should be deleted.
|
|
28
|
+
1. Make sure the Flux monorepo is checked out.
|
|
29
|
+
2. Run `bun install` in the project root.
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
There is no build step; consumers import directly from `./src/index.ts`.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
## 📦 Sibling packages
|
|
36
34
|
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- `feat(expandable): adds header slot to expandable.`
|
|
44
|
-
- `feat(expandable): adds header slot to expandable. [FLUX-123]`
|
|
45
|
-
- `chore: adds vue 3 build target.`
|
|
35
|
+
- [`@flux-ui/components`](../components)
|
|
36
|
+
- [`@flux-ui/internals`](../internals)
|
|
37
|
+
- [`@flux-ui/statistics`](../statistics)
|
|
38
|
+
- [`@flux-ui/dashboard`](../dashboard)
|
|
39
|
+
- [`@flux-ui/application`](../application)
|
package/package.json
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-ui/types",
|
|
3
3
|
"description": "Contains all public types of Flux UI packages.",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.61",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
8
|
-
"homepage": "https://flux.
|
|
8
|
+
"homepage": "https://flux-ui.dev",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/basmilius/flux.git",
|
|
12
|
-
"directory": "packages/
|
|
12
|
+
"directory": "packages/types"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"design system",
|
|
18
|
-
"vue",
|
|
19
|
-
"vue 3",
|
|
20
|
-
"ui",
|
|
21
|
-
"components",
|
|
22
|
-
"flux"
|
|
15
|
+
"flux",
|
|
16
|
+
"types"
|
|
23
17
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"prepublishOnly": "cp ../../README.md ."
|
|
26
|
-
},
|
|
27
18
|
"exports": {
|
|
28
19
|
".": "./src/index.ts"
|
|
29
20
|
},
|
|
@@ -32,16 +23,20 @@
|
|
|
32
23
|
"provenance": true
|
|
33
24
|
},
|
|
34
25
|
"files": [
|
|
35
|
-
"src"
|
|
36
|
-
"tsconfig.json"
|
|
26
|
+
"src"
|
|
37
27
|
],
|
|
38
28
|
"main": "./src/index.ts",
|
|
39
29
|
"module": "./src/index.ts",
|
|
40
30
|
"types": "./src/index.ts",
|
|
41
31
|
"typings": "./src/index.ts",
|
|
42
32
|
"sideEffects": false,
|
|
43
|
-
"
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
35
|
+
"luxon": "^3.7.2"
|
|
36
|
+
},
|
|
44
37
|
"devDependencies": {
|
|
45
|
-
"@types
|
|
38
|
+
"@fortawesome/fontawesome-common-types": "^7.2.0",
|
|
39
|
+
"@types/luxon": "^3.7.1",
|
|
40
|
+
"luxon": "^3.7.2"
|
|
46
41
|
}
|
|
47
42
|
}
|
package/src/common.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { FontAwesome } from '
|
|
2
|
-
import type { MaterialSymbol } from './material-symbols';
|
|
1
|
+
import type { IconName as FontAwesome } from '@fortawesome/fontawesome-common-types';
|
|
3
2
|
|
|
4
|
-
export type FluxIconName = FontAwesome
|
|
5
|
-
|
|
6
|
-
export type
|
|
3
|
+
export type FluxIconName = FontAwesome;
|
|
4
|
+
|
|
5
|
+
export type FluxAlignment =
|
|
6
|
+
| 'start'
|
|
7
|
+
| 'center'
|
|
8
|
+
| 'end';
|
|
7
9
|
|
|
8
10
|
export type FluxColor =
|
|
9
11
|
| 'gray'
|
package/src/components.ts
CHANGED
|
@@ -53,3 +53,47 @@ export type FluxSegmentedControlItemObject = {
|
|
|
53
53
|
readonly icon?: FluxIconName;
|
|
54
54
|
readonly label?: string;
|
|
55
55
|
};
|
|
56
|
+
|
|
57
|
+
export type FluxKanbanMoveEvent = {
|
|
58
|
+
readonly itemId: string | number;
|
|
59
|
+
readonly fromColumnId: string | number;
|
|
60
|
+
readonly toColumnId: string | number;
|
|
61
|
+
readonly beforeItemId?: string | number;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type FluxKanbanMoveColumnEvent = {
|
|
65
|
+
readonly columnId: string | number;
|
|
66
|
+
readonly beforeColumnId?: string | number;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type FluxTreeViewOption = {
|
|
70
|
+
readonly id: string | number;
|
|
71
|
+
readonly label: string;
|
|
72
|
+
readonly icon?: FluxIconName;
|
|
73
|
+
readonly children?: FluxTreeViewOption[];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type FluxCommandSubAction = {
|
|
77
|
+
readonly label: string;
|
|
78
|
+
readonly icon?: FluxIconName;
|
|
79
|
+
readonly onActivate: () => void;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type FluxCommandSourceItem = {
|
|
83
|
+
readonly id: string | number;
|
|
84
|
+
readonly label: string;
|
|
85
|
+
readonly subLabel?: string;
|
|
86
|
+
readonly icon?: FluxIconName;
|
|
87
|
+
readonly command?: string;
|
|
88
|
+
readonly subActions?: FluxCommandSubAction[];
|
|
89
|
+
readonly onActivate: () => void;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type FluxCommandSource = {
|
|
93
|
+
readonly key: string;
|
|
94
|
+
readonly label: string;
|
|
95
|
+
readonly icon?: FluxIconName;
|
|
96
|
+
readonly tab?: boolean;
|
|
97
|
+
readonly items: FluxCommandSourceItem[];
|
|
98
|
+
readonly fetchSearch?: (query: string) => Promise<FluxCommandSourceItem[]>;
|
|
99
|
+
};
|
package/src/filter.ts
CHANGED
|
@@ -41,6 +41,7 @@ export type FluxFilterOptionHeader = {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export type FluxFilterOptionItem = {
|
|
44
|
+
readonly icon?: FluxIconName;
|
|
44
45
|
readonly label: string;
|
|
45
46
|
readonly value: FluxFilterValueSingle;
|
|
46
47
|
};
|
|
@@ -60,10 +61,54 @@ export type FluxFilterValue =
|
|
|
60
61
|
| FluxFilterValueSingle
|
|
61
62
|
| FluxFilterValueSingle[];
|
|
62
63
|
|
|
63
|
-
export type FluxFilterState =
|
|
64
|
-
|
|
64
|
+
export type FluxFilterState = Record<string, FluxFilterValue>;
|
|
65
|
+
|
|
66
|
+
export type FluxFilterSpec = {
|
|
67
|
+
readonly icon?: FluxIconName;
|
|
68
|
+
readonly label: string;
|
|
69
|
+
readonly name: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type FluxFilterDateSpec = FluxFilterSpec;
|
|
73
|
+
|
|
74
|
+
export type FluxFilterDateRangeSpec = FluxFilterSpec;
|
|
75
|
+
|
|
76
|
+
export type FluxFilterOptionSpec = FluxFilterSpec & {
|
|
77
|
+
readonly options: FluxFilterOptionRow[];
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type FluxFilterOptionAsyncSpec = FluxFilterSpec & {
|
|
81
|
+
fetchOptions(ids: FluxFilterValue[]): Promise<FluxFilterOptionRow[]>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type FluxFilterOptionsSpec = FluxFilterSpec & {
|
|
85
|
+
readonly options: FluxFilterOptionRow[];
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type FluxFilterOptionsAsyncSpec = FluxFilterSpec & {
|
|
89
|
+
fetchOptions(ids: FluxFilterValue[]): Promise<FluxFilterOptionRow[]>;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type FluxFilterRangeSpec = FluxFilterSpec & {
|
|
93
|
+
formatter?(value: number): string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type FluxFilterSpecMap = {
|
|
97
|
+
date: FluxFilterDateSpec;
|
|
98
|
+
dateRange: FluxFilterDateRangeSpec;
|
|
99
|
+
option: FluxFilterOptionSpec;
|
|
100
|
+
optionAsync: FluxFilterOptionAsyncSpec;
|
|
101
|
+
options: FluxFilterOptionsSpec;
|
|
102
|
+
optionsAsync: FluxFilterOptionsAsyncSpec;
|
|
103
|
+
range: FluxFilterRangeSpec;
|
|
104
|
+
};
|
|
65
105
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
106
|
+
export type FluxFilterEntryMap = {
|
|
107
|
+
date: FluxFilterDateEntry;
|
|
108
|
+
dateRange: FluxFilterDateRangeEntry;
|
|
109
|
+
option: FluxFilterOptionEntry;
|
|
110
|
+
optionAsync: FluxFilterOptionEntry;
|
|
111
|
+
options: FluxFilterOptionsEntry;
|
|
112
|
+
optionsAsync: FluxFilterOptionsEntry;
|
|
113
|
+
range: FluxFilterRangeEntry;
|
|
69
114
|
};
|
package/src/form.ts
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import type { FluxIconName } from './common';
|
|
2
2
|
|
|
3
|
+
export type FluxFormInputBaseProps = {
|
|
4
|
+
readonly autoFocus?: boolean;
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
readonly error?: string | null;
|
|
7
|
+
readonly isCondensed?: boolean;
|
|
8
|
+
readonly isLoading?: boolean;
|
|
9
|
+
readonly isReadonly?: boolean;
|
|
10
|
+
readonly isSecondary?: boolean;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
readonly placeholder?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type FluxFormTreeViewSelectOption = {
|
|
16
|
+
readonly id: string | number;
|
|
17
|
+
readonly label: string;
|
|
18
|
+
readonly icon?: FluxIconName;
|
|
19
|
+
readonly selectable?: boolean;
|
|
20
|
+
readonly children?: FluxFormTreeViewSelectOption[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type FluxFormTreeViewSelectValue = FluxFormTreeViewSelectValueSingle | FluxFormTreeViewSelectValueSingle[];
|
|
24
|
+
export type FluxFormTreeViewSelectValueSingle = string | number;
|
|
25
|
+
|
|
3
26
|
export type FluxFormSelectGroup = {
|
|
4
27
|
readonly icon?: FluxIconName;
|
|
5
28
|
readonly label: string;
|
|
29
|
+
readonly value?: never;
|
|
6
30
|
};
|
|
7
31
|
|
|
8
32
|
export type FluxFormSelectOption = {
|
|
@@ -10,6 +34,8 @@ export type FluxFormSelectOption = {
|
|
|
10
34
|
readonly command?: string;
|
|
11
35
|
readonly commandIcon?: FluxIconName;
|
|
12
36
|
readonly icon?: FluxIconName;
|
|
37
|
+
readonly imageAlt?: string;
|
|
38
|
+
readonly imageSrc?: string;
|
|
13
39
|
readonly label: string;
|
|
14
40
|
readonly selectable?: boolean;
|
|
15
41
|
readonly value: string | number | null;
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export type {
|
|
2
|
+
FluxAlignment,
|
|
2
3
|
FluxAutoCompleteType,
|
|
3
4
|
FluxColor,
|
|
4
5
|
FluxDirection,
|
|
5
|
-
FluxFontAwesomeIconName,
|
|
6
6
|
FluxIconName,
|
|
7
7
|
FluxInputMask,
|
|
8
8
|
FluxInputType,
|
|
9
|
-
FluxMaterialIconName,
|
|
10
9
|
FluxMaybePromise,
|
|
11
10
|
FluxPressableType,
|
|
12
11
|
FluxSize,
|
|
@@ -18,35 +17,55 @@ export type {
|
|
|
18
17
|
FluxButtonProps,
|
|
19
18
|
FluxButtonSize,
|
|
20
19
|
FluxButtonSlots,
|
|
20
|
+
FluxCommandSource,
|
|
21
|
+
FluxCommandSourceItem,
|
|
22
|
+
FluxCommandSubAction,
|
|
21
23
|
FluxFocalPointObject,
|
|
24
|
+
FluxKanbanMoveColumnEvent,
|
|
25
|
+
FluxKanbanMoveEvent,
|
|
22
26
|
FluxLegendObject,
|
|
23
27
|
FluxPercentageBarItemObject,
|
|
24
|
-
FluxSegmentedControlItemObject
|
|
28
|
+
FluxSegmentedControlItemObject,
|
|
29
|
+
FluxTreeViewOption
|
|
25
30
|
} from './components';
|
|
26
31
|
|
|
27
32
|
export type {
|
|
28
33
|
FluxFilterBase,
|
|
29
34
|
FluxFilterDateEntry,
|
|
30
35
|
FluxFilterDateRangeEntry,
|
|
36
|
+
FluxFilterDateRangeSpec,
|
|
37
|
+
FluxFilterDateSpec,
|
|
38
|
+
FluxFilterEntryMap,
|
|
31
39
|
FluxFilterItem,
|
|
40
|
+
FluxFilterOptionAsyncSpec,
|
|
32
41
|
FluxFilterOptionEntry,
|
|
33
42
|
FluxFilterOptionHeader,
|
|
34
43
|
FluxFilterOptionItem,
|
|
35
44
|
FluxFilterOptionRow,
|
|
45
|
+
FluxFilterOptionSpec,
|
|
46
|
+
FluxFilterOptionsAsyncSpec,
|
|
36
47
|
FluxFilterOptionsEntry,
|
|
48
|
+
FluxFilterOptionsSpec,
|
|
37
49
|
FluxFilterRangeEntry,
|
|
50
|
+
FluxFilterRangeSpec,
|
|
51
|
+
FluxFilterSpec,
|
|
52
|
+
FluxFilterSpecMap,
|
|
38
53
|
FluxFilterState,
|
|
39
54
|
FluxFilterValue,
|
|
40
55
|
FluxFilterValueSingle
|
|
41
56
|
} from './filter';
|
|
42
57
|
|
|
43
58
|
export type {
|
|
59
|
+
FluxFormInputBaseProps,
|
|
44
60
|
FluxFormSelectEntry,
|
|
45
61
|
FluxFormSelectGroup,
|
|
46
62
|
FluxFormSelectOption,
|
|
47
63
|
FluxFormSelectOptions,
|
|
48
64
|
FluxFormSelectValue,
|
|
49
|
-
FluxFormSelectValueSingle
|
|
65
|
+
FluxFormSelectValueSingle,
|
|
66
|
+
FluxFormTreeViewSelectOption,
|
|
67
|
+
FluxFormTreeViewSelectValue,
|
|
68
|
+
FluxFormTreeViewSelectValueSingle
|
|
50
69
|
} from './form';
|
|
51
70
|
|
|
52
71
|
export type {
|
|
@@ -56,3 +75,7 @@ export type {
|
|
|
56
75
|
FluxSnackbarObject,
|
|
57
76
|
FluxTooltipObject
|
|
58
77
|
} from './notify';
|
|
78
|
+
|
|
79
|
+
export type {
|
|
80
|
+
FluxStatisticsChange
|
|
81
|
+
} from './statistics';
|