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

Container, Card, IMG, Text and Grid updates #1380

Draft
wants to merge 59 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
1f4625c
Init card
astrit May 21, 2024
8699f3c
Merge branch 'main' into gds-card
astrit May 28, 2024
d5c2f9f
Card update
astrit May 28, 2024
2fd9e86
Change icon
astrit May 30, 2024
b7bfe4a
Merge branch 'main' into gds-card
astrit May 30, 2024
d46af44
Update icon stories
astrit May 30, 2024
edf3ed6
Merge branch 'main' into gds-card
astrit May 30, 2024
78f9a41
Merge branch 'main' into gds-card
astrit Jun 4, 2024
9ce69ef
Span, Display, align and other props
astrit Jun 4, 2024
bb6c005
Hovered state for card
astrit Jun 4, 2024
628ea85
Add elevations
astrit Jun 10, 2024
716bdaf
Elevation bug fix, token un recognised!
astrit Jun 10, 2024
a753438
Update card elevation
astrit Jun 10, 2024
73f8c00
Demo cleanup
astrit Jun 10, 2024
b920261
Algin and justify example
astrit Jun 11, 2024
362d255
Update
astrit Jun 11, 2024
75afc7a
Merge branch 'main' into gds-card
astrit Jun 11, 2024
46fcf0a
Poc/style expression parser merge to card (#1430)
astrit Jun 11, 2024
93b4a10
Rename elevation to shadow
astrit Jun 11, 2024
95045a1
Add the column and row prop to span
astrit Jun 11, 2024
c096981
Add new examples
astrit Jun 11, 2024
f960185
Demo login screen
astrit Jun 13, 2024
789f4bc
Update app using card
astrit Jun 13, 2024
f663dc4
Custom story component
astrit Jun 13, 2024
9f36851
Merge branch 'main' into gds-card
astrit Jun 17, 2024
5a827b4
Add Text comp initial version
astrit Jun 17, 2024
475c6aa
Add base style for typography
astrit Jun 17, 2024
a3e16b2
Radius Demo
astrit Jun 17, 2024
f29b51b
Border to be defined
astrit Jun 17, 2024
6973ec1
Update examples
astrit Jun 18, 2024
af901e7
Update border props and examples
astrit Jun 18, 2024
58a21c1
Update border examples
astrit Jun 18, 2024
cd5daab
Merge branch 'main' into gds-card
astrit Jun 20, 2024
2f2f2cb
Merge branch 'gds-card' of https://github.com/seb-oss/green into gds-…
astrit Jun 20, 2024
8635ebd
Add Divider
astrit Jun 20, 2024
f7a8938
Add styles for size, typography etc
astrit Jun 20, 2024
ce76e9a
Add style dropdown
astrit Jun 20, 2024
0febe45
Document card props
astrit Jun 20, 2024
03455a6
Card documentation
astrit Jun 20, 2024
4cd873a
Card Stories
astrit Jun 24, 2024
cc2521a
Add video, mask etc
astrit Jun 24, 2024
feba3e4
Update examples
astrit Jun 24, 2024
c498ec6
Documentation for container
astrit Jun 24, 2024
e9b12bd
Docs: for IMG, Text, Video, Divider
astrit Jun 25, 2024
96d71a7
Spacing tokens preview
astrit Jun 25, 2024
482065b
Update all Text and Size tokens and components
astrit Jun 25, 2024
f0e66b7
Card update, Container text also space tokens
astrit Jun 25, 2024
dd8d250
Update text docs
astrit Jun 25, 2024
443ad55
Update import paths
astrit Jun 25, 2024
a864e35
Re categorize components
astrit Jun 25, 2024
8463869
Re categorise everything
astrit Jun 25, 2024
21dc5bf
Add line clamp on text
astrit Jun 25, 2024
a7fe815
Line Clamp update to use the decorator
astrit Jun 25, 2024
4aa6a3d
Update text story
astrit Jun 25, 2024
347e0e5
Update style on preview and head
astrit Jun 25, 2024
d869a11
Merge branch 'main' into gds-card
astrit Jun 26, 2024
305486a
Update grid examples + Style switcher
astrit Jun 26, 2024
763805d
Add variants
astrit Jun 26, 2024
0aa7941
Card extends container, and add beta tag
astrit Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions apps/core-lib-dev/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/core-lib-dev",
Expand All @@ -16,12 +18,13 @@
"tsConfig": "apps/core-lib-dev/tsconfig.app.json",
"webpackConfig": "apps/core-lib-dev/webpack.config.js",
"assets": [
"apps/core-lib-dev/src/favicon.ico",
"apps/core-lib-dev/src/assets"
],
"index": "apps/core-lib-dev/src/index.html",
"baseHref": "/",
"styles": ["apps/core-lib-dev/src/styles.scss"],
"styles": [
"apps/core-lib-dev/src/styles.scss"
],
"scripts": []
},
"configurations": {
Expand All @@ -43,7 +46,9 @@
},
"serve": {
"executor": "@nx/webpack:dev-server",
"inputs": ["core"],
"inputs": [
"core"
],
"options": {
"buildTarget": "core-lib-dev:build",
"port": 4210,
Expand All @@ -60,10 +65,12 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "apps/core-lib-dev/jest.config.ts"
}
}
}
}
}
54 changes: 33 additions & 21 deletions apps/core-lib-dev/src/app/app.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { property, state } from 'lit/decorators.js'
import { choose } from 'lit/directives/choose.js'

