Skip to content

Commit

Permalink
Merge pull request #5 from novacbn/0.2.X
Browse files Browse the repository at this point in the history
0.2.x
  • Loading branch information
novacbn authored Jun 21, 2021
2 parents a7fe39f + 0462207 commit 9411e21
Show file tree
Hide file tree
Showing 76 changed files with 570 additions and 77 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

## v0.2.6 -

- Added `name` HTML5 attribute to all Components as a global property.
- Adjusted dark / light shades coloring slightly.
- Fixed the sizing modifiers.
- Fixed the spacing modifiers.
- Fixed typo of `dismissable` -> `dismissible`.
- Fixed typing of `DESIGN_HIDDEN_ARGUMENT` not accepting array arguments for Viewports.
- Updated the following Components

- Feedback

- `Wave`

- Removed line wrapping from the children dots.

- Navigation

- `Aside` / `Omni`
Expand All @@ -17,6 +26,10 @@

- Fixed not resetting the `List` margins.

- `Menu`

- Fixed `Menu.Divider` not rendering non-text dividers properly.

- Overlays

- `Overlay`
Expand All @@ -25,6 +38,10 @@

- Surfaces

- `Box`

- Adjusted default color shade to match `Hero`.

- `Card` / `Tile`

- Added low transparency border for legibility.
Expand All @@ -33,6 +50,16 @@

- Updated `Tile.Section` to use bigger padding when first and / or last child for their respective sides.

- Typography

- `Heading` / `Text`

- Added `palette="accent/dark/light/alert/affirmative/negative"` text color modifier.

- `Text`

- Added initial keycap design for `<Text is="kbd">`.

## v0.2.5 - UNRELEASED

- Added new Components
Expand Down
36 changes: 28 additions & 8 deletions dist/kahi-ui.framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ span.ellipsis > span:nth-child(2) {
--size-icon: 1em;
vertical-align: middle;
display: inline-block;
white-space: nowrap;
font-size: var(--size-icon);
}

Expand Down Expand Up @@ -1530,19 +1531,23 @@ h6[data-variation~="headline"] {
line-height: 2rem;
}

