UNPKG

12.9 kBSource Map (JSON)View Raw
1{"version":3,"file":"ButtonThemes.js","sourceRoot":"../src/","sources":["components/Button/ButtonThemes.ts"],"names":[],"mappings":";AACA,OAAO,EAAU,oBAAoB,EAAa,4BAA4B,EAAE,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,IAAM,4BAA4B,GAAG;IACnC,OAAO;QACL,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,CAAC;KACV,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,KAAa;;IAClC,IAAA,wBAAiB,EAAE,iBAAU,CAAW;IAEhD,IAAM,gBAAgB,GAAG,CAAC,CAAC,gBAAgB,CAAC;IAC5C,IAAM,uBAAuB,GAAG,CAAC,CAAC,uBAAuB,CAAC;IAC1D,IAAM,uBAAuB,GAAG,CAAC,CAAC,uBAAuB,CAAC;IAC1D,IAAM,wBAAwB,GAAG,CAAC,CAAC,wBAAwB,CAAC;IAE5D,IAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;IAChC,IAAM,iBAAiB,GAAG,CAAC,CAAC,iBAAiB,CAAC;IAC9C,IAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC;IAChD,IAAM,iBAAiB,GAAG,CAAC,CAAC,iBAAiB,CAAC;IAC9C,IAAM,wBAAwB,GAAG,CAAC,CAAC,wBAAwB,CAAC;IAE5D,OAAO;QACL,IAAI,EAAE;YACJ,eAAe,EAAE,gBAAgB;YACjC,KAAK,EAAE,UAAU;SAClB;QAED,WAAW,EAAE;YACX,eAAe,EAAE,uBAAuB;YACxC,KAAK,EAAE,iBAAiB;YACxB,SAAS;gBACP,GAAC,oBAAoB,IAAG;oBACtB,WAAW,EAAE,WAAW;oBACxB,KAAK,EAAE,WAAW;iBACnB;mBACF;SACF;Q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P,GAAC,oBAAoB,IAAG;oBACtB,eAAe,EAAE,YAAY;iBAC9B;gBACD,YAAQ,GAAE;oBACR,eAAe,EAAE,CAAC,CAAC,8BAA8B;oBACjD,SAAS;wBACP,GAAC,oBAAoB,IAAG;4BACtB,KAAK,EAAE,WAAW;yBACnB;2BACF;iBACF;mBACF;SACF;QAED,6BAA6B,EAAE;YAC7B,eAAe,EAAE,CAAC,CAAC,+BAA+B;YAClD,SAAS,EAAE;gBACT,QAAQ,EAAE;oBACR,eAAe,EAAE,CAAC,CAAC,+BAA+B;iBACnD;aACF;SACF;QAED,4BAA4B,EAAE;YAC5B,eAAe,EAAE,CAAC,CAAC,8BAA8B;YACjD,SAAS,EAAE;gBACT,QAAQ,EAAE;oBACR,eAAe,EAAE,CAAC,CAAC,8BAA8B;iBAClD;aACF;SACF;QAED,6BAA6B,EAAE;YAC7B,eAAe,EAAE,CAAC,CAAC,8BAA8B;YACjD,SAAS,EAAE;gBACT,QAAQ,EAAE;oBACR,eAAe,EAAE,CAAC,CAAC,8BAA8B;iBAClD;aACF;SACF;QAED,mBAAmB,EAAE;YACnB,KAAK,EAAE,CAAC,CAAC,iBAAiB;SAC3B;QAED,2BAA2B,EAAE;YAC3B,KAAK,EAAE,CAAC,CAAC,eAAe;YAExB,SAAS;gBACP,GAAC,oBAAoB,IAAG;oBACtB,KAAK,EAAE,UAAU;iBAClB;mBACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { IButtonStyles } from './Button.types';\nimport { ITheme, HighContrastSelector, IRawStyle, getHighContrastNoAdjustStyle } from '../../Styling';\nimport { IsFocusVisibleClassName } from '../../Utilities';\n\nconst splitButtonDividerBaseStyles = (): IRawStyle => {\n return {\n position: 'absolute',\n width: 1,\n right: 31,\n top: 8,\n bottom: 8,\n };\n};\n\nexport function standardStyles(theme: ITheme): IButtonStyles {\n const { semanticColors: s, palette: p } = theme;\n\n const buttonBackground = s.buttonBackground;\n const buttonBackgroundPressed = s.buttonBackgroundPressed;\n const buttonBackgroundHovered = s.buttonBackgroundHovered;\n const buttonBackgroundDisabled = s.buttonBackgroundDisabled;\n\n const buttonText = s.buttonText;\n const buttonTextHovered = s.buttonTextHovered;\n const buttonTextDisabled = s.buttonTextDisabled;\n const buttonTextChecked = s.buttonTextChecked;\n const buttonTextCheckedHovered = s.buttonTextCheckedHovered;\n\n return {\n root: {\n backgroundColor: buttonBackground,\n color: buttonText,\n },\n\n rootHovered: {\n backgroundColor: buttonBackgroundHovered,\n color: buttonTextHovered,\n selectors: {\n [HighContrastSelector]: {\n borderColor: 'Highlight',\n color: 'Highlight',\n },\n },\n },\n\n rootPressed: {\n backgroundColor: buttonBackgroundPressed,\n color: buttonTextChecked,\n },\n\n rootExpanded: {\n backgroundColor: buttonBackgroundPressed,\n color: buttonTextChecked,\n },\n\n rootChecked: {\n backgroundColor: buttonBackgroundPressed,\n color: buttonTextChecked,\n },\n\n rootCheckedHovered: {\n backgroundColor: buttonBackgroundPressed,\n color: buttonTextCheckedHovered,\n },\n\n rootDisabled: {\n color: buttonTextDisabled,\n backgroundColor: buttonBackgroundDisabled,\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n borderColor: 'GrayText',\n backgroundColor: 'Window',\n },\n },\n },\n\n // Split button styles\n splitButtonContainer: {\n selectors: {\n [HighContrastSelector]: {\n border: 'none',\n },\n },\n },\n\n splitButtonMenuButton: {\n color: p.white,\n backgroundColor: 'transparent',\n selectors: {\n ':hover': {\n backgroundColor: p.neutralLight,\n selectors: {\n [HighContrastSelector]: {\n color: 'Highlight',\n },\n },\n },\n },\n },\n\n splitButtonMenuButtonDisabled: {\n backgroundColor: s.buttonBackgroundDisabled,\n selectors: {\n ':hover': {\n backgroundColor: s.buttonBackgroundDisabled,\n },\n },\n },\n\n splitButtonDivider: {\n ...splitButtonDividerBaseStyles(),\n backgroundColor: p.neutralTertiaryAlt,\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'WindowText',\n },\n },\n },\n\n splitButtonDividerDisabled: {\n backgroundColor: theme.palette.neutralTertiaryAlt,\n },\n\n splitButtonMenuButtonChecked: {\n backgroundColor: p.neutralQuaternaryAlt,\n selectors: {\n ':hover': {\n backgroundColor: p.neutralQuaternaryAlt,\n },\n },\n },\n\n splitButtonMenuButtonExpanded: {\n backgroundColor: p.neutralQuaternaryAlt,\n selectors: {\n ':hover': {\n backgroundColor: p.neutralQuaternaryAlt,\n },\n },\n },\n\n splitButtonMenuIcon: {\n color: s.buttonText,\n },\n\n splitButtonMenuIconDisabled: {\n color: s.buttonTextDisabled,\n },\n };\n}\n\nexport function primaryStyles(theme: ITheme): IButtonStyles {\n const { palette: p, semanticColors: s } = theme;\n\n return {\n root: {\n backgroundColor: s.primaryButtonBackground,\n border: `1px solid ${s.primaryButtonBackground}`,\n color: s.primaryButtonText,\n selectors: {\n [HighContrastSelector]: {\n color: 'Window',\n backgroundColor: 'WindowText',\n borderColor: 'WindowText',\n ...getHighContrastNoAdjustStyle(),\n },\n [`.${IsFocusVisibleClassName} &:focus`]: {\n selectors: {\n ':after': {\n border: `none`,\n outlineColor: p.white,\n },\n },\n },\n },\n },\n\n rootHovered: {\n backgroundColor: s.primaryButtonBackgroundHovered,\n border: `1px solid ${s.primaryButtonBackgroundHovered}`,\n color: s.primaryButtonTextHovered,\n selectors: {\n [HighContrastSelector]: {\n color: 'Window',\n backgroundColor: 'Highlight',\n borderColor: 'Highlight',\n },\n },\n },\n\n rootPressed: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n border: `1px solid ${s.primaryButtonBackgroundPressed}`,\n color: s.primaryButtonTextPressed,\n selectors: {\n [HighContrastSelector]: {\n color: 'Window',\n backgroundColor: 'WindowText',\n borderColor: 'WindowText',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n\n rootExpanded: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n color: s.primaryButtonTextPressed,\n },\n\n rootChecked: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n color: s.primaryButtonTextPressed,\n },\n\n rootCheckedHovered: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n color: s.primaryButtonTextPressed,\n },\n\n rootDisabled: {\n color: s.primaryButtonTextDisabled,\n backgroundColor: s.primaryButtonBackgroundDisabled,\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n borderColor: 'GrayText',\n backgroundColor: 'Window',\n },\n },\n },\n\n // Split button styles\n splitButtonContainer: {\n selectors: {\n [HighContrastSelector]: {\n border: 'none',\n },\n },\n },\n\n splitButtonDivider: {\n ...splitButtonDividerBaseStyles(),\n backgroundColor: p.white,\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'Window',\n },\n },\n },\n\n splitButtonMenuButton: {\n backgroundColor: s.primaryButtonBackground,\n color: s.primaryButtonText,\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'WindowText',\n },\n ':hover': {\n backgroundColor: s.primaryButtonBackgroundHovered,\n selectors: {\n [HighContrastSelector]: {\n color: 'Highlight',\n },\n },\n },\n },\n },\n\n splitButtonMenuButtonDisabled: {\n backgroundColor: s.primaryButtonBackgroundDisabled,\n selectors: {\n ':hover': {\n backgroundColor: s.primaryButtonBackgroundDisabled,\n },\n },\n },\n\n splitButtonMenuButtonChecked: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n selectors: {\n ':hover': {\n backgroundColor: s.primaryButtonBackgroundPressed,\n },\n },\n },\n\n splitButtonMenuButtonExpanded: {\n backgroundColor: s.primaryButtonBackgroundPressed,\n selectors: {\n ':hover': {\n backgroundColor: s.primaryButtonBackgroundPressed,\n },\n },\n },\n\n splitButtonMenuIcon: {\n color: s.primaryButtonText,\n },\n\n splitButtonMenuIconDisabled: {\n color: p.neutralTertiary,\n\n selectors: {\n [HighContrastSelector]: {\n color: 'GrayText',\n },\n },\n },\n };\n}\n"]}
\No newline at end of file