import { html } from '@sebgroup/green-core/scoping'
import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'
// import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'
import { gdsInitLocalization } from '@sebgroup/green-core/localization'
import '@sebgroup/green-core/components/icon/icons/flag.js'
import '@sebgroup/green-core/components/segmented-control/index.js'
Expand All @@ -13,6 +13,7 @@ import './simple-values.element'
import './complex-values.element'
import './datepicker.element'
import './calendar.element'
import './card.element'

const { setLocale, getLocale } = gdsInitLocalization()

Expand All @@ -34,11 +35,11 @@ export class AppElement extends LitElement {
accessor lang = 'sv'

@state()
accessor currentView = 'simple-values'
accessor currentView = 'card'

connectedCallback() {
super.connectedCallback()
registerTransitionalStyles()
// registerTransitionalStyles()
this.setLang(getLocale())
}

Expand Down Expand Up @@ -78,25 +79,36 @@ export class AppElement extends LitElement {
>
<gds-segment value="datepicker">Datepicker</gds-segment>
<gds-segment value="calendar">Calendar</gds-segment>
<gds-segment value="card">Card</gds-segment>
</gds-segmented-control>
<div class="card">
${choose(
this.currentView,
[
['simple-values', () => html`<simple-values></simple-values>`],
[
'complex-values',
() => html`<complex-values></complex-values>`,
],
[
'datepicker',
() => html`<datepicker-example></datepicker-example>`,
],
['calendar', () => html`<calendar-example></calendar-example>`],
],
() => html`No view selected`,
)}
</div>
${this.currentView === 'card'
? html`<card-example></card-example>`
: html`
<div class="card">
${choose(
this.currentView,
[
[
'simple-values',
() => html`<simple-values></simple-values>`,
],
[
'complex-values',
() => html`<complex-values></complex-values>`,
],
[
'datepicker',
() => html`<datepicker-example></datepicker-example>`,
],
[
'calendar',
() => html`<calendar-example></calendar-example>`,
],
],
() => html`No view selected`,
)}
</div>
`}
</div>
</gds-theme>
`
Expand Down
5 changes: 2 additions & 3 deletions apps/core-lib-dev/src/app/calendar.element.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { LitElement } from 'lit'
import { customElement, state } from 'lit/decorators.js'
import { html } from '@sebgroup/green-core/scoping'

import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'
// import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'

@customElement('calendar-example')
export class CalendarExample extends LitElement {
Expand All @@ -12,7 +11,7 @@ export class CalendarExample extends LitElement {

connectedCallback() {
super.connectedCallback()
registerTransitionalStyles()
// registerTransitionalStyles()
}

@state()
Expand Down
90 changes: 90 additions & 0 deletions apps/core-lib-dev/src/app/card.element.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { LitElement } from 'lit'
import { customElement } from 'lit/decorators.js'
import { html } from '@sebgroup/green-core/scoping'

@customElement('card-example')
export class CardExample extends LitElement {
protected createRenderRoot() {
return this
}

connectedCallback() {
super.connectedCallback()
}

render() {
return html`
<gds-container display="flex" padding="s{xs} m{l} l{2xl}">
<gds-card shadow="s" radius="xs" overflow="hidden">
<gds-grid columns="2" gap="xl">
<gds-container position="relative">
<gds-img
ratio="2/2.4"
src="./assets/cards.jpg"
alt="Cards"
fit="cover"
position="60%"
></gds-img>
<gds-container
position="absolute"
filter="20px"
inset="auto 20px 20px 20px"
padding="s{xs} m{l} l{2xl}"
background="rgba(0, 0, 0, 0.1)"
radius="xs"
color="white-text"
>
<h2>Title</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</gds-container>
</gds-container>
<gds-container>
<gds-card shadow="s" radius="xs">
<gds-container
display="flex"
direction="column"
padding="s{xs} m{l} l{2xl}"
align="stretch"
justify="center"
height="100%"
>
<h1>Login</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna
aliqua.
</p>
<gds-container
display="flex"
direction="column"
gap="s"
align="stretch"
>
<input type="text" placeholder="Username" />
<input type="password" placeholder="Password" />
</gds-container>
<gds-container
display="flex"
direction="row"
gap="xl"
align="center"
>
<gds-button>
Register
<gds-icon-growth slot="trail"></gds-icon-growth>
</gds-button>
<p>or</p>
<gds-button rank="secondary">Login</gds-button>
</gds-container>
</gds-container>
</gds-card>
</gds-container>
</gds-grid>
</gds-card>
</gds-container>
`
}
}
4 changes: 0 additions & 4 deletions apps/core-lib-dev/src/app/complex-values.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import {
getScopedTagName,
} from '@sebgroup/green-core'

import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'

const html = htmlTemplateTagFactory((strs, ...values) =>
strs.map((s, i) => s + values[i]).join(''),
)
Expand All @@ -15,8 +13,6 @@ export class AppElement extends HTMLElement {
public static observedAttributes = []

connectedCallback() {
registerTransitionalStyles()

this.innerHTML = html`
<form id="my-form">
<gds-dropdown id="dropdown" label="Select a value" style="width: 200px">
Expand Down
3 changes: 0 additions & 3 deletions apps/core-lib-dev/src/app/datepicker.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { LitElement } from 'lit'
import { customElement, state } from 'lit/decorators.js'
import { html } from '@sebgroup/green-core/scoping'

import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'

@customElement('datepicker-example')
export class CalendarExample extends LitElement {
protected createRenderRoot() {
Expand All @@ -12,7 +10,6 @@ export class CalendarExample extends LitElement {

connectedCallback() {
super.connectedCallback()
registerTransitionalStyles()
}

@state()
Expand Down
4 changes: 0 additions & 4 deletions apps/core-lib-dev/src/app/simple-values.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
getScopedTagName,
} from '@sebgroup/green-core'

import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles'

const html = htmlTemplateTagFactory((strs, ...values) =>
strs.map((s, i) => s + values[i]).join(''),
)
Expand All @@ -16,8 +14,6 @@ export class SimpleValues extends HTMLElement {
public static observedAttributes = []

connectedCallback() {
registerTransitionalStyles()

this.innerHTML = html`
<form id="my-form">
<gds-form-validator></gds-form-validator>
Expand Down
Binary file added apps/core-lib-dev/src/assets/cards.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/core-lib-dev/src/favicon.ico
Binary file not shown.
4 changes: 1 addition & 3 deletions apps/core-lib-dev/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>StemsLibDev</title>
<title>Green Design System</title>
<base href="/" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<sebgroup-root></sebgroup-root>
Expand Down
11 changes: 6 additions & 5 deletions apps/docs/content/component/button/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ date: 2023-12-22

The defaut button har the prio primary and is the variant normal.

<Pattern height="250">
<gds-button>Send payment</gds-button>
</Pattern>
<Story component='button' id="basic" />

```html
<gds-button>Send payment</gds-button>
Expand All @@ -24,13 +22,16 @@ The defaut button har the prio primary and is the variant normal.

Buttons exist in three different prios, Primary, Secondary and Tertiary

<Pattern height="250">
<Story component='button' id="ranks-and-variants" />
{/* <Story height="400" src='https://storybook.seb.io/latest/core/iframe.html?viewMode=story&id=components-button--ranks-and-variants' /> */}

{/* <Pattern height="250">
<Grid columns="3" contentInline="auto" justify="center">
<gds-button variant="primary">Send payment</gds-button>
<gds-button variant="secondary">Cancel</gds-button>
<gds-button variant="tertiary">More</gds-button>
</Grid>
</Pattern>
</Pattern> */}

```html
<gds-button prio="primary">Send payment</gds-button>
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/design/blocks/mdx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import FigmaProto from './figma/figmaProto'
import IMG from './image/image'
import SE from './lang/se'
import Row from './row/row'
import Story from './story/story'

const components = {
Figma,
Expand All @@ -26,6 +27,7 @@ const components = {
Pattern,
Spacer,
Grid,
Story,
}

export function Mdx({
Expand Down
8 changes: 8 additions & 0 deletions apps/docs/design/blocks/mdx/story/story.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
iframe.story {
width: 100%;
height: 100%;
border: 0;
border: 1px solid #eaeaea;
border-radius: 4px;
min-height: 400px;
}
Loading
Loading