@fluentui/react-button 0.0.0-nightlycc44f3625c20211220.1 → 0.0.0-nightlyd80c90385320220216.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +194 -23
- package/CHANGELOG.md +45 -13
- package/dist/react-button.d.ts +31 -36
- package/lib/components/Button/Button.js +6 -6
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +5 -5
- package/lib/components/Button/index.d.ts +2 -2
- package/lib/components/Button/index.js +1 -2
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.d.ts +1 -1
- package/lib/components/Button/renderButton.js +4 -4
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +1 -1
- package/lib/components/Button/useButton.js +1 -1
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +1 -9
- package/lib/components/Button/useButtonStyles.js +9 -18
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +6 -6
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +4 -4
- package/lib/components/CompoundButton/index.d.ts +1 -1
- package/lib/components/CompoundButton/index.js +1 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +5 -5
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.d.ts +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +3 -3
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +12 -12
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -6
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.d.ts +3 -8
- package/lib/components/MenuButton/index.d.ts +1 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.d.ts +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +4 -4
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.d.ts +1 -1
- package/lib/components/MenuButton/useMenuButton.js +5 -5
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +4 -4
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +6 -6
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.d.ts +6 -4
- package/lib/components/SplitButton/index.d.ts +1 -1
- package/lib/components/SplitButton/index.js +1 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.d.ts +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +4 -4
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.d.ts +1 -1
- package/lib/components/SplitButton/useSplitButton.js +17 -5
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +3 -2
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +6 -6
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +2 -1
- package/lib/components/ToggleButton/index.d.ts +1 -1
- package/lib/components/ToggleButton/index.js +1 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.d.ts +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +13 -9
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +5 -4
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +3 -3
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +5 -5
- package/lib-commonjs/components/Button/index.d.ts +2 -2
- package/lib-commonjs/components/Button/index.js +3 -5
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.d.ts +1 -1
- package/lib-commonjs/components/Button/renderButton.js +6 -6
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.d.ts +1 -1
- package/lib-commonjs/components/Button/useButton.js +3 -3
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +1 -9
- package/lib-commonjs/components/Button/useButtonStyles.js +18 -26
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -3
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +4 -4
- package/lib-commonjs/components/CompoundButton/index.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +3 -3
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +7 -7
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +4 -4
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +23 -22
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -3
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +3 -8
- package/lib-commonjs/components/MenuButton/index.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/index.js +3 -3
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +6 -6
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +5 -5
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +8 -8
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -3
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +6 -4
- package/lib-commonjs/components/SplitButton/index.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/index.js +3 -3
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +6 -6
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +18 -6
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +11 -9
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -3
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +2 -1
- package/lib-commonjs/components/ToggleButton/index.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +3 -3
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +14 -10
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +10 -8
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/package.json +9 -11
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC"}
|
@@ -2,4 +2,4 @@ import type { ButtonState } from './Button.types';
|
|
2
2
|
/**
|
3
3
|
* Renders a Button component by passing the state defined props to the appropriate slots.
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderButton_unstable: (state: ButtonState) => JSX.Element;
|
@@ -4,18 +4,18 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
4
4
|
* Renders a Button component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
6
|
|
7
|
-
export const
|
7
|
+
export const renderButton_unstable = state => {
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
|
-
} = getSlots(state
|
11
|
+
} = getSlots(state);
|
12
12
|
const {
|
13
13
|
iconOnly,
|
14
14
|
iconPosition
|
15
15
|
} = state;
|
16
16
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
17
|
-
}, iconPosition !== 'after' && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
18
|
-
}), !iconOnly && state.root.children, iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
17
|
+
}, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
18
|
+
}), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
19
19
|
}));
|
20
20
|
};
|
21
21
|
//# sourceMappingURL=renderButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAuB;AAC1D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAc,KAAd,CAArC;AACA,QAAM;AAAE,IAAA,QAAF;AAAY,IAAA;AAAZ,MAA6B,KAAnC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAD7C,EAEG,CAAC,QAAD,IAAa,KAAK,CAAC,IAAN,CAAW,QAF3B,EAGG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAH7C,CADF;AAOD,CAXM","sourceRoot":""}
|
@@ -5,4 +5,4 @@ import type { ButtonProps, ButtonState } from './Button.types';
|
|
5
5
|
* @param props - User provided props to the Button component.
|
6
6
|
* @param ref - User provided ref to be passed to the Button component.
|
7
7
|
*/
|
8
|
-
export declare const
|
8
|
+
export declare const useButton_unstable: (props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ButtonState;
|
@@ -6,7 +6,7 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
|
|
6
6
|
* @param ref - User provided ref to be passed to the Button component.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export const
|
9
|
+
export const useButton_unstable = (props, ref) => {
|
10
10
|
const {
|
11
11
|
appearance,
|
12
12
|
as,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button/useButton.ts"],"names":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KAA7B,CAFY,CAnBtB;AA8BL,IAAA,IAAI,EAAE;AA9BD,GAAP;AAgCD,CAjDM","sourceRoot":""}
|
@@ -1,11 +1,3 @@
|
|
1
1
|
import type { ButtonState } from './Button.types';
|
2
2
|
export declare const buttonClassName = "fui-Button";
|
3
|
-
export declare const
|
4
|
-
smallest: string;
|
5
|
-
smaller: string;
|
6
|
-
small: string;
|
7
|
-
medium: string;
|
8
|
-
large: string;
|
9
|
-
larger: string;
|
10
|
-
};
|
11
|
-
export declare const useButtonStyles: (state: ButtonState) => ButtonState;
|
3
|
+
export declare const useButtonStyles_unstable: (state: ButtonState) => ButtonState;
|
@@ -1,16 +1,7 @@
|
|
1
|
-
import { shorthands, __styles, mergeClasses } from '@
|
1
|
+
import { shorthands, __styles, mergeClasses } from '@griffel/react';
|
2
2
|
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
export const buttonSpacing = {
|
7
|
-
smallest: '2px',
|
8
|
-
smaller: '4px',
|
9
|
-
small: '6px',
|
10
|
-
medium: '8px',
|
11
|
-
large: '12px',
|
12
|
-
larger: '16px'
|
13
|
-
};
|
3
|
+
import { tokens } from '@fluentui/react-theme';
|
4
|
+
export const buttonClassName = 'fui-Button';
|
14
5
|
|
15
6
|
const useRootStyles = /*#__PURE__*/__styles({
|
16
7
|
"base": {
|
@@ -149,10 +140,10 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
149
140
|
"uwmqm3": ["f177v4lu", "f19lj068"],
|
150
141
|
"Bqenvij": "frvgh55",
|
151
142
|
"Bf4jedk": "fh7ncta",
|
152
|
-
"Bbmb7ep": ["
|
153
|
-
"Beyfa6y": ["
|
154
|
-
"B7oj6ja": ["
|
155
|
-
"Btl43ni": ["
|
143
|
+
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
144
|
+
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
145
|
+
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
146
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
156
147
|
"Be2twd7": "fy9rknc",
|
157
148
|
"Bhrd7zp": "figsok6",
|
158
149
|
"Bg96gwp": "fwrc4pm"
|
@@ -192,7 +183,7 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
192
183
|
"Bg96gwp": "faaz57k"
|
193
184
|
}
|
194
185
|
}, {
|
195
|
-
"d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fmrv4ls{vertical-align:middle;}", ".f1hu3pq6{margin-top:0;}", ".f11qmguv{margin-right:0;}", ".f1tyq0we{margin-left:0;}", ".f19f4twv{margin-bottom:0;}", ".f1n52uh2{max-width:280px;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fz5stix{white-space:nowrap;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1s6fcnf{outline-style:none;}", ".f6dzj5z{max-width:100%;}", ".fly5x3f{width:100%;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".fhovq9v{background-color:var(--colorSubtleBackground);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1g0x7ka{padding-top:0;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1qch9an{padding-bottom:0;}", ".frvgh55{height:24px;}", ".fh7ncta{min-width:64px;}", ".
|
186
|
+
"d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fmrv4ls{vertical-align:middle;}", ".f1hu3pq6{margin-top:0;}", ".f11qmguv{margin-right:0;}", ".f1tyq0we{margin-left:0;}", ".f19f4twv{margin-bottom:0;}", ".f1n52uh2{max-width:280px;}", ".f1p9o1ba{overflow-x:hidden;}", ".f1sil6mw{overflow-y:hidden;}", ".f1cmbuwj{text-overflow:ellipsis;}", ".fz5stix{white-space:nowrap;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f1s6fcnf{outline-style:none;}", ".f6dzj5z{max-width:100%;}", ".fly5x3f{width:100%;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".fhovq9v{background-color:var(--colorSubtleBackground);}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1g0x7ka{padding-top:0;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1qch9an{padding-bottom:0;}", ".frvgh55{height:24px;}", ".fh7ncta{min-width:64px;}", ".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);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fgfbwa2{-webkit-column-gap:6px;column-gap:6px;}", ".f1y3hx6l{row-gap:6px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".f1d2rq10{height:32px;}", ".f14es27b{min-width:96px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fbhnoac{height:40px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}"],
|
196
187
|
"h": [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fvcxoqz:hover{border-top-color:var(--colorNeutralStroke1Hover);}", ".f1ub3y4t:hover{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1m52nbi:hover{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1xlaoq0:hover{border-bottom-color:var(--colorNeutralStroke1Hover);}", ".fax3udt:hover{color:var(--colorNeutralForeground1);}", ".f8491dx:hover{cursor:pointer;}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}", ".f15wkkf3:hover{background-color:var(--colorBrandBackgroundHover);}", ".f1s2uweq:hover{border-top-color:transparent;}", ".fr80ssc:hover{border-right-color:transparent;}", ".fecsdlb:hover{border-left-color:transparent;}", ".f1ukrpxl:hover{border-bottom-color:transparent;}", ".f1rq72xc:hover{color:var(--colorNeutralForegroundOnBrand);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".f139oj5f:hover{color:var(--colorNeutralForeground2BrandHover);}"],
|
197
188
|
"a": [".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}", ".fvs00aa:active{border-top-color:var(--colorNeutralStroke1Pressed);}", ".f1assf6x:active{border-right-color:var(--colorNeutralStroke1Pressed);}", ".f4ruux4:active{border-left-color:var(--colorNeutralStroke1Pressed);}", ".fumykes:active{border-bottom-color:var(--colorNeutralStroke1Pressed);}", ".f1r2dosr:active{color:var(--colorNeutralForeground1);}", ".fb0xa7e:active{outline-style:none;}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}", ".fsp1bjw:active{background-color:var(--colorBrandBackgroundPressed);}", ".ff472gp:active{border-top-color:transparent;}", ".f4yyc7m:active{border-right-color:transparent;}", ".ft2aflc:active{border-left-color:transparent;}", ".fggejwh:active{border-bottom-color:transparent;}", ".f18otbis:active{color:var(--colorNeutralForegroundOnBrand);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}", ".f19au66r:active{color:var(--colorNeutralForeground2BrandPressed);}"]
|
198
189
|
});
|
@@ -396,7 +387,7 @@ const useIconStyles = /*#__PURE__*/__styles({
|
|
396
387
|
"d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
|
397
388
|
});
|
398
389
|
|
399
|
-
export const
|
390
|
+
export const useButtonStyles_unstable = state => {
|
400
391
|
const rootStyles = useRootStyles();
|
401
392
|
const rootDisabledStyles = useRootDisabledStyles();
|
402
393
|
const rootFocusStyles = useRootFocusStyles();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Button/useButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/useButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,YAAiC,YAAjC,QAAqD,gBAArD;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAGA,OAAO,MAAM,eAAe,GAAG,YAAxB;;AAEP,MAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAU,KAAK,QAAQ,IAAI,iBAAjB,CAAV,IAAiD,kBAAkB,CAAC,UAAD,CAZlC,EAcjC;AACA,EAAA,eAAe,CAAC,IAfiB,EAgBjC,UAAU,KAAK,SAAf,IAA4B,eAAe,CAAC,OAhBX,EAiBjC,eAAe,CAAC,IAAD,CAjBkB,EAkBjC,eAAe,CAAC,KAAD,CAlBkB,EAoBjC;AACA,EAAA,QAAQ,IAAI,kBAAkB,CAAC,IAAD,CArBG,EAuBjC;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAxBsB,CAAnC;;AA2BA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,IAAD,CAA5B,EAAoC,KAAK,CAAC,IAAN,CAAW,SAA/C,CAAnC;AACD;;AAED,SAAO,KAAP;AACD,CAzCM","sourceRoot":""}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { renderCompoundButton_unstable } from './renderCompoundButton';
|
3
|
+
import { useCompoundButton_unstable } from './useCompoundButton';
|
4
|
+
import { useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
|
5
5
|
/**
|
6
6
|
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
7
7
|
*/
|
8
8
|
|
9
9
|
export const CompoundButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
-
const state =
|
11
|
-
|
12
|
-
return
|
10
|
+
const state = useCompoundButton_unstable(props, ref);
|
11
|
+
useCompoundButtonStyles_unstable(state);
|
12
|
+
return renderCompoundButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
13
13
|
});
|
14
14
|
CompoundButton.displayName = 'CompoundButton';
|
15
15
|
//# sourceMappingURL=CompoundButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,6BAAT,QAA8C,wBAA9C;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AACA,SAAS,gCAAT,QAAiD,2BAAjD;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,0BAA0B,CAAC,KAAD,EAAQ,GAAR,CAAxC;AAEA,EAAA,gCAAgC,CAAC,KAAD,CAAhC;AAEA,SAAO,6BAA6B,CAAC,KAAD,CAApC,CALsG,CAMtG;AACD,CAPuE,CAAjE;AASP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
2
|
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
3
|
export declare type CompoundButtonSlots = ButtonSlots & {
|
4
4
|
/**
|
5
5
|
* Second line of text that describes the action this button takes.
|
6
6
|
*/
|
7
|
-
secondaryContent?:
|
7
|
+
secondaryContent?: Slot<'span'>;
|
8
8
|
/**
|
9
9
|
* Container that wraps the children and the secondaryContent slot.
|
10
10
|
*/
|
11
|
-
contentContainer:
|
11
|
+
contentContainer: NonNullable<Slot<'span'>>;
|
12
12
|
};
|
13
|
-
export declare type CompoundButtonProps = ComponentProps<CompoundButtonSlots
|
13
|
+
export declare type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> & Partial<ButtonCommons>;
|
14
14
|
export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
|
@@ -2,4 +2,4 @@ export * from './CompoundButton';
|
|
2
2
|
export * from './CompoundButton.types';
|
3
3
|
export * from './renderCompoundButton';
|
4
4
|
export * from './useCompoundButton';
|
5
|
-
export { compoundButtonClassName,
|
5
|
+
export { compoundButtonClassName, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
|
@@ -2,5 +2,5 @@ export * from './CompoundButton';
|
|
2
2
|
export * from './CompoundButton.types';
|
3
3
|
export * from './renderCompoundButton';
|
4
4
|
export * from './useCompoundButton';
|
5
|
-
export { compoundButtonClassName,
|
5
|
+
export { compoundButtonClassName, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CompoundButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CompoundButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC"}
|
@@ -2,4 +2,4 @@ import type { CompoundButtonState } from './CompoundButton.types';
|
|
2
2
|
/**
|
3
3
|
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderCompoundButton_unstable: (state: CompoundButtonState) => JSX.Element;
|
@@ -4,20 +4,20 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
4
4
|
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
6
|
|
7
|
-
export const
|
7
|
+
export const renderCompoundButton_unstable = state => {
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
|
-
} = getSlots(state
|
11
|
+
} = getSlots(state);
|
12
12
|
const {
|
13
13
|
iconOnly,
|
14
14
|
iconPosition
|
15
15
|
} = state;
|
16
16
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
17
|
-
}, iconPosition !== 'after' && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
17
|
+
}, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
18
18
|
}), !iconOnly && /*#__PURE__*/React.createElement(slots.contentContainer, { ...slotProps.contentContainer
|
19
|
-
}, slotProps.root.children, /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
20
|
-
})), iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
19
|
+
}, slotProps.root.children, slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
20
|
+
})), iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
21
21
|
}));
|
22
22
|
};
|
23
23
|
//# sourceMappingURL=renderCompoundButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,CAArC;AACA,QAAM;AAAE,IAAA,QAAF;AAAY,IAAA;AAAZ,MAA6B,KAAnC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAD7C,EAEG,CAAC,QAAD,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAF7B,CAHJ,EAQG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAR7C,CADF;AAYD,CAhBM","sourceRoot":""}
|
@@ -5,4 +5,4 @@ import type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.
|
|
5
5
|
* @param props - User provided props to the CompoundButton component.
|
6
6
|
* @param ref - User provided ref to be passed to the CompoundButton component.
|
7
7
|
*/
|
8
|
-
export declare const
|
8
|
+
export declare const useCompoundButton_unstable: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
2
|
-
import {
|
2
|
+
import { useButton_unstable } from '../Button/index';
|
3
3
|
/**
|
4
4
|
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
5
5
|
* @param props - User provided props to the CompoundButton component.
|
6
6
|
* @param ref - User provided ref to be passed to the CompoundButton component.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export const
|
9
|
+
export const useCompoundButton_unstable = ({
|
10
10
|
contentContainer,
|
11
11
|
secondaryContent,
|
12
12
|
...props
|
13
13
|
}, ref) => {
|
14
14
|
return { // Button state
|
15
|
-
...
|
15
|
+
...useButton_unstable(props, ref),
|
16
16
|
// Slots definition
|
17
17
|
components: {
|
18
18
|
root: 'button',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA,SAAS,kBAAT,QAAmC,iBAAnC;AAEA;;;;AAIG;;AACH,OAAO,MAAM,0BAA0B,GAAG,CACxC;AAAE,EAAA,gBAAF;AAAoB,EAAA,gBAApB;AAAsC,KAAG;AAAzC,CADwC,EAExC,GAFwC,KAGjB;AACvB,SAAO,EACL;AACA,OAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAFhB;AAIL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KALP;AAWL,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD,EAAmB;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnB,CAX7B;AAYL,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD;AAZ7B,GAAP;AAcD,CAlBM","sourceRoot":""}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { CompoundButtonState } from './CompoundButton.types';
|
2
2
|
export declare const compoundButtonClassName = "fui-CompoundButton";
|
3
|
-
export declare const
|
3
|
+
export declare const useCompoundButtonStyles_unstable: (state: CompoundButtonState) => CompoundButtonState;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { shorthands, mergeClasses, __styles } from '@
|
2
|
-
import {
|
1
|
+
import { shorthands, mergeClasses, __styles } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
3
|
+
import { useButtonStyles_unstable } from '../Button/useButtonStyles';
|
3
4
|
export const compoundButtonClassName = 'fui-CompoundButton';
|
4
5
|
const CompoundButtonClassNames = {
|
5
6
|
secondaryContent: `${compoundButtonClassName}-secondaryContent`
|
@@ -33,23 +34,23 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
33
34
|
"small": {
|
34
35
|
"z8tnut": "fp9bwmr",
|
35
36
|
"z189sj": ["f19lj068", "f177v4lu"],
|
36
|
-
"Byoj8tv": "
|
37
|
+
"Byoj8tv": "f1fow5ox",
|
37
38
|
"uwmqm3": ["f177v4lu", "f19lj068"],
|
38
39
|
"Be2twd7": "fkhj508",
|
39
40
|
"Bg96gwp": "f1i3iumi"
|
40
41
|
},
|
41
42
|
"medium": {
|
42
|
-
"z8tnut": "
|
43
|
+
"z8tnut": "fbtff6s",
|
43
44
|
"z189sj": ["f11qrl6u", "fjlbh76"],
|
44
|
-
"Byoj8tv": "
|
45
|
+
"Byoj8tv": "fp67ikv",
|
45
46
|
"uwmqm3": ["fjlbh76", "f11qrl6u"],
|
46
47
|
"Be2twd7": "fkhj508",
|
47
48
|
"Bg96gwp": "f1i3iumi"
|
48
49
|
},
|
49
50
|
"large": {
|
50
|
-
"z8tnut": "
|
51
|
+
"z8tnut": "fm4bm3s",
|
51
52
|
"z189sj": ["f1gbmcue", "f1rh9g5y"],
|
52
|
-
"Byoj8tv": "
|
53
|
+
"Byoj8tv": "fe2my4m",
|
53
54
|
"uwmqm3": ["f1rh9g5y", "f1gbmcue"],
|
54
55
|
"Be2twd7": "fod5ikn",
|
55
56
|
"Bg96gwp": "faaz57k"
|
@@ -60,7 +61,7 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
60
61
|
"n4n7rj": "f1xrf5v0"
|
61
62
|
}
|
62
63
|
}, {
|
63
|
-
"d": [".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".f11ysow2{height:auto;}", ".f900oq5 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1ur7rb7 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".
|
64
|
+
"d": [".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".f11ysow2{height:auto;}", ".f900oq5 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1ur7rb7 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1fow5ox{padding-bottom:10px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbtff6s{padding-top:14px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fp67ikv{padding-bottom:16px;}", ".fm4bm3s{padding-top:18px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fe2my4m{padding-bottom:20px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fj9njph .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
64
65
|
"h": [".f8rpug0:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".f1itoici:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f1l9nom2:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fr13fpv:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
65
66
|
"a": [".fre7xro:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1uen3ov:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fvjq8kx:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1xrf5v0:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
|
66
67
|
});
|
@@ -117,7 +118,6 @@ const useContentContainerStyles = /*#__PURE__*/__styles({
|
|
117
118
|
const useSecondaryContentStyles = /*#__PURE__*/__styles({
|
118
119
|
"base": {
|
119
120
|
"Bg96gwp": "flkuc6h",
|
120
|
-
"B6of3ja": "fvjh0tl",
|
121
121
|
"Bhrd7zp": "figsok6"
|
122
122
|
},
|
123
123
|
"small": {
|
@@ -130,10 +130,10 @@ const useSecondaryContentStyles = /*#__PURE__*/__styles({
|
|
130
130
|
"Be2twd7": "fkhj508"
|
131
131
|
}
|
132
132
|
}, {
|
133
|
-
"d": [".flkuc6h{line-height:100%;}", ".
|
133
|
+
"d": [".flkuc6h{line-height:100%;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
|
134
134
|
});
|
135
135
|
|
136
|
-
export const
|
136
|
+
export const useCompoundButtonStyles_unstable = state => {
|
137
137
|
const rootStyles = useRootStyles();
|
138
138
|
const rootIconOnlyStyles = useRootIconOnlyStyles();
|
139
139
|
const iconStyles = useIconStyles();
|
@@ -162,7 +162,7 @@ export const useCompoundButtonStyles = state => {
|
|
162
162
|
state.secondaryContent.className = mergeClasses(CompoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
|
163
163
|
}
|
164
164
|
|
165
|
-
|
165
|
+
useButtonStyles_unstable(state);
|
166
166
|
return state;
|
167
167
|
};
|
168
168
|
//# sourceMappingURL=useCompoundButtonStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,wBAAT,QAAyC,2BAAzC;AAGA,OAAO,MAAM,uBAAuB,GAAG,oBAAhC;AAEP,MAAM,wBAAwB,GAAG;AAC/B,EAAA,gBAAgB,EAAE,GAAG,uBAAuB;AADb,CAAjC;;AAIA,MAAM,aAAa,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAwHA,MAAM,qBAAqB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAAC,sBAAsB,CAAC,IAAxB,EAA8B,KAAK,CAAC,gBAAN,CAAuB,SAArD,CAA/C;;AAEA,MAAI,KAAK,CAAC,gBAAV,EAA4B;AAC1B,IAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,YAAY,CAC7C,wBAAwB,CAAC,gBADoB,EAE7C,sBAAsB,CAAC,IAFsB,EAG7C,sBAAsB,CAAC,IAAD,CAHuB,EAI7C,KAAK,CAAC,gBAAN,CAAuB,SAJsB,CAA/C;AAMD;;AAED,EAAA,wBAAwB,CAAC,KAAD,CAAxB;AAEA,SAAO,KAAP;AACD,CA7CM","sourceRoot":""}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { renderMenuButton_unstable } from './renderMenuButton';
|
3
|
+
import { useMenuButton_unstable } from './useMenuButton';
|
4
|
+
import { useMenuButtonStyles_unstable } from './useMenuButtonStyles';
|
5
5
|
/**
|
6
6
|
* MenuButtons are buttons that handle opening and closing a menu when they are triggered.
|
7
7
|
*/
|
8
8
|
|
9
9
|
export const MenuButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
-
const state =
|
11
|
-
|
12
|
-
return
|
10
|
+
const state = useMenuButton_unstable(props, ref);
|
11
|
+
useMenuButtonStyles_unstable(state);
|
12
|
+
return renderMenuButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
13
13
|
});
|
14
14
|
MenuButton.displayName = 'MenuButton';
|
15
15
|
//# sourceMappingURL=MenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AAEA,SAAO,yBAAyB,CAAC,KAAD,CAAhC,CAL8F,CAM9F;AACD,CAP+D,CAAzD;AASP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourceRoot":""}
|
@@ -1,15 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
3
2
|
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
4
|
-
declare type MenuTriggerChildProps = Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'> & {
|
5
|
-
ref?: React.Ref<never>;
|
6
|
-
};
|
7
3
|
export declare type MenuButtonSlots = ButtonSlots & {
|
8
4
|
/**
|
9
5
|
* Menu icon that indicates that this button has a menu that can be expanded.
|
10
6
|
*/
|
11
|
-
menuIcon?:
|
7
|
+
menuIcon?: Slot<'span'>;
|
12
8
|
};
|
13
|
-
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'
|
9
|
+
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>>;
|
14
10
|
export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
|
15
|
-
export {};
|
@@ -2,4 +2,4 @@ export * from './MenuButton.types';
|
|
2
2
|
export * from './MenuButton';
|
3
3
|
export * from './renderMenuButton';
|
4
4
|
export * from './useMenuButton';
|
5
|
-
export { menuButtonClassName,
|
5
|
+
export { menuButtonClassName, useMenuButtonStyles_unstable } from './useMenuButtonStyles';
|
@@ -2,5 +2,5 @@ export * from './MenuButton.types';
|
|
2
2
|
export * from './MenuButton';
|
3
3
|
export * from './renderMenuButton';
|
4
4
|
export * from './useMenuButton';
|
5
|
-
export { menuButtonClassName,
|
5
|
+
export { menuButtonClassName, useMenuButtonStyles_unstable } from './useMenuButtonStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC"}
|
@@ -2,4 +2,4 @@ import type { MenuButtonState } from './MenuButton.types';
|
|
2
2
|
/**
|
3
3
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderMenuButton_unstable: (state: MenuButtonState) => JSX.Element;
|
@@ -4,18 +4,18 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
4
4
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
6
|
|
7
|
-
export const
|
7
|
+
export const renderMenuButton_unstable = state => {
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
|
-
} = getSlots(state
|
11
|
+
} = getSlots(state);
|
12
12
|
const {
|
13
13
|
icon,
|
14
14
|
iconOnly
|
15
15
|
} = state;
|
16
16
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
17
|
-
}, /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
18
|
-
}), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && /*#__PURE__*/React.createElement(slots.menuIcon, { ...slotProps.menuIcon
|
17
|
+
}, slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
18
|
+
}), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && /*#__PURE__*/React.createElement(slots.menuIcon, { ...slotProps.menuIcon
|
19
19
|
}));
|
20
20
|
};
|
21
21
|
//# sourceMappingURL=renderMenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAkB,KAAlB,CAArC;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAqB,KAA3B;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADjB,EAEG,CAAC,QAAD,IAAa,SAAS,CAAC,IAAV,CAAe,QAF/B,EAGG,CAAC,CAAC,QAAD,IAAa,EAAC,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,QAAP,CAAd,KAAkC,KAAK,CAAC,QAAxC,iBAAoD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAHvD,CADF;AAOD,CAXM","sourceRoot":""}
|
@@ -3,4 +3,4 @@ import type { MenuButtonProps, MenuButtonState } from './MenuButton.types';
|
|
3
3
|
/**
|
4
4
|
* Given user props, returns the final state for a MenuButton.
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useMenuButton_unstable: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
2
|
+
import { ChevronDownRegular } from '@fluentui/react-icons';
|
3
3
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
4
|
-
import {
|
4
|
+
import { useButton_unstable } from '../Button/index';
|
5
5
|
/**
|
6
6
|
* Given user props, returns the final state for a MenuButton.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export const
|
9
|
+
export const useMenuButton_unstable = ({
|
10
10
|
menuIcon,
|
11
11
|
...props
|
12
12
|
}, ref) => {
|
13
|
-
const buttonState =
|
13
|
+
const buttonState = useButton_unstable(props, ref);
|
14
14
|
return { // Button state
|
15
15
|
...buttonState,
|
16
16
|
// State calculated from a set of props
|
@@ -23,7 +23,7 @@ export const useMenuButton = ({
|
|
23
23
|
},
|
24
24
|
menuIcon: resolveShorthand(menuIcon, {
|
25
25
|
defaultProps: {
|
26
|
-
children:
|
26
|
+
children: /*#__PURE__*/React.createElement(ChevronDownRegular, null)
|
27
27
|
},
|
28
28
|
required: true
|
29
29
|
})
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuButton/useMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/useMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,uBAAnC;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,kBAAT,QAAmC,iBAAnC;AAGA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CACpC;AAAE,EAAA,QAAF;AAAY,KAAG;AAAf,CADoC,EAEpC,GAFoC,KAGjB;AACnB,QAAM,WAAW,GAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAAtC;AACA,SAAO,EACL;AACA,OAAG,WAFE;AAIL;AACA,IAAA,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,QAAR,CALZ;AAOL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,QAAQ,EAAE;AAHA,KARP;AAcL,IAAA,QAAQ,EAAE,gBAAgB,CAAC,QAAD,EAAW;AACnC,MAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAC,kBAAD,EAAmB,IAAnB;AADE,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAAX;AAdrB,GAAP;AAqBD,CA1BM","sourceRoot":""}
|