@flux-ui/types 3.0.0-next.61 → 3.0.0-next.64

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/package.json CHANGED
@@ -1,7 +1,7 @@
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.61",
4
+ "version": "3.0.0-next.64",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
package/src/common.ts CHANGED
@@ -7,6 +7,11 @@ export type FluxAlignment =
7
7
  | 'center'
8
8
  | 'end';
9
9
 
10
+ export type FluxAlign =
11
+ | FluxAlignment
12
+ | 'stretch'
13
+ | 'baseline';
14
+
10
15
  export type FluxColor =
11
16
  | 'gray'
12
17
  | 'primary'
@@ -19,6 +24,17 @@ export type FluxDirection =
19
24
  | 'horizontal'
20
25
  | 'vertical';
21
26
 
27
+ export type FluxFlexWrap =
28
+ | 'wrap'
29
+ | 'nowrap'
30
+ | 'wrap-reverse';
31
+
32
+ export type FluxJustify =
33
+ | FluxAlignment
34
+ | 'between'
35
+ | 'around'
36
+ | 'evenly';
37
+
22
38
  export type FluxInputMask =
23
39
  | 'bic'
24
40
  | 'iban'
package/src/filter.ts CHANGED
@@ -1,12 +1,37 @@
1
1
  import type { DateTime } from 'luxon';
2
2
  import type { FluxIconName } from './common';
3
3
 
4
+ export type FluxFilterValueSingle =
5
+ | DateTime
6
+ | string
7
+ | boolean
8
+ | number
9
+ | null;
10
+
11
+ export type FluxFilterValue =
12
+ | FluxFilterValueSingle
13
+ | FluxFilterValueSingle[];
14
+
15
+ export type FluxFilterState<T extends Record<string, unknown> = Record<string, FluxFilterValue>> = T;
16
+
17
+ export type FluxFilterDefinition<TValue = FluxFilterValue> = {
18
+ readonly type: string;
19
+ readonly name: string;
20
+ readonly label: string;
21
+ readonly icon?: FluxIconName;
22
+ readonly disabled?: boolean;
23
+ readonly defaultValue?: TValue;
24
+ getValueLabel(value: TValue): Promise<string | null>;
25
+ onChange?(value: TValue): void;
26
+ onClear?(): void;
27
+ };
28
+
4
29
  export type FluxFilterBase = {
5
30
  getValueLabel(value: FluxFilterValue): Promise<string | null>;
6
-
7
31
  readonly icon?: FluxIconName;
8
32
  readonly label: string;
9
33
  readonly name: string;
34
+ readonly disabled?: boolean;
10
35
  };
11
36
 
12
37
  export type FluxFilterItem =
@@ -50,23 +75,14 @@ export type FluxFilterOptionRow =
50
75
  | FluxFilterOptionHeader
51
76
  | FluxFilterOptionItem;
52
77
 
53
- export type FluxFilterValueSingle =
54
- | DateTime
55
- | string
56
- | boolean
57
- | number
58
- | null;
59
-
60
- export type FluxFilterValue =
61
- | FluxFilterValueSingle
62
- | FluxFilterValueSingle[];
63
-
64
- export type FluxFilterState = Record<string, FluxFilterValue>;
65
-
66
78
  export type FluxFilterSpec = {
67
79
  readonly icon?: FluxIconName;
68
80
  readonly label: string;
69
81
  readonly name: string;
82
+ readonly disabled?: boolean;
83
+ readonly defaultValue?: FluxFilterValue;
84
+ onChange?(value: FluxFilterValue): void;
85
+ onClear?(): void;
70
86
  };
71
87
 
72
88
  export type FluxFilterDateSpec = FluxFilterSpec;
@@ -92,23 +108,3 @@ export type FluxFilterOptionsAsyncSpec = FluxFilterSpec & {
92
108
  export type FluxFilterRangeSpec = FluxFilterSpec & {
93
109
  formatter?(value: number): string;
94
110
  };
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
- };
105
-
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;
114
- };
package/src/index.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export type {
2
+ FluxAlign,
2
3
  FluxAlignment,
3
4
  FluxAutoCompleteType,
4
5
  FluxColor,
5
6
  FluxDirection,
7
+ FluxFlexWrap,
6
8
  FluxIconName,
7
9
  FluxInputMask,
8
10
  FluxInputType,
11
+ FluxJustify,
9
12
  FluxMaybePromise,
10
13
  FluxPressableType,
11
14
  FluxSize,
@@ -35,7 +38,7 @@ export type {
35
38
  FluxFilterDateRangeEntry,
36
39
  FluxFilterDateRangeSpec,
37
40
  FluxFilterDateSpec,
38
- FluxFilterEntryMap,
41
+ FluxFilterDefinition,
39
42
  FluxFilterItem,
40
43
  FluxFilterOptionAsyncSpec,
41
44
  FluxFilterOptionEntry,
@@ -49,7 +52,6 @@ export type {
49
52
  FluxFilterRangeEntry,
50
53
  FluxFilterRangeSpec,
51
54
  FluxFilterSpec,
52
- FluxFilterSpecMap,
53
55
  FluxFilterState,
54
56
  FluxFilterValue,
55
57
  FluxFilterValueSingle