@fluentui/react-button 9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -12
- package/README.md +24 -2
- package/lib/components/Button/Button.module.css +400 -0
- package/lib/components/Button/useButtonStyles.styles.css.js +14 -0
- package/lib/components/Button/useButtonStyles.styles.css.js.map +1 -0
- package/lib/components/Button/useButtonStyles.styles.raw.css.js +14 -0
- package/lib/components/Button/useButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/CompoundButton/CompoundButton.module.css +137 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js +27 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js +27 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.module.css +72 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js +26 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js.map +1 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js +26 -0
- package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.module.css +70 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js +17 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js +17 -0
- package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.module.css +242 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js +18 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js +18 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js.map +1 -0
- package/lib-commonjs/components/Button/Button.module.css +400 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs +33 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs +33 -0
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.module.css +137 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs +46 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs +46 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.module.css +72 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs +45 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs +45 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.module.css +70 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs +36 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs +36 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.module.css +242 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs +37 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs +37 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs.map +1 -0
- package/package.json +13 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-button
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Nov 2026 20:37:09 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.75.
|
|
7
|
+
## [9.75.2-experimental.css-modules.20261113-ba13c87438.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.11.3..@fluentui/react-button_v9.75.
|
|
9
|
+
Fri, 13 Nov 2026 20:37:09 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.11.3..@fluentui/react-button_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
|
-
- Release 9.75.
|
|
15
|
-
- Bump @fluentui/keyboard-keys to v9.75.
|
|
16
|
-
- Bump @fluentui/react-aria to v9.75.
|
|
17
|
-
- Bump @fluentui/react-jsx-runtime to v9.75.
|
|
18
|
-
- Bump @fluentui/react-shared-contexts to v9.75.
|
|
19
|
-
- Bump @fluentui/react-tabster to v9.75.
|
|
20
|
-
- Bump @fluentui/react-theme to v9.75.
|
|
21
|
-
- Bump @fluentui/react-utilities to v9.75.
|
|
14
|
+
- Release 9.75.2-experimental.css-modules.20261113-ba13c87438 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/keyboard-keys to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-aria to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-shared-contexts to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-theme to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
- Bump @fluentui/react-utilities to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
22
|
|
|
23
23
|
## [9.11.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.11.3)
|
|
24
24
|
|
package/README.md
CHANGED
|
@@ -89,10 +89,32 @@ Alternatively, run Storybook locally with:
|
|
|
89
89
|
1. `yarn start`
|
|
90
90
|
2. Select `react-button` from the list.
|
|
91
91
|
|
|
92
|
+
### Experimental CSS Modules
|
|
93
|
+
|
|
94
|
+
Button, CompoundButton, MenuButton, SplitButton, and ToggleButton have
|
|
95
|
+
`use<Component>Styles.styles.css.ts` alternatives beside their original Griffel
|
|
96
|
+
style hooks. The CSS Module hooks compose Button's shared styles and apply
|
|
97
|
+
independent state classes; nested CSS handles state combinations.
|
|
98
|
+
|
|
99
|
+
The prototype's component imports select the CSS Module hooks for local testing.
|
|
100
|
+
The original Griffel hooks remain available for comparison. CSS Modules rules are
|
|
101
|
+
unlayered, like Griffel's, and use FluentProvider's theme custom properties. They require
|
|
102
|
+
CSS Modules and native CSS nesting support, or an equivalent bundler transform.
|
|
103
|
+
Use headless/CSS-styled icons with their defaults in the low-priority `fluent` layer:
|
|
104
|
+
|
|
105
|
+
```css
|
|
106
|
+
@import url('@fluentui/react-icons/headless/styles.css') layer(fluent);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The Nx build copies every `*.module.css` file next to its hook in both `lib` and
|
|
110
|
+
`lib-commonjs`. Applications must process these CSS imports and retain CSS side
|
|
111
|
+
effects. Browser-based parity checks are required when changing the cascade;
|
|
112
|
+
JSDOM hook tests only validate the state-to-class mapping.
|
|
113
|
+
|
|
92
114
|
### Specification
|
|
93
115
|
|
|
94
|
-
See [SPEC.md](./
|
|
116
|
+
See [SPEC.md](./docs/SPEC.md).
|
|
95
117
|
|
|
96
118
|
### Migration Guide
|
|
97
119
|
|
|
98
|
-
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./
|
|
120
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./docs/MIGRATION.md) for guidance on updating to the latest component implementations.
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
/* @griffel-buckets reset: .root, .icon; defaults: .secondary, .medium, .rounded */
|
|
2
|
+
.root {
|
|
3
|
+
align-items: center;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
text-decoration-line: none;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
margin: 0;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: var(--colorNeutralBackground1);
|
|
12
|
+
color: var(--colorNeutralForeground1);
|
|
13
|
+
border: var(--strokeWidthThin) solid var(--colorNeutralStroke1);
|
|
14
|
+
font-family: var(--fontFamilyBase);
|
|
15
|
+
outline-style: none;
|
|
16
|
+
transition-duration: var(--durationFaster);
|
|
17
|
+
transition-property: background, border, color;
|
|
18
|
+
transition-timing-function: var(--curveEasyEase);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.root:hover {
|
|
22
|
+
background-color: var(--colorNeutralBackground1Hover);
|
|
23
|
+
border-color: var(--colorNeutralStroke1Hover);
|
|
24
|
+
color: var(--colorNeutralForeground1Hover);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.root:hover:active,
|
|
29
|
+
.root:active:focus-visible {
|
|
30
|
+
background-color: var(--colorNeutralBackground1Pressed);
|
|
31
|
+
border-color: var(--colorNeutralStroke1Pressed);
|
|
32
|
+
color: var(--colorNeutralForeground1Pressed);
|
|
33
|
+
outline-style: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
37
|
+
.root {
|
|
38
|
+
transition-duration: 0.01ms;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.root[data-fui-focus-visible] {
|
|
43
|
+
border-color: var(--colorStrokeFocus2);
|
|
44
|
+
border-radius: var(--borderRadiusMedium);
|
|
45
|
+
border-width: var(--strokeWidthThin);
|
|
46
|
+
outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
|
|
47
|
+
box-shadow: 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
|
|
48
|
+
z-index: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.secondary {
|
|
52
|
+
background-color: var(--colorNeutralBackground1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.outline {
|
|
56
|
+
background-color: var(--colorTransparentBackground);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.outline:hover {
|
|
60
|
+
background-color: var(--colorTransparentBackgroundHover);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.outline:hover:active,
|
|
64
|
+
.outline:active:focus-visible {
|
|
65
|
+
background-color: var(--colorTransparentBackgroundPressed);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.primary {
|
|
69
|
+
background-color: var(--colorBrandBackground);
|
|
70
|
+
border-color: transparent;
|
|
71
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.primary:hover {
|
|
75
|
+
background-color: var(--colorBrandBackgroundHover);
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.primary:hover:active,
|
|
81
|
+
.primary:active:focus-visible {
|
|
82
|
+
background-color: var(--colorBrandBackgroundPressed);
|
|
83
|
+
border-color: transparent;
|
|
84
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.subtle {
|
|
88
|
+
background-color: var(--colorSubtleBackground);
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
color: var(--colorNeutralForeground2);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.subtle:hover {
|
|
94
|
+
background-color: var(--colorSubtleBackgroundHover);
|
|
95
|
+
border-color: transparent;
|
|
96
|
+
color: var(--colorNeutralForeground2Hover);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.subtle:hover:active,
|
|
100
|
+
.subtle:active:focus-visible {
|
|
101
|
+
background-color: var(--colorSubtleBackgroundPressed);
|
|
102
|
+
border-color: transparent;
|
|
103
|
+
color: var(--colorNeutralForeground2Pressed);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.subtle:hover :global(.fui-Button__icon) {
|
|
107
|
+
color: var(--colorNeutralForeground2BrandHover);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.subtle:hover:active :global(.fui-Button__icon),
|
|
111
|
+
.subtle:active:focus-visible :global(.fui-Button__icon) {
|
|
112
|
+
color: var(--colorNeutralForeground2BrandPressed);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.transparent {
|
|
116
|
+
background-color: var(--colorTransparentBackground);
|
|
117
|
+
border-color: transparent;
|
|
118
|
+
color: var(--colorNeutralForeground2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.transparent:hover {
|
|
122
|
+
background-color: var(--colorTransparentBackgroundHover);
|
|
123
|
+
border-color: transparent;
|
|
124
|
+
color: var(--colorNeutralForeground2BrandHover);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.transparent:hover:active,
|
|
128
|
+
.transparent:active:focus-visible {
|
|
129
|
+
background-color: var(--colorTransparentBackgroundPressed);
|
|
130
|
+
border-color: transparent;
|
|
131
|
+
color: var(--colorNeutralForeground2BrandPressed);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.subtle:hover :global(.fui-Icon-filled),
|
|
135
|
+
.subtle:hover:active :global(.fui-Icon-filled),
|
|
136
|
+
.subtle:active:focus-visible :global(.fui-Icon-filled),
|
|
137
|
+
.transparent:hover :global(.fui-Icon-filled),
|
|
138
|
+
.transparent:hover:active :global(.fui-Icon-filled),
|
|
139
|
+
.transparent:active:focus-visible :global(.fui-Icon-filled) {
|
|
140
|
+
display: inline;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.subtle:hover :global(.fui-Icon-regular),
|
|
144
|
+
.subtle:hover:active :global(.fui-Icon-regular),
|
|
145
|
+
.subtle:active:focus-visible :global(.fui-Icon-regular),
|
|
146
|
+
.transparent:hover :global(.fui-Icon-regular),
|
|
147
|
+
.transparent:hover:active :global(.fui-Icon-regular),
|
|
148
|
+
.transparent:active:focus-visible :global(.fui-Icon-regular) {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.small {
|
|
153
|
+
min-width: calc(var(--spacingHorizontalXXXL) * 2);
|
|
154
|
+
padding: calc(var(--spacingVerticalXS) - var(--strokeWidthThin)) var(--spacingHorizontalS);
|
|
155
|
+
font-size: var(--fontSizeBase200);
|
|
156
|
+
font-weight: var(--fontWeightRegular);
|
|
157
|
+
line-height: var(--lineHeightBase200);
|
|
158
|
+
|
|
159
|
+
&:where(.withIcon) {
|
|
160
|
+
padding-top: var(--strokeWidthThin);
|
|
161
|
+
padding-bottom: var(--strokeWidthThin);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.medium {
|
|
166
|
+
padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin)) var(--spacingHorizontalM);
|
|
167
|
+
min-width: calc(var(--spacingHorizontalXXXL) * 3);
|
|
168
|
+
font-size: var(--fontSizeBase300);
|
|
169
|
+
font-weight: var(--fontWeightSemibold);
|
|
170
|
+
line-height: var(--lineHeightBase300);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.large {
|
|
174
|
+
min-width: calc(var(--spacingHorizontalXXXL) * 3);
|
|
175
|
+
padding: var(--spacingVerticalS) var(--spacingHorizontalL);
|
|
176
|
+
font-size: var(--fontSizeBase400);
|
|
177
|
+
font-weight: var(--fontWeightSemibold);
|
|
178
|
+
line-height: var(--lineHeightBase400);
|
|
179
|
+
|
|
180
|
+
&:where(.withIcon) {
|
|
181
|
+
padding-top: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
182
|
+
padding-bottom: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.rounded {
|
|
187
|
+
border-radius: var(--borderRadiusMedium);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.circular {
|
|
191
|
+
border-radius: var(--borderRadiusCircular);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.square {
|
|
195
|
+
border-radius: var(--borderRadiusNone);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.disabled,
|
|
199
|
+
.disabled:hover,
|
|
200
|
+
.disabled:hover:active,
|
|
201
|
+
.disabled:active:focus-visible {
|
|
202
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
203
|
+
border-color: var(--colorNeutralStrokeDisabled);
|
|
204
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
205
|
+
cursor: not-allowed;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.disabled :global(.fui-Button__icon),
|
|
209
|
+
.disabled:hover :global(.fui-Button__icon),
|
|
210
|
+
.disabled:hover:active :global(.fui-Button__icon),
|
|
211
|
+
.disabled:active:focus-visible :global(.fui-Button__icon) {
|
|
212
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.disabled:hover :global(.fui-Icon-filled),
|
|
216
|
+
.disabled:hover:active :global(.fui-Icon-filled),
|
|
217
|
+
.disabled:active:focus-visible :global(.fui-Icon-filled) {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.disabled:hover :global(.fui-Icon-regular),
|
|
222
|
+
.disabled:hover:active :global(.fui-Icon-regular),
|
|
223
|
+
.disabled:active:focus-visible :global(.fui-Icon-regular) {
|
|
224
|
+
display: inline;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.disabled {
|
|
228
|
+
&:where(.outline, .subtle, .transparent) {
|
|
229
|
+
&,
|
|
230
|
+
&:hover,
|
|
231
|
+
&:hover:active,
|
|
232
|
+
&:active:focus-visible {
|
|
233
|
+
background-color: var(--colorTransparentBackground);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:where(.primary, .subtle, .transparent) {
|
|
238
|
+
&,
|
|
239
|
+
&:hover,
|
|
240
|
+
&:hover:active,
|
|
241
|
+
&:active:focus-visible {
|
|
242
|
+
border-color: transparent;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.primary[data-fui-focus-visible] {
|
|
248
|
+
border-color: var(--colorStrokeFocus2);
|
|
249
|
+
box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset,
|
|
250
|
+
0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.primary[data-fui-focus-visible]:hover {
|
|
254
|
+
border-color: var(--colorStrokeFocus2);
|
|
255
|
+
box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Firefox needs an extra quarter of the default thin stroke at some zoom levels. */
|
|
259
|
+
@supports (-moz-appearance: button) {
|
|
260
|
+
.root[data-fui-focus-visible] {
|
|
261
|
+
box-shadow: 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.primary[data-fui-focus-visible] {
|
|
265
|
+
box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset,
|
|
266
|
+
0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.primary[data-fui-focus-visible]:hover {
|
|
270
|
+
box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.small[data-fui-focus-visible] {
|
|
275
|
+
border-radius: var(--borderRadiusSmall);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.large[data-fui-focus-visible] {
|
|
279
|
+
border-radius: var(--borderRadiusLarge);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.circular[data-fui-focus-visible] {
|
|
283
|
+
border-radius: var(--borderRadiusCircular);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.square[data-fui-focus-visible] {
|
|
287
|
+
border-radius: var(--borderRadiusNone);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.iconOnly {
|
|
291
|
+
padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin));
|
|
292
|
+
min-width: var(--spacingHorizontalXXXL);
|
|
293
|
+
max-width: var(--spacingHorizontalXXXL);
|
|
294
|
+
|
|
295
|
+
&:where(.small) {
|
|
296
|
+
padding: var(--strokeWidthThin);
|
|
297
|
+
min-width: var(--spacingHorizontalXXL);
|
|
298
|
+
max-width: var(--spacingHorizontalXXL);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&:where(.large) {
|
|
302
|
+
padding: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
303
|
+
min-width: calc(var(--spacingHorizontalXL) * 2);
|
|
304
|
+
max-width: calc(var(--spacingHorizontalXL) * 2);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.icon {
|
|
309
|
+
align-items: center;
|
|
310
|
+
display: inline-flex;
|
|
311
|
+
justify-content: center;
|
|
312
|
+
font-size: var(--fontSizeBase500);
|
|
313
|
+
height: var(--fontSizeBase500);
|
|
314
|
+
width: var(--fontSizeBase500);
|
|
315
|
+
--fui-Button__icon--spacing: var(--spacingHorizontalSNudge);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
:where(.small) .icon {
|
|
319
|
+
--fui-Button__icon--spacing: var(--spacingHorizontalXS);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
:where(.large) .icon {
|
|
323
|
+
font-size: var(--fontSizeBase600);
|
|
324
|
+
height: var(--fontSizeBase600);
|
|
325
|
+
width: var(--fontSizeBase600);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.before {
|
|
329
|
+
margin-inline-end: var(--fui-Button__icon--spacing);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.after {
|
|
333
|
+
margin-inline-start: var(--fui-Button__icon--spacing);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@media (forced-colors: active) {
|
|
337
|
+
.root:focus {
|
|
338
|
+
border-color: ButtonText;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.root:hover,
|
|
342
|
+
.root:hover:active,
|
|
343
|
+
.root:active:focus-visible {
|
|
344
|
+
background-color: HighlightText;
|
|
345
|
+
border-color: Highlight;
|
|
346
|
+
color: Highlight;
|
|
347
|
+
forced-color-adjust: none;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.primary {
|
|
351
|
+
background-color: Highlight;
|
|
352
|
+
border-color: HighlightText;
|
|
353
|
+
color: HighlightText;
|
|
354
|
+
forced-color-adjust: none;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.primary:hover,
|
|
358
|
+
.primary:hover:active,
|
|
359
|
+
.primary:active:focus-visible {
|
|
360
|
+
background-color: HighlightText;
|
|
361
|
+
border-color: Highlight;
|
|
362
|
+
color: Highlight;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.subtle:hover,
|
|
366
|
+
.subtle:hover:active,
|
|
367
|
+
.subtle:active:focus-visible,
|
|
368
|
+
.subtle:hover :global(.fui-Button__icon),
|
|
369
|
+
.subtle:hover:active :global(.fui-Button__icon),
|
|
370
|
+
.subtle:active:focus-visible :global(.fui-Button__icon) {
|
|
371
|
+
color: Highlight;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.transparent:hover,
|
|
375
|
+
.transparent:hover:active,
|
|
376
|
+
.transparent:active:focus-visible {
|
|
377
|
+
background-color: var(--colorTransparentBackground);
|
|
378
|
+
color: Highlight;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.disabled,
|
|
382
|
+
.disabled:hover,
|
|
383
|
+
.disabled:hover:active,
|
|
384
|
+
.disabled:active:focus-visible {
|
|
385
|
+
background-color: ButtonFace;
|
|
386
|
+
border-color: GrayText;
|
|
387
|
+
color: GrayText;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.disabled:focus {
|
|
391
|
+
border-color: GrayText;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.disabled :global(.fui-Button__icon),
|
|
395
|
+
.disabled:hover :global(.fui-Button__icon),
|
|
396
|
+
.disabled:hover:active :global(.fui-Button__icon),
|
|
397
|
+
.disabled:active:focus-visible :global(.fui-Button__icon) {
|
|
398
|
+
color: GrayText;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Button.module.css";
|
|
3
|
+
export const buttonClassNames = {
|
|
4
|
+
root: 'fui-Button',
|
|
5
|
+
icon: 'fui-Button__icon'
|
|
6
|
+
};
|
|
7
|
+
export const useButtonStyles_unstable = (state)=>{
|
|
8
|
+
const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
|
|
9
|
+
state.root.className = clsx(buttonClassNames.root, styles.root, styles[appearance], styles[size], styles[shape], icon && styles.withIcon, (disabled || disabledFocusable) && styles.disabled, iconOnly && styles.iconOnly, state.root.className);
|
|
10
|
+
if (state.icon) {
|
|
11
|
+
state.icon.className = clsx(buttonClassNames.icon, styles.icon, !!state.root.children && styles[iconPosition], state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/useButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './Button.module.css';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = clsx(\n buttonClassNames.root,\n styles.root,\n styles[appearance],\n styles[size],\n styles[shape],\n icon && styles.withIcon,\n (disabled || disabledFocusable) && styles.disabled,\n iconOnly && styles.iconOnly,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = clsx(\n buttonClassNames.icon,\n styles.icon,\n !!state.root.children && styles[iconPosition],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","buttonClassNames","root","icon","useButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","shape","size","className","withIcon","children"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,YAAY,sBAAsB;AAGzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;IACvC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEL,IAAI,EAAEM,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGP;IAE/FA,MAAMH,IAAI,CAACW,SAAS,GAAGd,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACY,KAAK,EACZZ,MAAM,CAACW,MAAM,EACbR,QAAQH,OAAOc,QAAQ,EACvB,AAACP,CAAAA,YAAYC,iBAAgB,KAAMR,OAAOO,QAAQ,EAClDE,YAAYT,OAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,KACrBE,iBAAiBE,IAAI,EACrBH,OAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,MAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Button.module.css";
|
|
3
|
+
export const buttonClassNames = {
|
|
4
|
+
root: 'fui-Button',
|
|
5
|
+
icon: 'fui-Button__icon'
|
|
6
|
+
};
|
|
7
|
+
export const useButtonStyles_unstable = (state)=>{
|
|
8
|
+
const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
|
|
9
|
+
state.root.className = clsx(buttonClassNames.root, styles.root, styles[appearance], styles[size], styles[shape], icon && styles.withIcon, (disabled || disabledFocusable) && styles.disabled, iconOnly && styles.iconOnly, state.root.className);
|
|
10
|
+
if (state.icon) {
|
|
11
|
+
state.icon.className = clsx(buttonClassNames.icon, styles.icon, !!state.root.children && styles[iconPosition], state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/useButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './Button.module.css';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = clsx(\n buttonClassNames.root,\n styles.root,\n styles[appearance],\n styles[size],\n styles[shape],\n icon && styles.withIcon,\n (disabled || disabledFocusable) && styles.disabled,\n iconOnly && styles.iconOnly,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = clsx(\n buttonClassNames.icon,\n styles.icon,\n !!state.root.children && styles[iconPosition],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","buttonClassNames","root","icon","useButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","shape","size","className","withIcon","children"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,YAAY,sBAAsB;AAGzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;IACvC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEL,IAAI,EAAEM,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGP;IAE/FA,MAAMH,IAAI,CAACW,SAAS,GAAGd,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACY,KAAK,EACZZ,MAAM,CAACW,MAAM,EACbR,QAAQH,OAAOc,QAAQ,EACvB,AAACP,CAAAA,YAAYC,iBAAgB,KAAMR,OAAOO,QAAQ,EAClDE,YAAYT,OAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,KACrBE,iBAAiBE,IAAI,EACrBH,OAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,MAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
height: auto;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.icon {
|
|
6
|
+
font-size: calc(var(--fontSizeBase500) * 2);
|
|
7
|
+
height: calc(var(--fontSizeBase500) * 2);
|
|
8
|
+
width: calc(var(--fontSizeBase500) * 2);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.root:where(.outline, .secondary, .subtle, .transparent) :global(.fui-CompoundButton__secondaryContent) {
|
|
12
|
+
color: var(--colorNeutralForeground2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.root:hover :global(.fui-CompoundButton__secondaryContent) {
|
|
16
|
+
color: var(--colorNeutralForeground2Hover);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.root:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
20
|
+
.root:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
21
|
+
color: var(--colorNeutralForeground2Pressed);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.primary :global(.fui-CompoundButton__secondaryContent),
|
|
25
|
+
.primary:hover :global(.fui-CompoundButton__secondaryContent),
|
|
26
|
+
.primary:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
27
|
+
.primary:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
28
|
+
color: var(--colorNeutralForegroundOnBrand);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.transparent:hover :global(.fui-CompoundButton__secondaryContent) {
|
|
32
|
+
color: var(--colorNeutralForeground2BrandHover);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.transparent:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
36
|
+
.transparent:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
37
|
+
color: var(--colorNeutralForeground2BrandPressed);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.small {
|
|
41
|
+
padding: var(--spacingVerticalS) var(--spacingHorizontalS) var(--spacingVerticalMNudge);
|
|
42
|
+
font-size: var(--fontSizeBase300);
|
|
43
|
+
line-height: var(--lineHeightBase300);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.medium {
|
|
47
|
+
padding: calc(var(--spacingVerticalL) - var(--strokeWidthThick)) var(--spacingHorizontalM) var(--spacingVerticalL);
|
|
48
|
+
font-size: var(--fontSizeBase300);
|
|
49
|
+
line-height: var(--lineHeightBase300);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.large {
|
|
53
|
+
padding: calc(var(--spacingVerticalXL) - var(--strokeWidthThick)) var(--spacingHorizontalL) var(--spacingVerticalXL);
|
|
54
|
+
font-size: var(--fontSizeBase400);
|
|
55
|
+
line-height: var(--lineHeightBase400);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.disabled :global(.fui-CompoundButton__secondaryContent),
|
|
59
|
+
.disabled:hover :global(.fui-CompoundButton__secondaryContent),
|
|
60
|
+
.disabled:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
61
|
+
.disabled:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
62
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.iconOnly {
|
|
66
|
+
padding: var(--spacingVerticalSNudge);
|
|
67
|
+
max-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalXS));
|
|
68
|
+
min-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalXS));
|
|
69
|
+
|
|
70
|
+
&:where(.small) {
|
|
71
|
+
padding: var(--spacingVerticalXS);
|
|
72
|
+
max-width: calc(var(--spacingHorizontalXXL) * 2);
|
|
73
|
+
min-width: calc(var(--spacingHorizontalXXL) * 2);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:where(.large) {
|
|
77
|
+
padding: var(--spacingVerticalS);
|
|
78
|
+
max-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalS));
|
|
79
|
+
min-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalS));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.before {
|
|
84
|
+
margin-inline-end: var(--spacingHorizontalM);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.after {
|
|
88
|
+
margin-inline-start: var(--spacingHorizontalM);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.contentContainer {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
text-align: start;
|
|
95
|
+
|
|
96
|
+
&:where(:dir(rtl)) {
|
|
97
|
+
text-align: right;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.secondaryContent {
|
|
102
|
+
line-height: 100%;
|
|
103
|
+
font-weight: var(--fontWeightRegular);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:where(.small, .medium) .secondaryContent {
|
|
107
|
+
font-size: var(--fontSizeBase200);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:where(.large) .secondaryContent {
|
|
111
|
+
font-size: var(--fontSizeBase300);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@media (forced-colors: active) {
|
|
115
|
+
.root:hover :global(.fui-CompoundButton__secondaryContent),
|
|
116
|
+
.root:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
117
|
+
.root:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
118
|
+
color: Highlight;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.primary :global(.fui-CompoundButton__secondaryContent) {
|
|
122
|
+
color: HighlightText;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.subtle:hover :global(.fui-CompoundButton__secondaryContent),
|
|
126
|
+
.subtle:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
127
|
+
.subtle:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
128
|
+
color: Canvas;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.disabled :global(.fui-CompoundButton__secondaryContent),
|
|
132
|
+
.disabled:hover :global(.fui-CompoundButton__secondaryContent),
|
|
133
|
+
.disabled:hover:active :global(.fui-CompoundButton__secondaryContent),
|
|
134
|
+
.disabled:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
|
|
135
|
+
color: GrayText;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useButtonStyles_unstable } from "../Button/useButtonStyles.styles.css.js";
|
|
4
|
+
import styles from "./CompoundButton.module.css";
|
|
5
|
+
export const compoundButtonClassNames = {
|
|
6
|
+
root: 'fui-CompoundButton',
|
|
7
|
+
icon: 'fui-CompoundButton__icon',
|
|
8
|
+
contentContainer: 'fui-CompoundButton__contentContainer',
|
|
9
|
+
secondaryContent: 'fui-CompoundButton__secondaryContent'
|
|
10
|
+
};
|
|
11
|
+
export const useCompoundButtonStyles_unstable = (state)=>{
|
|
12
|
+
const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;
|
|
13
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
14
|
+
state.root.className = clsx(compoundButtonClassNames.root, styles.root, styles[appearance], styles[size], (disabled || disabledFocusable) && styles.disabled, iconOnly && styles.iconOnly, state.root.className);
|
|
15
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
16
|
+
state.contentContainer.className = clsx(compoundButtonClassNames.contentContainer, styles.contentContainer, state.contentContainer.className);
|
|
17
|
+
if (state.icon) {
|
|
18
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
19
|
+
state.icon.className = clsx(compoundButtonClassNames.icon, styles.icon, state.root.children !== undefined && state.root.children !== null && styles[iconPosition], state.icon.className);
|
|
20
|
+
}
|
|
21
|
+
if (state.secondaryContent) {
|
|
22
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
23
|
+
state.secondaryContent.className = clsx(compoundButtonClassNames.secondaryContent, styles.secondaryContent, state.secondaryContent.className);
|
|
24
|
+
}
|
|
25
|
+
useButtonStyles_unstable(state);
|
|
26
|
+
return state;
|
|
27
|
+
};
|