diff --git a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.module.scss b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.module.scss index 8cae9718..fa47ec12 100644 --- a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.module.scss +++ b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.module.scss @@ -1,8 +1,7 @@ .checkboxWrapper { - height: 44px; + min-height: 44px; display: flex; position: relative; - align-items: center; &:hover { cursor: pointer; background-color: var(--px-color-surface-subtle-hover); @@ -11,6 +10,7 @@ &:active { background-color: var(--px-color-surface-subtle-active); } + border-radius: 4px; } .checkmark { @@ -18,7 +18,7 @@ margin-bottom: 10px; margin-right: 12px; margin-left: 8px; - width: 22px; + min-width: 22px; height: 22px; border: 2px solid var(--px-color-border-action); border-radius: 4px; @@ -38,3 +38,8 @@ .strong { font-weight: 600; } + +.label { + margin-top: 12px; + margin-bottom: 8px; +} diff --git a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.stories.tsx b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.stories.tsx index f83cc6f9..21091a8e 100644 --- a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.stories.tsx +++ b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.stories.tsx @@ -11,7 +11,7 @@ const meta: Meta = { }; export default meta; -export const Variants: StoryFn = () => { +export const MixedStateCheckbox: StoryFn = () => { const [selectedMalamute, setSelectedMalamute] = React.useState(true); const [selectedHusky, setSelectedHusky] = React.useState(true); const [selectedYorkshireTerrier, setSelectedYorkshireTerrier] = @@ -34,7 +34,7 @@ export const Variants: StoryFn = () => { <> { if (selectedHusky && selectedMalamute && selectedYorkshireTerrier) { setSelectedHusky(false); @@ -83,3 +83,39 @@ export const Variants: StoryFn = () => { ); }; + +export const LongTextOn400pxWideMax: StoryFn = () => { + const [selectedVar1, setSelectedVar1] = React.useState(true); + const [selectedVar2, setSelectedVar2] = React.useState(true); + const [selectedVar3, setSelectedVar3] = React.useState(false); + + return ( +
+ { + setSelectedVar2(val); + }} + value={selectedVar2} + /> + + { + setSelectedVar1(val); + }} + value={selectedVar1} + /> + { + setSelectedVar3(val); + }} + value={selectedVar3} + /> +
+ ); +}; diff --git a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.tsx b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.tsx index 686206a2..49ada63e 100644 --- a/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.tsx +++ b/libs/pxweb2-ui/src/lib/components/Checkbox/Checkbox.tsx @@ -47,11 +47,11 @@ export const Checkbox: React.FC = ({ > {value && } - +
- +
); }; @@ -111,11 +111,11 @@ export const MixedCheckbox: React.FC = ({ {value === 'true' && } {value === 'mixed' && }
- +
- +
); };