Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT TEST - first version of component tokens with updates #2296

Draft
wants to merge 6 commits into
base: alpha
Choose a base branch
from

Conversation

twjeffery
Copy link
Collaborator

No description provided.

@@ -1,7 +1,7 @@
<svelte:options customElement="goa-icon" />

<script lang="ts" context="module">
export type IconSize = "small" | "medium" | "large" | "xlarge";
export type IconSize = "1" | "2" | "3" | "4" | "5" | "6" | "2xsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new icon size scale (size 1-6) because the other (tshirt sizing) are misaligned with the token values. (i.e. goa-icon-small was using icon-size-medium)

This allow us to easily add the new icon sizes and fix this misalignment going forward without breaking changes.

font-weight: var(--goa-font-weight-regular);
/*box-shadow: var(--goa-badge-border); / inner shadow - new style */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new border style for badges as part of the upcoming style updates. Commented out for now.

--font-valign-fix,
0
); /* acumin font requires this to allow for vertical alignment */
padding-bottom: 0.2rem; /* acumin font requires this to allow for vertical alignment */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

font-v-align fix is not completely centering text, replaced with manual value

@@ -84,64 +84,132 @@
<span class="text">
<slot />
</span>
<goa-icon id="trailing-icon" type="arrow-forward" inverted="true" />
<goa-icon id="trailing-icon" size="4" type="arrow-forward" inverted="true" />
Copy link
Collaborator Author

@twjeffery twjeffery Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button corrected to be different sizes in start, regular, and compact buttons.

I was not sure how to change the icon size in the compact button. Added token value and class below.

