@fluentui/react-button 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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 +46 -12
- package/README.md +22 -0
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.module.css +401 -0
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.js +2 -2
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +1 -1
- package/lib/components/Button/useButton.js.map +1 -1
- 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/Button/useButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.module.css +143 -0
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +2 -2
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- 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/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.module.css +75 -0
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +2 -2
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- 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/MenuButton/useMenuButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.module.css +73 -0
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +2 -2
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- 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/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.module.css +234 -0
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- 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.js +12 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
- 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/components/ToggleButton/useToggleButtonStyles.styles.raw.js +11 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -1
- package/lib/contexts/ButtonContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.cjs +7 -7
- package/lib-commonjs/CompoundButton.cjs +7 -7
- package/lib-commonjs/MenuButton.cjs +7 -7
- package/lib-commonjs/SplitButton.cjs +7 -7
- package/lib-commonjs/ToggleButton.cjs +7 -7
- package/lib-commonjs/components/Button/Button.cjs.map +1 -1
- package/lib-commonjs/components/Button/Button.module.css +401 -0
- package/lib-commonjs/components/Button/Button.types.cjs.map +1 -1
- package/lib-commonjs/components/Button/index.cjs +7 -7
- package/lib-commonjs/components/Button/index.cjs.map +1 -1
- package/lib-commonjs/components/Button/renderButton.cjs.map +1 -1
- package/lib-commonjs/components/Button/useButton.cjs +4 -4
- package/lib-commonjs/components/Button/useButton.cjs.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Button/useButtonStyles.styles.cjs.map +1 -1
- 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.cjs +3 -3
- package/lib-commonjs/components/Button/useButtonStyles.styles.raw.cjs.map +1 -1
- 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.cjs.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.module.css +143 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.cjs.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.cjs +7 -7
- package/lib-commonjs/components/CompoundButton/index.cjs.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.cjs.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.cjs +3 -3
- package/lib-commonjs/components/CompoundButton/useCompoundButton.cjs.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.cjs.map +1 -1
- 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.cjs +3 -3
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.cjs.map +1 -1
- 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.cjs.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.module.css +75 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.cjs.map +1 -1
- package/lib-commonjs/components/MenuButton/index.cjs +7 -7
- package/lib-commonjs/components/MenuButton/index.cjs.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.cjs.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.cjs +3 -3
- package/lib-commonjs/components/MenuButton/useMenuButton.cjs.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.cjs +3 -3
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.cjs.map +1 -1
- 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.cjs +3 -3
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.cjs.map +1 -1
- 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.cjs.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.module.css +73 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.cjs.map +1 -1
- package/lib-commonjs/components/SplitButton/index.cjs +7 -7
- package/lib-commonjs/components/SplitButton/index.cjs.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.cjs.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.cjs +3 -3
- package/lib-commonjs/components/SplitButton/useSplitButton.cjs.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.cjs +3 -3
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.cjs.map +1 -1
- 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.cjs +3 -3
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.cjs.map +1 -1
- 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.cjs.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.module.css +234 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.cjs.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.cjs +7 -7
- package/lib-commonjs/components/ToggleButton/index.cjs.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.cjs.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.cjs +3 -3
- package/lib-commonjs/components/ToggleButton/useToggleButton.cjs.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.cjs +27 -4
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.cjs.map +1 -1
- 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.cjs +14 -4
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.cjs.map +1 -1
- 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/lib-commonjs/contexts/ButtonContext.cjs +3 -3
- package/lib-commonjs/contexts/ButtonContext.cjs.map +1 -1
- package/lib-commonjs/contexts/index.cjs +3 -3
- package/lib-commonjs/contexts/index.cjs.map +1 -1
- package/lib-commonjs/index.cjs +34 -34
- package/lib-commonjs/index.cjs.map +1 -1
- package/lib-commonjs/utils/index.cjs.map +1 -1
- package/lib-commonjs/utils/useToggleState.cjs.map +1 -1
- package/package.json +15 -15
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../src/utils/useToggleState.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<\n ToggleButtonProps,\n 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable' | 'isAccessible'\n >,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root' | 'isAccessible'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable, isAccessible = false } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n isAccessible,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","isAccessible","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAInG,OAAO,SAASC,eAOdC,KAAyB,EAAEC,KAAmB;IAC9C,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,eAAe,KAAK,EAAE,GAAGN;IACvF,MAAM,EAAEO,OAAO,EAAEC,IAAI,EAAE,GAAGP,MAAMQ,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,GAAGd,qBAAqB;QAC3DI,OAAOC;QACPU,cAAcT;QACdU,cAAc;IAChB;IAEA,MAAMC,qBAAqBN,SAAS,sBAAsBA,SAAS;IAEnE,MAAMO,gBAAgBpB,MAAMqB,WAAW,CACrC,CAACC;QACC,IAAI,CAACb,YAAY,CAACC,mBAAmB;YACnC,IAAIY,GAAGC,gBAAgB,EAAE;gBACvB;YACF;YAEAP,gBAAgB,CAACD;QACnB;IACF,GACA;QAACA;QAAcN;QAAUC;QAAmBM;KAAgB;IAG9D,OAAO;QACL,GAAGV,KAAK;QAERC,SAASQ;QAETJ;QAEAG,MAAM;YACJ,GAAGR,MAAMQ,IAAI;YACb,CAACK,qBAAqB,iBAAiB,eAAe,EAAEJ;YACxDH,SAAST,iBACPF,eAAeW,SAA2EQ;QAE9F;IACF;AACF"}
|
package/lib-commonjs/Button.cjs
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Button
|
|
12
|
+
get Button () {
|
|
13
13
|
return _index.Button;
|
|
14
14
|
},
|
|
15
|
-
buttonClassNames
|
|
15
|
+
get buttonClassNames () {
|
|
16
16
|
return _index.buttonClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderButton_unstable
|
|
18
|
+
get renderButton_unstable () {
|
|
19
19
|
return _index.renderButton_unstable;
|
|
20
20
|
},
|
|
21
|
-
useButtonBase_unstable
|
|
21
|
+
get useButtonBase_unstable () {
|
|
22
22
|
return _index.useButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useButtonStyles_unstable
|
|
24
|
+
get useButtonStyles_unstable () {
|
|
25
25
|
return _index.useButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useButton_unstable
|
|
27
|
+
get useButton_unstable () {
|
|
28
28
|
return _index.useButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
CompoundButton
|
|
12
|
+
get CompoundButton () {
|
|
13
13
|
return _index.CompoundButton;
|
|
14
14
|
},
|
|
15
|
-
compoundButtonClassNames
|
|
15
|
+
get compoundButtonClassNames () {
|
|
16
16
|
return _index.compoundButtonClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderCompoundButton_unstable
|
|
18
|
+
get renderCompoundButton_unstable () {
|
|
19
19
|
return _index.renderCompoundButton_unstable;
|
|
20
20
|
},
|
|
21
|
-
useCompoundButtonBase_unstable
|
|
21
|
+
get useCompoundButtonBase_unstable () {
|
|
22
22
|
return _index.useCompoundButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useCompoundButtonStyles_unstable
|
|
24
|
+
get useCompoundButtonStyles_unstable () {
|
|
25
25
|
return _index.useCompoundButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useCompoundButton_unstable
|
|
27
|
+
get useCompoundButton_unstable () {
|
|
28
28
|
return _index.useCompoundButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
MenuButton
|
|
12
|
+
get MenuButton () {
|
|
13
13
|
return _index.MenuButton;
|
|
14
14
|
},
|
|
15
|
-
menuButtonClassNames
|
|
15
|
+
get menuButtonClassNames () {
|
|
16
16
|
return _index.menuButtonClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderMenuButton_unstable
|
|
18
|
+
get renderMenuButton_unstable () {
|
|
19
19
|
return _index.renderMenuButton_unstable;
|
|
20
20
|
},
|
|
21
|
-
useMenuButtonBase_unstable
|
|
21
|
+
get useMenuButtonBase_unstable () {
|
|
22
22
|
return _index.useMenuButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useMenuButtonStyles_unstable
|
|
24
|
+
get useMenuButtonStyles_unstable () {
|
|
25
25
|
return _index.useMenuButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useMenuButton_unstable
|
|
27
|
+
get useMenuButton_unstable () {
|
|
28
28
|
return _index.useMenuButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
SplitButton
|
|
12
|
+
get SplitButton () {
|
|
13
13
|
return _index.SplitButton;
|
|
14
14
|
},
|
|
15
|
-
renderSplitButton_unstable
|
|
15
|
+
get renderSplitButton_unstable () {
|
|
16
16
|
return _index.renderSplitButton_unstable;
|
|
17
17
|
},
|
|
18
|
-
splitButtonClassNames
|
|
18
|
+
get splitButtonClassNames () {
|
|
19
19
|
return _index.splitButtonClassNames;
|
|
20
20
|
},
|
|
21
|
-
useSplitButtonBase_unstable
|
|
21
|
+
get useSplitButtonBase_unstable () {
|
|
22
22
|
return _index.useSplitButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useSplitButtonStyles_unstable
|
|
24
|
+
get useSplitButtonStyles_unstable () {
|
|
25
25
|
return _index.useSplitButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useSplitButton_unstable
|
|
27
|
+
get useSplitButton_unstable () {
|
|
28
28
|
return _index.useSplitButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToggleButton
|
|
12
|
+
get ToggleButton () {
|
|
13
13
|
return _index.ToggleButton;
|
|
14
14
|
},
|
|
15
|
-
renderToggleButton_unstable
|
|
15
|
+
get renderToggleButton_unstable () {
|
|
16
16
|
return _index.renderToggleButton_unstable;
|
|
17
17
|
},
|
|
18
|
-
toggleButtonClassNames
|
|
18
|
+
get toggleButtonClassNames () {
|
|
19
19
|
return _index.toggleButtonClassNames;
|
|
20
20
|
},
|
|
21
|
-
useToggleButtonBase_unstable
|
|
21
|
+
get useToggleButtonBase_unstable () {
|
|
22
22
|
return _index.useToggleButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useToggleButtonStyles_unstable
|
|
24
|
+
get useToggleButtonStyles_unstable () {
|
|
25
25
|
return _index.useToggleButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useToggleButton_unstable
|
|
27
|
+
get useToggleButton_unstable () {
|
|
28
28
|
return _index.useToggleButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles.styles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useButtonStyles_unstable')(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"names":["React","renderButton_unstable","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","Button","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;8BACO,oBAAiB;2BACpB,iBAAc;uCACR,8BAA2B;qCAGxB,kCAAkC;AAKvE,MAAMK,SAAAA,WAAAA,GAA2CL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,YAAQP,6BAAAA,EAAmBK,OAAOC;QAExCL,+CAAAA,EAAyBM;QAEzBL,gDAAAA,EAA4B,4BAA4BK;IAExD,WAAOR,mCAAAA,EAAsBQ;AAC7B,0FAA0F;AAC5F,GAAuC;AAEvCJ,OAAOK,WAAW,GAAG"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
@layer fluentui {
|
|
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
|
+
.icon {
|
|
160
|
+
--fui-Button__icon--spacing: var(--spacingHorizontalXS);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:where(.withIcon) {
|
|
164
|
+
padding-top: var(--strokeWidthThin);
|
|
165
|
+
padding-bottom: var(--strokeWidthThin);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.medium {
|
|
170
|
+
padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin)) var(--spacingHorizontalM);
|
|
171
|
+
min-width: calc(var(--spacingHorizontalXXXL) * 3);
|
|
172
|
+
font-size: var(--fontSizeBase300);
|
|
173
|
+
font-weight: var(--fontWeightSemibold);
|
|
174
|
+
line-height: var(--lineHeightBase300);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.large {
|
|
178
|
+
min-width: calc(var(--spacingHorizontalXXXL) * 3);
|
|
179
|
+
padding: var(--spacingVerticalS) var(--spacingHorizontalL);
|
|
180
|
+
font-size: var(--fontSizeBase400);
|
|
181
|
+
font-weight: var(--fontWeightSemibold);
|
|
182
|
+
line-height: var(--lineHeightBase400);
|
|
183
|
+
|
|
184
|
+
.icon {
|
|
185
|
+
font-size: var(--fontSizeBase600);
|
|
186
|
+
height: var(--fontSizeBase600);
|
|
187
|
+
width: var(--fontSizeBase600);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&:where(.withIcon) {
|
|
191
|
+
padding-top: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
192
|
+
padding-bottom: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.rounded {
|
|
197
|
+
border-radius: var(--borderRadiusMedium);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.circular {
|
|
201
|
+
border-radius: var(--borderRadiusCircular);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.square {
|
|
205
|
+
border-radius: var(--borderRadiusNone);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.disabled,
|
|
209
|
+
.disabled:hover,
|
|
210
|
+
.disabled:hover:active,
|
|
211
|
+
.disabled:active:focus-visible {
|
|
212
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
213
|
+
border-color: var(--colorNeutralStrokeDisabled);
|
|
214
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
215
|
+
cursor: not-allowed;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.disabled :global(.fui-Button__icon),
|
|
219
|
+
.disabled:hover :global(.fui-Button__icon),
|
|
220
|
+
.disabled:hover:active :global(.fui-Button__icon),
|
|
221
|
+
.disabled:active:focus-visible :global(.fui-Button__icon) {
|
|
222
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.disabled:hover :global(.fui-Icon-filled),
|
|
226
|
+
.disabled:hover:active :global(.fui-Icon-filled),
|
|
227
|
+
.disabled:active:focus-visible :global(.fui-Icon-filled) {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.disabled:hover :global(.fui-Icon-regular),
|
|
232
|
+
.disabled:hover:active :global(.fui-Icon-regular),
|
|
233
|
+
.disabled:active:focus-visible :global(.fui-Icon-regular) {
|
|
234
|
+
display: inline;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.disabled {
|
|
238
|
+
&:where(.outline, .subtle, .transparent) {
|
|
239
|
+
&,
|
|
240
|
+
&:hover,
|
|
241
|
+
&:hover:active,
|
|
242
|
+
&:active:focus-visible {
|
|
243
|
+
background-color: var(--colorTransparentBackground);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&:where(.primary, .subtle, .transparent) {
|
|
248
|
+
&,
|
|
249
|
+
&:hover,
|
|
250
|
+
&:hover:active,
|
|
251
|
+
&:active:focus-visible {
|
|
252
|
+
border-color: transparent;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.primary[data-fui-focus-visible] {
|
|
258
|
+
border-color: var(--colorStrokeFocus2);
|
|
259
|
+
box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset,
|
|
260
|
+
0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.primary[data-fui-focus-visible]:hover {
|
|
264
|
+
border-color: var(--colorStrokeFocus2);
|
|
265
|
+
box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* Firefox needs an extra quarter of the default thin stroke at some zoom levels. */
|
|
269
|
+
@supports (-moz-appearance: button) {
|
|
270
|
+
.root[data-fui-focus-visible] {
|
|
271
|
+
box-shadow: 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.primary[data-fui-focus-visible] {
|
|
275
|
+
box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset,
|
|
276
|
+
0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.primary[data-fui-focus-visible]:hover {
|
|
280
|
+
box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.small[data-fui-focus-visible] {
|
|
285
|
+
border-radius: var(--borderRadiusSmall);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.large[data-fui-focus-visible] {
|
|
289
|
+
border-radius: var(--borderRadiusLarge);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.circular[data-fui-focus-visible] {
|
|
293
|
+
border-radius: var(--borderRadiusCircular);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.square[data-fui-focus-visible] {
|
|
297
|
+
border-radius: var(--borderRadiusNone);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.iconOnly {
|
|
301
|
+
padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin));
|
|
302
|
+
min-width: var(--spacingHorizontalXXXL);
|
|
303
|
+
max-width: var(--spacingHorizontalXXXL);
|
|
304
|
+
|
|
305
|
+
&:where(.small) {
|
|
306
|
+
padding: var(--strokeWidthThin);
|
|
307
|
+
min-width: var(--spacingHorizontalXXL);
|
|
308
|
+
max-width: var(--spacingHorizontalXXL);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
&:where(.large) {
|
|
312
|
+
padding: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
|
|
313
|
+
min-width: calc(var(--spacingHorizontalXL) * 2);
|
|
314
|
+
max-width: calc(var(--spacingHorizontalXL) * 2);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.icon {
|
|
319
|
+
align-items: center;
|
|
320
|
+
display: inline-flex;
|
|
321
|
+
justify-content: center;
|
|
322
|
+
font-size: var(--fontSizeBase500);
|
|
323
|
+
height: var(--fontSizeBase500);
|
|
324
|
+
width: var(--fontSizeBase500);
|
|
325
|
+
--fui-Button__icon--spacing: var(--spacingHorizontalSNudge);
|
|
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
|
+
}
|
|
401
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/Button.types.ts"],"sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * A button supports different sizes.\n */\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: ButtonSize;\n};\n\nexport type ButtonBaseProps = DistributiveOmit<ButtonProps, 'appearance' | 'size' | 'shape'>;\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n\nexport type ButtonBaseState = DistributiveOmit<ButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":""}
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Button
|
|
12
|
+
get Button () {
|
|
13
13
|
return _Button.Button;
|
|
14
14
|
},
|
|
15
|
-
buttonClassNames
|
|
15
|
+
get buttonClassNames () {
|
|
16
16
|
return _useButtonStylesstyles.buttonClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderButton_unstable
|
|
18
|
+
get renderButton_unstable () {
|
|
19
19
|
return _renderButton.renderButton_unstable;
|
|
20
20
|
},
|
|
21
|
-
useButtonBase_unstable
|
|
21
|
+
get useButtonBase_unstable () {
|
|
22
22
|
return _useButton.useButtonBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useButtonStyles_unstable
|
|
24
|
+
get useButtonStyles_unstable () {
|
|
25
25
|
return _useButtonStylesstyles.useButtonStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useButton_unstable
|
|
27
|
+
get useButton_unstable () {
|
|
28
28
|
return _useButton.useButton_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/index.ts"],"sourcesContent":["export { Button } from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonBaseProps, ButtonProps, ButtonSlots, ButtonBaseState, ButtonState } from './Button.types';\nexport { renderButton_unstable } from './renderButton';\nexport { useButton_unstable, useButtonBase_unstable } from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n"],"names":["Button","renderButton_unstable","useButton_unstable","useButtonBase_unstable","buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,cAAM;;;eAKNI,uCAAgB;;;eAFhBH,mCAAqB;;;eACDE,iCAAsB;;;eACxBE,+CAAwB;;;eAD1CH,6BAAkB;;;wBAJJ,cAAW;8BAGI,oBAAiB;2BACI,iBAAc;uCACd,8BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { ButtonSlots, ButtonBaseState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonBaseState): JSXElement => {\n assertSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <state.root>\n {iconPosition !== 'after' && state.icon && <state.icon />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && state.icon && <state.icon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderButton_unstable","state","iconOnly","iconPosition","root","icon","children"],"mappings":";;;;+BAWaC;;;;;;;gCAVb,gDAAiD,GAEjD,SAASD,WAAW,QAAQ,4BAA4B;AAQjD,8BAA8B,CAACE;QACpCF,2BAAAA,EAAyBE;IACzB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGF;IAEnC,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMG,IAAI,EAAA;;YACRD,iBAAiB,WAAWF,MAAMI,IAAI,IAAA,WAAA,GAAI,mBAAA,EAACJ,MAAMI,IAAI,EAAA,CAAA;YACrD,CAACH,YAAYD,MAAMG,IAAI,CAACE,QAAQ;YAChCH,iBAAiB,WAAWF,MAAMI,IAAI,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,IAAI,EAAA,CAAA;;;AAG5D,EAAE"}
|