guestbell-forms 2.0.272 → 2.0.276
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/bookingCalendar/BookingCalendar.d.ts +2 -1
- package/build/components/bookingCalendar/BookingCalendar.js +7 -4
- package/build/components/bookingCalendar/BookingCalendar.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js +9 -7
- package/build/components/bookingCalendar/bookingCalendarControls/BookingCalendarControls.js.map +1 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.d.ts +2 -1
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js +10 -8
- package/build/components/bookingCalendar/bookingCalendarDatePicker/BookingCalendarDatePicker.js.map +1 -1
- package/build/components/bookingCalendar/common.d.ts +3 -1
- package/build/components/bookingCalendar/common.js +14 -2
- package/build/components/bookingCalendar/common.js.map +1 -1
- package/build/components/bookingCalendar/utils.js +3 -3
- package/build/components/bookingCalendar/utils.js.map +1 -1
- package/build/components/text/Text.js +1 -1
- package/build/components/text/Text.js.map +1 -1
- package/build/dist/guestbell-forms.css +7 -7
- package/build/dist/guestbell-forms.css.map +1 -1
- package/build/dist/guestbell-forms.min.css +1 -1
- package/build/dist/report.html +1 -1
- package/build/scss/components/button/buttons.scss +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/components/text/Text.tsx"],"names":["PlusIcon","classNames","require","TextRaw","props","inputRef","current","nativeTextAreaValueSetter","Object","getOwnPropertyDescriptor","window","HTMLInputElement","prototype","set","call","event","Event","bubbles","dispatchEvent","e","stopClickPropagation","stopPropagation","onKeyDown","number","undefined","value","toString","res","handleValueChange","state","isValid","errors","ignoreContext","formContext","updateCallback","componentId","validation","prevProps","prevState","onNumberChange","num","Number","isNaN","clearButtonHidden","length","disabled","title","tooltip","getValidationClass","readOnly","className","containerClick","containerRef","before","id","placeholder","getDisabled","required","handleChange","handleBlur","handleFocus","type","onClick","maxLength","sizeFromValue","after","showClearButton","clearClick","renderDefaultValidation","label","renderLabel","BaseInput","assign","defaultProps","Text"],"mappings":";;;;;;;;;AACA;;AAGA;;AACA;;AAKA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACYA,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;;;AACZ,IAAIC,UAAU,GAAGC,OAAO,CAAC,YAAD,CAAxB;;IAqBaC,O;;;;;AAOX,mBAAYC,KAAZ,EAA8B;AAAA;;AAAA;;AAC5B,8BAAMA,KAAN;;AAD4B,iEAsHT,YAAM;AACzB,UAAI,MAAKC,QAAL,CAAcC,OAAlB,EAA2B;AACzB,YAAIC,yBAAyB,GAAGC,MAAM,CAACC,wBAAP,CAC9BC,MAAM,CAACC,gBAAP,CAAwBC,SADM,EAE9B,OAF8B,EAG9BC,GAHF;;AAIA,YAAIN,yBAAJ,EAA+B;AAC7BA,UAAAA,yBAAyB,CAACO,IAA1B,CAA+B,MAAKT,QAAL,CAAcC,OAA7C,EAAsD,EAAtD;AAEA,cAAMS,KAAK,GAAG,IAAIC,KAAJ,CAAU,OAAV,EAAmB;AAAEC,YAAAA,OAAO,EAAE;AAAX,WAAnB,CAAd;;AACA,gBAAKZ,QAAL,CAAcC,OAAd,CAAsBY,aAAtB,CAAoCH,KAApC;AACD;AACF;AACF,KAnI6B;;AAAA,qEAqIL,UAACI,CAAD;AAAA,aACvB,MAAKf,KAAL,CAAWgB,oBAAX,IAAmCD,CAAC,CAACE,eAAF,EADZ;AAAA,KArIK;;AAAA,gEAwIV,UAACF,CAAD;AAAA,aAClB,MAAKf,KAAL,CAAWkB,SAAX,IAAwB,MAAKlB,KAAL,CAAWkB,SAAX,CAAqBH,CAArB,CADN;AAAA,KAxIU;;AAE5B,QAAIf,KAAK,CAACmB,MAAN,KAAiBC,SAArB,EAAgC;AAAA;;AAC9B,UAAMC,KAAK,6CAA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A,SAAS,EAAC;AAApB,QAfF,CA5BJ,eA8CE;AAAM,QAAA,SAAS,EAAC;AAAhB,QA9CF,eA+CE;AAAM,QAAA,SAAS,EAAC;AAAhB,QA/CF,EAgDG,KAAKyB,uBAAL,EAhDH,EAiDG,KAAKhE,KAAL,CAAWiE,KAAX,iBACC;AAAO,QAAA,SAAS,EAAE,KAAKjE,KAAL,CAAW6C,QAAX,GAAsB,gBAAtB,GAAyC;AAA3D,SACG,KAAKqB,WAAL,EADH,CAlDJ,CARF,CADF,CADF;AAoED;;;;EA3H0BC,qB;;;;gBAAhBpE,O,kBACkBK,MAAM,CAACgE,MAAP,CAAc,EAAd,EAAkBD,sBAAUE,YAA5B,EAA0C;AACrEZ,EAAAA,IAAI,EAAE,MAD+D;AAErEzC,EAAAA,oBAAoB,EAAE,IAF+C;AAGrE6B,EAAAA,QAAQ,EAAE;AAH2D,CAA1C,C;;AAkJxB,IAAMyB,IAAI,GAAG,wCAClB,sCAA2BvE,OAA3B,CADkB,EAElB,MAFkB,CAAb;;eAKQuE,I","sourcesContent":["// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport Button from '../button';\r\nimport * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_24px.svg';\r\nvar classNames = require('classnames');\r\n\r\nexport interface TextProps extends BaseInputProps<HTMLInputElement> {\r\n mask?: string;\r\n reverse?: boolean;\r\n placeholder?: string;\r\n stopClickPropagation?: boolean;\r\n inputRef?: React.Ref<HTMLInputElement>;\r\n readOnly?: boolean;\r\n type?: 'number' | 'text';\r\n maxLength?: number;\r\n showClearButton?: boolean;\r\n after?: React.ReactNode;\r\n before?: React.ReactNode;\r\n sizeFromValue?: boolean;\r\n onNumberChange?: (number: number, isValid: boolean) => void;\r\n number?: number;\r\n}\r\n\r\nexport interface TextState extends BaseInputState {}\r\n\r\nexport class TextRaw extends BaseInput<TextProps, TextState, HTMLInputElement> {\r\n public static defaultProps = Object.assign({}, BaseInput.defaultProps, {\r\n type: 'text',\r\n stopClickPropagation: true,\r\n readOnly: false,\r\n }) as TextProps;\r\n\r\n constructor(props: TextProps) {\r\n super(props);\r\n if (props.number !== undefined) {\r\n const value = props.number?.toString() ?? '';\r\n const res = this.handleValueChange(value, true, [], props, true);\r\n this.state = {\r\n ...this.state,\r\n isValid: res.isValid,\r\n errors: res.errors,\r\n value,\r\n };\r\n if (!this.props.ignoreContext) {\r\n this.props.formContext &&\r\n this.props.formContext.updateCallback(this.componentId, {\r\n validation: {\r\n isValid: res.isValid,\r\n errors: res.errors,\r\n },\r\n });\r\n }\r\n }\r\n }\r\n\r\n public componentDidUpdate(prevProps: TextProps, prevState: TextState) {\r\n if (\r\n this.props.onNumberChange &&\r\n (this.state.isValid !== prevState.isValid ||\r\n this.state.value !== prevState.value)\r\n ) {\r\n const num = Number(this.state.value);\r\n if (!isNaN(num)) {\r\n this.props.onNumberChange(num, this.state.isValid);\r\n }\r\n if (this.state.value === '') {\r\n this.props.onNumberChange(undefined, this.state.isValid);\r\n }\r\n }\r\n if (\r\n (prevProps.number !== undefined || this.props.number !== undefined) &&\r\n this.props.number !== prevProps.number\r\n ) {\r\n this.handleValueChange(this.props.number?.toString() ?? '');\r\n }\r\n super.componentDidUpdate(prevProps, prevState);\r\n }\r\n\r\n public render() {\r\n const clearButtonHidden = !this.state.value?.length || this.props.disabled;\r\n return (\r\n <InputGroup title={this.props.title} tooltip={this.props.tooltip}>\r\n <div\r\n className={`input__base text-input ${this.getValidationClass()} \r\n ${this.props.readOnly ? 'text-input--readOnly' : ''} ${\r\n this.props.className ? this.props.className : ''\r\n }`}\r\n onClick={this.containerClick}\r\n ref={this.containerRef}\r\n >\r\n <div className=\"text-input__textWrapper\">\r\n {this.props.before}\r\n <input\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n ref={this.inputRef}\r\n placeholder={this.props.placeholder}\r\n disabled={this.getDisabled()}\r\n required={this.props.required}\r\n className={this.state.value ? 'filled' : ''}\r\n onChange={this.handleChange}\r\n value={this.state.value}\r\n onBlur={this.handleBlur}\r\n onFocus={this.handleFocus}\r\n readOnly={this.props.readOnly}\r\n onKeyDown={this.onKeyDown}\r\n type={this.props.type}\r\n onClick={this.props.onClick}\r\n maxLength={this.props.maxLength}\r\n size={\r\n this.props.sizeFromValue\r\n ? this.props.value?.length || 1\r\n : undefined\r\n }\r\n />\r\n {this.props.after}\r\n {!this.props.readOnly && this.props.showClearButton && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-clear-button',\r\n })}\r\n disabled={clearButtonHidden}\r\n unobtrusive={true}\r\n noShadow={true}\r\n onClick={this.clearClick}\r\n className={classNames(\r\n 'text-input__clearButton line-height--0',\r\n {\r\n 'text-input__clearButton--hidden': clearButtonHidden,\r\n }\r\n )}\r\n >\r\n <PlusIcon className=\"transform-rotate--45 line-height--0\" />\r\n </Button>\r\n )}\r\n <span className=\"highlight\" />\r\n <span className=\"bar\" />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label className={this.props.readOnly ? 'label--focused' : ''}>\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n private clearClick = () => {\r\n if (this.inputRef.current) {\r\n var nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(\r\n window.HTMLInputElement.prototype,\r\n 'value'\r\n ).set;\r\n if (nativeTextAreaValueSetter) {\r\n nativeTextAreaValueSetter.call(this.inputRef.current, '');\r\n\r\n const event = new Event('input', { bubbles: true });\r\n this.inputRef.current.dispatchEvent(event);\r\n }\r\n }\r\n };\r\n\r\n private containerClick = (e: React.MouseEvent<HTMLDivElement>) =>\r\n this.props.stopClickPropagation && e.stopPropagation();\r\n\r\n private onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) =>\r\n this.props.onKeyDown && this.props.onKeyDown(e);\r\n}\r\n\r\nexport const Text = withThemeContext<TextProps, InstanceType<typeof TextRaw>>(\r\n withFormContext<TextProps>(TextRaw),\r\n 'text'\r\n);\r\n\r\nexport default Text;\r\n"],"file":"Text.js"}
|
1
|
+
{"version":3,"sources":["../../../src/lib/components/text/Text.tsx"],"names":["PlusIcon","classNames","require","TextRaw","props","inputRef","current","nativeTextAreaValueSetter","Object","getOwnPropertyDescriptor","window","HTMLInputElement","prototype","set","call","event","Event","bubbles","dispatchEvent","e","stopClickPropagation","stopPropagation","onKeyDown","number","undefined","value","toString","res","handleValueChange","state","isValid","errors","ignoreContext","formContext","updateCallback","componentId","validation","prevProps","prevState","onNumberChange","Number","num","isNaN","clearButtonHidden","length","disabled","title","tooltip","getValidationClass","readOnly","className","containerClick","containerRef","before","id","placeholder","getDisabled","required","handleChange","handleBlur","handleFocus","type","onClick","maxLength","sizeFromValue","after","showClearButton","clearClick","renderDefaultValidation","label","renderLabel","BaseInput","assign","defaultProps","Text"],"mappings":";;;;;;;;;AACA;;AAGA;;AACA;;AAKA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACYA,Q,YAAAA,Q;;;;;;AAAAA,Q;;;;;;;AACZ,IAAIC,UAAU,GAAGC,OAAO,CAAC,YAAD,CAAxB;;IAqBaC,O;;;;;AAOX,mBAAYC,KAAZ,EAA8B;AAAA;;AAAA;;AAC5B,8BAAMA,KAAN;;AAD4B,iEAuHT,YAAM;AACzB,UAAI,MAAKC,QAAL,CAAcC,OAAlB,EAA2B;AACzB,YAAIC,yBAAyB,GAAGC,MAAM,CAACC,wBAAP,CAC9BC,MAAM,CAACC,gBAAP,CAAwBC,SADM,EAE9B,OAF8B,EAG9BC,GAHF;;AAIA,YAAIN,yBAAJ,EAA+B;AAC7BA,UAAAA,yBAAyB,CAACO,IAA1B,CAA+B,MAAKT,Q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AAI,GAAG,wCAClB,sCAA2BvE,OAA3B,CADkB,EAElB,MAFkB,CAAb;;eAKQuE,I","sourcesContent":["// Libs\r\nimport * as React from 'react';\r\n\r\n// Misc\r\nimport InputGroup from '../inputGroup/InputGroup';\r\nimport {\r\n BaseInputProps,\r\n BaseInputState,\r\n BaseInput,\r\n} from '../base/input/BaseInput';\r\nimport { withFormContext } from '../form/withFormContext';\r\nimport { withThemeContext } from '../themeProvider/withThemeContext';\r\nimport Button from '../button';\r\nimport * as PlusIcon from 'material-design-icons/content/svg/production/ic_add_24px.svg';\r\nvar classNames = require('classnames');\r\n\r\nexport interface TextProps extends BaseInputProps<HTMLInputElement> {\r\n mask?: string;\r\n reverse?: boolean;\r\n placeholder?: string;\r\n stopClickPropagation?: boolean;\r\n inputRef?: React.Ref<HTMLInputElement>;\r\n readOnly?: boolean;\r\n type?: 'number' | 'text';\r\n maxLength?: number;\r\n showClearButton?: boolean;\r\n after?: React.ReactNode;\r\n before?: React.ReactNode;\r\n sizeFromValue?: boolean;\r\n onNumberChange?: (number: number, isValid: boolean) => void;\r\n number?: number;\r\n}\r\n\r\nexport interface TextState extends BaseInputState {}\r\n\r\nexport class TextRaw extends BaseInput<TextProps, TextState, HTMLInputElement> {\r\n public static defaultProps = Object.assign({}, BaseInput.defaultProps, {\r\n type: 'text',\r\n stopClickPropagation: true,\r\n readOnly: false,\r\n }) as TextProps;\r\n\r\n constructor(props: TextProps) {\r\n super(props);\r\n if (props.number !== undefined) {\r\n const value = props.number?.toString() ?? '';\r\n const res = this.handleValueChange(value, true, [], props, true);\r\n this.state = {\r\n ...this.state,\r\n isValid: res.isValid,\r\n errors: res.errors,\r\n value,\r\n };\r\n if (!this.props.ignoreContext) {\r\n this.props.formContext &&\r\n this.props.formContext.updateCallback(this.componentId, {\r\n validation: {\r\n isValid: res.isValid,\r\n errors: res.errors,\r\n },\r\n });\r\n }\r\n }\r\n }\r\n\r\n public componentDidUpdate(prevProps: TextProps, prevState: TextState) {\r\n if (\r\n this.props.onNumberChange &&\r\n (this.state.isValid !== prevState.isValid ||\r\n this.state.value !== prevState.value) &&\r\n this.props.number !== Number(this.state.value)\r\n ) {\r\n const num = Number(this.state.value);\r\n if (!isNaN(num)) {\r\n this.props.onNumberChange(num, this.state.isValid);\r\n }\r\n if (this.state.value === '') {\r\n this.props.onNumberChange(undefined, this.state.isValid);\r\n }\r\n }\r\n if (\r\n (prevProps.number !== undefined || this.props.number !== undefined) &&\r\n this.props.number !== prevProps.number\r\n ) {\r\n this.handleValueChange(this.props.number?.toString() ?? '');\r\n }\r\n super.componentDidUpdate(prevProps, prevState);\r\n }\r\n\r\n public render() {\r\n const clearButtonHidden = !this.state.value?.length || this.props.disabled;\r\n return (\r\n <InputGroup title={this.props.title} tooltip={this.props.tooltip}>\r\n <div\r\n className={`input__base text-input ${this.getValidationClass()} \r\n ${this.props.readOnly ? 'text-input--readOnly' : ''} ${\r\n this.props.className ? this.props.className : ''\r\n }`}\r\n onClick={this.containerClick}\r\n ref={this.containerRef}\r\n >\r\n <div className=\"text-input__textWrapper\">\r\n {this.props.before}\r\n <input\r\n {...(this.props.id && {\r\n id: this.props.id,\r\n })}\r\n ref={this.inputRef}\r\n placeholder={this.props.placeholder}\r\n disabled={this.getDisabled()}\r\n required={this.props.required}\r\n className={this.state.value ? 'filled' : ''}\r\n onChange={this.handleChange}\r\n value={this.state.value}\r\n onBlur={this.handleBlur}\r\n onFocus={this.handleFocus}\r\n readOnly={this.props.readOnly}\r\n onKeyDown={this.onKeyDown}\r\n type={this.props.type}\r\n onClick={this.props.onClick}\r\n maxLength={this.props.maxLength}\r\n size={\r\n this.props.sizeFromValue\r\n ? this.props.value?.length || 1\r\n : undefined\r\n }\r\n />\r\n {this.props.after}\r\n {!this.props.readOnly && this.props.showClearButton && (\r\n <Button\r\n {...(this.props.id && {\r\n id: this.props.id + '-clear-button',\r\n })}\r\n disabled={clearButtonHidden}\r\n unobtrusive={true}\r\n noShadow={true}\r\n onClick={this.clearClick}\r\n className={classNames(\r\n 'text-input__clearButton line-height--0',\r\n {\r\n 'text-input__clearButton--hidden': clearButtonHidden,\r\n }\r\n )}\r\n >\r\n <PlusIcon className=\"transform-rotate--45 line-height--0\" />\r\n </Button>\r\n )}\r\n <span className=\"highlight\" />\r\n <span className=\"bar\" />\r\n {this.renderDefaultValidation()}\r\n {this.props.label && (\r\n <label className={this.props.readOnly ? 'label--focused' : ''}>\r\n {this.renderLabel()}\r\n </label>\r\n )}\r\n </div>\r\n </div>\r\n </InputGroup>\r\n );\r\n }\r\n\r\n private clearClick = () => {\r\n if (this.inputRef.current) {\r\n var nativeTextAreaValueSetter = Object.getOwnPropertyDescriptor(\r\n window.HTMLInputElement.prototype,\r\n 'value'\r\n ).set;\r\n if (nativeTextAreaValueSetter) {\r\n nativeTextAreaValueSetter.call(this.inputRef.current, '');\r\n\r\n const event = new Event('input', { bubbles: true });\r\n this.inputRef.current.dispatchEvent(event);\r\n }\r\n }\r\n };\r\n\r\n private containerClick = (e: React.MouseEvent<HTMLDivElement>) =>\r\n this.props.stopClickPropagation && e.stopPropagation();\r\n\r\n private onKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) =>\r\n this.props.onKeyDown && this.props.onKeyDown(e);\r\n}\r\n\r\nexport const Text = withThemeContext<TextProps, InstanceType<typeof TextRaw>>(\r\n withFormContext<TextProps>(TextRaw),\r\n 'text'\r\n);\r\n\r\nexport default Text;\r\n"],"file":"Text.js"}
|
@@ -1010,7 +1010,7 @@
|
|
1010
1010
|
background-color: #10bdc7;
|
1011
1011
|
fill: white;
|
1012
1012
|
color: white; }
|
1013
|
-
.guestbell-btn.guestbell-btn-primary:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1013
|
+
.guestbell-btn.guestbell-btn-primary:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1014
1014
|
background-color: #0d9ea6; }
|
1015
1015
|
.guestbell-btn.guestbell-btn-primary:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1016
1016
|
box-shadow: inset 0 0 0 1px #10bdc7 !important;
|
@@ -1056,7 +1056,7 @@
|
|
1056
1056
|
background-color: #5cb85c;
|
1057
1057
|
fill: white;
|
1058
1058
|
color: white; }
|
1059
|
-
.guestbell-btn.guestbell-btn-success:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1059
|
+
.guestbell-btn.guestbell-btn-success:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1060
1060
|
background-color: #49a749; }
|
1061
1061
|
.guestbell-btn.guestbell-btn-success:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1062
1062
|
box-shadow: inset 0 0 0 1px #5cb85c !important;
|
@@ -1102,7 +1102,7 @@
|
|
1102
1102
|
background-color: white;
|
1103
1103
|
fill: #555555;
|
1104
1104
|
color: #555555; }
|
1105
|
-
.guestbell-btn.guestbell-btn-white:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1105
|
+
.guestbell-btn.guestbell-btn-white:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1106
1106
|
background-color: #ededed; }
|
1107
1107
|
.guestbell-btn.guestbell-btn-white:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1108
1108
|
box-shadow: inset 0 0 0 1px white !important;
|
@@ -1148,7 +1148,7 @@
|
|
1148
1148
|
background-color: #a8dadc;
|
1149
1149
|
fill: white;
|
1150
1150
|
color: white; }
|
1151
|
-
.guestbell-btn.guestbell-btn-info:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1151
|
+
.guestbell-btn.guestbell-btn-info:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1152
1152
|
background-color: #8fcfd2; }
|
1153
1153
|
.guestbell-btn.guestbell-btn-info:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1154
1154
|
box-shadow: inset 0 0 0 1px #a8dadc !important;
|
@@ -1194,7 +1194,7 @@
|
|
1194
1194
|
background-color: #d9534f;
|
1195
1195
|
fill: white;
|
1196
1196
|
color: white; }
|
1197
|
-
.guestbell-btn.guestbell-btn-error:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1197
|
+
.guestbell-btn.guestbell-btn-error:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1198
1198
|
background-color: #d33632; }
|
1199
1199
|
.guestbell-btn.guestbell-btn-error:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1200
1200
|
box-shadow: inset 0 0 0 1px #d9534f !important;
|
@@ -1240,7 +1240,7 @@
|
|
1240
1240
|
background-color: #f0ad4e;
|
1241
1241
|
fill: white;
|
1242
1242
|
color: white; }
|
1243
|
-
.guestbell-btn.guestbell-btn-warning:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1243
|
+
.guestbell-btn.guestbell-btn-warning:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1244
1244
|
background-color: #ed9e2d; }
|
1245
1245
|
.guestbell-btn.guestbell-btn-warning:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1246
1246
|
box-shadow: inset 0 0 0 1px #f0ad4e !important;
|
@@ -1286,7 +1286,7 @@
|
|
1286
1286
|
background-color: #555555;
|
1287
1287
|
fill: white;
|
1288
1288
|
color: white; }
|
1289
|
-
.guestbell-btn.guestbell-btn-gray:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):hover {
|
1289
|
+
.guestbell-btn.guestbell-btn-gray:not(.guestbell-btn--disabled):not(.guestbell-btn--blank):not(.guestbell-btn--outlined):not(.guestbell-btn--unobtrusive):hover {
|
1290
1290
|
background-color: #434343; }
|
1291
1291
|
.guestbell-btn.guestbell-btn-gray:not(.guestbell-btn--disabled).guestbell-btn--outlined {
|
1292
1292
|
box-shadow: inset 0 0 0 1px #555555 !important;
|