Skip to content

Commit

Permalink
feat: data badge
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Jul 7, 2021
1 parent 853b932 commit 1ce1e17
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/badge-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Data badge
12 changes: 12 additions & 0 deletions components/badge-data/bem.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @license EUPL-1.2
* Copyright (c) 2021 Robbert Broersma
*/

@import "../badge/bem";

.utrecht-badge-data {
@extend .utrecht-badge;
letter-spacing: var(--utrecht-badge-data-letter-spacing, inherit);
text-transform: var(--utrecht-badge-data-text-transform, inherit);
}
44 changes: 44 additions & 0 deletions components/badge-data/bem.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
@license EUPL-1.2
Copyright (c) 2021 Robbert Broersma
-->

import { Meta, Story, Canvas, ArgsTable } from "@storybook/addon-docs";

import "./bem.scss";

import README from "./README.md";

export const Template = ({ textContent }) => `<div class="utrecht-badge-data">${textContent}</div>`;

<Meta
title="Components/Badge/Data Badge"
argTypes={{
textContent: {
description: "Text content",
control: "text",
defaultValue: "Festivals",
},
}}
parameters={{
docs: {
transformSource: (_src, { args }) => Template(args),
},
status: {
type: "WORK IN PROGRESS",
},
notes: {
UX: README,
},
}}
/>

# Data badge

Styling via the `.utrecht-badge-data` class name:

<Canvas>
<Story name="Data badge">{Template.bind({})}</Story>
</Canvas>

<ArgsTable story="Data badge" />
8 changes: 8 additions & 0 deletions components/badge-data/block.style-dictionary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"utrecht": {
"badge-data": {
"letter-spacing": {},
"text-transform": {}
}
}
}
20 changes: 20 additions & 0 deletions components/badge-data/stencil.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @license EUPL-1.2
* Copyright (c) 2021 Robbert Broersma
*/
import { Component, h } from "@stencil/core";

@Component({
tag: "utrecht-badge-data",
styleUrl: "bem.scss",
shadow: true,
})
export class BadgeData {
render() {
return (
<div class="utrecht-badge-data">
<slot></slot>
</div>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"utrecht": {
"badge-data": {
"letter-spacing": {
"value": "0.15ch"
},
"text-transform": {
"value": "uppercase"
}
}
}
}

0 comments on commit 1ce1e17

Please sign in to comment.