@fluentui/react-button 9.0.0-alpha.10 → 9.0.0-alpha.100
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +2418 -1
- package/CHANGELOG.md +920 -2
- package/README.md +19 -108
- package/dist/demo/index.html +71 -0
- package/dist/demo/react-dom.development.js +21413 -0
- package/dist/demo/react.development.js +3155 -0
- package/dist/react-button.d.ts +204 -82
- package/lib/Button.js.map +1 -1
- package/lib/CompoundButton.d.ts +1 -0
- package/lib/CompoundButton.js +2 -0
- package/lib/CompoundButton.js.map +1 -0
- package/lib/MenuButton.d.ts +1 -0
- package/lib/MenuButton.js +2 -0
- package/lib/MenuButton.js.map +1 -0
- package/lib/SplitButton.d.ts +1 -0
- package/lib/SplitButton.js +2 -0
- package/lib/SplitButton.js.map +1 -0
- package/lib/ToggleButton.d.ts +1 -0
- package/lib/ToggleButton.js +2 -0
- package/lib/ToggleButton.js.map +1 -0
- package/lib/common/isConformant.d.ts +4 -2
- package/lib/common/isConformant.js +9 -6
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Button/Button.d.ts +4 -11
- package/lib/components/Button/Button.js +7 -16
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +57 -60
- package/lib/components/Button/Button.types.js +1 -0
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.d.ts +1 -2
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.d.ts +2 -2
- package/lib/components/Button/renderButton.js +9 -8
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +5 -7
- package/lib/components/Button/useButton.js +49 -23
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +10 -4
- package/lib/components/Button/useButtonStyles.js +350 -378
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.d.ts +6 -0
- package/lib/components/CompoundButton/CompoundButton.js +15 -0
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +14 -0
- package/lib/components/CompoundButton/CompoundButton.types.js +2 -0
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -0
- package/lib/components/CompoundButton/index.d.ts +5 -0
- package/lib/components/CompoundButton/index.js +6 -0
- package/lib/components/CompoundButton/index.js.map +1 -0
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +5 -0
- package/lib/components/CompoundButton/renderCompoundButton.js +17 -0
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButton.d.ts +8 -0
- package/lib/components/CompoundButton/useCompoundButton.js +29 -0
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +164 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.d.ts +6 -0
- package/lib/components/MenuButton/MenuButton.js +15 -0
- package/lib/components/MenuButton/MenuButton.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.types.d.ts +11 -0
- package/lib/components/MenuButton/MenuButton.types.js +2 -0
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -0
- package/lib/components/MenuButton/index.d.ts +5 -0
- package/lib/components/MenuButton/index.js +6 -0
- package/lib/components/MenuButton/index.js.map +1 -0
- package/lib/components/MenuButton/renderMenuButton.d.ts +5 -0
- package/lib/components/MenuButton/renderMenuButton.js +17 -0
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -0
- package/lib/components/MenuButton/useMenuButton.d.ts +6 -0
- package/lib/components/MenuButton/useMenuButton.js +32 -0
- package/lib/components/MenuButton/useMenuButton.js.map +1 -0
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js +34 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib/components/SplitButton/SplitButton.js +16 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.types.d.ts +19 -0
- package/lib/components/SplitButton/SplitButton.types.js +2 -0
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
- package/lib/components/SplitButton/index.d.ts +5 -0
- package/lib/components/SplitButton/index.js +6 -0
- package/lib/components/SplitButton/index.js.map +1 -0
- package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
- package/lib/components/SplitButton/renderSplitButton.js +15 -0
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib/components/SplitButton/useSplitButton.d.ts +8 -0
- package/lib/components/SplitButton/useSplitButton.js +73 -0
- package/lib/components/SplitButton/useSplitButton.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js +77 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.d.ts +6 -0
- package/lib/components/ToggleButton/ToggleButton.js +15 -0
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +19 -0
- package/lib/components/ToggleButton/ToggleButton.types.js +2 -0
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -0
- package/lib/components/ToggleButton/index.d.ts +5 -0
- package/lib/components/ToggleButton/index.js +6 -0
- package/lib/components/ToggleButton/index.js.map +1 -0
- package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib/components/ToggleButton/renderToggleButton.js +2 -0
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButton.d.ts +9 -0
- package/lib/components/ToggleButton/useToggleButton.js +50 -0
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js +190 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Button.js +7 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.d.ts +1 -0
- package/lib-commonjs/CompoundButton.js +10 -0
- package/lib-commonjs/CompoundButton.js.map +1 -0
- package/lib-commonjs/MenuButton.d.ts +1 -0
- package/lib-commonjs/MenuButton.js +10 -0
- package/lib-commonjs/MenuButton.js.map +1 -0
- package/lib-commonjs/SplitButton.d.ts +1 -0
- package/lib-commonjs/SplitButton.js +10 -0
- package/lib-commonjs/SplitButton.js.map +1 -0
- package/lib-commonjs/ToggleButton.d.ts +1 -0
- package/lib-commonjs/ToggleButton.js +10 -0
- package/lib-commonjs/ToggleButton.js.map +1 -0
- package/lib-commonjs/common/isConformant.d.ts +4 -2
- package/lib-commonjs/common/isConformant.js +19 -8
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Button/Button.d.ts +4 -11
- package/lib-commonjs/components/Button/Button.js +20 -20
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +57 -60
- package/lib-commonjs/components/Button/Button.types.js +4 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.d.ts +1 -2
- package/lib-commonjs/components/Button/index.js +21 -5
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.d.ts +2 -2
- package/lib-commonjs/components/Button/renderButton.js +24 -13
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.d.ts +5 -7
- package/lib-commonjs/components/Button/useButton.js +59 -24
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +10 -4
- package/lib-commonjs/components/Button/useButtonStyles.js +360 -379
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +6 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +26 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +14 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +6 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/index.d.ts +5 -0
- package/lib-commonjs/components/CompoundButton/index.js +26 -0
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +5 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +29 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +8 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +41 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +175 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.d.ts +6 -0
- package/lib-commonjs/components/MenuButton/MenuButton.js +26 -0
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +11 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.js +6 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -0
- package/lib-commonjs/components/MenuButton/index.d.ts +5 -0
- package/lib-commonjs/components/MenuButton/index.js +26 -0
- package/lib-commonjs/components/MenuButton/index.js.map +1 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +5 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +29 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +6 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.js +46 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +44 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js +27 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +19 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
- package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
- package/lib-commonjs/components/SplitButton/index.js +26 -0
- package/lib-commonjs/components/SplitButton/index.js.map +1 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +27 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +8 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.js +86 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +88 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +6 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +26 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +19 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +6 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/index.d.ts +5 -0
- package/lib-commonjs/components/ToggleButton/index.js +26 -0
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +16 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +9 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +63 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +200 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib-commonjs/index.d.ts +4 -0
- package/lib-commonjs/index.js +15 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +21 -14
- package/config/api-extractor.json +0 -3
- package/config/pre-copy.json +0 -9
- package/config/tests.js +0 -6
- package/etc/react-button.api.md +0 -104
- package/just.config.ts +0 -3
- package/lib/components/Button/useButtonState.d.ts +0 -6
- package/lib/components/Button/useButtonState.js +0 -45
- package/lib/components/Button/useButtonState.js.map +0 -1
- package/lib-amd/Button.d.ts +0 -1
- package/lib-amd/Button.js +0 -6
- package/lib-amd/Button.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -2
- package/lib-amd/common/isConformant.js +0 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Button/Button.d.ts +0 -13
- package/lib-amd/components/Button/Button.js +0 -24
- package/lib-amd/components/Button/Button.js.map +0 -1
- package/lib-amd/components/Button/Button.types.d.ts +0 -65
- package/lib-amd/components/Button/Button.types.js +0 -5
- package/lib-amd/components/Button/Button.types.js.map +0 -1
- package/lib-amd/components/Button/index.d.ts +0 -6
- package/lib-amd/components/Button/index.js +0 -10
- package/lib-amd/components/Button/index.js.map +0 -1
- package/lib-amd/components/Button/renderButton.d.ts +0 -5
- package/lib-amd/components/Button/renderButton.js +0 -16
- package/lib-amd/components/Button/renderButton.js.map +0 -1
- package/lib-amd/components/Button/useButton.d.ts +0 -10
- package/lib-amd/components/Button/useButton.js +0 -28
- package/lib-amd/components/Button/useButton.js.map +0 -1
- package/lib-amd/components/Button/useButtonState.d.ts +0 -6
- package/lib-amd/components/Button/useButtonState.js +0 -48
- package/lib-amd/components/Button/useButtonState.js.map +0 -1
- package/lib-amd/components/Button/useButtonStyles.d.ts +0 -4
- package/lib-amd/components/Button/useButtonStyles.js +0 -385
- package/lib-amd/components/Button/useButtonStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -1
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/lib-commonjs/components/Button/useButtonState.d.ts +0 -6
- package/lib-commonjs/components/Button/useButtonState.js +0 -47
- package/lib-commonjs/components/Button/useButtonState.js.map +0 -1
- package/src/components/Button/Button.types.ts +0 -120
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useButtonStyles.js","sourceRoot":"../src/","sources":["components/Button/useButtonStyles.ts"],"names":[],"mappings":";;AACA,iEAAmE;AAGnE,6EAA6E;AAC7E,sEAAsE;AACtE,IAAM,aAAa,GAAG;IACpB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;CACf,CAAC;AAEF,oGAAoG;AACpG,mGAAmG;AACtF,QAAA,gBAAgB,GAAG,UAAC,KA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AAC;KACF;CACF,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,UAAC,KAAkB,EAAE,SAA+B;IACjF,KAAK,CAAC,SAAS,GAAG,sBAAE,CAAC,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IACrD,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAE7C,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,sBAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;IACtF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,sBAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC","sourcesContent":["import { ButtonState, ButtonStyleSelectors, ButtonVariantTokens } from './Button.types';\nimport { ax, makeStylesCompat } from '@fluentui/react-make-styles';\nimport { Theme } from '@fluentui/react-theme';\n\n// TODO: These are named in design specs but not hoisted to global/alias yet.\n// We're tracking these here to determine how we can hoist them.\nconst buttonSpacing = {\n smallest: '2px',\n smaller: '4px',\n small: '6px',\n medium: '8px',\n large: '12px',\n larger: '16px',\n};\n\n// We do not want a combinatorial explosion of component variables for variants (bg, bgPrimary, etc)\n// We want a fixed interface of variables for a given component and to alter those between variants\nexport const makeButtonTokens = (theme: Theme): ButtonVariantTokens => ({\n base: {\n // TODO: these are not in the global/alias theme currently\n // When they are shown in the token UI, we need to make it clear there is no global/alias mapping support\n height: '32px',\n paddingX: buttonSpacing.large,\n paddingY: '0',\n minWidth: '96px',\n maxWidth: '280px',\n\n color: theme.alias.color.neutral.neutralForeground1,\n content2Color: theme.alias.color.neutral.neutralForeground2,\n background: theme.alias.color.neutral.neutralBackground1,\n backgroundPressed: theme.alias.color.neutral.neutralBackground1,\n\n borderRadius: theme.global.borderRadius.medium,\n borderWidth: theme.global.strokeWidth.thin,\n borderColor: theme.alias.color.neutral.neutralStroke1,\n\n backgroundHover: theme.alias.color.neutral.neutralBackground1Hover,\n borderColorHover: theme.alias.color.neutral.neutralStroke1Hover,\n\n backgroundActive: theme.alias.color.neutral.neutralBackground1Pressed,\n borderColorActive: theme.alias.color.neutral.neutralStroke1Pressed,\n\n fontWeight: theme.global.type.fontWeights.semibold,\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n\n iconSpacing: buttonSpacing.small,\n iconWidth: '20px',\n iconHeight: '20px',\n },\n disabled: {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n content2Color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n small: {\n paddingX: buttonSpacing.medium,\n borderRadius: theme.global.borderRadius.small,\n // TODO: design spec says minWidth \"can be toggled off\", consider prop like compact?\n minWidth: '64px',\n height: '24px',\n fontSize: theme.global.type.fontSizes.base[200],\n lineHeight: theme.global.type.fontSizes.base[200],\n fontWeight: theme.global.type.fontWeights.regular,\n },\n large: {\n paddingX: buttonSpacing.larger,\n height: '40px',\n borderRadius: theme.global.borderRadius.medium,\n fontSize: theme.global.type.fontSizes.base[400],\n // TODO: 24px is not on the global ramp of line heights\n // 22px = theme.global.type.lineHeights.base[400]\n // 28px = theme.global.type.lineHeights.base[500]\n lineHeight: '24px',\n iconWidth: '24px',\n iconHeight: '24px',\n iconSpacing: buttonSpacing.small,\n },\n // TODO: Would be ideal to automate a check to ensure when a variant is accessed, all the tokens are accessed as well.\n // If not, it means there is cruft in the variant tokens definition.\n // All tokens in a variant should be mapped to some style property.\n iconOnly: {\n paddingX: buttonSpacing.small,\n paddingY: buttonSpacing.small,\n minWidth: '32px',\n maxWidth: '32px',\n },\n // TODO: combinatorial \"variants\" is wrong, we already have iconOnly and small.\n // we essentially need to update component token mappings based on variant matchers.\n // fow the sake of progress for now, we're extending variants to have combinations.\n iconOnlySmall: {\n paddingX: buttonSpacing.smallest,\n paddingY: buttonSpacing.smallest,\n borderRadius: theme.global.borderRadius.small,\n minWidth: '24px',\n maxWidth: '24px',\n },\n iconOnlyLarge: {\n paddingX: buttonSpacing.small,\n paddingY: buttonSpacing.small,\n borderRadius: theme.global.borderRadius.medium,\n minWidth: '40px',\n maxWidth: '40px',\n },\n primary: {\n color: theme.alias.color.neutral.neutralForegroundInvertedAccessible,\n\n background: theme.alias.color.brand.brandBackground,\n borderColor: 'transparent',\n borderColorHover: 'transparent',\n borderColorActive: 'transparent',\n\n backgroundHover: theme.alias.color.brand.brandBackgroundHover,\n backgroundPressed: theme.alias.color.brand.brandBackgroundPressed,\n\n // TODO: spec calls out \"shadow 4 __brand__\", are we missing tokens?\n shadow: theme.alias.shadow.shadow4,\n\n // TODO: spec calls out \"shadow 2 __darker__\", are we missing tokens?\n shadowPressed: theme.alias.shadow.shadow2,\n },\n primaryDisabled: {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n // borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n content2Color: theme.alias.color.neutral.neutralForegroundDisabled,\n shadow: 'none',\n shadowPressed: 'none',\n },\n});\n\nconst useRootStyles = makeStylesCompat<ButtonStyleSelectors>([\n [\n null,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonTokens.base.iconSpacing,\n // // TODO: 1) ask designers what our vertical align strategy is\n // // 2) enforce with conformance for inline elements\n verticalAlign: 'text-bottom',\n margin: 0,\n\n padding: `${buttonTokens.base.paddingY} ${buttonTokens.base.paddingX}`,\n height: buttonTokens.base.height,\n\n minWidth: buttonTokens.base.minWidth,\n maxWidth: buttonTokens.base.maxWidth,\n\n color: buttonTokens.base.color,\n borderStyle: 'solid',\n borderRadius: buttonTokens.base.borderRadius,\n borderWidth: buttonTokens.base.borderWidth,\n borderColor: buttonTokens.base.borderColor,\n background: buttonTokens.base.background,\n\n outline: 'none',\n ':hover': {\n background: buttonTokens.base.backgroundHover,\n borderColor: buttonTokens.base.borderColorHover,\n cursor: 'pointer',\n },\n ':active': {\n background: buttonTokens.base.backgroundActive,\n borderColor: buttonTokens.base.borderColorActive,\n outline: 'none',\n },\n // TODO: this is for toggle button only. Use here in regular button?\n // '.active': theme.alias.color.neutral.neutralStroke1Pressed,\n };\n },\n ],\n [\n ({ size }) => size === 'small',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n padding: `${buttonTokens.small.paddingX} ${buttonTokens.small.paddingY}`,\n minWidth: buttonTokens.small.minWidth,\n height: buttonTokens.small.height,\n borderRadius: buttonTokens.small.borderRadius,\n };\n },\n ],\n [\n ({ size }) => size === 'large',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n gap: buttonTokens.large.iconSpacing,\n padding: `${buttonTokens.large.paddingX} ${buttonTokens.large.paddingY}`,\n height: buttonTokens.large.height,\n borderRadius: buttonTokens.large.borderRadius,\n };\n },\n ],\n [\n ({ disabled }) => disabled,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n background: buttonTokens.disabled.background,\n borderColor: buttonTokens.disabled.borderColor,\n color: buttonTokens.disabled.color,\n ':hover': {\n background: buttonTokens.disabled.background,\n borderColor: buttonTokens.disabled.borderColor,\n cursor: 'default',\n },\n ':active': {\n background: buttonTokens.disabled.background,\n borderColor: buttonTokens.disabled.borderColor,\n },\n };\n },\n ],\n [\n ({ primary }) => primary,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n background: buttonTokens.primary.background,\n color: buttonTokens.primary.color,\n borderColor: buttonTokens.primary.borderColor,\n // TODO: spec calls out \"shadow 4 __darker__\", are we missing tokens?\n boxShadow: buttonTokens.primary.shadow,\n\n ':hover': {\n background: buttonTokens.primary.backgroundHover,\n borderColor: buttonTokens.primary.borderColorHover,\n },\n\n ':active': {\n background: buttonTokens.primary.backgroundPressed,\n // TODO: spec calls out \"shadow 2 __darker__\", are we missing tokens?\n boxShadow: buttonTokens.primary.shadow,\n borderColor: buttonTokens.primary.borderColorActive,\n },\n\n // TODO: focus\n };\n },\n ],\n [\n ({ primary, disabled }) => primary && disabled,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n background: buttonTokens.primaryDisabled.background,\n color: buttonTokens.primaryDisabled.color,\n boxShadow: buttonTokens.primaryDisabled.shadow,\n ':hover': {\n background: buttonTokens.primaryDisabled.background,\n cursor: 'default',\n },\n ':active': {\n boxShadow: buttonTokens.primaryDisabled.shadowPressed,\n },\n };\n },\n ],\n [\n ({ iconOnly }) => iconOnly,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n padding: buttonTokens.iconOnly.paddingX,\n minWidth: buttonTokens.iconOnly.minWidth,\n maxWidth: buttonTokens.iconOnly.maxWidth,\n };\n },\n ],\n [\n ({ iconOnly, size }) => iconOnly && size === 'small',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n padding: `${buttonTokens.iconOnlySmall.paddingX} ${buttonTokens.iconOnlySmall.paddingY}`,\n minWidth: buttonTokens.iconOnlySmall.minWidth,\n maxWidth: buttonTokens.iconOnlySmall.maxWidth,\n borderRadius: buttonTokens.iconOnlySmall.borderRadius,\n };\n },\n ],\n [\n ({ iconOnly, size }) => iconOnly && size === 'large',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n padding: `${buttonTokens.iconOnlyLarge.paddingX} ${buttonTokens.iconOnlyLarge.paddingY}`,\n minWidth: buttonTokens.iconOnlyLarge.minWidth,\n maxWidth: buttonTokens.iconOnlyLarge.maxWidth,\n borderRadius: buttonTokens.iconOnlyLarge.borderRadius,\n };\n },\n ],\n // TODO: add disabled before ship prerelease\n]);\n\nconst useChildrenStyles = makeStylesCompat<ButtonStyleSelectors>([\n [\n null,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n // TODO: This is \"Body, Strong (?)\" token in the design spec (14px size, 20px line, semibold weight)\n // There are some type aliases in the figma not in our theme as well, not sure if this maps to alias or not\n fontWeight: buttonTokens.base.fontWeight,\n fontSize: buttonTokens.base.fontSize,\n lineHeight: buttonTokens.base.lineHeight,\n };\n },\n ],\n [\n ({ size }) => size === 'small',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n fontSize: buttonTokens.small.fontSize,\n fontWeight: buttonTokens.small.fontWeight,\n lineHeight: buttonTokens.small.lineHeight,\n };\n },\n ],\n [\n ({ size }) => size === 'large',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n fontSize: buttonTokens.large.fontSize,\n lineHeight: buttonTokens.large.lineHeight,\n };\n },\n ],\n]);\n\nconst useIconStyles = makeStylesCompat<ButtonStyleSelectors>([\n [\n null,\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: buttonTokens.base.iconHeight,\n width: buttonTokens.base.iconWidth,\n };\n },\n ],\n [\n ({ size }) => size === 'large',\n theme => {\n const buttonTokens = makeButtonTokens(theme);\n\n return {\n width: buttonTokens.large.iconWidth,\n height: buttonTokens.large.iconHeight,\n };\n },\n ],\n]);\n\nexport const useButtonStyles = (state: ButtonState, selectors: ButtonStyleSelectors) => {\n state.className = ax(state.className, useRootStyles(selectors));\n\n state.children = state.children || { className: '' };\n state.icon = state.icon || { className: '' };\n\n state.children.className = ax(state.children.className, useChildrenStyles(selectors));\n state.icon.className = ax(state.icon.className, useIconStyles(selectors));\n};\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/Button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,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,UAAU,CAAC,IAAxB,EAA8B,UAAU,CAAC,IAAD,CAAxC,EAAgD,KAAK,CAAC,IAAN,CAAW,SAA3D,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CAvCM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { CompoundButtonProps } from './CompoundButton.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
5
|
+
*/
|
6
|
+
export declare const CompoundButton: ForwardRefComponent<CompoundButtonProps>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.CompoundButton = void 0;
|
7
|
+
|
8
|
+
var React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
var renderCompoundButton_1 = /*#__PURE__*/require("./renderCompoundButton");
|
11
|
+
|
12
|
+
var useCompoundButton_1 = /*#__PURE__*/require("./useCompoundButton");
|
13
|
+
|
14
|
+
var useCompoundButtonStyles_1 = /*#__PURE__*/require("./useCompoundButtonStyles");
|
15
|
+
/**
|
16
|
+
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
exports.CompoundButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
|
+
var state = useCompoundButton_1.useCompoundButton(props, ref);
|
22
|
+
useCompoundButtonStyles_1.useCompoundButtonStyles(state);
|
23
|
+
return renderCompoundButton_1.renderCompoundButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
|
+
});
|
25
|
+
exports.CompoundButton.displayName = 'CompoundButton';
|
26
|
+
//# sourceMappingURL=CompoundButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClG,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AAEA,EAAA,yBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP,CALkG,CAMlG;AACD,CAPuE,CAA3D;AASb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
3
|
+
export declare type CompoundButtonSlots = ButtonSlots & {
|
4
|
+
/**
|
5
|
+
* Second line of text that describes the action this button takes.
|
6
|
+
*/
|
7
|
+
secondaryContent?: IntrinsicShorthandProps<'span'>;
|
8
|
+
/**
|
9
|
+
* Container that wraps the children and the secondaryContent slot.
|
10
|
+
*/
|
11
|
+
contentContainer: IntrinsicShorthandProps<'span'>;
|
12
|
+
};
|
13
|
+
export declare type CompoundButtonProps = ComponentProps<CompoundButtonSlots> & Partial<ButtonCommons>;
|
14
|
+
export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useCompoundButtonStyles = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
tslib_1.__exportStar(require("./CompoundButton"), exports);
|
11
|
+
|
12
|
+
tslib_1.__exportStar(require("./CompoundButton.types"), exports);
|
13
|
+
|
14
|
+
tslib_1.__exportStar(require("./renderCompoundButton"), exports);
|
15
|
+
|
16
|
+
tslib_1.__exportStar(require("./useCompoundButton"), exports);
|
17
|
+
|
18
|
+
var useCompoundButtonStyles_1 = /*#__PURE__*/require("./useCompoundButtonStyles");
|
19
|
+
|
20
|
+
Object.defineProperty(exports, "useCompoundButtonStyles", {
|
21
|
+
enumerable: true,
|
22
|
+
get: function () {
|
23
|
+
return useCompoundButtonStyles_1.useCompoundButtonStyles;
|
24
|
+
}
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,yBAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA","sourceRoot":""}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderCompoundButton = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var React = /*#__PURE__*/require("react");
|
11
|
+
|
12
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
+
/**
|
14
|
+
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
15
|
+
*/
|
16
|
+
|
17
|
+
|
18
|
+
var renderCompoundButton = function (state) {
|
19
|
+
var _a = react_utilities_1.getSlots(state, ['root', 'contentContainer', 'icon', 'secondaryContent']),
|
20
|
+
slots = _a.slots,
|
21
|
+
slotProps = _a.slotProps;
|
22
|
+
|
23
|
+
var iconOnly = state.iconOnly,
|
24
|
+
iconPosition = state.iconPosition;
|
25
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), iconPosition !== 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && React.createElement(slots.contentContainer, tslib_1.__assign({}, slotProps.contentContainer), slotProps.root.children, React.createElement(slots.secondaryContent, tslib_1.__assign({}, slotProps.secondaryContent))), iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
|
26
|
+
};
|
27
|
+
|
28
|
+
exports.renderCompoundButton = renderCompoundButton;
|
29
|
+
//# sourceMappingURL=renderCompoundButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,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|
+
import * as React from 'react';
|
2
|
+
import type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';
|
3
|
+
/**
|
4
|
+
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
5
|
+
* @param props - User provided props to the CompoundButton component.
|
6
|
+
* @param ref - User provided ref to be passed to the CompoundButton component.
|
7
|
+
*/
|
8
|
+
export declare const useCompoundButton: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useCompoundButton = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
|
12
|
+
var index_1 = /*#__PURE__*/require("../Button/index");
|
13
|
+
/**
|
14
|
+
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
15
|
+
* @param props - User provided props to the CompoundButton component.
|
16
|
+
* @param ref - User provided ref to be passed to the CompoundButton component.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
var useCompoundButton = function (_a, ref) {
|
21
|
+
var contentContainer = _a.contentContainer,
|
22
|
+
secondaryContent = _a.secondaryContent,
|
23
|
+
props = tslib_1.__rest(_a, ["contentContainer", "secondaryContent"]);
|
24
|
+
|
25
|
+
return tslib_1.__assign(tslib_1.__assign({}, index_1.useButton(props, ref)), {
|
26
|
+
// Slots definition
|
27
|
+
components: {
|
28
|
+
root: 'button',
|
29
|
+
icon: 'span',
|
30
|
+
contentContainer: 'span',
|
31
|
+
secondaryContent: 'span'
|
32
|
+
},
|
33
|
+
contentContainer: react_utilities_1.resolveShorthand(contentContainer, {
|
34
|
+
required: true
|
35
|
+
}),
|
36
|
+
secondaryContent: react_utilities_1.resolveShorthand(secondaryContent)
|
37
|
+
});
|
38
|
+
};
|
39
|
+
|
40
|
+
exports.useCompoundButton = useCompoundButton;
|
41
|
+
//# sourceMappingURL=useCompoundButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAEA;;;;AAIG;;;AACI,IAAM,iBAAiB,GAAG,UAC/B,EAD+B,EAE/B,GAF+B,EAEsB;AADnD,MAAA,gBAAgB,GAAA,EAAA,CAAA,gBAAhB;AAAA,MAAkB,gBAAgB,GAAA,EAAA,CAAA,gBAAlC;AAAA,MAAuC,KAAK,GAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAA9C,CAAA,kBAAA,EAAA,kBAAA,CAA8C,CAA5C;;AAGF,SAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EAEK,OAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,CAFL,CAAA,EAE0B;AAExB;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KAHY;AASxB,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB,EAAmC;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnC,CATM;AAUxB,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB;AAVM,GAF1B,CAAA;AAcD,CAlBM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
@@ -0,0 +1,175 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useCompoundButtonStyles = void 0;
|
7
|
+
|
8
|
+
var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
|
+
|
10
|
+
var useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
|
11
|
+
|
12
|
+
var CompoundButtonClassNames = {
|
13
|
+
secondaryContent: 'CompoundButton-secondaryContent'
|
14
|
+
};
|
15
|
+
|
16
|
+
var useRootStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
17
|
+
"base": {
|
18
|
+
"rmohyg": "fsbu5mz",
|
19
|
+
"Bqenvij": "f11ysow2",
|
20
|
+
"Bekya5a": "f1smw4j4",
|
21
|
+
"Bi863bl": "f1b73140",
|
22
|
+
"B7j81dy": "f19sbf7w"
|
23
|
+
},
|
24
|
+
"outline": {},
|
25
|
+
"primary": {
|
26
|
+
"Bekya5a": "f1wrmfx5",
|
27
|
+
"Bi863bl": "fl6im4w",
|
28
|
+
"B7j81dy": "f1y0ndy"
|
29
|
+
},
|
30
|
+
"subtle": {
|
31
|
+
"Bekya5a": "f1smw4j4",
|
32
|
+
"Bi863bl": "f182e9fe",
|
33
|
+
"B7j81dy": "fdrkfd0"
|
34
|
+
},
|
35
|
+
"transparent": {
|
36
|
+
"Bekya5a": "f1smw4j4",
|
37
|
+
"Bi863bl": "f182e9fe",
|
38
|
+
"B7j81dy": "fdrkfd0"
|
39
|
+
},
|
40
|
+
"small": {
|
41
|
+
"z8tnut": "fp9bwmr",
|
42
|
+
"z189sj": ["f19lj068", "f177v4lu"],
|
43
|
+
"Byoj8tv": "f150uoa4",
|
44
|
+
"uwmqm3": ["f177v4lu", "f19lj068"],
|
45
|
+
"Be2twd7": "fkhj508",
|
46
|
+
"Bg96gwp": "f1i3iumi"
|
47
|
+
},
|
48
|
+
"medium": {
|
49
|
+
"z8tnut": "f1kcqot9",
|
50
|
+
"z189sj": ["f11qrl6u", "fjlbh76"],
|
51
|
+
"Byoj8tv": "fpe6lb7",
|
52
|
+
"uwmqm3": ["fjlbh76", "f11qrl6u"],
|
53
|
+
"Be2twd7": "fkhj508",
|
54
|
+
"Bg96gwp": "f1i3iumi"
|
55
|
+
},
|
56
|
+
"large": {
|
57
|
+
"z8tnut": "fqag9an",
|
58
|
+
"z189sj": ["f1gbmcue", "f1rh9g5y"],
|
59
|
+
"Byoj8tv": "fp67ikv",
|
60
|
+
"uwmqm3": ["f1rh9g5y", "f1gbmcue"],
|
61
|
+
"Be2twd7": "fod5ikn",
|
62
|
+
"Bg96gwp": "faaz57k"
|
63
|
+
},
|
64
|
+
"disabled": {
|
65
|
+
"Bekya5a": "f1ygg8x6",
|
66
|
+
"Bi863bl": "fhtktt2",
|
67
|
+
"B7j81dy": "f1v2jbe6"
|
68
|
+
}
|
69
|
+
}, {
|
70
|
+
"d": [".fsbu5mz{gap:12px;}", ".f11ysow2{height:auto;}", ".f1smw4j4 .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1wrmfx5 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1ygg8x6 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
71
|
+
"h": [".f1b73140:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".fl6im4w:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f182e9fe:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fhtktt2:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
|
72
|
+
"a": [".f19sbf7w:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1y0ndy:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fdrkfd0:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1v2jbe6:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
|
73
|
+
});
|
74
|
+
|
75
|
+
var useRootIconOnlyStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
76
|
+
"small": {
|
77
|
+
"z8tnut": "f10ra9hq",
|
78
|
+
"z189sj": ["f8wuabp", "fycuoez"],
|
79
|
+
"Byoj8tv": "f1y2xyjm",
|
80
|
+
"uwmqm3": ["fycuoez", "f8wuabp"],
|
81
|
+
"B2u0y6b": "ft5vyj6",
|
82
|
+
"Bf4jedk": "f17suaiq"
|
83
|
+
},
|
84
|
+
"medium": {
|
85
|
+
"z8tnut": "f1xp5gbu",
|
86
|
+
"z189sj": ["f1sgzk6v", "f1bg5zqg"],
|
87
|
+
"Byoj8tv": "f1d7kygh",
|
88
|
+
"uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
|
89
|
+
"B2u0y6b": "fdczgix",
|
90
|
+
"Bf4jedk": "fjdcg9m"
|
91
|
+
},
|
92
|
+
"large": {
|
93
|
+
"z8tnut": "fp9bwmr",
|
94
|
+
"z189sj": ["f19lj068", "f177v4lu"],
|
95
|
+
"Byoj8tv": "f150uoa4",
|
96
|
+
"uwmqm3": ["f177v4lu", "f19lj068"],
|
97
|
+
"B2u0y6b": "fww51uw",
|
98
|
+
"Bf4jedk": "f1qhsl2h"
|
99
|
+
}
|
100
|
+
}, {
|
101
|
+
"d": [".f10ra9hq{padding-top:4px;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1y2xyjm{padding-bottom:4px;}", ".ft5vyj6{max-width:48px;}", ".f17suaiq{min-width:48px;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".fdczgix{max-width:52px;}", ".fjdcg9m{min-width:52px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fww51uw{max-width:56px;}", ".f1qhsl2h{min-width:56px;}"]
|
102
|
+
});
|
103
|
+
|
104
|
+
var useIconStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
105
|
+
"base": {
|
106
|
+
"Be2twd7": "fndrnj9",
|
107
|
+
"Bqenvij": "fbhnoac",
|
108
|
+
"a9b677": "feqmc2u"
|
109
|
+
}
|
110
|
+
}, {
|
111
|
+
"d": [".fndrnj9{font-size:40px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}"]
|
112
|
+
});
|
113
|
+
|
114
|
+
var useContentContainerStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
115
|
+
"base": {
|
116
|
+
"mc9l5x": "f22iagw",
|
117
|
+
"Beiy3e4": "f1vx9l62",
|
118
|
+
"fsow6f": ["f1o700av", "fes3tcz"]
|
119
|
+
}
|
120
|
+
}, {
|
121
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"]
|
122
|
+
});
|
123
|
+
|
124
|
+
var useSecondaryContentStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
125
|
+
"base": {
|
126
|
+
"Bg96gwp": "flkuc6h",
|
127
|
+
"B6of3ja": "fvjh0tl",
|
128
|
+
"Bhrd7zp": "figsok6"
|
129
|
+
},
|
130
|
+
"small": {
|
131
|
+
"Be2twd7": "fy9rknc"
|
132
|
+
},
|
133
|
+
"medium": {
|
134
|
+
"Be2twd7": "fy9rknc"
|
135
|
+
},
|
136
|
+
"large": {
|
137
|
+
"Be2twd7": "fkhj508"
|
138
|
+
}
|
139
|
+
}, {
|
140
|
+
"d": [".flkuc6h{line-height:100%;}", ".fvjh0tl{margin-top:4px;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
|
141
|
+
});
|
142
|
+
|
143
|
+
var useCompoundButtonStyles = function (state) {
|
144
|
+
var rootStyles = useRootStyles();
|
145
|
+
var rootIconOnlyStyles = useRootIconOnlyStyles();
|
146
|
+
var iconStyles = useIconStyles();
|
147
|
+
var contentContainerStyles = useContentContainerStyles();
|
148
|
+
var secondaryContentStyles = useSecondaryContentStyles();
|
149
|
+
var appearance = state.appearance,
|
150
|
+
disabled = state.disabled,
|
151
|
+
disabledFocusable = state.disabledFocusable,
|
152
|
+
iconOnly = state.iconOnly,
|
153
|
+
size = state.size;
|
154
|
+
state.root.className = react_make_styles_1.mergeClasses( // Root styles
|
155
|
+
rootStyles.base, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles
|
156
|
+
(disabled || disabledFocusable) && rootStyles.disabled, // Icon-only styles
|
157
|
+
iconOnly && rootIconOnlyStyles[size], // User provided class name
|
158
|
+
state.root.className);
|
159
|
+
|
160
|
+
if (state.icon) {
|
161
|
+
state.icon.className = react_make_styles_1.mergeClasses(iconStyles.base, state.icon.className);
|
162
|
+
}
|
163
|
+
|
164
|
+
state.contentContainer.className = react_make_styles_1.mergeClasses(contentContainerStyles.base, state.contentContainer.className);
|
165
|
+
|
166
|
+
if (state.secondaryContent) {
|
167
|
+
state.secondaryContent.className = react_make_styles_1.mergeClasses(CompoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
|
168
|
+
}
|
169
|
+
|
170
|
+
useButtonStyles_1.useButtonStyles(state);
|
171
|
+
return state;
|
172
|
+
};
|
173
|
+
|
174
|
+
exports.useCompoundButtonStyles = useCompoundButtonStyles;
|
175
|
+
//# sourceMappingURL=useCompoundButtonStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,IAAM,wBAAwB,GAAG;AAC/B,EAAA,gBAAgB,EAAE;AADa,CAAjC;;AAIA,IAAM,aAAa,gBAAG,mBAAA,SAAA;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,IAAM,qBAAqB,gBAAG,mBAAA,SAAA;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,EAA9B;;AAsBA,IAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AASA,IAAM,yBAAy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AAvB;AACD;;AAED,EAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,mBAAA,CAAA,YAAA,CAAa,sBAAsB,CAAC,IAApC,EAA0C,KAAK,CAAC,gBAAN,CAAuB,SAAjE,CAAnC;;AAEA,MAAI,KAAK,CAAC,gBAAV,EAA4B;AAC1B,IAAA,KAAK,CAAC,gBAAN,CAAuB,SAAvB,GAAmC,mBAAA,CAAA,YAAA,CACjC,wBAAwB,CAAC,gBADQ,EAEjC,sBAAsB,CAAC,IAFU,EAGjC,sBAAsB,CAAC,IAAD,CAHW,EAIjC,KAAK,CAAC,gBAAN,CAAuB,SAJU,CAAnC;AAMD;;AAED,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CA3CM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { MenuButtonProps } from './MenuButton.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* MenuButtons are buttons that handle opening and closing a menu when they are triggered.
|
5
|
+
*/
|
6
|
+
export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.MenuButton = void 0;
|
7
|
+
|
8
|
+
var React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
var renderMenuButton_1 = /*#__PURE__*/require("./renderMenuButton");
|
11
|
+
|
12
|
+
var useMenuButton_1 = /*#__PURE__*/require("./useMenuButton");
|
13
|
+
|
14
|
+
var useMenuButtonStyles_1 = /*#__PURE__*/require("./useMenuButtonStyles");
|
15
|
+
/**
|
16
|
+
* MenuButtons are buttons that handle opening and closing a menu when they are triggered.
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
exports.MenuButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
|
+
var state = useMenuButton_1.useMenuButton(props, ref);
|
22
|
+
useMenuButtonStyles_1.useMenuButtonStyles(state);
|
23
|
+
return renderMenuButton_1.renderMenuButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
|
+
});
|
25
|
+
exports.MenuButton.displayName = 'MenuButton';
|
26
|
+
//# sourceMappingURL=MenuButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,UAAA,gBAAmD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC1F,MAAM,KAAK,GAAG,eAAA,CAAA,aAAA,CAAc,KAAd,EAAqB,GAArB,CAAd;AAEA,EAAA,qBAAA,CAAA,mBAAA,CAAoB,KAApB;AAEA,SAAO,kBAAA,CAAA,gBAAA,CAAiB,KAAjB,CAAP,CAL0F,CAM1F;AACD,CAP+D,CAAnD;AASb,OAAA,CAAA,UAAA,CAAW,WAAX,GAAyB,YAAzB","sourceRoot":""}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { MenuTriggerChildProps } from '@fluentui/react-menu';
|
2
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
3
|
+
import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
|
4
|
+
export declare type MenuButtonSlots = ButtonSlots & {
|
5
|
+
/**
|
6
|
+
* Menu icon that indicates that this button has a menu that can be expanded.
|
7
|
+
*/
|
8
|
+
menuIcon?: IntrinsicShorthandProps<'span'>;
|
9
|
+
};
|
10
|
+
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>> & Partial<MenuTriggerChildProps>;
|
11
|
+
export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useMenuButtonStyles = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
tslib_1.__exportStar(require("./MenuButton.types"), exports);
|
11
|
+
|
12
|
+
tslib_1.__exportStar(require("./MenuButton"), exports);
|
13
|
+
|
14
|
+
tslib_1.__exportStar(require("./renderMenuButton"), exports);
|
15
|
+
|
16
|
+
tslib_1.__exportStar(require("./useMenuButton"), exports);
|
17
|
+
|
18
|
+
var useMenuButtonStyles_1 = /*#__PURE__*/require("./useMenuButtonStyles");
|
19
|
+
|
20
|
+
Object.defineProperty(exports, "useMenuButtonStyles", {
|
21
|
+
enumerable: true,
|
22
|
+
get: function () {
|
23
|
+
return useMenuButtonStyles_1.useMenuButtonStyles;
|
24
|
+
}
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,qBAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,qBAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA","sourceRoot":""}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderMenuButton = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var React = /*#__PURE__*/require("react");
|
11
|
+
|
12
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
+
/**
|
14
|
+
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
15
|
+
*/
|
16
|
+
|
17
|
+
|
18
|
+
var renderMenuButton = function (state) {
|
19
|
+
var _a = react_utilities_1.getSlots(state, ['root', 'icon', 'menuIcon']),
|
20
|
+
slots = _a.slots,
|
21
|
+
slotProps = _a.slotProps;
|
22
|
+
|
23
|
+
var icon = state.icon,
|
24
|
+
iconOnly = state.iconOnly;
|
25
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon)));
|
26
|
+
};
|
27
|
+
|
28
|
+
exports.renderMenuButton = renderMenuButton;
|
29
|
+
//# sourceMappingURL=renderMenuButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAD,EAAuB;AAC/C,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,EAAiC,CAAC,MAAD,EAAS,MAAT,EAAiB,UAAjB,CAAjC,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACE,MAAA,IAAI,GAAe,KAAK,CAApB,IAAJ;AAAA,MAAM,QAAQ,GAAK,KAAK,CAAV,QAAd;AAER,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADF,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,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAHrC,CADF;AAOD,CAXM;;AAAM,OAAA,CAAA,gBAAA,GAAgB,gBAAhB","sourceRoot":""}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { MenuButtonProps, MenuButtonState } from './MenuButton.types';
|
3
|
+
/**
|
4
|
+
* Given user props, returns the final state for a MenuButton.
|
5
|
+
*/
|
6
|
+
export declare const useMenuButton: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
|