diff --git a/CHANGELOG.md b/CHANGELOG.md index b74860aa6..ec6495a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` @@ -17,6 +26,10 @@ - Fixed not resetting the `List` margins. + - `Menu` + + - Fixed `Menu.Divider` not rendering non-text dividers properly. + - Overlays - `Overlay` @@ -25,6 +38,10 @@ - Surfaces + - `Box` + + - Adjusted default color shade to match `Hero`. + - `Card` / `Tile` - Added low transparency border for legibility. @@ -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 ``. + ## v0.2.5 - UNRELEASED - Added new Components diff --git a/dist/kahi-ui.framework.css b/dist/kahi-ui.framework.css index 33a509731..0d34b1d6d 100644 --- a/dist/kahi-ui.framework.css +++ b/dist/kahi-ui.framework.css @@ -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); } @@ -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; @@ -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)); diff --git a/docs/feedback/wave.md b/docs/feedback/wave.md index 6d45e1ff3..c0b583bc2 100644 --- a/docs/feedback/wave.md +++ b/docs/feedback/wave.md @@ -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"; - +
DEFAULT diff --git a/docs/framework/browser-support.md b/docs/framework/browser-support.md index f86985ae6..e1acbe946 100644 --- a/docs/framework/browser-support.md +++ b/docs/framework/browser-support.md @@ -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** | - - -## Features +## Features Used - CSS diff --git a/docs/modifiers/html5.md b/docs/modifiers/html5.md index be16a10f8..8656cbf7b 100644 --- a/docs/modifiers/html5.md +++ b/docs/modifiers/html5.md @@ -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 Anchor." +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 + + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + + +``` + +## 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 + + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. +``` + +## 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). + + +```html repl HTML5 id + + +Scroll to Heading! + + + + + + + + + + + +Hello World! +``` + +## 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 + + +Open Landing Page + +``` + +## 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 + + +Hover me! +``` + +## 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. + + +```html repl HTML5 tabindex + + + + + + + +``` diff --git a/docs/navigation/menu.md b/docs/navigation/menu.md index ec0bceb96..c8a7b7123 100644 --- a/docs/navigation/menu.md +++ b/docs/navigation/menu.md @@ -1,3 +1,199 @@ ++++ +[[properties."Menu.Container"]] +name="orientation" +description="Renders the Menu.Container horizontally." +types=["horizontal", "{VIEWPORT}:horizontal"] + +[[properties."Menu.Anchor"]] +name="active" +description="Renders the Menu.Anchor with aria-pressed attribute, and styles the Menu.Anchor as if it where being clicked." +types=["boolean"] + +[[properties."Menu.Anchor"]] +name="disabled" +description="Renders the Menu.Anchor with aria-disabled attributes, and styles the Menu.Anchor partially transparent." +types=["boolean"] + +[[properties."Menu.Anchor"]] +name="href" +description="Renders the Menu.Anchor as a <a role=\"button\"> and links to the specified href property." +types=["string"] + +[[properties."Menu.Anchor"]] +name="download" +description="If linking to a downloadable file, this property will be used as the suggested file name." +types=["string"] + +[[properties."Menu.Anchor"]] +name="rel" +description="Sets how the Menu.Anchor relates to the current page, see MDN for more information." +types=["string"] + +[[properties."Menu.Anchor"]] +name="target" +description="Sets the target of the Menu.Anchor being navigated, see MDN for more information." +types=["string"] + +[[properties."Menu.Button"]] +name="active" +description="Renders the Menu.Button with aria-pressed attribute, and styles the Menu.Button as if it where being clicked." +types=["boolean"] + +[[properties."Menu.Button"]] +name="disabled" +description="Renders the Menu.Button with disabled attributes, and styles the Menu.Button partially transparent." +types=["boolean"] ++++ + # Menu -... +`Menu` renders a nestable list of actionable buttons and links. Typically used in context menus or used as the main content body of [`Aside`](./aside.md). + + +```html repl Menu Preview + + + + + Copy + + CTRL+C + + + + Cut + + CTRL+X + + + + + + Delete + + DEL + + +``` + +## Imports + +```html default Menu Imports + +``` + +## Orientation + +> **NOTE**: By passing an array, you can set [responsive values](../framework/responsivity.md). e.g. `orientation={["tablet:horizontal", "mobile:horizontal"]}` + +> **IMPORTANT**: You should never use sub menus whenever using horizontal `Menu.Container` Components. + +You can alter the orientation of how the `Menu.Container` lays out the children. + + +```html repl Menu Orientation + + + + + Documentation + + + + Github + + + + Releases + + +``` + +## Sub Menus + +You can nest more menus via `` Component and using `` in `` or `` Components. + + +```html repl Menu Sub Menu + + + + + + FEEDBACK + + + + Dot + + ICON + + + + Spinner + + ICON + + + + + + + OVERLAYS + + + + Overlay + + ICON + + + + + + +``` + +## Text Divider + +In place of `` you can also use `` with text content. + + +```html repl Menu Text Divider + + + + + + FEEDBACK + + + + Dot + + ICON + + + + Spinner + + ICON + + + + + + +``` diff --git a/docs/typography/heading.md b/docs/typography/heading.md index 8aa9356f6..4d3a71278 100644 --- a/docs/typography/heading.md +++ b/docs/typography/heading.md @@ -9,6 +9,11 @@ name="is" description="Changes the HTML tag used for rendering the text, and the text size." types=["h1", "h2", "h3", "h4", "h5", "h6"] +[[properties.Text]] +name="palette" +description="Alters the displayed color scheme." +types=["accent", "dark", "light", "alert", "affirmative", "negative"] + [[properties.Heading]] name="transform" description="Alters how the text casing is rendered." diff --git a/docs/typography/text.md b/docs/typography/text.md index ac725536f..917de7bed 100644 --- a/docs/typography/text.md +++ b/docs/typography/text.md @@ -10,6 +10,11 @@ description="Changes the HTML tag used for rendering the text, altering its appe default="p" types=["abbr", "b", "del", "em", "i", "ins", "kbd", "mark", "p", "pre", "s", "samp", "small", "span", "strong", "sub", "sup", "u"] +[[properties.Text]] +name="palette" +description="Alters the displayed color scheme." +types=["accent", "dark", "light", "alert", "affirmative", "negative"] + [[properties.Text]] name="size" description="Changes how big the text will be rendered." diff --git a/packages/@kahi-ui-docs-kit/src/shared/components/shell/ShellAside.svelte b/packages/@kahi-ui-docs-kit/src/shared/components/shell/ShellAside.svelte index 52afad778..562307dfa 100644 --- a/packages/@kahi-ui-docs-kit/src/shared/components/shell/ShellAside.svelte +++ b/packages/@kahi-ui-docs-kit/src/shared/components/shell/ShellAside.svelte @@ -5,7 +5,7 @@ import {browser} from "$app/env"; import {page} from "$app/stores"; - import {Anchor, Aside, ContextButton, Scrollable, Stack} from "@kahi-ui/framework"; + import {Anchor, Aside, ContextButton, Stack} from "@kahi-ui/framework"; import {onMount} from "svelte"; import {Menu} from "svelte-feather/components/Menu"; import {X} from "svelte-feather/components/X"; @@ -82,11 +82,11 @@ {/if} - +