@fluentui/react-select 9.0.0-beta.12 → 9.0.0-beta.14
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/CHANGELOG.json +117 -4
- package/CHANGELOG.md +33 -5
- package/README.md +1 -1
- package/dist/index.d.ts +9 -0
- package/lib/SelectField.js +2 -0
- package/lib/SelectField.js.map +1 -0
- package/lib/components/Select/useSelectStyles.js +65 -33
- package/lib/components/Select/useSelectStyles.js.map +1 -1
- package/lib/components/SelectField/SelectField.js +14 -0
- package/lib/components/SelectField/SelectField.js.map +1 -0
- package/lib/components/SelectField/index.js +2 -0
- package/lib/components/SelectField/index.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/SelectField.js +10 -0
- package/lib-commonjs/SelectField.js.map +1 -0
- package/lib-commonjs/components/Select/useSelectStyles.js +65 -33
- package/lib-commonjs/components/Select/useSelectStyles.js.map +1 -1
- package/lib-commonjs/components/SelectField/SelectField.js +24 -0
- package/lib-commonjs/components/SelectField/SelectField.js.map +1 -0
- package/lib-commonjs/components/SelectField/index.js +10 -0
- package/lib-commonjs/components/SelectField/index.js.map +1 -0
- package/lib-commonjs/index.js +16 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -8
- package/Spec.md +0 -238
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,120 @@
|
|
|
2
2
|
"name": "@fluentui/react-select",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 11 Nov 2022 14:53:22 GMT",
|
|
6
|
+
"tag": "@fluentui/react-select_v9.0.0-beta.14",
|
|
7
|
+
"version": "9.0.0-beta.14",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "martinhochel@microsoft.com",
|
|
12
|
+
"package": "@fluentui/react-select",
|
|
13
|
+
"commit": "b3907043bd8d7b650c55e8e7c3119b14f2606c38",
|
|
14
|
+
"comment": "fix: create valid export maps"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "behowell@microsoft.com",
|
|
18
|
+
"package": "@fluentui/react-select",
|
|
19
|
+
"commit": "39ba7b6d4648781b979fcf694579f97b851348af",
|
|
20
|
+
"comment": "chore: Move SelectField into the @fluentui/react-select package and export as _unstable"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "sarah.higley@microsoft.com",
|
|
24
|
+
"package": "@fluentui/react-select",
|
|
25
|
+
"commit": "023737b640281434710caecc55270838895b50bc",
|
|
26
|
+
"comment": "fix: update disabled + underline styles, have all text-like form control disabled states match"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-select",
|
|
31
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.8",
|
|
32
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-select",
|
|
37
|
+
"comment": "Bump @fluentui/react-theme to v9.1.2",
|
|
38
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-select",
|
|
43
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.1",
|
|
44
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-select",
|
|
49
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18",
|
|
50
|
+
"commit": "b4c9a0ae8d7444bf746f1307ab01e2dc16310720"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"none": [
|
|
54
|
+
{
|
|
55
|
+
"author": "martinhochel@microsoft.com",
|
|
56
|
+
"package": "@fluentui/react-select",
|
|
57
|
+
"commit": "87859b052155ca206ef3540a2a9623803f6e2b93",
|
|
58
|
+
"comment": "test: replace deprecated module.parent with require.main within isConformance"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"date": "Wed, 02 Nov 2022 11:57:59 GMT",
|
|
65
|
+
"tag": "@fluentui/react-select_v9.0.0-beta.13",
|
|
66
|
+
"version": "9.0.0-beta.13",
|
|
67
|
+
"comments": {
|
|
68
|
+
"prerelease": [
|
|
69
|
+
{
|
|
70
|
+
"author": "sarah.higley@microsoft.com",
|
|
71
|
+
"package": "@fluentui/react-select",
|
|
72
|
+
"commit": "fe895d6bb4f9df0304f63f7e77acafef4b912925",
|
|
73
|
+
"comment": "fix: update styles based on design review"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"author": "olfedias@microsoft.com",
|
|
77
|
+
"package": "@fluentui/react-select",
|
|
78
|
+
"commit": "c619ba066f11a8654e95375314824ba6b81b003e",
|
|
79
|
+
"comment": "chore: Update Griffel to latest version"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"author": "tristan.watanabe@gmail.com",
|
|
83
|
+
"package": "@fluentui/react-select",
|
|
84
|
+
"commit": "2f9363cb9ea22fa49991018dd578c9a4a16ddc8f",
|
|
85
|
+
"comment": "chore: Migrate to new package structure."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"author": "beachball",
|
|
89
|
+
"package": "@fluentui/react-select",
|
|
90
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.0",
|
|
91
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"author": "beachball",
|
|
95
|
+
"package": "@fluentui/react-select",
|
|
96
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.17",
|
|
97
|
+
"commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"date": "Tue, 25 Oct 2022 00:35:36 GMT",
|
|
104
|
+
"tag": "@fluentui/react-select_v9.0.0-beta.12",
|
|
105
|
+
"version": "9.0.0-beta.12",
|
|
106
|
+
"comments": {
|
|
107
|
+
"none": [
|
|
108
|
+
{
|
|
109
|
+
"author": "miroslav.stastny@microsoft.com",
|
|
110
|
+
"package": "@fluentui/react-select",
|
|
111
|
+
"commit": "6ced976a8d0e6a0e2e207da8fe0eb810e2bd19bc",
|
|
112
|
+
"comment": "Update package readme"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"date": "Thu, 20 Oct 2022 08:39:44 GMT",
|
|
6
119
|
"tag": "@fluentui/react-select_v9.0.0-beta.12",
|
|
7
120
|
"version": "9.0.0-beta.12",
|
|
8
121
|
"comments": {
|
|
@@ -29,19 +142,19 @@
|
|
|
29
142
|
"author": "beachball",
|
|
30
143
|
"package": "@fluentui/react-select",
|
|
31
144
|
"comment": "Bump @fluentui/react-theme to v9.1.1",
|
|
32
|
-
"commit": "
|
|
145
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
33
146
|
},
|
|
34
147
|
{
|
|
35
148
|
"author": "beachball",
|
|
36
149
|
"package": "@fluentui/react-select",
|
|
37
150
|
"comment": "Bump @fluentui/react-utilities to v9.1.2",
|
|
38
|
-
"commit": "
|
|
151
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
39
152
|
},
|
|
40
153
|
{
|
|
41
154
|
"author": "beachball",
|
|
42
155
|
"package": "@fluentui/react-select",
|
|
43
156
|
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16",
|
|
44
|
-
"commit": "
|
|
157
|
+
"commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
|
|
45
158
|
}
|
|
46
159
|
]
|
|
47
160
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-select
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 11 Nov 2022 14:53:22 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-select_v9.0.0-beta.14)
|
|
8
|
+
|
|
9
|
+
Fri, 11 Nov 2022 14:53:22 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-select_v9.0.0-beta.13..@fluentui/react-select_v9.0.0-beta.14)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
|
|
15
|
+
- chore: Move SelectField into the @fluentui/react-select package and export as _unstable ([PR #25593](https://github.com/microsoft/fluentui/pull/25593) by behowell@microsoft.com)
|
|
16
|
+
- fix: update disabled + underline styles, have all text-like form control disabled states match ([PR #25543](https://github.com/microsoft/fluentui/pull/25543) by sarah.higley@microsoft.com)
|
|
17
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.8 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.1.2 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.2.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
20
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
21
|
+
|
|
22
|
+
## [9.0.0-beta.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-select_v9.0.0-beta.13)
|
|
23
|
+
|
|
24
|
+
Wed, 02 Nov 2022 11:57:59 GMT
|
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-select_v9.0.0-beta.12..@fluentui/react-select_v9.0.0-beta.13)
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- fix: update styles based on design review ([PR #24339](https://github.com/microsoft/fluentui/pull/24339) by sarah.higley@microsoft.com)
|
|
30
|
+
- chore: Update Griffel to latest version ([PR #25412](https://github.com/microsoft/fluentui/pull/25412) by olfedias@microsoft.com)
|
|
31
|
+
- chore: Migrate to new package structure. ([PR #25359](https://github.com/microsoft/fluentui/pull/25359) by tristan.watanabe@gmail.com)
|
|
32
|
+
- Bump @fluentui/react-utilities to v9.2.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
33
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.17 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
34
|
+
|
|
7
35
|
## [9.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-select_v9.0.0-beta.12)
|
|
8
36
|
|
|
9
|
-
Thu, 20 Oct 2022 08:
|
|
37
|
+
Thu, 20 Oct 2022 08:39:44 GMT
|
|
10
38
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-select_v9.0.0-beta.11..@fluentui/react-select_v9.0.0-beta.12)
|
|
11
39
|
|
|
12
40
|
### Changes
|
|
@@ -14,9 +42,9 @@ Thu, 20 Oct 2022 08:35:21 GMT
|
|
|
14
42
|
- feat: Add red border when aria-invalid is set ([PR #25252](https://github.com/microsoft/fluentui/pull/25252) by behowell@microsoft.com)
|
|
15
43
|
- chore: Bump peer deps to support React 18 ([PR #24972](https://github.com/microsoft/fluentui/pull/24972) by mgodbolt@microsoft.com)
|
|
16
44
|
- chore: Update Griffel to latest version ([PR #25212](https://github.com/microsoft/fluentui/pull/25212) by olfedias@microsoft.com)
|
|
17
|
-
- Bump @fluentui/react-theme to v9.1.1 ([
|
|
18
|
-
- Bump @fluentui/react-utilities to v9.1.2 ([
|
|
19
|
-
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([
|
|
45
|
+
- Bump @fluentui/react-theme to v9.1.1 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
46
|
+
- Bump @fluentui/react-utilities to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
47
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
20
48
|
|
|
21
49
|
## [9.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-select_v9.0.0-beta.11)
|
|
22
50
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @fluentui/react-select
|
|
2
2
|
|
|
3
|
-
**React Select components for [Fluent UI React](https://
|
|
3
|
+
**React Select components for [Fluent UI React](https://react.fluentui.dev)**
|
|
4
4
|
|
|
5
5
|
The Select component provides a styled wrapper around the native `<select>` element. It is recommended over Combobox when features like filtering and virtualization are not required. It provides better cross-platform functionality particularly on mobile, and better accessibility.
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
5
|
+
import { FieldControl } from '@fluentui/react-field';
|
|
6
|
+
import type { FieldProps } from '@fluentui/react-field';
|
|
7
|
+
import { FieldSlots } from '@fluentui/react-field';
|
|
5
8
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
6
9
|
import * as React_2 from 'react';
|
|
7
10
|
import type { Slot } from '@fluentui/react-utilities';
|
|
@@ -19,6 +22,12 @@ export declare const Select: ForwardRefComponent<SelectProps>;
|
|
|
19
22
|
|
|
20
23
|
export declare const selectClassNames: SlotClassNames<SelectSlots>;
|
|
21
24
|
|
|
25
|
+
export declare const SelectField_unstable: ForwardRefComponent<SelectFieldProps_unstable>;
|
|
26
|
+
|
|
27
|
+
export declare const selectFieldClassNames: SlotClassNames<FieldSlots<FieldControl>>;
|
|
28
|
+
|
|
29
|
+
export declare type SelectFieldProps_unstable = FieldProps<typeof Select>;
|
|
30
|
+
|
|
22
31
|
/**
|
|
23
32
|
* Data passed to the `onChange` callback when a new option is selected.
|
|
24
33
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectField.js","sourceRoot":"../src/","sources":["SelectField.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './components/SelectField/index';\n"]}
|
|
@@ -9,7 +9,7 @@ const iconSizes = {
|
|
|
9
9
|
small: '16px',
|
|
10
10
|
medium: '20px',
|
|
11
11
|
large: '24px'
|
|
12
|
-
}; //
|
|
12
|
+
}; // This 400 style is not in the typography styles.
|
|
13
13
|
// May need a design change
|
|
14
14
|
|
|
15
15
|
const contentSizes = {
|
|
@@ -24,6 +24,36 @@ const fieldHeights = {
|
|
|
24
24
|
medium: '32px',
|
|
25
25
|
large: '40px'
|
|
26
26
|
};
|
|
27
|
+
/* Since the <select> element must span the full width and cannot have children,
|
|
28
|
+
* the right padding needs to be calculated from the sum of the following:
|
|
29
|
+
* 1. Field padding-right
|
|
30
|
+
* 2. Icon width
|
|
31
|
+
* 3. Content-icon spacing
|
|
32
|
+
* 4. Content inner padding
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
const paddingRight = {
|
|
36
|
+
small: `calc(${tokens.spacingHorizontalSNudge}
|
|
37
|
+
+ ${iconSizes.small}
|
|
38
|
+
+ ${tokens.spacingHorizontalXXS}
|
|
39
|
+
+ ${tokens.spacingHorizontalXXS})`,
|
|
40
|
+
medium: `calc(${tokens.spacingHorizontalMNudge}
|
|
41
|
+
+ ${iconSizes.medium}
|
|
42
|
+
+ ${tokens.spacingHorizontalXXS}
|
|
43
|
+
+ ${tokens.spacingHorizontalXXS})`,
|
|
44
|
+
large: `calc(${tokens.spacingHorizontalM}
|
|
45
|
+
+ ${iconSizes.large}
|
|
46
|
+
+ ${tokens.spacingHorizontalSNudge}
|
|
47
|
+
+ ${tokens.spacingHorizontalSNudge})`
|
|
48
|
+
};
|
|
49
|
+
/* Left padding is calculated from the outer padding + inner content padding values
|
|
50
|
+
* since <select> can't have additional child content or custom inner layout */
|
|
51
|
+
|
|
52
|
+
const paddingLeft = {
|
|
53
|
+
small: `calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,
|
|
54
|
+
medium: `calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,
|
|
55
|
+
large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`
|
|
56
|
+
};
|
|
27
57
|
/* end of shared values */
|
|
28
58
|
|
|
29
59
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
@@ -95,21 +125,17 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
95
125
|
"E5pizo": "f1couhl3",
|
|
96
126
|
"B7ck84d": "f1ewtqcl",
|
|
97
127
|
"sj55zd": "f19n0e5",
|
|
128
|
+
"Bceei9c": "f1k6fduh",
|
|
98
129
|
"Bh6795r": "fqerorx",
|
|
130
|
+
"B2u0y6b": "f6dzj5z",
|
|
131
|
+
"Byoj8tv": "f1qch9an",
|
|
132
|
+
"z8tnut": "f1g0x7ka",
|
|
99
133
|
"B3aqqti": "fatbyko",
|
|
100
134
|
"Brovlpu": "f1grzc83",
|
|
101
135
|
"Bxa1mx5": "f19shzzi"
|
|
102
136
|
},
|
|
103
137
|
"disabled": {
|
|
104
138
|
"De3pzq": "f1c21dwh",
|
|
105
|
-
"B4j52fo": "f5ogflp",
|
|
106
|
-
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
107
|
-
"Bn0qgzm": "f1f09k3d",
|
|
108
|
-
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
109
|
-
"icvyot": "fzkkow9",
|
|
110
|
-
"vrafjx": ["fcdblym", "fjik90z"],
|
|
111
|
-
"oivjwe": "fg706s2",
|
|
112
|
-
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
113
139
|
"g2u3we": "f1jj8ep1",
|
|
114
140
|
"h3c5rm": ["f15xbau", "fy0fskl"],
|
|
115
141
|
"B9xav0g": "f4ikngz",
|
|
@@ -121,12 +147,16 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
121
147
|
"Bxeuatn": "f1cwzwz",
|
|
122
148
|
"n51gp8": ["f14g86mu", "f1rvyvqg"]
|
|
123
149
|
},
|
|
150
|
+
"disabledUnderline": {
|
|
151
|
+
"g2u3we": "fgig46g",
|
|
152
|
+
"h3c5rm": ["f1mxt3zg", "fziff3p"],
|
|
153
|
+
"B9xav0g": "f4ikngz",
|
|
154
|
+
"zhjwy3": ["fziff3p", "f1mxt3zg"]
|
|
155
|
+
},
|
|
124
156
|
"small": {
|
|
125
157
|
"Bqenvij": "frvgh55",
|
|
126
|
-
"
|
|
127
|
-
"z189sj": ["
|
|
128
|
-
"Byoj8tv": "f1qch9an",
|
|
129
|
-
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
158
|
+
"uwmqm3": ["f1xile11", "fqznh8f"],
|
|
159
|
+
"z189sj": ["fiqd4sw", "f11fkzut"],
|
|
130
160
|
"Bahqtrf": "fk6fouc",
|
|
131
161
|
"Be2twd7": "fy9rknc",
|
|
132
162
|
"Bhrd7zp": "figsok6",
|
|
@@ -134,10 +164,8 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
134
164
|
},
|
|
135
165
|
"medium": {
|
|
136
166
|
"Bqenvij": "f1d2rq10",
|
|
137
|
-
"
|
|
138
|
-
"z189sj": ["
|
|
139
|
-
"Byoj8tv": "f1qch9an",
|
|
140
|
-
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
167
|
+
"uwmqm3": ["f1e60jzv", "f135dnwl"],
|
|
168
|
+
"z189sj": ["f154vowv", "flqamny"],
|
|
141
169
|
"Bahqtrf": "fk6fouc",
|
|
142
170
|
"Be2twd7": "fkhj508",
|
|
143
171
|
"Bhrd7zp": "figsok6",
|
|
@@ -145,10 +173,8 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
145
173
|
},
|
|
146
174
|
"large": {
|
|
147
175
|
"Bqenvij": "fbhnoac",
|
|
148
|
-
"
|
|
149
|
-
"z189sj": ["
|
|
150
|
-
"Byoj8tv": "f1qch9an",
|
|
151
|
-
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
176
|
+
"uwmqm3": ["fnphzt9", "flt1dlf"],
|
|
177
|
+
"z189sj": ["f1xi5ia2", "f1xi1l47"],
|
|
152
178
|
"Be2twd7": "fod5ikn",
|
|
153
179
|
"Bg96gwp": "faaz57k"
|
|
154
180
|
},
|
|
@@ -165,7 +191,15 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
165
191
|
"g2u3we": "fj3muxo",
|
|
166
192
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
|
167
193
|
"B9xav0g": "f1c1zstj",
|
|
168
|
-
"zhjwy3": ["f1lxtadh", "f1akhkt"]
|
|
194
|
+
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
|
195
|
+
"Bgoe8wy": "fvcxoqz",
|
|
196
|
+
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
|
197
|
+
"oetu4i": "flmw63s",
|
|
198
|
+
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
|
199
|
+
"B6oc9vd": "fvs00aa",
|
|
200
|
+
"ak43y8": ["f1assf6x", "f4ruux4"],
|
|
201
|
+
"wmxk5l": "fqhmt4z",
|
|
202
|
+
"B50zh58": ["f4ruux4", "f1assf6x"]
|
|
169
203
|
},
|
|
170
204
|
"underline": {
|
|
171
205
|
"De3pzq": "f1c21dwh",
|
|
@@ -193,7 +227,7 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
193
227
|
"hhx65j": "f1fgmyf4"
|
|
194
228
|
}
|
|
195
229
|
}, {
|
|
196
|
-
"d": [".fqrijq1{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".frvgh55{height:24px;}", ".
|
|
230
|
+
"d": [".fqrijq1{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1k6fduh{cursor:pointer;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f6dzj5z{max-width:100%;}", ".f1qch9an{padding-bottom:0;}", ".f1g0x7ka{padding-top:0;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".fgig46g{border-top-color:var(--colorTransparentStrokeDisabled);}", ".f1mxt3zg{border-right-color:var(--colorTransparentStrokeDisabled);}", ".fziff3p{border-left-color:var(--colorTransparentStrokeDisabled);}", ".frvgh55{height:24px;}", ".f1xile11{padding-left:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".fqznh8f{padding-right:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".fiqd4sw{padding-right:calc(var(--spacingHorizontalSNudge)\n + 16px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".f11fkzut{padding-left:calc(var(--spacingHorizontalSNudge)\n + 16px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1d2rq10{height:32px;}", ".f1e60jzv{padding-left:calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}", ".f135dnwl{padding-right:calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}", ".f154vowv{padding-right:calc(var(--spacingHorizontalMNudge)\n + 20px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".flqamny{padding-left:calc(var(--spacingHorizontalMNudge)\n + 20px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbhnoac{height:40px;}", ".fnphzt9{padding-left:calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));}", ".flt1dlf{padding-right:calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));}", ".f1xi5ia2{padding-right:calc(var(--spacingHorizontalM)\n + 24px\n + var(--spacingHorizontalSNudge)\n + var(--spacingHorizontalSNudge));}", ".f1xi1l47{padding-left:calc(var(--spacingHorizontalM)\n + 24px\n + var(--spacingHorizontalSNudge)\n + var(--spacingHorizontalSNudge));}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fs4k3qj:not(:focus-within),.fs4k3qj:hover:not(:focus-within){border-top-color:var(--colorPaletteRedBorder2);}", ".fcee079:not(:focus-within),.fcee079:hover:not(:focus-within){border-right-color:var(--colorPaletteRedBorder2);}", ".fmyw78r:not(:focus-within),.fmyw78r:hover:not(:focus-within){border-left-color:var(--colorPaletteRedBorder2);}", ".f1fgmyf4:not(:focus-within),.f1fgmyf4:hover:not(:focus-within){border-bottom-color:var(--colorPaletteRedBorder2);}"],
|
|
197
231
|
"f": [".fatbyko:focus{outline-width:2px;}", ".f1grzc83:focus{outline-style:solid;}", ".f19shzzi:focus{outline-color:transparent;}"],
|
|
198
232
|
"m": [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
199
233
|
"m": "(forced-colors: active)"
|
|
@@ -203,7 +237,9 @@ const useSelectStyles = /*#__PURE__*/__styles({
|
|
|
203
237
|
"m": "(forced-colors: active)"
|
|
204
238
|
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
205
239
|
"m": "(forced-colors: active)"
|
|
206
|
-
}]]
|
|
240
|
+
}]],
|
|
241
|
+
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".flmw63s:hover{border-bottom-color:var(--colorNeutralStrokeAccessible);}"],
|
|
242
|
+
"a": [".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fqhmt4z:active{border-bottom-color:var(--colorNeutralStrokeAccessible);}"]
|
|
207
243
|
});
|
|
208
244
|
|
|
209
245
|
const useIconStyles = /*#__PURE__*/__styles({
|
|
@@ -212,7 +248,6 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
|
212
248
|
"sj55zd": "fxkbij4",
|
|
213
249
|
"mc9l5x": "ftgm304",
|
|
214
250
|
"qhf8xq": "f1euv43f",
|
|
215
|
-
"j35jbq": ["fnyteob", "f1enpzzf"],
|
|
216
251
|
"Bkecrkj": "f1aehjj5",
|
|
217
252
|
"Bo70h7d": "fvc9v3g"
|
|
218
253
|
},
|
|
@@ -223,26 +258,23 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
|
223
258
|
"small": {
|
|
224
259
|
"Be2twd7": "f4ybsrx",
|
|
225
260
|
"Bqenvij": "fd461yt",
|
|
226
|
-
"
|
|
227
|
-
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
261
|
+
"j35jbq": ["f13lnp83", "f1i5nn0v"],
|
|
228
262
|
"a9b677": "fjw5fx7"
|
|
229
263
|
},
|
|
230
264
|
"medium": {
|
|
231
265
|
"Be2twd7": "fe5j1ua",
|
|
232
266
|
"Bqenvij": "fjamq6b",
|
|
233
|
-
"
|
|
234
|
-
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
267
|
+
"j35jbq": ["fnyteob", "f1enpzzf"],
|
|
235
268
|
"a9b677": "f64fuq3"
|
|
236
269
|
},
|
|
237
270
|
"large": {
|
|
238
271
|
"Be2twd7": "f1rt2boy",
|
|
239
272
|
"Bqenvij": "frvgh55",
|
|
240
|
-
"
|
|
241
|
-
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
273
|
+
"j35jbq": ["f8b87gs", "fedtrts"],
|
|
242
274
|
"a9b677": "fq4mcun"
|
|
243
275
|
}
|
|
244
276
|
}, {
|
|
245
|
-
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fxkbij4{color:var(--colorNeutralStrokeAccessible);}", ".ftgm304{display:block;}", ".f1euv43f{position:absolute;}", ".
|
|
277
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fxkbij4{color:var(--colorNeutralStrokeAccessible);}", ".ftgm304{display:block;}", ".f1euv43f{position:absolute;}", ".f1aehjj5{pointer-events:none;}", ".fvc9v3g svg{display:block;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".f13lnp83{right:var(--spacingHorizontalSNudge);}", ".f1i5nn0v{left:var(--spacingHorizontalSNudge);}", ".fjw5fx7{width:16px;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".fnyteob{right:var(--spacingHorizontalMNudge);}", ".f1enpzzf{left:var(--spacingHorizontalMNudge);}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".f8b87gs{right:var(--spacingHorizontalM);}", ".fedtrts{left:var(--spacingHorizontalM);}", ".fq4mcun{width:24px;}"],
|
|
246
278
|
"m": [["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
|
|
247
279
|
"m": "(forced-colors: active)"
|
|
248
280
|
}]]
|
|
@@ -263,7 +295,7 @@ export const useSelectStyles_unstable = state => {
|
|
|
263
295
|
const rootStyles = useRootStyles();
|
|
264
296
|
const selectStyles = useSelectStyles();
|
|
265
297
|
state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);
|
|
266
|
-
state.select.className = mergeClasses(selectClassNames.select, selectStyles.base, selectStyles[size], selectStyles[appearance], !disabled && invalid && appearance !== 'underline' && selectStyles.invalid, !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline, disabled && selectStyles.disabled, state.select.className);
|
|
298
|
+
state.select.className = mergeClasses(selectClassNames.select, selectStyles.base, selectStyles[size], selectStyles[appearance], !disabled && invalid && appearance !== 'underline' && selectStyles.invalid, !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline, disabled && selectStyles.disabled, disabled && appearance === 'underline' && selectStyles.disabledUnderline, state.select.className);
|
|
267
299
|
|
|
268
300
|
if (state.icon) {
|
|
269
301
|
state.icon.className = mergeClasses(selectClassNames.icon, iconStyles.icon, disabled && iconStyles.disabled, iconStyles[size], state.icon.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Select/useSelectStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAIA,OAAO,MAAM,gBAAgB,GAAgC;EAC3D,IAAI,EAAE,YADqD;EAE3D,MAAM,EAAE,oBAFmD;EAG3D,IAAI,EAAE;AAHqD,CAAtD;AAMP,MAAM,SAAS,GAAG;EAChB,KAAK,EAAE,MADS;EAEhB,MAAM,EAAE,MAFQ;EAGhB,KAAK,EAAE;AAHS,CAAlB,C,CAMA;AACA;;AACA,MAAM,YAAY,GAAG;EACnB,KAAK;IACH,QAAQ,EAAE,MAAM,CAAC,eADd;IAEH,UAAU,EAAE,MAAM,CAAC;EAFhB;AADc,CAArB,C,CAOA;;AACA,MAAM,YAAY,GAAG;EACnB,KAAK,EAAE,MADY;EAEnB,MAAM,EAAE,MAFW;EAGnB,KAAK,EAAE;AAHY,CAArB;AAMA;;AAEA,MAAM,aAAa,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;IAAA;EAAA;EAAA;AAAA,EAAtB;;AA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,KAAK,CAAC,MAAN,CAAa,QAA9B;EACA,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,MAAN,CAAa,cAAb,CAA4B,EAA/B,KAAsC,MAAtD;EAEA,MAAM,UAAU,GAAG,aAAa,EAAhC;EACA,MAAM,UAAU,GAAG,aAAa,EAAhC;EACA,MAAM,YAAY,GAAG,eAAe,EAApC;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,gBAAgB,CAAC,IAAlB,EAAwB,UAAU,CAAC,IAAnC,EAAyC,KAAK,CAAC,IAAN,CAAW,SAApD,CAAnC;EAEA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CACnC,gBAAgB,CAAC,MADkB,EAEnC,YAAY,CAAC,IAFsB,EAGnC,YAAY,CAAC,IAAD,CAHuB,EAInC,YAAY,CAAC,UAAD,CAJuB,EAKnC,CAAC,QAAD,IAAa,OAAb,IAAwB,UAAU,KAAK,WAAvC,IAAsD,YAAY,CAAC,OALhC,EAMnC,CAAC,QAAD,IAAa,OAAb,IAAwB,UAAU,KAAK,WAAvC,IAAsD,YAAY,CAAC,gBANhC,EAOnC,QAAQ,IAAI,YAAY,CAAC,QAPU,EAQnC,KAAK,CAAC,MAAN,CAAa,SARsB,CAArC;;EAWA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,gBAAgB,CAAC,IADgB,EAEjC,UAAU,CAAC,IAFsB,EAGjC,QAAQ,IAAI,UAAU,CAAC,QAHU,EAIjC,UAAU,CAAC,IAAD,CAJuB,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;EAOD;;EAED,OAAO,KAAP;AACD,CAjCM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\nexport const selectClassNames: SlotClassNames<SelectSlots> = {\n root: 'fui-Select',\n select: 'fui-Select__select',\n icon: 'fui-Select__icon',\n};\n\nconst iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\n// TODO: This 400 style is not in the typography styles.\n// May need a design change\nconst contentSizes = {\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n\n//TODO: Should fieldHeights be a set of global design tokens or constants?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n/* end of shared values */\n\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexWrap: 'nowrap',\n fontFamily: tokens.fontFamilyBase,\n position: 'relative',\n\n '&::after': {\n backgroundImage: `linear-gradient(\n 0deg,\n ${tokens.colorCompoundBrandStroke} 0%,\n ${tokens.colorCompoundBrandStroke} 50%,\n transparent 50%,\n transparent 100%\n )`,\n ...shorthands.borderRadius(0, 0, tokens.borderRadiusMedium, tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: tokens.borderRadiusMedium,\n position: 'absolute',\n bottom: '0',\n left: '0',\n right: '0',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n\n '&:focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n },\n});\n\nconst useSelectStyles = makeStyles({\n base: {\n appearance: 'none',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxShadow: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n\n ':focus': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n small: {\n height: fieldHeights.small,\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption1,\n },\n medium: {\n height: fieldHeights.medium,\n ...shorthands.padding('0', tokens.spacingHorizontalMNudge),\n ...typographyStyles.body1,\n },\n large: {\n height: fieldHeights.large,\n ...shorthands.padding('0', tokens.spacingHorizontalM),\n ...contentSizes[400],\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n ...shorthands.borderRadius(0),\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n});\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n display: 'block',\n position: 'absolute',\n right: tokens.spacingHorizontalMNudge,\n pointerEvents: 'none',\n\n // the SVG must have display: block for accurate positioning\n // otherwise an extra inline space is inserted after the svg element\n '& svg': {\n display: 'block',\n },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n small: {\n fontSize: iconSizes.small,\n height: iconSizes.small,\n paddingRight: tokens.spacingHorizontalSNudge,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.small,\n },\n medium: {\n fontSize: iconSizes.medium,\n height: iconSizes.medium,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.medium,\n },\n large: {\n fontSize: iconSizes.large,\n height: iconSizes.large,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalSNudge,\n width: iconSizes.large,\n },\n});\n\n/**\n * Apply styling to the Select slots based on the state\n */\nexport const useSelectStyles_unstable = (state: SelectState): SelectState => {\n const { size, appearance } = state;\n const disabled = state.select.disabled;\n const invalid = `${state.select['aria-invalid']}` === 'true';\n\n const iconStyles = useIconStyles();\n const rootStyles = useRootStyles();\n const selectStyles = useSelectStyles();\n\n state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);\n\n state.select.className = mergeClasses(\n selectClassNames.select,\n selectStyles.base,\n selectStyles[size],\n selectStyles[appearance],\n !disabled && invalid && appearance !== 'underline' && selectStyles.invalid,\n !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline,\n disabled && selectStyles.disabled,\n state.select.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n selectClassNames.icon,\n iconStyles.icon,\n disabled && iconStyles.disabled,\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["components/Select/useSelectStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAIA,OAAO,MAAM,gBAAgB,GAAgC;EAC3D,IAAI,EAAE,YADqD;EAE3D,MAA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,UAAU,CAAC,QAHU,EAIjC,UAAU,CAAC,IAAD,CAJuB,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;EAOD;;EAED,OAAO,KAAP;AACD,CAlCM","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\nexport const selectClassNames: SlotClassNames<SelectSlots> = {\n root: 'fui-Select',\n select: 'fui-Select__select',\n icon: 'fui-Select__icon',\n};\n\nconst iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\n// This 400 style is not in the typography styles.\n// May need a design change\nconst contentSizes = {\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n\n//TODO: Should fieldHeights be a set of global design tokens or constants?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n/* Since the <select> element must span the full width and cannot have children,\n * the right padding needs to be calculated from the sum of the following:\n * 1. Field padding-right\n * 2. Icon width\n * 3. Content-icon spacing\n * 4. Content inner padding\n */\nconst paddingRight = {\n small: `calc(${tokens.spacingHorizontalSNudge}\n + ${iconSizes.small}\n + ${tokens.spacingHorizontalXXS}\n + ${tokens.spacingHorizontalXXS})`,\n medium: `calc(${tokens.spacingHorizontalMNudge}\n + ${iconSizes.medium}\n + ${tokens.spacingHorizontalXXS}\n + ${tokens.spacingHorizontalXXS})`,\n large: `calc(${tokens.spacingHorizontalM}\n + ${iconSizes.large}\n + ${tokens.spacingHorizontalSNudge}\n + ${tokens.spacingHorizontalSNudge})`,\n};\n\n/* Left padding is calculated from the outer padding + inner content padding values\n * since <select> can't have additional child content or custom inner layout */\nconst paddingLeft = {\n small: `calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,\n medium: `calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n};\n\n/* end of shared values */\n\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexWrap: 'nowrap',\n fontFamily: tokens.fontFamilyBase,\n position: 'relative',\n\n '&::after': {\n backgroundImage: `linear-gradient(\n 0deg,\n ${tokens.colorCompoundBrandStroke} 0%,\n ${tokens.colorCompoundBrandStroke} 50%,\n transparent 50%,\n transparent 100%\n )`,\n ...shorthands.borderRadius(0, 0, tokens.borderRadiusMedium, tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: tokens.borderRadiusMedium,\n position: 'absolute',\n bottom: '0',\n left: '0',\n right: '0',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n\n '&:focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n },\n});\n\nconst useSelectStyles = makeStyles({\n base: {\n appearance: 'none',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxShadow: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n flexGrow: 1,\n maxWidth: '100%',\n paddingBottom: 0,\n paddingTop: 0,\n\n ':focus': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n disabledUnderline: {\n ...shorthands.borderColor(\n tokens.colorTransparentStrokeDisabled,\n tokens.colorTransparentStrokeDisabled,\n tokens.colorNeutralStrokeDisabled,\n ),\n },\n\n small: {\n height: fieldHeights.small,\n paddingLeft: paddingLeft.small,\n paddingRight: paddingRight.small,\n ...typographyStyles.caption1,\n },\n medium: {\n height: fieldHeights.medium,\n paddingLeft: paddingLeft.medium,\n paddingRight: paddingRight.medium,\n ...typographyStyles.body1,\n },\n large: {\n height: fieldHeights.large,\n paddingLeft: paddingLeft.large,\n paddingRight: paddingRight.large,\n ...contentSizes[400],\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n '&:hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n\n '&:active': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n ...shorthands.borderRadius(0),\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n});\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n display: 'block',\n position: 'absolute',\n pointerEvents: 'none',\n\n // the SVG must have display: block for accurate positioning\n // otherwise an extra inline space is inserted after the svg element\n '& svg': {\n display: 'block',\n },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n small: {\n fontSize: iconSizes.small,\n height: iconSizes.small,\n right: tokens.spacingHorizontalSNudge,\n width: iconSizes.small,\n },\n medium: {\n fontSize: iconSizes.medium,\n height: iconSizes.medium,\n right: tokens.spacingHorizontalMNudge,\n width: iconSizes.medium,\n },\n large: {\n fontSize: iconSizes.large,\n height: iconSizes.large,\n right: tokens.spacingHorizontalM,\n width: iconSizes.large,\n },\n});\n\n/**\n * Apply styling to the Select slots based on the state\n */\nexport const useSelectStyles_unstable = (state: SelectState): SelectState => {\n const { size, appearance } = state;\n const disabled = state.select.disabled;\n const invalid = `${state.select['aria-invalid']}` === 'true';\n\n const iconStyles = useIconStyles();\n const rootStyles = useRootStyles();\n const selectStyles = useSelectStyles();\n\n state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);\n\n state.select.className = mergeClasses(\n selectClassNames.select,\n selectStyles.base,\n selectStyles[size],\n selectStyles[appearance],\n !disabled && invalid && appearance !== 'underline' && selectStyles.invalid,\n !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline,\n disabled && selectStyles.disabled,\n disabled && appearance === 'underline' && selectStyles.disabledUnderline,\n state.select.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n selectClassNames.icon,\n iconStyles.icon,\n disabled && iconStyles.disabled,\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getFieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from '@fluentui/react-field';
|
|
3
|
+
import { Select } from '../../Select';
|
|
4
|
+
export const selectFieldClassNames = /*#__PURE__*/getFieldClassNames('SelectField');
|
|
5
|
+
export const SelectField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
const state = useField_unstable(props, ref, {
|
|
7
|
+
component: Select,
|
|
8
|
+
classNames: selectFieldClassNames
|
|
9
|
+
});
|
|
10
|
+
useFieldStyles_unstable(state);
|
|
11
|
+
return renderField_unstable(state);
|
|
12
|
+
});
|
|
13
|
+
SelectField.displayName = 'SelectField';
|
|
14
|
+
//# sourceMappingURL=SelectField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/SelectField/SelectField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SACE,kBADF,EAEE,oBAFF,EAGE,uBAHF,EAIE,iBAJF,QAKO,uBALP;AAOA,SAAS,MAAT,QAAuB,cAAvB;AAIA,OAAO,MAAM,qBAAqB,gBAAG,kBAAkB,CAAC,aAAD,CAAhD;AAEP,OAAO,MAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,EAAa;IAAE,SAAS,EAAE,MAAb;IAAqB,UAAU,EAAE;EAAjC,CAAb,CAA/B;EACA,uBAAuB,CAAC,KAAD,CAAvB;EACA,OAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CAJiE,CAA3D;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Select } from '../../Select';\n\nexport type SelectFieldProps = FieldProps<typeof Select>;\n\nexport const selectFieldClassNames = getFieldClassNames('SelectField');\n\nexport const SelectField: ForwardRefComponent<SelectFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Select, classNames: selectFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nSelectField.displayName = 'SelectField';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SelectField/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC","sourcesContent":["export * from './SelectField';\n"]}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,MADF,EAEE,gBAFF,EAGE,qBAHF,EAIE,wBAJF,EAKE,kBALF,QAMO,UANP","sourcesContent":["export {\n Select,\n selectClassNames,\n renderSelect_unstable,\n useSelectStyles_unstable,\n useSelect_unstable,\n} from './Select';\nexport type { SelectOnChangeData, SelectProps, SelectSlots, SelectState } from './Select';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,MADF,EAEE,gBAFF,EAGE,qBAHF,EAIE,wBAJF,EAKE,kBALF,QAMO,UANP;AASA,SAAS,WAAW,IAAI,oBAAxB,EAA8C,qBAA9C,QAA2E,eAA3E","sourcesContent":["export {\n Select,\n selectClassNames,\n renderSelect_unstable,\n useSelectStyles_unstable,\n useSelect_unstable,\n} from './Select';\nexport type { SelectOnChangeData, SelectProps, SelectSlots, SelectState } from './Select';\n\nexport { SelectField as SelectField_unstable, selectFieldClassNames } from './SelectField';\nexport type { SelectFieldProps as SelectFieldProps_unstable } from './SelectField';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SelectField.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/SelectField/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -18,7 +18,7 @@ const iconSizes = {
|
|
|
18
18
|
small: '16px',
|
|
19
19
|
medium: '20px',
|
|
20
20
|
large: '24px'
|
|
21
|
-
}; //
|
|
21
|
+
}; // This 400 style is not in the typography styles.
|
|
22
22
|
// May need a design change
|
|
23
23
|
|
|
24
24
|
const contentSizes = {
|
|
@@ -33,6 +33,36 @@ const fieldHeights = {
|
|
|
33
33
|
medium: '32px',
|
|
34
34
|
large: '40px'
|
|
35
35
|
};
|
|
36
|
+
/* Since the <select> element must span the full width and cannot have children,
|
|
37
|
+
* the right padding needs to be calculated from the sum of the following:
|
|
38
|
+
* 1. Field padding-right
|
|
39
|
+
* 2. Icon width
|
|
40
|
+
* 3. Content-icon spacing
|
|
41
|
+
* 4. Content inner padding
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
const paddingRight = {
|
|
45
|
+
small: `calc(${react_theme_1.tokens.spacingHorizontalSNudge}
|
|
46
|
+
+ ${iconSizes.small}
|
|
47
|
+
+ ${react_theme_1.tokens.spacingHorizontalXXS}
|
|
48
|
+
+ ${react_theme_1.tokens.spacingHorizontalXXS})`,
|
|
49
|
+
medium: `calc(${react_theme_1.tokens.spacingHorizontalMNudge}
|
|
50
|
+
+ ${iconSizes.medium}
|
|
51
|
+
+ ${react_theme_1.tokens.spacingHorizontalXXS}
|
|
52
|
+
+ ${react_theme_1.tokens.spacingHorizontalXXS})`,
|
|
53
|
+
large: `calc(${react_theme_1.tokens.spacingHorizontalM}
|
|
54
|
+
+ ${iconSizes.large}
|
|
55
|
+
+ ${react_theme_1.tokens.spacingHorizontalSNudge}
|
|
56
|
+
+ ${react_theme_1.tokens.spacingHorizontalSNudge})`
|
|
57
|
+
};
|
|
58
|
+
/* Left padding is calculated from the outer padding + inner content padding values
|
|
59
|
+
* since <select> can't have additional child content or custom inner layout */
|
|
60
|
+
|
|
61
|
+
const paddingLeft = {
|
|
62
|
+
small: `calc(${react_theme_1.tokens.spacingHorizontalSNudge} + ${react_theme_1.tokens.spacingHorizontalXXS})`,
|
|
63
|
+
medium: `calc(${react_theme_1.tokens.spacingHorizontalMNudge} + ${react_theme_1.tokens.spacingHorizontalXXS})`,
|
|
64
|
+
large: `calc(${react_theme_1.tokens.spacingHorizontalM} + ${react_theme_1.tokens.spacingHorizontalSNudge})`
|
|
65
|
+
};
|
|
36
66
|
/* end of shared values */
|
|
37
67
|
|
|
38
68
|
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
@@ -104,21 +134,17 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
104
134
|
"E5pizo": "f1couhl3",
|
|
105
135
|
"B7ck84d": "f1ewtqcl",
|
|
106
136
|
"sj55zd": "f19n0e5",
|
|
137
|
+
"Bceei9c": "f1k6fduh",
|
|
107
138
|
"Bh6795r": "fqerorx",
|
|
139
|
+
"B2u0y6b": "f6dzj5z",
|
|
140
|
+
"Byoj8tv": "f1qch9an",
|
|
141
|
+
"z8tnut": "f1g0x7ka",
|
|
108
142
|
"B3aqqti": "fatbyko",
|
|
109
143
|
"Brovlpu": "f1grzc83",
|
|
110
144
|
"Bxa1mx5": "f19shzzi"
|
|
111
145
|
},
|
|
112
146
|
"disabled": {
|
|
113
147
|
"De3pzq": "f1c21dwh",
|
|
114
|
-
"B4j52fo": "f5ogflp",
|
|
115
|
-
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
116
|
-
"Bn0qgzm": "f1f09k3d",
|
|
117
|
-
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
118
|
-
"icvyot": "fzkkow9",
|
|
119
|
-
"vrafjx": ["fcdblym", "fjik90z"],
|
|
120
|
-
"oivjwe": "fg706s2",
|
|
121
|
-
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
122
148
|
"g2u3we": "f1jj8ep1",
|
|
123
149
|
"h3c5rm": ["f15xbau", "fy0fskl"],
|
|
124
150
|
"B9xav0g": "f4ikngz",
|
|
@@ -130,12 +156,16 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
130
156
|
"Bxeuatn": "f1cwzwz",
|
|
131
157
|
"n51gp8": ["f14g86mu", "f1rvyvqg"]
|
|
132
158
|
},
|
|
159
|
+
"disabledUnderline": {
|
|
160
|
+
"g2u3we": "fgig46g",
|
|
161
|
+
"h3c5rm": ["f1mxt3zg", "fziff3p"],
|
|
162
|
+
"B9xav0g": "f4ikngz",
|
|
163
|
+
"zhjwy3": ["fziff3p", "f1mxt3zg"]
|
|
164
|
+
},
|
|
133
165
|
"small": {
|
|
134
166
|
"Bqenvij": "frvgh55",
|
|
135
|
-
"
|
|
136
|
-
"z189sj": ["
|
|
137
|
-
"Byoj8tv": "f1qch9an",
|
|
138
|
-
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
167
|
+
"uwmqm3": ["f1xile11", "fqznh8f"],
|
|
168
|
+
"z189sj": ["fiqd4sw", "f11fkzut"],
|
|
139
169
|
"Bahqtrf": "fk6fouc",
|
|
140
170
|
"Be2twd7": "fy9rknc",
|
|
141
171
|
"Bhrd7zp": "figsok6",
|
|
@@ -143,10 +173,8 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
143
173
|
},
|
|
144
174
|
"medium": {
|
|
145
175
|
"Bqenvij": "f1d2rq10",
|
|
146
|
-
"
|
|
147
|
-
"z189sj": ["
|
|
148
|
-
"Byoj8tv": "f1qch9an",
|
|
149
|
-
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
176
|
+
"uwmqm3": ["f1e60jzv", "f135dnwl"],
|
|
177
|
+
"z189sj": ["f154vowv", "flqamny"],
|
|
150
178
|
"Bahqtrf": "fk6fouc",
|
|
151
179
|
"Be2twd7": "fkhj508",
|
|
152
180
|
"Bhrd7zp": "figsok6",
|
|
@@ -154,10 +182,8 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
154
182
|
},
|
|
155
183
|
"large": {
|
|
156
184
|
"Bqenvij": "fbhnoac",
|
|
157
|
-
"
|
|
158
|
-
"z189sj": ["
|
|
159
|
-
"Byoj8tv": "f1qch9an",
|
|
160
|
-
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
185
|
+
"uwmqm3": ["fnphzt9", "flt1dlf"],
|
|
186
|
+
"z189sj": ["f1xi5ia2", "f1xi1l47"],
|
|
161
187
|
"Be2twd7": "fod5ikn",
|
|
162
188
|
"Bg96gwp": "faaz57k"
|
|
163
189
|
},
|
|
@@ -174,7 +200,15 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
174
200
|
"g2u3we": "fj3muxo",
|
|
175
201
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
|
176
202
|
"B9xav0g": "f1c1zstj",
|
|
177
|
-
"zhjwy3": ["f1lxtadh", "f1akhkt"]
|
|
203
|
+
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
|
204
|
+
"Bgoe8wy": "fvcxoqz",
|
|
205
|
+
"Bwzppfd": ["f1ub3y4t", "f1m52nbi"],
|
|
206
|
+
"oetu4i": "flmw63s",
|
|
207
|
+
"gg5e9n": ["f1m52nbi", "f1ub3y4t"],
|
|
208
|
+
"B6oc9vd": "fvs00aa",
|
|
209
|
+
"ak43y8": ["f1assf6x", "f4ruux4"],
|
|
210
|
+
"wmxk5l": "fqhmt4z",
|
|
211
|
+
"B50zh58": ["f4ruux4", "f1assf6x"]
|
|
178
212
|
},
|
|
179
213
|
"underline": {
|
|
180
214
|
"De3pzq": "f1c21dwh",
|
|
@@ -202,7 +236,7 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
202
236
|
"hhx65j": "f1fgmyf4"
|
|
203
237
|
}
|
|
204
238
|
}, {
|
|
205
|
-
"d": [".fqrijq1{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".frvgh55{height:24px;}", ".
|
|
239
|
+
"d": [".fqrijq1{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1k6fduh{cursor:pointer;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f6dzj5z{max-width:100%;}", ".f1qch9an{padding-bottom:0;}", ".f1g0x7ka{padding-top:0;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1jj8ep1{border-top-color:var(--colorNeutralStrokeDisabled);}", ".f15xbau{border-right-color:var(--colorNeutralStrokeDisabled);}", ".fy0fskl{border-left-color:var(--colorNeutralStrokeDisabled);}", ".f4ikngz{border-bottom-color:var(--colorNeutralStrokeDisabled);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".fgig46g{border-top-color:var(--colorTransparentStrokeDisabled);}", ".f1mxt3zg{border-right-color:var(--colorTransparentStrokeDisabled);}", ".fziff3p{border-left-color:var(--colorTransparentStrokeDisabled);}", ".frvgh55{height:24px;}", ".f1xile11{padding-left:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".fqznh8f{padding-right:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".fiqd4sw{padding-right:calc(var(--spacingHorizontalSNudge)\n + 16px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".f11fkzut{padding-left:calc(var(--spacingHorizontalSNudge)\n + 16px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1d2rq10{height:32px;}", ".f1e60jzv{padding-left:calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}", ".f135dnwl{padding-right:calc(var(--spacingHorizontalMNudge) + var(--spacingHorizontalXXS));}", ".f154vowv{padding-right:calc(var(--spacingHorizontalMNudge)\n + 20px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".flqamny{padding-left:calc(var(--spacingHorizontalMNudge)\n + 20px\n + var(--spacingHorizontalXXS)\n + var(--spacingHorizontalXXS));}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbhnoac{height:40px;}", ".fnphzt9{padding-left:calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));}", ".flt1dlf{padding-right:calc(var(--spacingHorizontalM) + var(--spacingHorizontalSNudge));}", ".f1xi5ia2{padding-right:calc(var(--spacingHorizontalM)\n + 24px\n + var(--spacingHorizontalSNudge)\n + var(--spacingHorizontalSNudge));}", ".f1xi1l47{padding-left:calc(var(--spacingHorizontalM)\n + 24px\n + var(--spacingHorizontalSNudge)\n + var(--spacingHorizontalSNudge));}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}", ".fs4k3qj:not(:focus-within),.fs4k3qj:hover:not(:focus-within){border-top-color:var(--colorPaletteRedBorder2);}", ".fcee079:not(:focus-within),.fcee079:hover:not(:focus-within){border-right-color:var(--colorPaletteRedBorder2);}", ".fmyw78r:not(:focus-within),.fmyw78r:hover:not(:focus-within){border-left-color:var(--colorPaletteRedBorder2);}", ".f1fgmyf4:not(:focus-within),.f1fgmyf4:hover:not(:focus-within){border-bottom-color:var(--colorPaletteRedBorder2);}"],
|
|
206
240
|
"f": [".fatbyko:focus{outline-width:2px;}", ".f1grzc83:focus{outline-style:solid;}", ".f19shzzi:focus{outline-color:transparent;}"],
|
|
207
241
|
"m": [["@media (forced-colors: active){.fg455y9{border-top-color:GrayText;}}", {
|
|
208
242
|
"m": "(forced-colors: active)"
|
|
@@ -212,7 +246,9 @@ const useSelectStyles = /*#__PURE__*/react_1.__styles({
|
|
|
212
246
|
"m": "(forced-colors: active)"
|
|
213
247
|
}], ["@media (forced-colors: active){.f14g86mu{border-left-color:GrayText;}.f1rvyvqg{border-right-color:GrayText;}}", {
|
|
214
248
|
"m": "(forced-colors: active)"
|
|
215
|
-
}]]
|
|
249
|
+
}]],
|
|
250
|
+
"h": [".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".flmw63s:hover{border-bottom-color:var(--colorNeutralStrokeAccessible);}"],
|
|
251
|
+
"a": [".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fqhmt4z:active{border-bottom-color:var(--colorNeutralStrokeAccessible);}"]
|
|
216
252
|
});
|
|
217
253
|
|
|
218
254
|
const useIconStyles = /*#__PURE__*/react_1.__styles({
|
|
@@ -221,7 +257,6 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
|
|
|
221
257
|
"sj55zd": "fxkbij4",
|
|
222
258
|
"mc9l5x": "ftgm304",
|
|
223
259
|
"qhf8xq": "f1euv43f",
|
|
224
|
-
"j35jbq": ["fnyteob", "f1enpzzf"],
|
|
225
260
|
"Bkecrkj": "f1aehjj5",
|
|
226
261
|
"Bo70h7d": "fvc9v3g"
|
|
227
262
|
},
|
|
@@ -232,26 +267,23 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
|
|
|
232
267
|
"small": {
|
|
233
268
|
"Be2twd7": "f4ybsrx",
|
|
234
269
|
"Bqenvij": "fd461yt",
|
|
235
|
-
"
|
|
236
|
-
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
270
|
+
"j35jbq": ["f13lnp83", "f1i5nn0v"],
|
|
237
271
|
"a9b677": "fjw5fx7"
|
|
238
272
|
},
|
|
239
273
|
"medium": {
|
|
240
274
|
"Be2twd7": "fe5j1ua",
|
|
241
275
|
"Bqenvij": "fjamq6b",
|
|
242
|
-
"
|
|
243
|
-
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
276
|
+
"j35jbq": ["fnyteob", "f1enpzzf"],
|
|
244
277
|
"a9b677": "f64fuq3"
|
|
245
278
|
},
|
|
246
279
|
"large": {
|
|
247
280
|
"Be2twd7": "f1rt2boy",
|
|
248
281
|
"Bqenvij": "frvgh55",
|
|
249
|
-
"
|
|
250
|
-
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
282
|
+
"j35jbq": ["f8b87gs", "fedtrts"],
|
|
251
283
|
"a9b677": "fq4mcun"
|
|
252
284
|
}
|
|
253
285
|
}, {
|
|
254
|
-
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fxkbij4{color:var(--colorNeutralStrokeAccessible);}", ".ftgm304{display:block;}", ".f1euv43f{position:absolute;}", ".
|
|
286
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fxkbij4{color:var(--colorNeutralStrokeAccessible);}", ".ftgm304{display:block;}", ".f1euv43f{position:absolute;}", ".f1aehjj5{pointer-events:none;}", ".fvc9v3g svg{display:block;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".f13lnp83{right:var(--spacingHorizontalSNudge);}", ".f1i5nn0v{left:var(--spacingHorizontalSNudge);}", ".fjw5fx7{width:16px;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".fnyteob{right:var(--spacingHorizontalMNudge);}", ".f1enpzzf{left:var(--spacingHorizontalMNudge);}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".f8b87gs{right:var(--spacingHorizontalM);}", ".fedtrts{left:var(--spacingHorizontalM);}", ".fq4mcun{width:24px;}"],
|
|
255
287
|
"m": [["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
|
|
256
288
|
"m": "(forced-colors: active)"
|
|
257
289
|
}]]
|
|
@@ -272,7 +304,7 @@ const useSelectStyles_unstable = state => {
|
|
|
272
304
|
const rootStyles = useRootStyles();
|
|
273
305
|
const selectStyles = useSelectStyles();
|
|
274
306
|
state.root.className = react_1.mergeClasses(exports.selectClassNames.root, rootStyles.base, state.root.className);
|
|
275
|
-
state.select.className = react_1.mergeClasses(exports.selectClassNames.select, selectStyles.base, selectStyles[size], selectStyles[appearance], !disabled && invalid && appearance !== 'underline' && selectStyles.invalid, !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline, disabled && selectStyles.disabled, state.select.className);
|
|
307
|
+
state.select.className = react_1.mergeClasses(exports.selectClassNames.select, selectStyles.base, selectStyles[size], selectStyles[appearance], !disabled && invalid && appearance !== 'underline' && selectStyles.invalid, !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline, disabled && selectStyles.disabled, disabled && appearance === 'underline' && selectStyles.disabledUnderline, state.select.className);
|
|
276
308
|
|
|
277
309
|
if (state.icon) {
|
|
278
310
|
state.icon.className = react_1.mergeClasses(exports.selectClassNames.icon, iconStyles.icon, disabled && iconStyles.disabled, iconStyles[size], state.icon.className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Select/useSelectStyles.ts"],"names":[],"mappings":";;;;;;;AAA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OAAA,CAAA,gBAAA,CAAiB,IAA9B,EAAoC,UAAU,CAAC,IAA/C,EAAqD,KAAK,CAAC,IAAN,CAAW,SAAhE,CAAvB;EAEA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CACvB,OAAA,CAAA,gBAAA,CAAiB,MADM,EAEvB,YAAY,CAAC,IAFU,EAGvB,YAAY,CAAC,IAAD,CAHW,EAIvB,YAAY,CAAC,UAAD,CAJW,EAKvB,CAAC,QAAD,IAAa,OAAb,IAAwB,UAAU,KAAK,WAAvC,IAAsD,YAAY,CAAC,OAL5C,EAMvB,CAAC,QAAD,IAAa,OAAb,IAAwB,UAAU,KAAK,WAAvC,IAAsD,YAAY,CAAC,gBAN5C,EAOvB,QAAQ,IAAI,YAAY,CAAC,QAPF,EAQvB,KAAK,CAAC,MAAN,CAAa,SARU,CAAzB;;EAWA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,gBAAA,CAAiB,IADI,EAErB,UAAU,CAAC,IAFU,EAGrB,QAAQ,IAAI,UAAU,CAAC,QAHF,EAIrB,UAAU,CAAC,IAAD,CAJW,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;EAOD;;EAED,OAAO,KAAP;AACD,CAjCM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\nexport const selectClassNames: SlotClassNames<SelectSlots> = {\n root: 'fui-Select',\n select: 'fui-Select__select',\n icon: 'fui-Select__icon',\n};\n\nconst iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\n// TODO: This 400 style is not in the typography styles.\n// May need a design change\nconst contentSizes = {\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n\n//TODO: Should fieldHeights be a set of global design tokens or constants?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n/* end of shared values */\n\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexWrap: 'nowrap',\n fontFamily: tokens.fontFamilyBase,\n position: 'relative',\n\n '&::after': {\n backgroundImage: `linear-gradient(\n 0deg,\n ${tokens.colorCompoundBrandStroke} 0%,\n ${tokens.colorCompoundBrandStroke} 50%,\n transparent 50%,\n transparent 100%\n )`,\n ...shorthands.borderRadius(0, 0, tokens.borderRadiusMedium, tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: tokens.borderRadiusMedium,\n position: 'absolute',\n bottom: '0',\n left: '0',\n right: '0',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n\n '&:focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n },\n});\n\nconst useSelectStyles = makeStyles({\n base: {\n appearance: 'none',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxShadow: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n\n ':focus': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n small: {\n height: fieldHeights.small,\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption1,\n },\n medium: {\n height: fieldHeights.medium,\n ...shorthands.padding('0', tokens.spacingHorizontalMNudge),\n ...typographyStyles.body1,\n },\n large: {\n height: fieldHeights.large,\n ...shorthands.padding('0', tokens.spacingHorizontalM),\n ...contentSizes[400],\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n ...shorthands.borderRadius(0),\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n});\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n display: 'block',\n position: 'absolute',\n right: tokens.spacingHorizontalMNudge,\n pointerEvents: 'none',\n\n // the SVG must have display: block for accurate positioning\n // otherwise an extra inline space is inserted after the svg element\n '& svg': {\n display: 'block',\n },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n small: {\n fontSize: iconSizes.small,\n height: iconSizes.small,\n paddingRight: tokens.spacingHorizontalSNudge,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.small,\n },\n medium: {\n fontSize: iconSizes.medium,\n height: iconSizes.medium,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.medium,\n },\n large: {\n fontSize: iconSizes.large,\n height: iconSizes.large,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalSNudge,\n width: iconSizes.large,\n },\n});\n\n/**\n * Apply styling to the Select slots based on the state\n */\nexport const useSelectStyles_unstable = (state: SelectState): SelectState => {\n const { size, appearance } = state;\n const disabled = state.select.disabled;\n const invalid = `${state.select['aria-invalid']}` === 'true';\n\n const iconStyles = useIconStyles();\n const rootStyles = useRootStyles();\n const selectStyles = useSelectStyles();\n\n state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);\n\n state.select.className = mergeClasses(\n selectClassNames.select,\n selectStyles.base,\n selectStyles[size],\n selectStyles[appearance],\n !disabled && invalid && appearance !== 'underline' && selectStyles.invalid,\n !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline,\n disabled && selectStyles.disabled,\n state.select.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n selectClassNames.icon,\n iconStyles.icon,\n disabled && iconStyles.disabled,\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["components/Select/useSelectStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,gBAAA,GAAgD;EAC3D,IAAI,EAAE,YADqD;EAE3D,MAAM,EAAE,oBAFmD;EAG3D,IAAI,EAAE;AAHqD,CAAhD;AAMb,MAAM,SAAS,GAAG;EAChB,KAAK,EAAE,MADS;EAEhB,MAAM,EAAE,MAFQ;EAGhB,KAAK,EAAE;AAHS,CAAlB,C,CAMA;AACA;;AACA,M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C,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,gBAAA,CAAiB,IADI,EAErB,UAAU,CAAC,IAFU,EAGrB,QAAQ,IAAI,UAAU,CAAC,QAHF,EAIrB,UAAU,CAAC,IAAD,CAJW,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;EAOD;;EAED,OAAO,KAAP;AACD,CAlCM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\nexport const selectClassNames: SlotClassNames<SelectSlots> = {\n root: 'fui-Select',\n select: 'fui-Select__select',\n icon: 'fui-Select__icon',\n};\n\nconst iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\n// This 400 style is not in the typography styles.\n// May need a design change\nconst contentSizes = {\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n\n//TODO: Should fieldHeights be a set of global design tokens or constants?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n/* Since the <select> element must span the full width and cannot have children,\n * the right padding needs to be calculated from the sum of the following:\n * 1. Field padding-right\n * 2. Icon width\n * 3. Content-icon spacing\n * 4. Content inner padding\n */\nconst paddingRight = {\n small: `calc(${tokens.spacingHorizontalSNudge}\n + ${iconSizes.small}\n + ${tokens.spacingHorizontalXXS}\n + ${tokens.spacingHorizontalXXS})`,\n medium: `calc(${tokens.spacingHorizontalMNudge}\n + ${iconSizes.medium}\n + ${tokens.spacingHorizontalXXS}\n + ${tokens.spacingHorizontalXXS})`,\n large: `calc(${tokens.spacingHorizontalM}\n + ${iconSizes.large}\n + ${tokens.spacingHorizontalSNudge}\n + ${tokens.spacingHorizontalSNudge})`,\n};\n\n/* Left padding is calculated from the outer padding + inner content padding values\n * since <select> can't have additional child content or custom inner layout */\nconst paddingLeft = {\n small: `calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`,\n medium: `calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`,\n large: `calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`,\n};\n\n/* end of shared values */\n\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexWrap: 'nowrap',\n fontFamily: tokens.fontFamilyBase,\n position: 'relative',\n\n '&::after': {\n backgroundImage: `linear-gradient(\n 0deg,\n ${tokens.colorCompoundBrandStroke} 0%,\n ${tokens.colorCompoundBrandStroke} 50%,\n transparent 50%,\n transparent 100%\n )`,\n ...shorthands.borderRadius(0, 0, tokens.borderRadiusMedium, tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: tokens.borderRadiusMedium,\n position: 'absolute',\n bottom: '0',\n left: '0',\n right: '0',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n\n '&:focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n },\n});\n\nconst useSelectStyles = makeStyles({\n base: {\n appearance: 'none',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxShadow: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n flexGrow: 1,\n maxWidth: '100%',\n paddingBottom: 0,\n paddingTop: 0,\n\n ':focus': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n disabledUnderline: {\n ...shorthands.borderColor(\n tokens.colorTransparentStrokeDisabled,\n tokens.colorTransparentStrokeDisabled,\n tokens.colorNeutralStrokeDisabled,\n ),\n },\n\n small: {\n height: fieldHeights.small,\n paddingLeft: paddingLeft.small,\n paddingRight: paddingRight.small,\n ...typographyStyles.caption1,\n },\n medium: {\n height: fieldHeights.medium,\n paddingLeft: paddingLeft.medium,\n paddingRight: paddingRight.medium,\n ...typographyStyles.body1,\n },\n large: {\n height: fieldHeights.large,\n paddingLeft: paddingLeft.large,\n paddingRight: paddingRight.large,\n ...contentSizes[400],\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n\n '&:hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n\n '&:active': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n ...shorthands.borderRadius(0),\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n});\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n display: 'block',\n position: 'absolute',\n pointerEvents: 'none',\n\n // the SVG must have display: block for accurate positioning\n // otherwise an extra inline space is inserted after the svg element\n '& svg': {\n display: 'block',\n },\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n small: {\n fontSize: iconSizes.small,\n height: iconSizes.small,\n right: tokens.spacingHorizontalSNudge,\n width: iconSizes.small,\n },\n medium: {\n fontSize: iconSizes.medium,\n height: iconSizes.medium,\n right: tokens.spacingHorizontalMNudge,\n width: iconSizes.medium,\n },\n large: {\n fontSize: iconSizes.large,\n height: iconSizes.large,\n right: tokens.spacingHorizontalM,\n width: iconSizes.large,\n },\n});\n\n/**\n * Apply styling to the Select slots based on the state\n */\nexport const useSelectStyles_unstable = (state: SelectState): SelectState => {\n const { size, appearance } = state;\n const disabled = state.select.disabled;\n const invalid = `${state.select['aria-invalid']}` === 'true';\n\n const iconStyles = useIconStyles();\n const rootStyles = useRootStyles();\n const selectStyles = useSelectStyles();\n\n state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);\n\n state.select.className = mergeClasses(\n selectClassNames.select,\n selectStyles.base,\n selectStyles[size],\n selectStyles[appearance],\n !disabled && invalid && appearance !== 'underline' && selectStyles.invalid,\n !disabled && invalid && appearance === 'underline' && selectStyles.invalidUnderline,\n disabled && selectStyles.disabled,\n disabled && appearance === 'underline' && selectStyles.disabledUnderline,\n state.select.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n selectClassNames.icon,\n iconStyles.icon,\n disabled && iconStyles.disabled,\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectField = exports.selectFieldClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_field_1 = /*#__PURE__*/require("@fluentui/react-field");
|
|
11
|
+
|
|
12
|
+
const Select_1 = /*#__PURE__*/require("../../Select");
|
|
13
|
+
|
|
14
|
+
exports.selectFieldClassNames = /*#__PURE__*/react_field_1.getFieldClassNames('SelectField');
|
|
15
|
+
exports.SelectField = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
|
+
const state = react_field_1.useField_unstable(props, ref, {
|
|
17
|
+
component: Select_1.Select,
|
|
18
|
+
classNames: exports.selectFieldClassNames
|
|
19
|
+
});
|
|
20
|
+
react_field_1.useFieldStyles_unstable(state);
|
|
21
|
+
return react_field_1.renderField_unstable(state);
|
|
22
|
+
});
|
|
23
|
+
exports.SelectField.displayName = 'SelectField';
|
|
24
|
+
//# sourceMappingURL=SelectField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/SelectField/SelectField.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAOA,MAAA,QAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AAIa,OAAA,CAAA,qBAAA,gBAAwB,aAAA,CAAA,kBAAA,CAAmB,aAAnB,CAAxB;AAEA,OAAA,CAAA,WAAA,gBAAqD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EAChG,MAAM,KAAK,GAAG,aAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,EAA8B;IAAE,SAAS,EAAE,QAAA,CAAA,MAAb;IAAqB,UAAU,EAAE,OAAA,CAAA;EAAjC,CAA9B,CAAd;EACA,aAAA,CAAA,uBAAA,CAAwB,KAAxB;EACA,OAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CAJiE,CAArD;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","sourcesContent":["import * as React from 'react';\nimport type { FieldProps } from '@fluentui/react-field';\nimport {\n getFieldClassNames,\n renderField_unstable,\n useFieldStyles_unstable,\n useField_unstable,\n} from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { Select } from '../../Select';\n\nexport type SelectFieldProps = FieldProps<typeof Select>;\n\nexport const selectFieldClassNames = getFieldClassNames('SelectField');\n\nexport const SelectField: ForwardRefComponent<SelectFieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref, { component: Select, classNames: selectFieldClassNames });\n useFieldStyles_unstable(state);\n return renderField_unstable(state);\n});\n\nSelectField.displayName = 'SelectField';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/SelectField/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './SelectField';\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useSelect_unstable = exports.useSelectStyles_unstable = exports.renderSelect_unstable = exports.selectClassNames = exports.Select = void 0;
|
|
6
|
+
exports.selectFieldClassNames = exports.SelectField_unstable = exports.useSelect_unstable = exports.useSelectStyles_unstable = exports.renderSelect_unstable = exports.selectClassNames = exports.Select = void 0;
|
|
7
7
|
|
|
8
8
|
var Select_1 = /*#__PURE__*/require("./Select");
|
|
9
9
|
|
|
@@ -37,4 +37,19 @@ Object.defineProperty(exports, "useSelect_unstable", {
|
|
|
37
37
|
return Select_1.useSelect_unstable;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
+
|
|
41
|
+
var SelectField_1 = /*#__PURE__*/require("./SelectField");
|
|
42
|
+
|
|
43
|
+
Object.defineProperty(exports, "SelectField_unstable", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return SelectField_1.SelectField;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "selectFieldClassNames", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return SelectField_1.selectFieldClassNames;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
40
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,MAAA;EAAM;AAAN,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,wBAAA;EAAwB;AAAxB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA","sourcesContent":["export {\n Select,\n selectClassNames,\n renderSelect_unstable,\n useSelectStyles_unstable,\n useSelect_unstable,\n} from './Select';\nexport type { SelectOnChangeData, SelectProps, SelectSlots, SelectState } from './Select';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,MAAA;EAAM;AAAN,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,gBAAA;EAAgB;AAAhB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,wBAAA;EAAwB;AAAxB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,QAAA,CAAA,kBAAA;EAAkB;AAAlB,CAAA;;AAIF,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,WAAA;EAAW;AAAX,CAAA;AAAqC,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,qBAAA;EAAqB;AAArB,CAAA","sourcesContent":["export {\n Select,\n selectClassNames,\n renderSelect_unstable,\n useSelectStyles_unstable,\n useSelect_unstable,\n} from './Select';\nexport type { SelectOnChangeData, SelectProps, SelectSlots, SelectState } from './Select';\n\nexport { SelectField as SelectField_unstable, selectFieldClassNames } from './SelectField';\nexport type { SelectFieldProps as SelectFieldProps_unstable } from './SelectField';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-select",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.14",
|
|
4
4
|
"description": "Fluent UI React Select component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "dist/index.d.ts",
|
|
7
|
+
"typings": "./dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -28,13 +28,14 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.18"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@fluentui/react-field": "9.0.0-alpha.8",
|
|
34
35
|
"@fluentui/react-icons": "^2.0.175",
|
|
35
|
-
"@fluentui/react-theme": "^9.1.
|
|
36
|
-
"@fluentui/react-utilities": "^9.1
|
|
37
|
-
"@griffel/react": "^1.4.
|
|
36
|
+
"@fluentui/react-theme": "^9.1.2",
|
|
37
|
+
"@fluentui/react-utilities": "^9.2.1",
|
|
38
|
+
"@griffel/react": "^1.4.2",
|
|
38
39
|
"tslib": "^2.1.0"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
@@ -53,9 +54,10 @@
|
|
|
53
54
|
},
|
|
54
55
|
"exports": {
|
|
55
56
|
".": {
|
|
56
|
-
"types": "./
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
57
58
|
"import": "./lib/index.js",
|
|
58
59
|
"require": "./lib-commonjs/index.js"
|
|
59
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"./package.json": "./package.json"
|
|
60
62
|
}
|
|
61
63
|
}
|
package/Spec.md
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# @fluentui/react-select Spec
|
|
2
|
-
|
|
3
|
-
## Background
|
|
4
|
-
|
|
5
|
-
The Select component allows users to select one value from a predefined set of values. It does so by providing a styled wrapper around the HTML `<select>` element. This means it inherits the dropdown UI and keyboard functionality from the platform.
|
|
6
|
-
|
|
7
|
-
Select is a more lightweight, accessible, and less feature-rich alternative to Combobox. It has better mobile support, and better cross-platform screen reader support. Unlike Combobox, it does not provide filtering, multiple selection, or virtualization. Select is recommended over Combobox when the following are true:
|
|
8
|
-
|
|
9
|
-
- The control is a basic single-select that matches the functionality of a `<select>`
|
|
10
|
-
- Native-feeling cross platform UX (particularly on mobile) is a primary concern
|
|
11
|
-
- Performance, accessibility, and bundle size are primary concerns
|
|
12
|
-
|
|
13
|
-
Combobox is recommended if any of the following are needed:
|
|
14
|
-
|
|
15
|
-
- Filtering or freeform text input
|
|
16
|
-
- Virtualization
|
|
17
|
-
- Control over styling the dropdown and options
|
|
18
|
-
- Multiple selection
|
|
19
|
-
|
|
20
|
-
## Prior Art
|
|
21
|
-
|
|
22
|
-
The [Open UI research on Select](https://open-ui.org/components/select.research) combines both the ideas of the proposed Fluent Combobox and Select. There is also an [Open UI draft describing the select element](https://open-ui.org/components/select).
|
|
23
|
-
|
|
24
|
-
### Comparison of v8 and v0
|
|
25
|
-
|
|
26
|
-
`@fluentui/react` has three different controls that are different flavors of select/combobox:
|
|
27
|
-
|
|
28
|
-
- [Combobox](https://developer.microsoft.com/en-us/fluentui#/controls/web/combobox): an editable combobox with a textfield and dropdown listbox
|
|
29
|
-
- [Dropdown](https://developer.microsoft.com/en-us/fluentui#/controls/web/dropdown): a non-editable combobox with dropdown listbox
|
|
30
|
-
- [Pickers](https://developer.microsoft.com/en-us/fluentui#/controls/web/pickers): an editable combobox with greater customization, particularly in displaying selected items
|
|
31
|
-
|
|
32
|
-
`@fluentui/react-northstar` has one combobox control:
|
|
33
|
-
|
|
34
|
-
- [Dropdown](https://fluentsite.z22.web.core.windows.net/0.51.2/components/dropdown/definition): either an editable or non-editable combobox with a tag-like approach to selected items
|
|
35
|
-
|
|
36
|
-
### Functional variations across v8 and v0 components
|
|
37
|
-
|
|
38
|
-
The main functional variants in existing components are as follows:
|
|
39
|
-
|
|
40
|
-
- Editable vs. non-editable: editable comboboxes have a textbox and allow the user to type, which optionally filters the listbox
|
|
41
|
-
- Within editable comboboxes: freeform text input and filtering on input are optional
|
|
42
|
-
- Within editable comboboxes: When a typed value does not match an option, it can be cleared or preserved on blur
|
|
43
|
-
- Single vs. multiselect
|
|
44
|
-
- Within multiselect: selected options may be presented as text within the combobox value, pills, or a custom render.
|
|
45
|
-
|
|
46
|
-
### Dropdown options variations across v8 and v0 Components
|
|
47
|
-
|
|
48
|
-
- Options may have an icon, image, text + description, or entirely custom render
|
|
49
|
-
- Options may be grouped with a group header and divider
|
|
50
|
-
- There may be a "load more results" action
|
|
51
|
-
- Within multiselect: There may be a "Select all" option
|
|
52
|
-
|
|
53
|
-
## Sample Code
|
|
54
|
-
|
|
55
|
-
Default/standard Select:
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
<label htmlFor="selectID">Choose a color</label>
|
|
59
|
-
<Select id="selectID">
|
|
60
|
-
<option>Red</option>
|
|
61
|
-
<option>Green</option>
|
|
62
|
-
<option>Blue</option>
|
|
63
|
-
</Select>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Select with grouped options:
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
<label htmlFor="selectID">Choose an animal</label>
|
|
70
|
-
<Select id="selectID">
|
|
71
|
-
<optgroup label="Land">
|
|
72
|
-
<option>Cat</option>
|
|
73
|
-
<option>Dog</option>
|
|
74
|
-
<option>Horse</option>
|
|
75
|
-
</optgroup>
|
|
76
|
-
<optgroup label="Water">
|
|
77
|
-
<option>Dolphin</option>
|
|
78
|
-
<option>Seal</option>
|
|
79
|
-
<option>Shark</option>
|
|
80
|
-
</optgroup>
|
|
81
|
-
</Select>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Select with appearance and size set:
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
<label htmlFor="selectID">Choose a color</label>
|
|
88
|
-
<Select id="selectID" appearance="filledDarker" size="small">
|
|
89
|
-
<option>Red</option>
|
|
90
|
-
<option>Green</option>
|
|
91
|
-
<option>Blue</option>
|
|
92
|
-
</Select>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Disabled Select with second option selected:
|
|
96
|
-
|
|
97
|
-
```tsx
|
|
98
|
-
<label htmlFor="selectID">Choose a color</label>
|
|
99
|
-
<Select id="selectID" disabled>
|
|
100
|
-
<option>Red</option>
|
|
101
|
-
<option selected>Green</option>
|
|
102
|
-
<option>Blue</option>
|
|
103
|
-
</Select>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## Variants
|
|
107
|
-
|
|
108
|
-
### Size
|
|
109
|
-
|
|
110
|
-
- Small
|
|
111
|
-
- Medium (default)
|
|
112
|
-
- Large
|
|
113
|
-
|
|
114
|
-
### Appearance
|
|
115
|
-
|
|
116
|
-
- Filled darker
|
|
117
|
-
- Filled lighter
|
|
118
|
-
- Outline (default)
|
|
119
|
-
- Transparent
|
|
120
|
-
|
|
121
|
-
### Unsupported Select variants
|
|
122
|
-
|
|
123
|
-
#### Multiple Selection
|
|
124
|
-
|
|
125
|
-
The Select component does not support multi-select, and does not support the native `multiselect` attribute. Multiple selection is instead provided through the Combobox component. This is because the native `<select multiple>` has poor accessibility and general UX, and we do not recommend using it. Additionally, because the options are not styleable, there is little benefit to using a wrapped `<Select multiple>` over using the native element directly.
|
|
126
|
-
|
|
127
|
-
#### Size attribute
|
|
128
|
-
|
|
129
|
-
For similar reasons to `multiple`, the native `size` attribute is not supported out of the box. It also has very limited styling support, and therefore also has little benefit over the native `<select size="N">`. The Listbox (TODO: confirm name) component is an alternative to using the `size` attribute on a `<select>`.
|
|
130
|
-
|
|
131
|
-
## API
|
|
132
|
-
|
|
133
|
-
From [Select.types.tsx](https://github.com/microsoft/fluentui/blob/master/packages/react-select/src/components/Select/Select.types.ts)
|
|
134
|
-
|
|
135
|
-
### Slots
|
|
136
|
-
|
|
137
|
-
In this component, `select` is the primary slot. Since `select` is primary, `root` is a separate explicit slot to customize the wrapper.
|
|
138
|
-
|
|
139
|
-
```ts
|
|
140
|
-
export type SelectSlots = {
|
|
141
|
-
/** Root of the component, renders as a `<span>`. */
|
|
142
|
-
root: IntrinsicSlotProps<'span'>;
|
|
143
|
-
/** The actual `<select>` element */
|
|
144
|
-
select: IntrinsicSlotProps<'select'>;
|
|
145
|
-
/** the icon, typically a down arrow */
|
|
146
|
-
icon: IntrinsicSlotProps<'span'>;
|
|
147
|
-
};
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Children
|
|
151
|
-
|
|
152
|
-
Children of the `Select` component are rendered as children of the internal `<select>` element. The only children that are supported in practice are the `<optgroup>` and `<option>` elements.
|
|
153
|
-
|
|
154
|
-
## Structure
|
|
155
|
-
|
|
156
|
-
- _**Public**_
|
|
157
|
-
|
|
158
|
-
```tsx
|
|
159
|
-
<label htmlFor="selectID">Choose a color</label>
|
|
160
|
-
<Select id="selectID" className="my-select-class">
|
|
161
|
-
<option>Red</option>
|
|
162
|
-
<option>Green</option>
|
|
163
|
-
<option>Blue</option>
|
|
164
|
-
</Select>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
- _**DOM**_
|
|
168
|
-
|
|
169
|
-
```html
|
|
170
|
-
<label for="selectID">Choose a color</label>
|
|
171
|
-
<span class="my-select-class">
|
|
172
|
-
<select id="selectID">
|
|
173
|
-
<option>Red</option>
|
|
174
|
-
<option>Green</option>
|
|
175
|
-
<option>Blue</option>
|
|
176
|
-
</select>
|
|
177
|
-
<svg><!-- icon --></svg>
|
|
178
|
-
</span>
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Migration
|
|
182
|
-
|
|
183
|
-
The Select component is a new approach that was not present in `@fluentui/react` v8, or `@fluentui/react-northstar`. It can be considered if the currently used control is the `@fluentui/react` Dropdown component, or the `@fluentui/react-northstar` Dropdown without `search`.
|
|
184
|
-
|
|
185
|
-
### Props
|
|
186
|
-
|
|
187
|
-
| v8 Dropdown | v0 Dropdown | Proposal |
|
|
188
|
-
| -------------------- | ------------------------- | --------------------------------- |
|
|
189
|
-
| options | items | children |
|
|
190
|
-
| defaultSelectedKey | defaultValue | child with `selected` |
|
|
191
|
-
| selectedKey | value | imperative ref.value |
|
|
192
|
-
| id | n/a | id |
|
|
193
|
-
| disabled | disabled | disabled |
|
|
194
|
-
| required | n/a | required |
|
|
195
|
-
| multiSelect | multiple | use Combobox |
|
|
196
|
-
| placeholder | placeholder | child with `value=""` |
|
|
197
|
-
| ariaLabel | n/a | aria-label |
|
|
198
|
-
| n/a | aria-\* | aria-\* |
|
|
199
|
-
| errorMessage | error | invalid, message handled in Field |
|
|
200
|
-
| label, onRenderLabel | n/a | Handled in Field |
|
|
201
|
-
| componentRef | n/a | ref |
|
|
202
|
-
| n/a | popperRef, popper props | n/a |
|
|
203
|
-
| calloutProps | list | n/a |
|
|
204
|
-
| panelProps | n/a | n/a |
|
|
205
|
-
| openOnKeyboardFocus | n/a | n/a |
|
|
206
|
-
| n/a | a11ySelectedItemsMessage | n/a |
|
|
207
|
-
| n/a | align | n/a |
|
|
208
|
-
| n/a | autosize | n/a |
|
|
209
|
-
| n/a | checkable | n/a |
|
|
210
|
-
| n/a | clearable | n/a |
|
|
211
|
-
| n/a | defaultHighlightedIndex | n/a |
|
|
212
|
-
| n/a | defaultOpen | n/a |
|
|
213
|
-
| n/a | fluid | default style |
|
|
214
|
-
| n/a | headerMessage | optgroup child with `name` |
|
|
215
|
-
| n/a | highlightFirstItemOnOpen | n/a |
|
|
216
|
-
| n/a | highlightedIndex | n/a |
|
|
217
|
-
| n/a | inline | use custom styles |
|
|
218
|
-
| n/a | inverted | n/a |
|
|
219
|
-
| n/a | loading | n/a |
|
|
220
|
-
| n/a | noResultsMessage | use children |
|
|
221
|
-
| n/a | offset | n/a |
|
|
222
|
-
| n/a | open | n/a |
|
|
223
|
-
| n/a | position | n/a |
|
|
224
|
-
| n/a | positionFixed | n/a |
|
|
225
|
-
| n/a | search | use Combobox |
|
|
226
|
-
| styles | styles | style |
|
|
227
|
-
| onRenderCaretDown | toggleIndicator | use icon slot |
|
|
228
|
-
| n/a | triggerButton | n/a |
|
|
229
|
-
| onRenderContainer | n/a | n/a |
|
|
230
|
-
| onRenderItem | renderItem | use children |
|
|
231
|
-
| onRenderList | list slot | n/a |
|
|
232
|
-
| onRenderOption | renderItem, headerMessage | use children |
|
|
233
|
-
| onRenderPlaceholder | n/a | n/a |
|
|
234
|
-
| onRenderTitle | n/a | n/a |
|
|
235
|
-
|
|
236
|
-
## Behaviors and Accessibility
|
|
237
|
-
|
|
238
|
-
This component makes use of the native `<select>` element, and inherits the native semantics and keyboard interactivity.
|