abbr[data-transform="capitalize"], b[data-transform="capitalize"], del[data-transform="capitalize"], em[data-transform="capitalize"], h1[data-transform="capitalize"], h2[data-transform="capitalize"], h3[data-transform="capitalize"], h4[data-transform="capitalize"], h5[data-transform="capitalize"], h6[data-transform="capitalize"], i[data-transform="capitalize"], ins[data-transform="capitalize"], kbd[data-transform="capitalize"], mark[data-transform="capitalize"], p[data-transform="capitalize"], pre[data-transform="capitalize"], s[data-transform="capitalize"], samp[data-transform="capitalize"], small[data-transform="capitalize"], span[data-transform="capitalize"], strong[data-transform="capitalize"], sub[data-transform="capitalize"], sup[data-transform="capitalize"], u[data-transform="capitalize"] {
abbr[data-palette], b[data-palette], del[data-palette], em[data-palette], h1[data-palette], h2[data-palette], h3[data-palette], h4[data-palette], h5[data-palette], h6[data-palette], i[data-palette], ins[data-palette], kbd[data-palette], mark[data-palette], p[data-palette], pre[data-palette], s[data-palette], samp[data-palette], small[data-palette], span:not([class])[data-palette], strong[data-palette], sub[data-palette], sup[data-palette], u[data-palette] {
color: rgb(var(--palette-foreground-bg));
}

abbr[data-transform="capitalize"], b[data-transform="capitalize"], del[data-transform="capitalize"], em[data-transform="capitalize"], h1[data-transform="capitalize"], h2[data-transform="capitalize"], h3[data-transform="capitalize"], h4[data-transform="capitalize"], h5[data-transform="capitalize"], h6[data-transform="capitalize"], i[data-transform="capitalize"], ins[data-transform="capitalize"], kbd[data-transform="capitalize"], mark[data-transform="capitalize"], p[data-transform="capitalize"], pre[data-transform="capitalize"], s[data-transform="capitalize"], samp[data-transform="capitalize"], small[data-transform="capitalize"], span:not([class])[data-transform="capitalize"], strong[data-transform="capitalize"], sub[data-transform="capitalize"], sup[data-transform="capitalize"], u[data-transform="capitalize"] {
text-transform: capitalize;
}

abbr[data-transform="lowercase"], b[data-transform="lowercase"], del[data-transform="lowercase"], em[data-transform="lowercase"], h1[data-transform="lowercase"], h2[data-transform="lowercase"], h3[data-transform="lowercase"], h4[data-transform="lowercase"], h5[data-transform="lowercase"], h6[data-transform="lowercase"], i[data-transform="lowercase"], ins[data-transform="lowercase"], kbd[data-transform="lowercase"], mark[data-transform="lowercase"], p[data-transform="lowercase"], pre[data-transform="lowercase"], s[data-transform="lowercase"], samp[data-transform="lowercase"], small[data-transform="lowercase"], span[data-transform="lowercase"], strong[data-transform="lowercase"], sub[data-transform="lowercase"], sup[data-transform="lowercase"], u[data-transform="lowercase"] {
abbr[data-transform="lowercase"], b[data-transform="lowercase"], del[data-transform="lowercase"], em[data-transform="lowercase"], h1[data-transform="lowercase"], h2[data-transform="lowercase"], h3[data-transform="lowercase"], h4[data-transform="lowercase"], h5[data-transform="lowercase"], h6[data-transform="lowercase"], i[data-transform="lowercase"], ins[data-transform="lowercase"], kbd[data-transform="lowercase"], mark[data-transform="lowercase"], p[data-transform="lowercase"], pre[data-transform="lowercase"], s[data-transform="lowercase"], samp[data-transform="lowercase"], small[data-transform="lowercase"], span:not([class])[data-transform="lowercase"], strong[data-transform="lowercase"], sub[data-transform="lowercase"], sup[data-transform="lowercase"], u[data-transform="lowercase"] {
text-transform: lowercase;
}

abbr[data-transform="uppercase"], b[data-transform="uppercase"], del[data-transform="uppercase"], em[data-transform="uppercase"], h1[data-transform="uppercase"], h2[data-transform="uppercase"], h3[data-transform="uppercase"], h4[data-transform="uppercase"], h5[data-transform="uppercase"], h6[data-transform="uppercase"], i[data-transform="uppercase"], ins[data-transform="uppercase"], kbd[data-transform="uppercase"], mark[data-transform="uppercase"], p[data-transform="uppercase"], pre[data-transform="uppercase"], s[data-transform="uppercase"], samp[data-transform="uppercase"], small[data-transform="uppercase"], span[data-transform="uppercase"], strong[data-transform="uppercase"], sub[data-transform="uppercase"], sup[data-transform="uppercase"], u[data-transform="uppercase"] {
abbr[data-transform="uppercase"], b[data-transform="uppercase"], del[data-transform="uppercase"], em[data-transform="uppercase"], h1[data-transform="uppercase"], h2[data-transform="uppercase"], h3[data-transform="uppercase"], h4[data-transform="uppercase"], h5[data-transform="uppercase"], h6[data-transform="uppercase"], i[data-transform="uppercase"], ins[data-transform="uppercase"], kbd[data-transform="uppercase"], mark[data-transform="uppercase"], p[data-transform="uppercase"], pre[data-transform="uppercase"], s[data-transform="uppercase"], samp[data-transform="uppercase"], small[data-transform="uppercase"], span:not([class])[data-transform="uppercase"], strong[data-transform="uppercase"], sub[data-transform="uppercase"], sup[data-transform="uppercase"], u[data-transform="uppercase"] {
text-transform: uppercase;
}

abbr[data-variation~="truncate"], b[data-variation~="truncate"], del[data-variation~="truncate"], em[data-variation~="truncate"], h1[data-variation~="truncate"], h2[data-variation~="truncate"], h3[data-variation~="truncate"], h4[data-variation~="truncate"], h5[data-variation~="truncate"], h6[data-variation~="truncate"], i[data-variation~="truncate"], ins[data-variation~="truncate"], kbd[data-variation~="truncate"], mark[data-variation~="truncate"], p[data-variation~="truncate"], pre[data-variation~="truncate"], s[data-variation~="truncate"], samp[data-variation~="truncate"], small[data-variation~="truncate"], span[data-variation~="truncate"], strong[data-variation~="truncate"], sub[data-variation~="truncate"], sup[data-variation~="truncate"], u[data-variation~="truncate"] {
abbr[data-variation~="truncate"], b[data-variation~="truncate"], del[data-variation~="truncate"], em[data-variation~="truncate"], h1[data-variation~="truncate"], h2[data-variation~="truncate"], h3[data-variation~="truncate"], h4[data-variation~="truncate"], h5[data-variation~="truncate"], h6[data-variation~="truncate"], i[data-variation~="truncate"], ins[data-variation~="truncate"], kbd[data-variation~="truncate"], mark[data-variation~="truncate"], p[data-variation~="truncate"], pre[data-variation~="truncate"], s[data-variation~="truncate"], samp[data-variation~="truncate"], small[data-variation~="truncate"], span:not([class])[data-variation~="truncate"], strong[data-variation~="truncate"], sub[data-variation~="truncate"], sup[data-variation~="truncate"], u[data-variation~="truncate"] {
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
Expand All @@ -1554,22 +1559,37 @@ abbr[data-size], b[data-size], del[data-size], em[data-size], i[data-size], ins[
line-height: var(--size-line-height);
}

h1[data-align="center"], h2[data-align="center"], h3[data-align="center"], h4[data-align="center"], h5[data-align="center"], h6[data-align="center"], p[data-align="center"], span[data-align="center"] {
h1[data-align="center"], h2[data-align="center"], h3[data-align="center"], h4[data-align="center"], h5[data-align="center"], h6[data-align="center"], p[data-align="center"], span:not([class])[data-align="center"] {
text-align: center;
}

h1[data-align="left"], h2[data-align="left"], h3[data-align="left"], h4[data-align="left"], h5[data-align="left"], h6[data-align="left"], p[data-align="left"], span[data-align="left"] {
h1[data-align="left"], h2[data-align="left"], h3[data-align="left"], h4[data-align="left"], h5[data-align="left"], h6[data-align="left"], p[data-align="left"], span:not([class])[data-align="left"] {
text-align: left;
}

h1[data-align="justify"], h2[data-align="justify"], h3[data-align="justify"], h4[data-align="justify"], h5[data-align="justify"], h6[data-align="justify"], p[data-align="justify"], span[data-align="justify"] {
h1[data-align="justify"], h2[data-align="justify"], h3[data-align="justify"], h4[data-align="justify"], h5[data-align="justify"], h6[data-align="justify"], p[data-align="justify"], span:not([class])[data-align="justify"] {
text-align: justify;
}

h1[data-align="right"], h2[data-align="right"], h3[data-align="right"], h4[data-align="right"], h5[data-align="right"], h6[data-align="right"], p[data-align="right"], span[data-align="right"] {
h1[data-align="right"], h2[data-align="right"], h3[data-align="right"], h4[data-align="right"], h5[data-align="right"], h6[data-align="right"], p[data-align="right"], span:not([class])[data-align="right"] {
text-align: right;
}

kbd {
--size-text: 65%;
border-width: 2px;
padding-left: 0.25rem;
padding-right: 0.25rem;
padding-top: 0.125rem;
padding-bottom: 0.125rem;
border-radius: 0.375rem;
white-space: nowrap;
background-color: rgba(var(--palette-background-bg), 0.3);
border-color: rgba(var(--palette-background-bg), 0.5);
border-style: outset;
font-size: var(--size-text);
}

pre {
--tw-bg-opacity: 1;
background-color: rgba(147, 156, 168, var(--tw-bg-opacity));
Expand Down
2 changes: 1 addition & 1 deletion docs/feedback/wave.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You can change the color palette of the `Wave` via the `palette` property.
import {Stack, Text, Wave} from "@kahi-ui/framework";
</script>

<Stack spacing="medium" orientation="horizontal">
<Stack spacing="medium" orientation="horizontal" variation="wrap">
<div>
<Text>
<Text is="strong">DEFAULT</Text>
Expand Down
15 changes: 5 additions & 10 deletions docs/framework/browser-support.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# Browser Support

TODO: Browser support table with minimum tested versions as-well
| | Chrome | Edge | Firefox | Safari | Internet Explorer |
| --------------------- | --------------- | --------------- | -------------- | ------------------ | ----------------- |
| **Estimated Minimum** | 64+ _July 2020_ | 84+ _July 2020_ | 67+ _May 2019_ | 14.1+ _April 2021_ | **UNSUPPORTED** |
| **Tested Minimum** | 89+ | ? | 87+ | ? | **UNSUPPORTED** |

<!--
- Chrome 84+ — July 2020
- Edge 84+ — July 2020
- Firefox 67+ — May 2019
- Safari 14.1+ — April 2021
- Internet Explorer — **UNSUPPORTED**
-->

## Features
## Features Used

- CSS

Expand Down
131 changes: 130 additions & 1 deletion docs/modifiers/html5.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,132 @@
+++
[[properties."*"]]
name="class"
description="Sets a class name(s) on the Component."
types=["string"]

[[properties."*"]]
name="style"
description="Sets inline CSS properties on the Component."
types=["string"]

[[properties."*"]]
name="id"
description="Sets an identifier that other Components can target or useful for querying DOM by association."
types=["string"]

[[properties."*"]]
name="name"
description="Sets an identifier that will be used in form submissions or targettable by specific Components like <code>Anchor</code>."
types=["string"]

[[properties."*"]]
name="title"
description="Sets text for a tooltip whenever an end-user hovers the Component, and useful for assistive technologies."
types=["string"]

[[properties."*"]]
name="tabindex"
description="Alters how the Browser will cycle through the elements within the Component's current stacking context."
types=["number", "string"]
+++

# HTML5

...
All Components have access to several common HTML5 global attributes.

## class

[`class`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class) allows you to apply CSS classes that you've defined to Components. However, you will have to use `:global` on your class names to bypass Svelte's local scoping.

```html repl HTML5 class
<script>
import {Text} from "@kahi-ui/framework";
</script>

<Text class="my-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>

<style>
:global(.my-text) {
color: red;
}
</style>
```

## style

[`style`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style) allows you to apply inline CSS properties to Components.

```html repl HTML5 style
<script>
import {Text} from "@kahi-ui/framework";
</script>

<Text style="color:red;">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</Text>
```

## id

[`id`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) allows you to set an identifier that other elements can target or targettable for scrolling by a [URL fragment](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash).

<!-- prettier-ignore -->
```html repl HTML5 id
<script>
import {Anchor, Heading, Spacer} from "@kahi-ui/framework";
</script>

<Anchor href="#target-heading">Scroll to Heading!</Anchor>

<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />
<Spacer spacing="huge" />

<Heading id="target-heading">Hello World!</Heading>
```

## name

[`name`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/name) allows you to set an identifier for the Component to set its value to in a form, or, can targettable by an [`Anchor`](../navigation/anchor.md).

```html repl HTML5 name
<script>
import {Anchor} from "@kahi-ui/framework";
</script>

<Anchor target="target-iframe" href="/">Open Landing Page</Anchor>
<iframe name="target-iframe" width="100%" height="256"></iframe>
```

## title

[`title`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title) allows you to set a timed effect to show a text tooltip whenever an end-user hovers for long enough. Typically you don't want to rely on this attribute for the UI. Rather use it for semantic and assistive purposes.

```html repl HTML5 title
<script>
import {Text} from "@kahi-ui/framework";
</script>

<Text title="I am some additional text!">Hover me!</Text>
```

## tabindex

[`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) allows you to configure how the Browser cycles through elements in the current stacking context when they press their tab keyboard button, or similar.

<!-- prettier-ignore -->
```html repl HTML5 tabindex
<script>
import {Button} from "@kahi-ui/framework";
</script>

<Button tabindex="3">Index #3</Button>
<Button tabindex="1">Index #1</Button>
<Button tabindex="-1">Unselectable</Button>
<Button tabindex="4">Index #4</Button>
<Button tabindex="2">Index #2</Button>
```
Loading

0 comments on commit 9411e21

Please sign in to comment.