diff --git a/addons/api/mirage/factories/host-set.js b/addons/api/mirage/factories/host-set.js index 3b88650b7..4bb6ad7bb 100644 --- a/addons/api/mirage/factories/host-set.js +++ b/addons/api/mirage/factories/host-set.js @@ -12,4 +12,12 @@ export default factory.extend({ 'remove-hosts', ], id: (i) => `host-set-id-${i}`, + type() { + return this.hostCatalog?.type || factory.attrs.type; + }, + plugin() { + if (this.type === 'plugin') { + return this.hostCatalog.plugin; + } + }, }); diff --git a/addons/api/mirage/generated/factories/host-set.js b/addons/api/mirage/generated/factories/host-set.js index 9d14e3e4f..9a8000ef9 100644 --- a/addons/api/mirage/generated/factories/host-set.js +++ b/addons/api/mirage/generated/factories/host-set.js @@ -5,20 +5,11 @@ import { random, date, datatype } from 'faker'; * GeneratedHostSetModelFactory */ export default Factory.extend({ - type: () => random.arrayElement(['static', 'plugin']), + type: 'static', name: () => random.words(), description: () => random.words(), created_time: () => date.recent(), updated_time: () => date.recent(), version: () => datatype.number(), size: () => datatype.number(), - plugin: function (i) { - if (this.type == 'plugin') { - return { - id: `pl_${datatype.hexaDecimal(5)}`, - name: i % 2 ? 'aws' : 'azure', - description: random.words(), - }; - } - }, }); diff --git a/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx b/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx index 360108563..a730607c7 100644 --- a/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/radio/card/index.stories.mdx @@ -21,7 +21,7 @@ Renders a form radiofield in a Wide format. ``` - {{ + {{ template: hbs` - {{ + {{ template: hbs` + +```htmlbars + + + + + +``` + + {{ + template: hbs` + + + + + + `, + context: { + name: text('name', 'mustagree'), + disabled: boolean('disabled', false), + selectedValue: text('selectedValue', 'disagree'), + firstFieldLabel: text('first label', 'Agree'), + firstFieldValue: text('first value', 'agree'), + firstFieldIcon: select( + 'firstFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + secondFieldIcon: select( + 'secondFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + thirdFieldIcon: select( + 'thirdFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + secondFieldLabel: text('second label', 'Maybe'), + secondFieldValue: text('second value', 'maybe'), + thirdFieldLabel: text('third label', 'Disagree'), + thirdFieldValue: text('third value', 'disagree'), + changed: action('changed') + } + }} + + +```htmlbars + + + + +``` + + {{ + template: hbs` + + + + + + `, + context: { + name: text('name', 'mustagree'), + disabled: boolean('disabled', false), + selectedValue: text('selectedValue', 'disagree'), + firstFieldLabel: text('first label', 'Agree'), + firstFieldValue: text('first value', 'agree'), + firstFieldIcon: select( + 'firstFieldIcon', + { + 'none': null, + 'flight-icons/svg/azure-color-16': 'flight-icons/svg/azure-color-16', + }, + null + ), + secondFieldLabel: text('second label', 'Maybe'), + secondFieldValue: text('second value', 'maybe'), + thirdFieldLabel: text('third label', 'Disagree'), + thirdFieldValue: text('third value', 'disagree'), + changed: action('changed') + } + }} + diff --git a/addons/rose/addon/styles/rose/components/form/_radio-card.scss b/addons/rose/addon/styles/rose/components/form/_radio-card.scss index 85364923a..5e8018b40 100644 --- a/addons/rose/addon/styles/rose/components/form/_radio-card.scss +++ b/addons/rose/addon/styles/rose/components/form/_radio-card.scss @@ -58,9 +58,10 @@ $radio-svg: ( } } position: relative; - display: flex; + display: inline-flex; align-items: center; justify-content: center; + margin: $size-m $size-xs $size-xl 0; .radio-card-overlay { position: absolute; @@ -81,8 +82,7 @@ $radio-svg: ( display: block; position: relative; text-align: left; - word-break: break-all; - border: $size-xxxxs solid var(--ui-gray-subtler-6); + border: $size-xxxxs solid var(--ui-gray-subtler-2); box-shadow: 0 $size-xxs $size-xxs rgba(var(--stark-components), var(--opacity-2)); border-radius: $size-xxs;