diff --git a/addons/rose/addon/components/rose/form/radio/radio-card/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/radio-card/index.stories.mdx index 35a81b942..6cd77c36b 100644 --- a/addons/rose/addon/components/rose/form/radio/radio-card/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/radio-card/index.stories.mdx @@ -9,7 +9,7 @@ import { text, boolean, select } from '@storybook/addon-knobs'; Renders a form radiofield. ```htmlbars - - {{ + {{ template: hbs` - `, context: { - label: text('text', 'Radiofield'), + label: text('text', 'AWS'), error: boolean('error', false), value: text('value', 'value and selectedValue must match to select radiofield'), selectedValue: text( @@ -55,49 +55,30 @@ Renders a form radiofield. ```htmlbars - ``` - {{ + {{ template: hbs` - - - `, context: { + label: text('text', 'AWS Tile'), error: boolean('error', false), value: text('value', 'value and selectedValue must match to select radiofield'), selectedValue: text( @@ -114,7 +95,6 @@ Renders a form radiofield. }, null ), - inline: boolean('inline', false) } }} diff --git a/addons/rose/addon/components/rose/form/radio/radio-card/index.js b/addons/rose/addon/components/rose/form/radio/radio-card/tile/index.js similarity index 53% rename from addons/rose/addon/components/rose/form/radio/radio-card/index.js rename to addons/rose/addon/components/rose/form/radio/radio-card/tile/index.js index 67337301e..c670c00be 100644 --- a/addons/rose/addon/components/rose/form/radio/radio-card/index.js +++ b/addons/rose/addon/components/rose/form/radio/radio-card/tile/index.js @@ -1,7 +1,7 @@ -import RoseFormRadioRadioComponent from '../radio'; +import RoseFormRadioRadioComponent from '../../radio'; export default class RoseFormRadioRadioCardComponent extends RoseFormRadioRadioComponent { // =attributes - className = 'rose-form-radio-card'; + className = 'rose-form-radio-card-tile'; } diff --git a/addons/rose/addon/components/rose/form/radio/radio-card/wide/index.js b/addons/rose/addon/components/rose/form/radio/radio-card/wide/index.js new file mode 100644 index 000000000..3ba04b04d --- /dev/null +++ b/addons/rose/addon/components/rose/form/radio/radio-card/wide/index.js @@ -0,0 +1,7 @@ +import RoseFormRadioRadioComponent from '../../radio'; + +export default class RoseFormRadioRadioCardComponent extends RoseFormRadioRadioComponent { + // =attributes + + className = 'rose-form-radio-card-wide'; +} diff --git a/addons/rose/addon/components/rose/form/radio/radio/index.hbs b/addons/rose/addon/components/rose/form/radio/radio/index.hbs index 8537a4d00..40f460dad 100644 --- a/addons/rose/addon/components/rose/form/radio/radio/index.hbs +++ b/addons/rose/addon/components/rose/form/radio/radio/index.hbs @@ -1,5 +1,4 @@
- - + + - {{yield}}
diff --git a/addons/rose/addon/styles/rose/components/form/_radioCard.scss b/addons/rose/addon/styles/rose/components/form/_radioCard.scss index bfb66a079..d74f0f2d7 100644 --- a/addons/rose/addon/styles/rose/components/form/_radioCard.scss +++ b/addons/rose/addon/styles/rose/components/form/_radioCard.scss @@ -1,73 +1,208 @@ -.rose-form-radio-card { - box-sizing: content-box; - flex-basis: 7rem; - width: 350px; - flex-direction: column-reverse; - justify-content: space-between; +@use '../../variables/sizing'; +@use '../../utilities/type'; + +.rose-form-radio-card-wide { + position: relative; display: flex; - border-radius: 2px; - text-align: center; - color: #6f7682; - font-weight: 600; - line-height: 1; - font-size: 12px; - border: 1px solid #bac1cc; - min-height: 115px; - /* Elevation / Low */ + align-items: center; + width: 350px; + justify-content: center; - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - border-radius: 2px; - .radio-wrapper { - background: #f7f8fa; - width: 100%; - padding-top: 7px; - padding-bottom: 7px; - .rose-form-radio-field { - &:checked { - .radio-wrapper { - background: red; - } - } - } - } - &:hover { - border: 1px solid #6f7682; - .radio-wrapper { - background: #f7f8fa; - } - } + .overlay { + position: absolute; + height: 30px; + background-color: #f7f8fa; + width: 348px; + bottom: 1px; + right: 0; + } .rose-form-radio-label { - width: 350px; font-style: normal; font-weight: bold; font-size: 14px; color: #000; + width: 350px; + height: 115px; display: block; - position: absolute; - /* top: 40px; */ - padding-top: 30px; - padding-bottom: 70px; + position: relative; text-align: left; - &::before { - content: ""; - padding-left: 40px; - } - &:checked { - background-color: salmon; - } + word-break: break-all; + border: 1px solid #bac1cc; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + border-radius: 2px; + padding: 19px; + box-sizing: border-box; + background-color: #FFFFFF; } - .rose-form-radio-label:checked { - background: red; - } - .rose-form-radio-field { + position: absolute; + margin-bottom: 3px; + z-index: 1; + bottom: 3px; &:not(:disabled) { + &:hover { + ~ .rose-form-radio-label { + border: 1px solid #6f7682; + } + } &:checked { ~ .rose-form-radio-label { - background: red; + .overlay { + background-color: #f0f5ff; + } + border: 1px solid #1563ff; } } } + + &:disabled { + ~ .rose-form-radio-label { + border: 1px solid #dce0e6; + background-color: #fbfbfc; + color: #626873; + } + } + } + + &.error { + color: var(--failure); + .rose-form-radio-field { + opacity: 0; + &:not(:disabled):not(:focus) { + ~ .rose-form-radio-label { + .overlay { + background-color: #f9ecee; + } + border: 1px solid #c73445; + } + &:checked { + ~ .rose-form-radio-label { + &::after { + position: absolute; + bottom: 3px; + right: 161px; + display: block; + width: 1.2rem; + height: 1.2rem; + transform: scale(2); + pointer-events: none; + content: " "; + background: no-repeat 50%/50% 50%; + background-image: url($data-svg-prefix + map-get( + $radio-svg, + 'error-checked' + )); /* text-align: center; */ + z-index: 2; + } + } + } + } + + + } + } +} + +.rose-form-radio-card-tile { + position: relative; + display: flex; + align-items: center; + width: 240px; + justify-content: center; + + + .overlay { + position: absolute; + height: 30px; + background-color: #f7f8fa; + width: 238px; + bottom: 1px; + right: 0; + } + .rose-form-radio-label { + font-style: normal; + font-weight: bold; + font-size: 14px; + color: #000; + width: 240px; + height: 145px; + display: block; + position: relative; + text-align: left; + word-break: break-all; + border: 1px solid #bac1cc; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + border-radius: 2px; + padding: 19px; + box-sizing: border-box; + background-color: #FFFFFF; + } + .rose-form-radio-field { + position: absolute; + margin-bottom: 3px; + z-index: 1; + bottom: 3px; + &:not(:disabled) { + &:hover { + ~ .rose-form-radio-label { + border: 1px solid #6f7682; + } + } + &:checked { + ~ .rose-form-radio-label { + .overlay { + background-color: #f0f5ff; + } + border: 1px solid #1563ff; + } + } + } + + &:disabled { + ~ .rose-form-radio-label { + border: 1px solid #dce0e6; + background-color: #fbfbfc; + color: #626873; + } + } + } + + &.error { + color: var(--failure); + .rose-form-radio-field { + opacity: 0; + &:not(:disabled):not(:focus) { + ~ .rose-form-radio-label { + .overlay { + background-color: #f9ecee; + } + border: 1px solid #c73445; + } + &:checked { + ~ .rose-form-radio-label { + &::after { + position: absolute; + bottom: 3px; + right: 109px; + display: block; + width: 1.2rem; + height: 1.2rem; + transform: scale(2); + pointer-events: none; + content: " "; + background: no-repeat 50%/50% 50%; + background-image: url($data-svg-prefix + map-get( + $radio-svg, + 'error-checked' + )); /* text-align: center; */ + z-index: 2; + } + } + } + } + + + } } } diff --git a/addons/rose/app/components/rose/form/radio/radio-card.js b/addons/rose/app/components/rose/form/radio/radio-card/tile/index.js similarity index 85% rename from addons/rose/app/components/rose/form/radio/radio-card.js rename to addons/rose/app/components/rose/form/radio/radio-card/tile/index.js index 42acc95ea..d3d617b77 100644 --- a/addons/rose/app/components/rose/form/radio/radio-card.js +++ b/addons/rose/app/components/rose/form/radio/radio-card/tile/index.js @@ -1 +1 @@ -export { default } from 'rose/components/rose/form/radio/radio-card'; +export { default } from 'rose/components/rose/form/radio/radio-card/tile'; diff --git a/addons/rose/app/components/rose/form/radio/radio-card/wide/index.js b/addons/rose/app/components/rose/form/radio/radio-card/wide/index.js new file mode 100644 index 000000000..5c17ecb7e --- /dev/null +++ b/addons/rose/app/components/rose/form/radio/radio-card/wide/index.js @@ -0,0 +1 @@ +export { default } from 'rose/components/rose/form/radio/radio-card/wide'; diff --git a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs index f45a32682..41d16fc56 100644 --- a/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs +++ b/ui/admin/app/templates/scopes/scope/auth-methods/index.hbs @@ -35,13 +35,14 @@ - - + {{#if (or @model