src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='149.351' height='42' viewBox='0 0 149.351 42'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bclip-path:url(%23a);%7D.c%7Bfill:%2300aad2;%7D.d%7Bfill:%235f6a72;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='149.351' height='42'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg class='b'%3E%3Crect class='c' width='13.555' height='13.555' transform='translate(135.796 21.524)'/%3E%3Cpath class='d' d='M63.082,33.088c-1.383.138-2.835.277-4.357.346.553-4.357,2.835-10.373,5.671-9.405,1.66.553.761,5.671-1.314,9.059m-3.527,2.974a3.761,3.761,0,0,1-1.245,0,.851.851,0,0,0,.346-.692v-.553c.761,0,1.936-.138,3.389-.277a4.327,4.327,0,0,1-2.49,1.521M76.844,25.688c1.8-1.66,2.7-1.521,2.9-1.106.484.968-1.591,4.357-5.671,6.224a10.328,10.328,0,0,1,2.766-5.118m66.736,1.66c-.207-3.389-3.181-3.942-3.6-2.974-.138.346,1.106.207,1.106,2.628,0,3.942-4.011,9.129-9.129,9.129-5.532,0-6.985-4.357-7.261-6.432-.207-1.452.138-3.458-2.351-3.181-1.729.207-3.25,3.527-5.463,6.362-1.867,2.42-2.7,2.213-2.282.138.553-2.628,2.7-8.714,5.187-9.129,1.176-.207,1.591,1.8,2.075.553s.069-4.011-2.559-4.011c-1.8,0-3.942,1.936-5.74,4.08-1.521,1.936-9.336,13.416-12.656,10.927-1.521-1.176-1.383-5.878-.415-11.411,3.873-1.521,7.123-1.037,8.921-.138.9.415,1.037.346.622-.622-.553-1.452-3.665-3.734-8.575-2.7-.138,0-.207.069-.346.069.415-1.8.83-3.665,1.383-5.463.484-1.66,1.8-4.5-1.729-4.979-1.106-.207-.622.346-1.037,1.867-.692,2.766-1.521,6.362-2.144,10.028a19.745,19.745,0,0,0-7.538,8.091,38.59,38.59,0,0,0,.9-4.772,1.589,1.589,0,0,0-1.245-1.729c-.761-.207-1.729.138-2.628,1.452-2.144,3.043-4.841,7.815-8.99,9.82-2.974,1.452-4.288,0-4.357-2.282a9.869,9.869,0,0,0,1.521-.553c5.394-2.351,7.192-5.947,5.878-8.16-1.314-2.075-4.979-1.452-7.953,1.66a11.175,11.175,0,0,0-2.7,6.5c-1.245.277-2.628.484-4.219.692,2.49-4.08,2.282-9.613-1.383-10.581-4.288-1.106-6.432,3.043-7.331,6.5.346-3.873.9-7.745,1.591-11.549.346-1.66,1.452-4.5-2.075-4.979-1.106-.207-.968.346-.9,1.867.138,2.075-2.144,14.454-.968,19.848-1.521.484-2.144,1.66-.207,2.835,1.383.83,4.357,1.106,7.331-.346a9.3,9.3,0,0,0,2.766-2.144c1.8-.207,3.665-.553,5.394-.83.277,2.42,1.867,4.219,5.463,3.873,5.118-.484,9.682-6.777,11.411-9.82-.346,3.25-2.42,10.373,1.176,10.028,1.383-.138.83-.346.9-1.591.346-4.288,3.873-7.953,7.4-10.166-.622,5.256-.415,9.958,2.006,11.411,4.426,2.766,10.581-4.5,14.039-8.921-1.729,3.942-2.7,8.921-.138,9.682,3.043.9,5.463-4.219,8.3-8.091.346,2.766,2.213,7.607,9.682,7.607,8.022-.069,13.071-4.91,12.863-10.1m-108.3,8.645A66.439,66.439,0,0,1,27.4,32.534a59.168,59.168,0,0,0,6.777-2.974,54.453,54.453,0,0,0,1.106,6.432m20.4,3.873c-.069-.207-.622.069-1.106,0-1.452-.207-3.389-2.213-3.942-5.463-1.037-5.878-.415-11.687,1.314-20.332.346-1.66,1.452-4.5-2.075-5.048-1.106-.138-.553.415-.83,1.867C47.66,17.32,42.4,21.954,37.149,25.066,36.6,17.735,36.8,9.505,38.186,4.526c1.176-4.219,2.559-3.458.83-4.357s-3.734.277-5.325,3.458S24.839,23.89,13.221,35.439C7.273,41.317,1.879,38.274.842,37.375c-.9-.761-1.176.415-.138,1.591,4.772,5.256,11.826,2.282,14.384-.277,7.054-7.054,15.283-22.268,18.6-28.7a98.251,98.251,0,0,0,.277,16.874,50.129,50.129,0,0,1-8.3,3.181c-1.66.415-2.7,1.106-2.7,1.867s1.106,1.521,2.7,2.282c2.835,1.383,11.2,5.256,13.209,6.5,1.729,1.037,2.628.207,3.112-.9.692-1.452-1.176-2.282-2.974-2.766a60.545,60.545,0,0,1-1.66-9.267c4.219-2.628,8.437-6.086,10.788-10.443C47.522,20.916,46,33.3,49.873,38.482a5.451,5.451,0,0,0,4.564,2.213c.968-.069,1.383-.692,1.245-.83' transform='translate(-0.038 0.124)'/%3E%3C/g%3E%3C/svg%3E"
/>
<!-- Logo and optional link -->
{#if url}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added component property to set custom link for logo. If no url set, then no link on logo. (just like we have for app header logo)

<!-- Logo and optional link -->
{#if url}
<a href={url}>
<img src={goalogo} alt="Government of Alberta Logo" class="logo"/>
Copy link
Collaborator Author

@twjeffery twjeffery Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the logo svg (updated colours from CPE).

Would we rather have the svg embedded for performance/loading reasons instead of linked to a file? If so I can change this to be an embedded svg like before.

@@ -83,31 +102,41 @@

@container self (--mobile) {
.content {
padding: 2rem 1rem;
padding: var(--goa-footer-padding-small-screen);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added mobile variants for all footers with breakpoint (different type size and spacing as per design)

@@ -71,6 +71,20 @@
href="https://www.alberta.ca/index.aspx"
target={`_${headerurltarget}`}>Alberta Government</a
>
{#if feedbackurl}
Copy link
Collaborator Author

@twjeffery twjeffery Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added ability to show feedback link on live microsite type

image

}

:global([role="tabpanel"]:focus-visible) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added focus styling for tab content

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before

image

After

image

@@ -79,7 +79,4 @@
</section>

<style>
[role="tabpanel"] {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to tabs component

}
}

@media (--mobile) {

.tabs {
border-left: var(--goa-tabs-bottom-border);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added left and bottom border as per design.

image

border-left: 4px solid transparent;
padding: var(--goa-tab-padding-mobile);
border-left: var(--goa-tab-border-not-selected);
text-overflow: ellipsis;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added ellipses when text overflow

added min width for tab, and horizontally centred text for min width.

@@ -233,10 +233,12 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<goa-icon-button
size="medium"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed close icon button size and thicker icon.

flex-direction: column;
}

.callout-bar {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added mobile callout variant -- with top bar layout (as per design)

image

@@ -195,17 +216,26 @@
cursor: pointer;
}

/* Add hover styles when the user hovers over the label */
label:hover .container {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added hover when user hovers over label (not just checkbox square)

@@ -47,7 +47,7 @@
// margin
export let mt: Spacing = null;
export let mr: Spacing = null;
export let mb: Spacing = "m";
export let mb: Spacing = null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the margin-bottom on radio item to gap on radio group, to fix extra space between helper text and radio group (bug)

margin: 0;
opacity: 0;
}

.goa-radio-label {
padding: 0 var(--goa-space-xl) 0 var(--goa-space-xs);
font-weight: var(--goa-font-weight-regular);
padding: 0 var(--goa-space-xs);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved padding right on the item to GAP on the group when horizontal. This fixes a weird bug where the space right beside the next radio input is clickable

.goa-radio--disabled .goa-radio-label {
opacity: 0.4;
.goa-radio--disabled .goa-radio-label,
.goa-radio--disabled ~ .goa-radio-description {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed item descriptions not ”disabling” when input is disabled

margin-top: var(--offset-top, 3px);
margin-bottom: var(--offset-bottom, 3px);
margin-left: var(--offset-left, 0);
margin-right: var(--offset-right, 0);
/* overflow: hidden; */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would clip the background borders radius in the app-header menu when hovering menu items.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image image

@@ -234,26 +246,34 @@
align-items: center;
}

.tooltip:focus-visible {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the tooltip gap to the tooltip, instead of the focus, because this happens:

Before
image

After
image

@@ -19,11 +19,11 @@
// Private

const _mobileLogo =
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='32' height='32' viewBox='0 0 16 16'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;%7D.b%7Bfill:%2300aad2;%7D.c%7Bclip-path:url(%23a);%7D.d%7Bfill:%23fff;%7D%3C/style%3E%3CclipPath id='a'%3E%3Crect class='a' width='14' height='14' transform='translate(-0.345 -0.21)'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg transform='translate(0 -0.135)'%3E%3Ccircle class='b' cx='8' cy='8' r='8' transform='translate(0 0.135)'/%3E%3Cg transform='translate(1.345 1.344)'%3E%3Cg class='c' transform='translate(0 0)'%3E%3Cpath class='d' d='M12.612,13.636a16.24,16.24,0,0,1-1.86-.822,13.436,13.436,0,0,0,1.6-.708,11.312,11.312,0,0,0,.264,1.53M16.032,7.3c-.266-.034-.128.091-.2.442a5.465,5.465,0,0,1-2.8,3.338,16.141,16.141,0,0,1,.249-4.84c.275-1,.6-.813.2-1.022-.427-.22-.887.071-1.258.813A27.247,27.247,0,0,1,7.4,13.522a2.141,2.141,0,0,1-2.918.461c-.206-.174-.282.095-.026.37a2.412,2.412,0,0,0,3.387-.082A32.715,32.715,0,0,0,12.219,7.51a23.541,23.541,0,0,0,.063,3.971,11.464,11.464,0,0,1-1.964.749c-.388.1-.628.26-.635.439-.007.2.253.363.63.541.67.318,2.633,1.246,3.117,1.527.414.24.616.053.739-.207.16-.338-.279-.533-.7-.661a13.175,13.175,0,0,1-.382-2.179,7.143,7.143,0,0,0,2.547-2.454,4.7,4.7,0,0,0,.4-1.133,2.125,2.125,0,0,0,.048-.742s-.007-.054-.048-.059' transform='translate(-3.51 -3.943)'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E";
"data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_169_613)'%3E%3Cpath d='M12 0C14.3734 0 16.6935 0.703788 18.6668 2.02236C20.6402 3.34094 22.1783 5.21509 23.0866 7.4078C23.9948 9.60051 24.2324 12.0133 23.7694 14.3411C23.3064 16.6689 22.1635 18.8071 20.4853 20.4853C18.8071 22.1635 16.6689 23.3064 14.3411 23.7694C12.0133 24.2324 9.60051 23.9948 7.4078 23.0866C5.21509 22.1783 3.34094 20.6402 2.02236 18.6668C0.703788 16.6935 0 14.3734 0 12C0 8.8174 1.26428 5.76516 3.51472 3.51472C5.76516 1.26428 8.8174 0 12 0V0Z' fill='%2300B6ED'/%3E%3Cpath d='M15.5215 16.5533C14.7002 16.2504 13.8987 15.8965 13.1215 15.4937C13.827 15.2346 14.515 14.9299 15.181 14.5817C15.2489 15.2461 15.3625 15.9051 15.521 16.554M19.9318 8.38678C19.5881 8.34334 19.7666 8.50318 19.6709 8.95606C19.2569 10.9087 17.6599 12.3161 16.0567 13.2602C15.8887 11.0241 15.9574 8.54158 16.3783 7.02022C16.7335 5.73598 17.1559 5.97166 16.632 5.7019C16.08 5.41798 15.4884 5.7931 15.0091 6.74974C14.5298 7.70638 12.3228 12.8995 8.7948 16.4061C6.99024 18.2011 5.358 17.2766 5.03112 17.0006C4.7652 16.776 4.66704 17.1228 4.99704 17.478C6.45648 19.0517 8.58864 18.1488 9.36504 17.3729C11.5106 15.2282 14.0052 10.6116 15.0144 8.6527C14.8969 10.3588 14.9239 12.0718 15.0953 13.7733C14.2825 14.1722 13.4348 14.4955 12.5628 14.7393C12.0626 14.8704 11.7533 15.0741 11.7442 15.3057C11.7343 15.5594 12.0701 15.7735 12.5556 16.0039C13.4196 16.4143 15.9511 17.6102 16.5749 17.9719C17.1089 18.2817 17.3695 18.0401 17.5277 17.7055C17.7343 17.2694 17.1677 17.0174 16.6186 16.8533C16.3762 15.9328 16.2116 14.9937 16.1263 14.0457C17.4132 13.2537 18.6802 12.1977 19.4105 10.8809C19.6463 10.418 19.8216 9.92681 19.932 9.41926C20.0085 9.1067 20.0293 8.78313 19.9937 8.46334C19.9937 8.46334 19.9841 8.3935 19.932 8.38678' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_169_613'%3E%3Crect width='24' height='24' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated logo

@@ -3,6 +3,7 @@ import { ReactNode } from "react";
interface WCProps {
maxcontentwidth?: string;
testid?: string;
url?: string;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added property in footer component for url on logo

@@ -99,54 +130,64 @@
container: self / inline-size;
}

/* Screen sizes */

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed alignment of icon and icon thickness

Before

image

After

image

color: var(--goa-footer-color-links-hover);
}

a:focus-visible {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added hover and focus styling for links in the footer

box-sizing: border-box;
font-family: var(--goa-font-family-sans);
}

.feedback-link {
display: inline-flex; /* Keeps the text and icon together when text wraps */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed wrapping on external icon and text (stays together)

height: 100%;
flex-direction: column;
gap: var(--goa-side-menu-items-gap);
border-right: var(--goa-side-menu-border-right); /* should this happen on the parent div on the page? */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added right border (in design)

display: block;
width: var(--goa-side-menu-width);
display: flex;
height: 100%;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 100% height

@@ -310,10 +314,11 @@
display: flex;
flex-direction: row;
align-items: center;
gap: 1rem;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed bug on "profile" type.

Before

image

After

image

@@ -275,6 +277,25 @@
<!-- ======================================================================= -->
<style>
:host {
/* TODO: Component tokens, to move to design tokens file ------------------------------------------------------- */
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed various spacing bugs

Before

image image

After

image image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed a lot of issues with the scroll bar, buttons on mobile, and spacing overall when scroll and when on mobile.

Before

image

After
image

/* Error Container */
.error .container,
.error .container:hover {
border: var(--goa-border-width-m) solid var(--goa-color-interactive-error);
background-color: var(--goa-color-greyscale-white);
box-shadow: none;
}
.error .container.selected,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed error states on hover and focus

}
label:hover.disabled.error .container {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: description not changing colour on disabled state

Before

image

After

image

padding: 0 ${hpadding} 3px;
`}
>
<slot />
</div>

<style>


Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Styled the scroll bar

@@ -57,7 +57,10 @@ goa-table[variant="relaxed"] td {
goa-table thead th {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the styles for the table to the table svelte file?

height: 3.75rem;
padding: 0 1rem;
height: 3rem;
padding: 12px 1rem;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed bug with layout and hover

Before
image

After
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant