@fluentui/react-combobox 9.0.0-beta.19 → 9.0.0-beta.21
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 -1
- package/CHANGELOG.md +32 -2
- package/lib/components/Combobox/Combobox.js +0 -1
- package/lib/components/Combobox/Combobox.js.map +1 -1
- package/lib/components/Combobox/renderCombobox.js +10 -6
- package/lib/components/Combobox/renderCombobox.js.map +1 -1
- package/lib/components/Combobox/useCombobox.js +41 -53
- package/lib/components/Combobox/useCombobox.js.map +1 -1
- package/lib/components/Combobox/useComboboxStyles.js +209 -217
- package/lib/components/Combobox/useComboboxStyles.js.map +1 -1
- package/lib/components/ComboboxField/ComboboxField.js.map +1 -1
- package/lib/components/Dropdown/Dropdown.js +0 -1
- package/lib/components/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/Dropdown/renderDropdown.js +10 -6
- package/lib/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib/components/Dropdown/useDropdown.js +20 -32
- package/lib/components/Dropdown/useDropdown.js.map +1 -1
- package/lib/components/Dropdown/useDropdownStyles.js +199 -206
- package/lib/components/Dropdown/useDropdownStyles.js.map +1 -1
- package/lib/components/Listbox/Listbox.js +0 -1
- package/lib/components/Listbox/Listbox.js.map +1 -1
- package/lib/components/Listbox/renderListbox.js +2 -2
- package/lib/components/Listbox/renderListbox.js.map +1 -1
- package/lib/components/Listbox/useListbox.js +6 -13
- package/lib/components/Listbox/useListbox.js.map +1 -1
- package/lib/components/Listbox/useListboxStyles.js +18 -21
- package/lib/components/Listbox/useListboxStyles.js.map +1 -1
- package/lib/components/Option/Option.js +0 -1
- package/lib/components/Option/Option.js.map +1 -1
- package/lib/components/Option/renderOption.js +4 -3
- package/lib/components/Option/renderOption.js.map +1 -1
- package/lib/components/Option/useOption.js +20 -32
- package/lib/components/Option/useOption.js.map +1 -1
- package/lib/components/Option/useOptionStyles.js +74 -79
- package/lib/components/Option/useOptionStyles.js.map +1 -1
- package/lib/components/OptionGroup/OptionGroup.js +0 -1
- package/lib/components/OptionGroup/OptionGroup.js.map +1 -1
- package/lib/components/OptionGroup/renderOptionGroup.js +4 -3
- package/lib/components/OptionGroup/renderOptionGroup.js.map +1 -1
- package/lib/components/OptionGroup/useOptionGroup.js +0 -1
- package/lib/components/OptionGroup/useOptionGroup.js.map +1 -1
- package/lib/components/OptionGroup/useOptionGroupStyles.js +29 -34
- package/lib/components/OptionGroup/useOptionGroupStyles.js.map +1 -1
- package/lib/contexts/ComboboxContext.js +8 -11
- package/lib/contexts/ComboboxContext.js.map +1 -1
- package/lib/contexts/ListboxContext.js +6 -9
- package/lib/contexts/ListboxContext.js.map +1 -1
- package/lib/contexts/useComboboxContextValues.js.map +1 -1
- package/lib/contexts/useListboxContextValues.js +2 -2
- package/lib/contexts/useListboxContextValues.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/dropdownKeyActions.js +12 -33
- package/lib/utils/dropdownKeyActions.js.map +1 -1
- package/lib/utils/internalTokens.js.map +1 -1
- package/lib/utils/useComboboxBaseState.js +23 -27
- package/lib/utils/useComboboxBaseState.js.map +1 -1
- package/lib/utils/useComboboxPopup.js +6 -4
- package/lib/utils/useComboboxPopup.js.map +1 -1
- package/lib/utils/useOptionCollection.js +10 -20
- package/lib/utils/useOptionCollection.js.map +1 -1
- package/lib/utils/useScrollOptionsIntoView.js +2 -5
- package/lib/utils/useScrollOptionsIntoView.js.map +1 -1
- package/lib/utils/useSelection.js +7 -12
- package/lib/utils/useSelection.js.map +1 -1
- package/lib/utils/useTriggerListboxSlots.js +31 -39
- package/lib/utils/useTriggerListboxSlots.js.map +1 -1
- package/lib-commonjs/Combobox.js +0 -2
- package/lib-commonjs/Combobox.js.map +1 -1
- package/lib-commonjs/ComboboxField.js +0 -2
- package/lib-commonjs/ComboboxField.js.map +1 -1
- package/lib-commonjs/Dropdown.js +0 -2
- package/lib-commonjs/Dropdown.js.map +1 -1
- package/lib-commonjs/Listbox.js +0 -2
- package/lib-commonjs/Listbox.js.map +1 -1
- package/lib-commonjs/Option.js +0 -2
- package/lib-commonjs/Option.js.map +1 -1
- package/lib-commonjs/OptionGroup.js +0 -2
- package/lib-commonjs/OptionGroup.js.map +1 -1
- package/lib-commonjs/components/Combobox/Combobox.js +0 -7
- package/lib-commonjs/components/Combobox/Combobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/Combobox.types.js.map +1 -1
- package/lib-commonjs/components/Combobox/index.js +0 -6
- package/lib-commonjs/components/Combobox/index.js.map +1 -1
- package/lib-commonjs/components/Combobox/renderCombobox.js +10 -12
- package/lib-commonjs/components/Combobox/renderCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useCombobox.js +41 -63
- package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
- package/lib-commonjs/components/Combobox/useComboboxStyles.js +209 -222
- package/lib-commonjs/components/Combobox/useComboboxStyles.js.map +1 -1
- package/lib-commonjs/components/ComboboxField/ComboboxField.js +0 -4
- package/lib-commonjs/components/ComboboxField/ComboboxField.js.map +1 -1
- package/lib-commonjs/components/ComboboxField/index.js +0 -2
- package/lib-commonjs/components/ComboboxField/index.js.map +1 -1
- package/lib-commonjs/components/Dropdown/Dropdown.js +0 -7
- package/lib-commonjs/components/Dropdown/Dropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/Dropdown.types.js.map +1 -1
- package/lib-commonjs/components/Dropdown/index.js +0 -6
- package/lib-commonjs/components/Dropdown/index.js.map +1 -1
- package/lib-commonjs/components/Dropdown/renderDropdown.js +10 -12
- package/lib-commonjs/components/Dropdown/renderDropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdown.js +20 -43
- package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
- package/lib-commonjs/components/Dropdown/useDropdownStyles.js +199 -211
- package/lib-commonjs/components/Dropdown/useDropdownStyles.js.map +1 -1
- package/lib-commonjs/components/Listbox/Listbox.js +0 -7
- package/lib-commonjs/components/Listbox/Listbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/Listbox.types.js.map +1 -1
- package/lib-commonjs/components/Listbox/index.js +0 -6
- package/lib-commonjs/components/Listbox/index.js.map +1 -1
- package/lib-commonjs/components/Listbox/renderListbox.js +2 -7
- package/lib-commonjs/components/Listbox/renderListbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/useListbox.js +6 -23
- package/lib-commonjs/components/Listbox/useListbox.js.map +1 -1
- package/lib-commonjs/components/Listbox/useListboxStyles.js +18 -25
- package/lib-commonjs/components/Listbox/useListboxStyles.js.map +1 -1
- package/lib-commonjs/components/Option/Option.js +0 -6
- package/lib-commonjs/components/Option/Option.js.map +1 -1
- package/lib-commonjs/components/Option/Option.types.js.map +1 -1
- package/lib-commonjs/components/Option/index.js +0 -6
- package/lib-commonjs/components/Option/index.js.map +1 -1
- package/lib-commonjs/components/Option/renderOption.js +4 -7
- package/lib-commonjs/components/Option/renderOption.js.map +1 -1
- package/lib-commonjs/components/Option/useOption.js +20 -39
- package/lib-commonjs/components/Option/useOption.js.map +1 -1
- package/lib-commonjs/components/Option/useOptionStyles.js +74 -83
- package/lib-commonjs/components/Option/useOptionStyles.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/OptionGroup.js +0 -6
- package/lib-commonjs/components/OptionGroup/OptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/OptionGroup.types.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/index.js +0 -6
- package/lib-commonjs/components/OptionGroup/index.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/renderOptionGroup.js +4 -7
- package/lib-commonjs/components/OptionGroup/renderOptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/useOptionGroup.js +0 -4
- package/lib-commonjs/components/OptionGroup/useOptionGroup.js.map +1 -1
- package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.js +29 -38
- package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.js.map +1 -1
- package/lib-commonjs/contexts/ComboboxContext.js +8 -13
- package/lib-commonjs/contexts/ComboboxContext.js.map +1 -1
- package/lib-commonjs/contexts/ListboxContext.js +6 -11
- package/lib-commonjs/contexts/ListboxContext.js.map +1 -1
- package/lib-commonjs/contexts/useComboboxContextValues.js +0 -2
- package/lib-commonjs/contexts/useComboboxContextValues.js.map +1 -1
- package/lib-commonjs/contexts/useListboxContextValues.js +2 -6
- package/lib-commonjs/contexts/useListboxContextValues.js.map +1 -1
- package/lib-commonjs/index.js +0 -20
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/ComboboxBase.types.js.map +1 -1
- package/lib-commonjs/utils/OptionCollection.types.js.map +1 -1
- package/lib-commonjs/utils/Selection.types.js.map +1 -1
- package/lib-commonjs/utils/dropdownKeyActions.js +12 -37
- package/lib-commonjs/utils/dropdownKeyActions.js.map +1 -1
- package/lib-commonjs/utils/internalTokens.js.map +1 -1
- package/lib-commonjs/utils/useComboboxBaseState.js +23 -33
- package/lib-commonjs/utils/useComboboxBaseState.js.map +1 -1
- package/lib-commonjs/utils/useComboboxPopup.js +6 -8
- package/lib-commonjs/utils/useComboboxPopup.js.map +1 -1
- package/lib-commonjs/utils/useOptionCollection.js +10 -23
- package/lib-commonjs/utils/useOptionCollection.js.map +1 -1
- package/lib-commonjs/utils/useScrollOptionsIntoView.js +2 -9
- package/lib-commonjs/utils/useScrollOptionsIntoView.js.map +1 -1
- package/lib-commonjs/utils/useSelection.js +7 -15
- package/lib-commonjs/utils/useSelection.js.map +1 -1
- package/lib-commonjs/utils/useTriggerListboxSlots.js +30 -43
- package/lib-commonjs/utils/useTriggerListboxSlots.js.map +1 -1
- package/package.json +9 -9
|
@@ -7,99 +7,96 @@ export const optionClassNames = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Styles for the root slot
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
const useStyles = /*#__PURE__*/__styles({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
root: {
|
|
12
|
+
Bt984gj: "f122n59",
|
|
13
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
14
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
15
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
16
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
17
|
+
sj55zd: "f19n0e5",
|
|
18
|
+
i8kkvl: "f1ufnopg",
|
|
19
|
+
Bceei9c: "f1k6fduh",
|
|
20
|
+
mc9l5x: "f22iagw",
|
|
21
|
+
Bahqtrf: "fk6fouc",
|
|
22
|
+
Be2twd7: "fkhj508",
|
|
23
|
+
Bg96gwp: "f1i3iumi",
|
|
24
|
+
z8tnut: "fp2oml8",
|
|
25
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
26
|
+
Byoj8tv: "f1tdddsa",
|
|
27
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"],
|
|
28
|
+
qhf8xq: "f10pi13n",
|
|
29
|
+
Jwef8y: "f1knas48",
|
|
30
|
+
ecr2s2: "fb40n2d"
|
|
32
31
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
active: {
|
|
33
|
+
Bsft5z2: "f13zj6fq",
|
|
34
|
+
E3zdtr: "f1mdlcz9",
|
|
35
|
+
B80jsxd: "f1nwj1ja",
|
|
36
|
+
t2ki1e: "ffmd2fr",
|
|
37
|
+
Bm2nyyq: "f8rth92",
|
|
38
|
+
Barhvk9: ["flthirb", "ftkbnf5"],
|
|
39
|
+
Bw17bha: "f1lh990p",
|
|
40
|
+
vfts7: ["ftkbnf5", "flthirb"],
|
|
41
|
+
xrcqlc: "fc9v8v1",
|
|
42
|
+
Ihftqj: ["f1mwfetb", "f18mat8f"],
|
|
43
|
+
Bcgy8vk: "f1cb6c3",
|
|
44
|
+
Bhxzhr1: ["f18mat8f", "f1mwfetb"],
|
|
45
|
+
B3778ie: ["f1ibwz09", "f1kp91vd"],
|
|
46
|
+
d9w3h3: ["f1kp91vd", "f1ibwz09"],
|
|
47
|
+
Bl18szs: ["f1pix4dl", "f13nd1z4"],
|
|
48
|
+
B4j8arr: ["f13nd1z4", "f1pix4dl"],
|
|
49
|
+
B0n5ga8: "f1qw5sz7",
|
|
50
|
+
s924m2: ["f19va7ni", "f1a9v3mw"],
|
|
51
|
+
B1q35kw: "fkkziue",
|
|
52
|
+
Gp14am: ["f1a9v3mw", "f19va7ni"],
|
|
53
|
+
bn5sak: "f1a97anr",
|
|
54
|
+
By385i5: "f5226zp",
|
|
55
|
+
Eqx8gd: ["fa2bdqt", "fei6g0k"],
|
|
56
|
+
B1piin3: ["fei6g0k", "fa2bdqt"]
|
|
58
57
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
disabled: {
|
|
59
|
+
sj55zd: "f1s2aq7o",
|
|
60
|
+
Jwef8y: "f9ql6rf",
|
|
61
|
+
ecr2s2: "fgj9um3",
|
|
62
|
+
Bbusuzp: "f1dcs8yz"
|
|
64
63
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
selected: {},
|
|
65
|
+
checkIcon: {
|
|
66
|
+
Be2twd7: "fod5ikn",
|
|
67
|
+
Frg6f3: ["f18b9hdq", "fn6qj8t"],
|
|
68
|
+
t21cq0: ["f1xk557c", "f1h9en5y"],
|
|
69
|
+
Bcdw1i0: "fd7fpy0",
|
|
70
|
+
Bo70h7d: "fvc9v3g"
|
|
72
71
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
multiselectCheck: {
|
|
73
|
+
sj55zd: "f11d4kpn",
|
|
74
|
+
Be2twd7: "f1pp30po",
|
|
75
|
+
Bcdw1i0: "f1022m68"
|
|
77
76
|
},
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
selectedCheck: {
|
|
78
|
+
Bcdw1i0: "f1022m68"
|
|
80
79
|
},
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
selectedMultiselectCheck: {
|
|
81
|
+
sj55zd: "f1817uup"
|
|
83
82
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
checkDisabled: {
|
|
84
|
+
sj55zd: "f1s2aq7o",
|
|
85
|
+
Bbusuzp: "f1dcs8yz"
|
|
87
86
|
}
|
|
88
87
|
}, {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
d: [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".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);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1ufnopg{-webkit-column-gap:var(--spacingHorizontalXS);column-gap:var(--spacingHorizontalXS);}", ".f1k6fduh{cursor:pointer;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fp2oml8{padding-top:var(--spacingVerticalSNudge);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}", ".f10pi13n{position:relative;}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".f1nwj1ja::after{pointer-events:none;}", ".ffmd2fr::after{z-index:1;}", ".f8rth92::after{border-top-style:solid;}", ".flthirb::after{border-right-style:solid;}", ".ftkbnf5::after{border-left-style:solid;}", ".f1lh990p::after{border-bottom-style:solid;}", ".fc9v8v1::after{border-top-width:2px;}", ".f1mwfetb::after{border-right-width:2px;}", ".f18mat8f::after{border-left-width:2px;}", ".f1cb6c3::after{border-bottom-width:2px;}", ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1pix4dl::after{border-top-right-radius:var(--borderRadiusMedium);}", ".f13nd1z4::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1qw5sz7::after{border-top-color:var(--colorStrokeFocus2);}", ".f19va7ni::after{border-right-color:var(--colorStrokeFocus2);}", ".f1a9v3mw::after{border-left-color:var(--colorStrokeFocus2);}", ".fkkziue::after{border-bottom-color:var(--colorStrokeFocus2);}", ".f1a97anr::after{top:-2px;}", ".f5226zp::after{bottom:-2px;}", ".fa2bdqt::after{left:-2px;}", ".fei6g0k::after{right:-2px;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".f18b9hdq{margin-left:calc(var(--spacingHorizontalXXS) * -1);}", ".fn6qj8t{margin-right:calc(var(--spacingHorizontalXXS) * -1);}", ".f1xk557c{margin-right:var(--spacingHorizontalXXS);}", ".f1h9en5y{margin-left:var(--spacingHorizontalXXS);}", ".fd7fpy0{visibility:hidden;}", ".fvc9v3g svg{display:block;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f1pp30po{font-size:var(--fontSizeBase500);}", ".f1022m68{visibility:visible;}", ".f1817uup{color:var(--colorBrandBackground);}"],
|
|
89
|
+
h: [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}"],
|
|
90
|
+
a: [".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".fgj9um3:active{background-color:var(--colorTransparentBackground);}"],
|
|
91
|
+
m: [["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
|
|
92
|
+
m: "(forced-colors: active)"
|
|
94
93
|
}], ["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
|
|
95
|
-
|
|
94
|
+
m: "(forced-colors: active)"
|
|
96
95
|
}]]
|
|
97
96
|
});
|
|
98
97
|
/**
|
|
99
98
|
* Apply styling to the Option slots based on the state
|
|
100
99
|
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
100
|
export const useOptionStyles_unstable = state => {
|
|
104
101
|
const {
|
|
105
102
|
active,
|
|
@@ -110,11 +107,9 @@ export const useOptionStyles_unstable = state => {
|
|
|
110
107
|
} = state;
|
|
111
108
|
const styles = useStyles();
|
|
112
109
|
state.root.className = mergeClasses(optionClassNames.root, styles.root, active && focusVisible && styles.active, disabled && styles.disabled, selected && styles.selected, state.root.className);
|
|
113
|
-
|
|
114
110
|
if (state.checkIcon) {
|
|
115
111
|
state.checkIcon.className = mergeClasses(optionClassNames.checkIcon, styles.checkIcon, state.checkIcon.className, multiselect && styles.multiselectCheck, selected && styles.selectedCheck, selected && multiselect && styles.selectedMultiselectCheck, disabled && styles.checkDisabled);
|
|
116
112
|
}
|
|
117
|
-
|
|
118
113
|
return state;
|
|
119
114
|
};
|
|
120
115
|
//# sourceMappingURL=useOptionStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAE9C,mBAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,OAAO,MAAMC,gBAAgB,GAAgC;EAC3DC,IAAI,EAAE,YAAY;EAClBC,SAAS,EAAE;CACZ;AAED;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;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;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;EAAA;IAAA;EAAA;AAAA,EAgGhB;AAEF;;;AAGA,OAAO,MAAMC,wBAAwB,GAAIC,KAAkB,IAAiB;EAC1E,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAEC,YAAY;IAAEC,WAAW;IAAEC;EAAQ,CAAE,GAAGL,KAAK;EACvE,MAAMM,MAAM,GAAGR,SAAS,EAAE;EAC1BE,KAAK,CAACJ,IAAI,CAACW,SAAS,GAAGd,YAAY,CACjCE,gBAAgB,CAACC,IAAI,EACrBU,MAAM,CAACV,IAAI,EACXK,MAAM,IAAIE,YAAY,IAAIG,MAAM,CAACL,MAAM,EACvCC,QAAQ,IAAII,MAAM,CAACJ,QAAQ,EAC3BG,QAAQ,IAAIC,MAAM,CAACD,QAAQ,EAC3BL,KAAK,CAACJ,IAAI,CAACW,SAAS,CACrB;EAED,IAAIP,KAAK,CAACH,SAAS,EAAE;IACnBG,KAAK,CAACH,SAAS,CAACU,SAAS,GAAGd,YAAY,CACtCE,gBAAgB,CAACE,SAAS,EAC1BS,MAAM,CAACT,SAAS,EAChBG,KAAK,CAACH,SAAS,CAACU,SAAS,EACzBH,WAAW,IAAIE,MAAM,CAACE,gBAAgB,EACtCH,QAAQ,IAAIC,MAAM,CAACG,aAAa,EAChCJ,QAAQ,IAAID,WAAW,IAAIE,MAAM,CAACI,wBAAwB,EAC1DR,QAAQ,IAAII,MAAM,CAACK,aAAa,CACjC;;EAGH,OAAOX,KAAK;AACd,CAAC","names":["tokens","mergeClasses","shorthands","optionClassNames","root","checkIcon","useStyles","useOptionStyles_unstable","state","active","disabled","focusVisible","multiselect","selected","styles","className","multiselectCheck","selectedCheck","selectedMultiselectCheck","checkDisabled"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/components/Option/useOptionStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { OptionSlots, OptionState } from './Option.types';\n\nexport const optionClassNames: SlotClassNames<OptionSlots> = {\n root: 'fui-Option',\n checkIcon: 'fui-Option__checkIcon',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n alignItems: 'center',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n color: tokens.colorNeutralForeground1,\n columnGap: tokens.spacingHorizontalXS,\n cursor: 'pointer',\n display: 'flex',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalS),\n position: 'relative',\n\n '&:hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n },\n\n '&:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n },\n },\n\n active: {\n // taken from @fluentui/react-tabster\n // cannot use createFocusIndicatorStyle() directly, since we aren't using the :focus selector\n '::after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth('2px'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ...shorthands.borderColor(tokens.colorStrokeFocus2),\n\n top: '-2px',\n bottom: '-2px',\n left: '-2px',\n right: '-2px',\n },\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n },\n\n '&:active': {\n backgroundColor: tokens.colorTransparentBackground,\n },\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n\n selected: {},\n\n checkIcon: {\n fontSize: tokens.fontSizeBase400,\n // Shift icon(s) to the left to give text content extra spacing without needing an extra node\n // This is done instead of gap since the extra space only exists between icon > content, not icon > icon\n marginLeft: `calc(${tokens.spacingHorizontalXXS} * -1)`,\n marginRight: tokens.spacingHorizontalXXS,\n visibility: 'hidden',\n\n '& svg': {\n display: 'block',\n },\n },\n\n multiselectCheck: {\n color: tokens.colorNeutralForeground3,\n fontSize: tokens.fontSizeBase500,\n visibility: 'visible',\n },\n\n selectedCheck: {\n visibility: 'visible',\n },\n\n selectedMultiselectCheck: {\n color: tokens.colorBrandBackground,\n },\n\n checkDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\n/**\n * Apply styling to the Option slots based on the state\n */\nexport const useOptionStyles_unstable = (state: OptionState): OptionState => {\n const { active, disabled, focusVisible, multiselect, selected } = state;\n const styles = useStyles();\n state.root.className = mergeClasses(\n optionClassNames.root,\n styles.root,\n active && focusVisible && styles.active,\n disabled && styles.disabled,\n selected && styles.selected,\n state.root.className,\n );\n\n if (state.checkIcon) {\n state.checkIcon.className = mergeClasses(\n optionClassNames.checkIcon,\n styles.checkIcon,\n state.checkIcon.className,\n multiselect && styles.multiselectCheck,\n selected && styles.selectedCheck,\n selected && multiselect && styles.selectedMultiselectCheck,\n disabled && styles.checkDisabled,\n );\n }\n\n return state;\n};\n"]}
|
|
@@ -5,7 +5,6 @@ import { useOptionGroupStyles_unstable } from './useOptionGroupStyles';
|
|
|
5
5
|
/**
|
|
6
6
|
* OptionGroup component: allows grouping of Option components within a Combobox
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
8
|
export const OptionGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
9
|
const state = useOptionGroup_unstable(props, ref);
|
|
11
10
|
useOptionGroupStyles_unstable(state);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,SAASC,0BAA0B,QAAQ,qBAAqB;AAChE,SAASC,6BAA6B,QAAQ,wBAAwB;AAItE;;;AAGA,OAAO,MAAMC,WAAW,gBAA0CJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGP,uBAAuB,CAACK,KAAK,EAAEC,GAAG,CAAC;EAEjDJ,6BAA6B,CAACK,KAAK,CAAC;EACpC,OAAON,0BAA0B,CAACM,KAAK,CAAC;AAC1C,CAAC,CAAC;AAEFJ,WAAW,CAACK,WAAW,GAAG,aAAa","names":["React","useOptionGroup_unstable","renderOptionGroup_unstable","useOptionGroupStyles_unstable","OptionGroup","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/components/OptionGroup/OptionGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useOptionGroup_unstable } from './useOptionGroup';\nimport { renderOptionGroup_unstable } from './renderOptionGroup';\nimport { useOptionGroupStyles_unstable } from './useOptionGroupStyles';\nimport type { OptionGroupProps } from './OptionGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * OptionGroup component: allows grouping of Option components within a Combobox\n */\nexport const OptionGroup: ForwardRefComponent<OptionGroupProps> = React.forwardRef((props, ref) => {\n const state = useOptionGroup_unstable(props, ref);\n\n useOptionGroupStyles_unstable(state);\n return renderOptionGroup_unstable(state);\n});\n\nOptionGroup.displayName = 'OptionGroup';\n"]}
|
|
@@ -3,14 +3,15 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of OptionGroup
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
export const renderOptionGroup_unstable = state => {
|
|
8
7
|
const {
|
|
9
8
|
slots,
|
|
10
9
|
slotProps
|
|
11
10
|
} = getSlots(state);
|
|
12
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
|
13
|
-
|
|
11
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
|
12
|
+
...slotProps.root
|
|
13
|
+
}, slots.label && /*#__PURE__*/React.createElement(slots.label, {
|
|
14
|
+
...slotProps.label
|
|
14
15
|
}, slotProps.label.children), slotProps.root.children);
|
|
15
16
|
};
|
|
16
17
|
//# sourceMappingURL=renderOptionGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAmBE,KAAK,CAAC;EAE9D,oBACEH,oBAACI,KAAK,CAACE,IAAI;IAAA,GAAKD,SAAS,CAACC;EAAI,GAC3BF,KAAK,CAACG,KAAK,iBAAIP,oBAACI,KAAK,CAACG,KAAK;IAAA,GAAKF,SAAS,CAACE;EAAK,GAAGF,SAAS,CAACE,KAAK,CAACC,QAAQ,CAAe,EACzFH,SAAS,CAACC,IAAI,CAACE,QAAQ,CACb;AAEjB,CAAC","names":["React","getSlots","renderOptionGroup_unstable","state","slots","slotProps","root","label","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/components/OptionGroup/renderOptionGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { OptionGroupState, OptionGroupSlots } from './OptionGroup.types';\n\n/**\n * Render the final JSX of OptionGroup\n */\nexport const renderOptionGroup_unstable = (state: OptionGroupState) => {\n const { slots, slotProps } = getSlots<OptionGroupSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.label && <slots.label {...slotProps.label}>{slotProps.label.children}</slots.label>}\n {slotProps.root.children}\n </slots.root>\n );\n};\n"]}
|
|
@@ -8,7 +8,6 @@ import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-
|
|
|
8
8
|
* @param props - props from this instance of OptionGroup
|
|
9
9
|
* @param ref - reference to root HTMLElement of OptionGroup
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
export const useOptionGroup_unstable = (props, ref) => {
|
|
13
12
|
const labelId = useId('group-label');
|
|
14
13
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AACA,SAASA,qBAAqB,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ,2BAA2B;AAG1F;;;;;;;;;AASA,OAAO,MAAMC,uBAAuB,GAAG,CAACC,KAAuB,EAAEC,GAA2B,KAAsB;EAChH,MAAMC,OAAO,GAAGJ,KAAK,CAAC,aAAa,CAAC;EACpC,MAAM;IAAEK;EAAK,CAAE,GAAGH,KAAK;EAEvB,OAAO;IACLI,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXF,KAAK,EAAE;KACR;IACDE,IAAI,EAAET,qBAAqB,CAAC,KAAK,EAAE;MACjCK,GAAG;MACHK,IAAI,EAAE,OAAO;MACb,iBAAiB,EAAEH,KAAK,GAAGD,OAAO,GAAGK,SAAS;MAC9C,GAAGP;KACJ,CAAC;IACFG,KAAK,EAAEN,gBAAgB,CAACM,KAAK,EAAE;MAC7BK,YAAY,EAAE;QACZC,EAAE,EAAEP,OAAO;QACXI,IAAI,EAAE;;KAET;GACF;AACH,CAAC","names":["getNativeElementProps","resolveShorthand","useId","useOptionGroup_unstable","props","ref","labelId","label","components","root","role","undefined","defaultProps","id"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/components/OptionGroup/useOptionGroup.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { OptionGroupProps, OptionGroupState } from './OptionGroup.types';\n\n/**\n * Create the state required to render OptionGroup.\n *\n * The returned state can be modified with hooks such as useOptionGroupStyles_unstable,\n * before being passed to renderOptionGroup_unstable.\n *\n * @param props - props from this instance of OptionGroup\n * @param ref - reference to root HTMLElement of OptionGroup\n */\nexport const useOptionGroup_unstable = (props: OptionGroupProps, ref: React.Ref<HTMLElement>): OptionGroupState => {\n const labelId = useId('group-label');\n const { label } = props;\n\n return {\n components: {\n root: 'div',\n label: 'span',\n },\n root: getNativeElementProps('div', {\n ref,\n role: 'group',\n 'aria-labelledby': label ? labelId : undefined,\n ...props,\n }),\n label: resolveShorthand(label, {\n defaultProps: {\n id: labelId,\n role: 'presentation',\n },\n }),\n };\n};\n"]}
|
|
@@ -7,54 +7,49 @@ export const optionGroupClassNames = {
|
|
|
7
7
|
/**
|
|
8
8
|
* Styles for the root slot
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
const useStyles = /*#__PURE__*/__styles({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
root: {
|
|
12
|
+
mc9l5x: "f22iagw",
|
|
13
|
+
Beiy3e4: "f1vx9l62",
|
|
14
|
+
Belr9w4: "fiut8dr",
|
|
15
|
+
B8lkq7l: "f1xxzjds",
|
|
16
|
+
Gwp8xu: "fu19d3i",
|
|
17
|
+
H93o2g: "flylvvz",
|
|
18
|
+
eii1in: "f1ug5m11",
|
|
19
|
+
om0q45: "f5642y",
|
|
20
|
+
Hl9o3s: "ffdf81h",
|
|
21
|
+
Bi9x0x4: "flgyru6",
|
|
22
|
+
B0i58d9: ["f1fjgumo", "f1sgo0dv"],
|
|
23
|
+
sl1c2c: "fwsdxdw",
|
|
24
|
+
z4hxbw: ["f1sgo0dv", "f1fjgumo"]
|
|
26
25
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
label: {
|
|
27
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
28
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
29
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
30
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
31
|
+
sj55zd: "f11d4kpn",
|
|
32
|
+
mc9l5x: "ftgm304",
|
|
33
|
+
Be2twd7: "fy9rknc",
|
|
34
|
+
Bhrd7zp: "fl43uef",
|
|
35
|
+
Bg96gwp: "fwrc4pm",
|
|
36
|
+
z8tnut: "f17mpqex",
|
|
37
|
+
z189sj: ["fdw0yi8", "fk8j09s"],
|
|
38
|
+
Byoj8tv: "fdvome7",
|
|
39
|
+
uwmqm3: ["fk8j09s", "fdw0yi8"]
|
|
41
40
|
}
|
|
42
41
|
}, {
|
|
43
|
-
|
|
42
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".fiut8dr{row-gap:var(--spacingHorizontalXXS);}", ".f1xxzjds:not(:last-child)::after{content:\"\";}", ".fu19d3i:not(:last-child)::after{border-bottom-width:var(--strokeWidthThin);}", ".flylvvz:not(:last-child)::after{border-bottom-style:solid;}", ".f1ug5m11:not(:last-child)::after{border-bottom-color:var(--colorNeutralStroke2);}", ".f5642y:not(:last-child)::after{display:block;}", ".ffdf81h:not(:last-child)::after{padding-bottom:var(--spacingHorizontalXS);}", ".flgyru6:not(:last-child)::after{margin-top:0;}", ".f1fjgumo:not(:last-child)::after{margin-right:calc(var(--spacingHorizontalXS) * -1);}", ".f1sgo0dv:not(:last-child)::after{margin-left:calc(var(--spacingHorizontalXS) * -1);}", ".fwsdxdw:not(:last-child)::after{margin-bottom:var(--spacingVerticalXS);}", ".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);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".ftgm304{display:block;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}"]
|
|
44
43
|
});
|
|
45
44
|
/**
|
|
46
45
|
* Apply styling to the OptionGroup slots based on the state
|
|
47
46
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
47
|
export const useOptionGroupStyles_unstable = state => {
|
|
51
48
|
const styles = useStyles();
|
|
52
49
|
state.root.className = mergeClasses(optionGroupClassNames.root, styles.root, state.root.className);
|
|
53
|
-
|
|
54
50
|
if (state.label) {
|
|
55
51
|
state.label.className = mergeClasses(optionGroupClassNames.label, styles.label, state.label.className);
|
|
56
52
|
}
|
|
57
|
-
|
|
58
53
|
return state;
|
|
59
54
|
};
|
|
60
55
|
//# sourceMappingURL=useOptionGroupStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAE9C,mBAAqBC,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,OAAO,MAAMC,qBAAqB,GAAqC;EACrEC,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE;CACR;AAED;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAwBhB;AAEF;;;AAGA,OAAO,MAAMC,6BAA6B,GAAIC,KAAuB,IAAsB;EACzF,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1BE,KAAK,CAACJ,IAAI,CAACM,SAAS,GAAGT,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAEK,MAAM,CAACL,IAAI,EAAEI,KAAK,CAACJ,IAAI,CAACM,SAAS,CAAC;EAElG,IAAIF,KAAK,CAACH,KAAK,EAAE;IACfG,KAAK,CAACH,KAAK,CAACK,SAAS,GAAGT,YAAY,CAACE,qBAAqB,CAACE,KAAK,EAAEI,MAAM,CAACJ,KAAK,EAAEG,KAAK,CAACH,KAAK,CAACK,SAAS,CAAC;;EAGxG,OAAOF,KAAK;AACd,CAAC","names":["tokens","mergeClasses","shorthands","optionGroupClassNames","root","label","useStyles","useOptionGroupStyles_unstable","state","styles","className"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/components/OptionGroup/useOptionGroupStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { OptionGroupSlots, OptionGroupState } from './OptionGroup.types';\n\nexport const optionGroupClassNames: SlotClassNames<OptionGroupSlots> = {\n root: 'fui-OptionGroup',\n label: 'fui-OptionGroup__label',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n rowGap: tokens.spacingHorizontalXXS,\n\n '&:not(:last-child)::after': {\n content: '\"\"',\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n display: 'block',\n paddingBottom: tokens.spacingHorizontalXS,\n ...shorthands.margin(0, `calc(${tokens.spacingHorizontalXS} * -1)`, tokens.spacingVerticalXS),\n },\n },\n\n label: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase200,\n ...shorthands.padding(tokens.spacingHorizontalS, tokens.spacingHorizontalSNudge),\n },\n});\n\n/**\n * Apply styling to the OptionGroup slots based on the state\n */\nexport const useOptionGroupStyles_unstable = (state: OptionGroupState): OptionGroupState => {\n const styles = useStyles();\n state.root.className = mergeClasses(optionGroupClassNames.root, styles.root, state.root.className);\n\n if (state.label) {\n state.label.className = mergeClasses(optionGroupClassNames.label, styles.label, state.label.className);\n }\n\n return state;\n};\n"]}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { createContext } from '@fluentui/react-context-selector';
|
|
2
|
-
|
|
1
|
+
import { createContext } from '@fluentui/react-context-selector';
|
|
2
|
+
// eslint-disable-next-line @fluentui/no-context-default-value
|
|
3
3
|
export const ComboboxContext = /*#__PURE__*/createContext({
|
|
4
4
|
activeOption: undefined,
|
|
5
5
|
appearance: 'outline',
|
|
6
6
|
focusVisible: false,
|
|
7
7
|
open: false,
|
|
8
|
-
|
|
9
8
|
registerOption() {
|
|
10
9
|
return () => undefined;
|
|
11
10
|
},
|
|
12
|
-
|
|
13
11
|
selectedOptions: [],
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
selectOption() {
|
|
13
|
+
// noop
|
|
16
14
|
},
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
setActiveOption() {
|
|
16
|
+
// noop
|
|
19
17
|
},
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
setOpen() {
|
|
19
|
+
// noop
|
|
22
20
|
},
|
|
23
|
-
|
|
24
21
|
size: 'medium'
|
|
25
22
|
});
|
|
26
23
|
export const ComboboxProvider = ComboboxContext.Provider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,aAAa,QAAQ,kCAAkC;AAoBhE;AACA,OAAO,MAAMC,eAAe,gBAAGD,aAAa,CAAuB;EACjEE,YAAY,EAAEC,SAAS;EACvBC,UAAU,EAAE,SAAS;EACrBC,YAAY,EAAE,KAAK;EACnBC,IAAI,EAAE,KAAK;EACXC,cAAc;IACZ,OAAO,MAAMJ,SAAS;EACxB,CAAC;EACDK,eAAe,EAAE,EAAE;EACnBC,YAAY;IACV;EAAA,CACD;EACDC,eAAe;IACb;EAAA,CACD;EACDC,OAAO;IACL;EAAA,CACD;EACDC,IAAI,EAAE;CACP,CAAC;AAEF,OAAO,MAAMC,gBAAgB,GAAGZ,eAAe,CAACa,QAAQ","names":["createContext","ComboboxContext","activeOption","undefined","appearance","focusVisible","open","registerOption","selectedOptions","selectOption","setActiveOption","setOpen","size","ComboboxProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/contexts/ComboboxContext.ts"],"sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport { ComboboxState } from '../components/Combobox/Combobox.types';\n\n/**\n * Context shared with Combobox, Listbox, & Options\n */\nexport type ComboboxContextValue = Pick<\n ComboboxState,\n | 'activeOption'\n | 'appearance'\n | 'focusVisible'\n | 'open'\n | 'registerOption'\n | 'selectedOptions'\n | 'selectOption'\n | 'setActiveOption'\n | 'setOpen'\n | 'size'\n>;\n\n// eslint-disable-next-line @fluentui/no-context-default-value\nexport const ComboboxContext = createContext<ComboboxContextValue>({\n activeOption: undefined,\n appearance: 'outline',\n focusVisible: false,\n open: false,\n registerOption() {\n return () => undefined;\n },\n selectedOptions: [],\n selectOption() {\n // noop\n },\n setActiveOption() {\n // noop\n },\n setOpen() {\n // noop\n },\n size: 'medium',\n});\n\nexport const ComboboxProvider = ComboboxContext.Provider;\n"]}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { createContext } from '@fluentui/react-context-selector';
|
|
2
|
-
|
|
1
|
+
import { createContext } from '@fluentui/react-context-selector';
|
|
2
|
+
// eslint-disable-next-line @fluentui/no-context-default-value
|
|
3
3
|
export const ListboxContext = /*#__PURE__*/createContext({
|
|
4
4
|
activeOption: undefined,
|
|
5
5
|
focusVisible: false,
|
|
6
6
|
multiselect: false,
|
|
7
|
-
|
|
8
7
|
registerOption() {
|
|
9
8
|
return () => undefined;
|
|
10
9
|
},
|
|
11
|
-
|
|
12
10
|
selectedOptions: [],
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
selectOption() {
|
|
12
|
+
// noop
|
|
15
13
|
},
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
setActiveOption() {
|
|
15
|
+
// noop
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
});
|
|
21
18
|
export const ListboxProvider = ListboxContext.Provider;
|
|
22
19
|
//# sourceMappingURL=ListboxContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,aAAa,QAAQ,kCAAkC;AAiBhE;AACA,OAAO,MAAMC,cAAc,gBAAGD,aAAa,CAAsB;EAC/DE,YAAY,EAAEC,SAAS;EACvBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,KAAK;EAClBC,cAAc;IACZ,OAAO,MAAMH,SAAS;EACxB,CAAC;EACDI,eAAe,EAAE,EAAE;EACnBC,YAAY;IACV;EAAA,CACD;EACDC,eAAe;IACb;EAAA;CAEH,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGT,cAAc,CAACU,QAAQ","names":["createContext","ListboxContext","activeOption","undefined","focusVisible","multiselect","registerOption","selectedOptions","selectOption","setActiveOption","ListboxProvider","Provider"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/contexts/ListboxContext.ts"],"sourcesContent":["import { createContext } from '@fluentui/react-context-selector';\nimport { ListboxState } from '../components/Listbox/Listbox.types';\n\n/**\n * Context shared with all Listbox Options\n */\nexport type ListboxContextValue = Pick<\n ListboxState,\n | 'activeOption'\n | 'focusVisible'\n | 'multiselect'\n | 'registerOption'\n | 'selectedOptions'\n | 'selectOption'\n | 'setActiveOption'\n>;\n\n// eslint-disable-next-line @fluentui/no-context-default-value\nexport const ListboxContext = createContext<ListboxContextValue>({\n activeOption: undefined,\n focusVisible: false,\n multiselect: false,\n registerOption() {\n return () => undefined;\n },\n selectedOptions: [],\n selectOption() {\n // noop\n },\n setActiveOption() {\n // noop\n },\n});\n\nexport const ListboxProvider = ListboxContext.Provider;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAEA,OAAM,SAAUA,wBAAwB,CAACC,KAAwB;EAC/D,MAAM;IACJC,YAAY;IACZC,UAAU;IACVC,YAAY;IACZC,IAAI;IACJC,cAAc;IACdC,eAAe;IACfC,YAAY;IACZC,eAAe;IACfC,OAAO;IACPC;EAAI,CACL,GAAGV,KAAK;EAET,MAAMW,QAAQ,GAAG;IACfV,YAAY;IACZC,UAAU;IACVC,YAAY;IACZC,IAAI;IACJC,cAAc;IACdC,eAAe;IACfC,YAAY;IACZC,eAAe;IACfC,OAAO;IACPC;GACD;EAED,OAAO;IAAEC;EAAQ,CAAE;AACrB","names":["useComboboxContextValues","state","activeOption","appearance","focusVisible","open","registerOption","selectedOptions","selectOption","setActiveOption","setOpen","size","combobox"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/contexts/useComboboxContextValues.ts"],"sourcesContent":["import { ComboboxBaseContextValues, ComboboxBaseState } from '../utils/ComboboxBase.types';\n\nexport function useComboboxContextValues(state: ComboboxBaseState): ComboboxBaseContextValues {\n const {\n activeOption,\n appearance,\n focusVisible,\n open,\n registerOption,\n selectedOptions,\n selectOption,\n setActiveOption,\n setOpen,\n size,\n } = state;\n\n const combobox = {\n activeOption,\n appearance,\n focusVisible,\n open,\n registerOption,\n selectedOptions,\n selectOption,\n setActiveOption,\n setOpen,\n size,\n };\n\n return { combobox };\n}\n"]}
|
|
@@ -10,8 +10,8 @@ export function useListboxContextValues(state) {
|
|
|
10
10
|
selectedOptions,
|
|
11
11
|
selectOption,
|
|
12
12
|
setActiveOption
|
|
13
|
-
} = state;
|
|
14
|
-
|
|
13
|
+
} = state;
|
|
14
|
+
// get register/unregister functions from parent combobox context
|
|
15
15
|
const comboboxRegisterOption = useContextSelector(ComboboxContext, ctx => ctx.registerOption);
|
|
16
16
|
const registerOptionValue = hasComboboxContext ? comboboxRegisterOption : registerOption;
|
|
17
17
|
const listbox = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,kBAAkB,EAAEC,mBAAmB,QAAQ,kCAAkC;AAE1F,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,OAAM,SAAUC,uBAAuB,CAACC,KAAmB;EACzD,MAAMC,kBAAkB,GAAGJ,mBAAmB,CAACC,eAAe,CAAC;EAC/D,MAAM;IACJI,YAAY;IACZC,YAAY;IACZC,WAAW;IACXC,cAAc;IACdC,eAAe;IACfC,YAAY;IACZC;EAAe,CAChB,GAAGR,KAAK;EAET;EACA,MAAMS,sBAAsB,GAAGb,kBAAkB,CAACE,eAAe,EAAEY,GAAG,IAAIA,GAAG,CAACL,cAAc,CAAC;EAE7F,MAAMM,mBAAmB,GAAGV,kBAAkB,GAAGQ,sBAAsB,GAAGJ,cAAc;EAExF,MAAMO,OAAO,GAAG;IACdV,YAAY;IACZC,YAAY;IACZC,WAAW;IACXC,cAAc,EAAEM,mBAAmB;IACnCL,eAAe;IACfC,YAAY;IACZC;GACD;EAED,OAAO;IAAEI;EAAO,CAAE;AACpB","names":["useContextSelector","useHasParentContext","ComboboxContext","useListboxContextValues","state","hasComboboxContext","activeOption","focusVisible","multiselect","registerOption","selectedOptions","selectOption","setActiveOption","comboboxRegisterOption","ctx","registerOptionValue","listbox"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/contexts/useListboxContextValues.ts"],"sourcesContent":["import { useContextSelector, useHasParentContext } from '@fluentui/react-context-selector';\nimport { ListboxContextValues, ListboxState } from '../components/Listbox/Listbox.types';\nimport { ComboboxContext } from './ComboboxContext';\n\nexport function useListboxContextValues(state: ListboxState): ListboxContextValues {\n const hasComboboxContext = useHasParentContext(ComboboxContext);\n const {\n activeOption,\n focusVisible,\n multiselect,\n registerOption,\n selectedOptions,\n selectOption,\n setActiveOption,\n } = state;\n\n // get register/unregister functions from parent combobox context\n const comboboxRegisterOption = useContextSelector(ComboboxContext, ctx => ctx.registerOption);\n\n const registerOptionValue = hasComboboxContext ? comboboxRegisterOption : registerOption;\n\n const listbox = {\n activeOption,\n focusVisible,\n multiselect,\n registerOption: registerOptionValue,\n selectedOptions,\n selectOption,\n setActiveOption,\n };\n\n return { listbox };\n}\n"]}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAE7D,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SAASC,uBAAuB,QAAQ,oCAAoC;AAC5E,SACEC,OAAO,EACPC,iBAAiB,EACjBC,sBAAsB,EACtBC,yBAAyB,EACzBC,mBAAmB,QACd,WAAW;AAElB,SACEC,MAAM,EACNC,gBAAgB,EAChBC,qBAAqB,EACrBC,wBAAwB,EACxBC,kBAAkB,QACb,UAAU;AAEjB,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,oBAAoB,QACf,YAAY;AASnB,SACEC,QAAQ,EACRC,kBAAkB,EAClBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,oBAAoB,QACf,YAAY;AASnB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,eAAe;AAGtB,SAASC,aAAa,IAAIC,sBAAsB,EAAEC,uBAAuB,QAAQ,iBAAiB","names":["ComboboxProvider","ListboxProvider","useComboboxContextValues","useListboxContextValues","Listbox","listboxClassNames","renderListbox_unstable","useListboxStyles_unstable","useListbox_unstable","Option","optionClassNames","renderOption_unstable","useOptionStyles_unstable","useOption_unstable","Combobox","comboboxClassNames","renderCombobox_unstable","useComboboxStyles_unstable","useCombobox_unstable","Dropdown","dropdownClassNames","renderDropdown_unstable","useDropdownStyles_unstable","useDropdown_unstable","OptionGroup","optionGroupClassNames","renderOptionGroup_unstable","useOptionGroupStyles_unstable","useOptionGroup_unstable","ComboboxField","ComboboxField_unstable","comboboxFieldClassNames"],"sourceRoot":"../src/","sources":["packages/react-components/react-combobox/src/index.ts"],"sourcesContent":["export { ComboboxProvider } from './contexts/ComboboxContext';\nexport type { ComboboxContextValue } from './contexts/ComboboxContext';\nexport { ListboxProvider } from './contexts/ListboxContext';\nexport type { ListboxContextValue } from './contexts/ListboxContext';\nexport { useComboboxContextValues } from './contexts/useComboboxContextValues';\nexport { useListboxContextValues } from './contexts/useListboxContextValues';\nexport {\n Listbox,\n listboxClassNames,\n renderListbox_unstable,\n useListboxStyles_unstable,\n useListbox_unstable,\n} from './Listbox';\nexport type { ListboxContextValues, ListboxProps, ListboxSlots, ListboxState } from './Listbox';\nexport {\n Option,\n optionClassNames,\n renderOption_unstable,\n useOptionStyles_unstable,\n useOption_unstable,\n} from './Option';\nexport type { OptionProps, OptionSlots, OptionState } from './Option';\nexport {\n Combobox,\n comboboxClassNames,\n renderCombobox_unstable,\n useComboboxStyles_unstable,\n useCombobox_unstable,\n} from './Combobox';\nexport type {\n ComboboxContextValues,\n ComboboxOpenChangeData,\n ComboboxOpenEvents,\n ComboboxProps,\n ComboboxSlots,\n ComboboxState,\n} from './Combobox';\nexport {\n Dropdown,\n dropdownClassNames,\n renderDropdown_unstable,\n useDropdownStyles_unstable,\n useDropdown_unstable,\n} from './Dropdown';\nexport type {\n DropdownContextValues,\n DropdownOpenChangeData,\n DropdownOpenEvents,\n DropdownProps,\n DropdownSlots,\n DropdownState,\n} from './Dropdown';\nexport {\n OptionGroup,\n optionGroupClassNames,\n renderOptionGroup_unstable,\n useOptionGroupStyles_unstable,\n useOptionGroup_unstable,\n} from './OptionGroup';\nexport type { OptionGroupProps, OptionGroupSlots, OptionGroupState } from './OptionGroup';\n\nexport { ComboboxField as ComboboxField_unstable, comboboxFieldClassNames } from './ComboboxField';\nexport type { ComboboxFieldProps as ComboboxFieldProps_unstable } from './ComboboxField';\n"]}
|