Skip to content

Commit

Permalink
[DW-3497] Descriptor isolated placement
Browse files Browse the repository at this point in the history
  • Loading branch information
lekeDevOps committed Nov 30, 2023
1 parent f3c1804 commit 5ad2b79
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/nhsd/components/atoms/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
@use "selector-toggle";
@use "summary-list";
@use "avatar";
@use "descriptors";
11 changes: 11 additions & 0 deletions src/nhsd/components/atoms/descriptors/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%digital-heading {
color: #231f20;
font-family: "FrutigerLTW01-65Bold.woff2", sans-serif;
font-size: 32px;
font-weight: bold;
line-height: 40px;
}

.digital-descriptor-text {
@extend %digital-heading;
}
35 changes: 35 additions & 0 deletions src/nhsd/components/atoms/descriptors/descriptors.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Load storybook config
import * as sbConfig from '../../../../../.storybook/storybook-config';

// Load template file
import template from './template.njk';

const componentName = 'Digital descriptor';
const storyDescription = `${sbConfig.heading.lab}`;
const sourceCode = `// Sass import \n@use "nhsd/components/atoms/descriptors";
// HTML`;

// Component defaults
export default {
title: `${sbConfig.title.designSystem} / ${sbConfig.title.components} / ${sbConfig.title.atoms} / ${componentName}`,
parameters: {
docs: {
description: {
component: storyDescription,
},
},
},
};

const Template = (args) => template.render({ params: { ...args } });

export const LabComponent = Template.bind({});
LabComponent.storyName = sbConfig.title.lab;
LabComponent.parameters = {
docs: {
source: {
code: `${sourceCode}\n${LabComponent()}`,
},
},
};
1 change: 1 addition & 0 deletions src/nhsd/components/atoms/descriptors/template.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p class="digital-descriptor-text">Digital</p>
12 changes: 0 additions & 12 deletions src/nhsd/components/atoms/logo/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,3 @@ $-root: ".nhsd-a-logo";
fill: nhsd-colours.get('black');
}
}

%digital-heading {
color: #231f20;
font-family: "FrutigerLTW01-65Bold.woff2", sans-serif;
font-size: 32px;
font-weight: bold;
line-height: 40px;
}

.digital-descriptor-text {
@extend %digital-heading;
}
16 changes: 0 additions & 16 deletions src/nhsd/components/atoms/logo/logo.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,3 @@ BlackLogoComponent.parameters = {
},
},
};

export const DigitalComponent = Template.bind({});
DigitalComponent.storyName = 'Digital Descriptor';
DigitalComponent.args = {
classes: 'digital-descriptor-text',
};
DigitalComponent.parameters = {
docs: {
description: {
story: 'A digital descriptor can replace the logo with the class `digital-descriptor-text`',
},
source: {
code: `${sourceCode}\n${DigitalComponent(DigitalComponent.args)}`,
},
},
};
3 changes: 1 addition & 2 deletions src/nhsd/components/atoms/logo/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{%- if params.classes %}
{% set classNames = classNames + " " + params.classes %}
{% endif -%}

{%- if params.logo == 'nhse' -%}
<svg class="{{ classNames }}" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="80" height="60" viewBox="0 0 25.570341 19.900145" version="1.1" id="svg336">
<defs id="defs330">
Expand All @@ -24,8 +25,6 @@
</g>
</g>
</svg>
{%- elif params.classes == 'digital-descriptor-text' -%}
<p class="digital-descriptor-text">Digital</p>
{%- else -%}
<svg
class="{{ classNames }}"
Expand Down

0 comments on commit 5ad2b79

Please sign in to comment.