Skip to content

Commit

Permalink
feat(Themes): themes now available
Browse files Browse the repository at this point in the history
feat: disabled prop and styling for all form inputs
  • Loading branch information
N00nDay committed Mar 14, 2023
1 parent 72bfc5d commit c77e8ec
Show file tree
Hide file tree
Showing 231 changed files with 2,050 additions and 1,303 deletions.
71 changes: 61 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@
"type": "module",
"types": "index.d.ts",
"dependencies": {
"color": "^4.2.3",
"dayjs": "^1.11.7",
"nanoid": "^4.0.1",
"randomcolor": "^0.6.2",
"tailwind-merge": "^1.10.0",
"tippy.js": "^6.3.7"
},
Expand Down
3 changes: 1 addition & 2 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ body {
@apply w-full;
@apply flex;
@apply flex-col;
@apply bg-light-surface;
@apply dark:bg-dark-surface;
@apply bg-background;
@apply overflow-hidden;
overscroll-behavior: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/docs/components/code-block/CodeBlock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
}
const defaultClass = 'overflow-hidden w-full shadow bg-[#141517] text-sm text-white rounded-md';
const defaultClass = 'overflow-hidden w-full shadow bg-black text-sm text-white rounded-md';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
5 changes: 1 addition & 4 deletions src/docs/components/inline-code/InlineCode.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
<code
class="bg-light-icon-background dark:bg-dark-icon-background text-light-icon dark:text-dark-icon text-sm rounded-md px-2 py-1"
><slot /></code
>
<code class="bg-default text-default-content text-sm rounded-md px-2 py-1"><slot /></code>
2 changes: 1 addition & 1 deletion src/docs/components/kbd/Kbd.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { twMerge } from 'tailwind-merge';
const defaultClass =
'mx-1 bg-light-background dark:bg-dark-background rounded-md px-1.5 py-[0.0625] border border-light-border-base dark:border-dark-border shadow-sm';
'mx-1 bg-background rounded-md px-1.5 py-[0.0625] border border-border shadow-sm';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
90 changes: 24 additions & 66 deletions src/docs/components/navigation/Navigation.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { Badge, Menu, Divider } from '../../../lib';
import { page } from '$app/stores';
import { onMount } from 'svelte/internal';
interface Item {
title: string;
Expand Down Expand Up @@ -182,7 +181,7 @@
},
{
title: 'Table',
href: '/table?orderBy=created_at&order=asc&page=1'
href: '/table'
},
{
title: 'Tabs',
Expand All @@ -206,66 +205,40 @@
export let handleClose: (() => void) | undefined = undefined;
let active = '';
$: active =
$page.url.pathname.substring(0, $page.url.pathname.indexOf('?')) || $page.url.pathname;
function handleClick(item: string) {
active = item;
$: console.log('active', active);
function handleClick() {
if (handleClose) {
handleClose();
}
}
const menuTitleClass = 'text-xs font-bold text-primary py-2 px-3 h-10';
onMount(() => {
active = $page.url.pathname;
});
</script>

<h3 class={menuTitleClass}>GET STARTED</h3>
<Menu {active}>
<Menu.Item
key="/installation"
label="Installation"
href="/installation"
on:click={() => handleClick('/installation')}
/>
<Menu.Item
key="/typography"
label="Typography"
href="/typography"
on:click={() => handleClick('/typography')}
/>
<Menu.Item key="/installation" label="Installation" href="/installation" on:click={handleClick} />
<Menu.Item key="/typography" label="Typography" href="/typography" on:click={handleClick} />
<Menu.Item key="/themes" label="Themes" href="/themes" on:click={handleClick} />
</Menu>
<Divider />
<h3 class={menuTitleClass}>COMPONENTS</h3>
<Menu {active}>
{#each sidebarItems as item}
{#if item.beta}
<Menu.Item
key={item.href}
label={item.title}
href={item.href}
on:click={() => handleClick(item.href)}
>
<Menu.Item key={item.href} label={item.title} href={item.href} on:click={handleClick}>
<Badge slot="extra" type="error">BETA</Badge>
</Menu.Item>
{:else if item.updated}
<Menu.Item
key={item.href}
label={item.title}
href={item.href}
on:click={() => handleClick(item.href)}
>
<Menu.Item key={item.href} label={item.title} href={item.href} on:click={handleClick}>
<Badge slot="extra" type="success">UPDATED</Badge>
</Menu.Item>
{:else}
<Menu.Item
key={item.href}
label={item.title}
href={item.href}
on:click={() => handleClick(item.href)}
/>
<Menu.Item key={item.href} label={item.title} href={item.href} on:click={handleClick} />
{/if}
{/each}
</Menu>
Expand All @@ -276,20 +249,10 @@
key="/click-outside"
label="clickOutside"
href="/click-outside"
on:click={() => handleClick('/click-outside')}
/>
<Menu.Item
key="/clipboard"
label="clipboard"
href="/clipboard"
on:click={() => handleClick('/clipboard')}
/>
<Menu.Item
key="/tooltip"
label="tooltip"
href="/tooltip"
on:click={() => handleClick('/tooltip')}
on:click={handleClick}
/>
<Menu.Item key="/clipboard" label="clipboard" href="/clipboard" on:click={handleClick} />
<Menu.Item key="/tooltip" label="tooltip" href="/tooltip" on:click={handleClick} />
</Menu>
<Divider />
<h3 class={menuTitleClass}>UTILITIES</h3>
Expand All @@ -298,53 +261,48 @@
key="/compute-progress"
label="computeProgress"
href="/compute-progress"
on:click={() => handleClick('/compute-progress')}
on:click={handleClick}
/>
<Menu.Item
key="/compute-trend-percent"
label="computeTrendPercent"
href="/compute-trend-percent"
on:click={() => handleClick('/compute-trend-percent')}
on:click={handleClick}
/>
<Menu.Item
key="/compute-trend-value"
label="computeTrendValue"
href="/compute-trend-value"
on:click={() => handleClick('/compute-trend-value')}
on:click={handleClick}
/>
<Menu.Item
key="/copy-to-clipboard"
label="copyToClipboard"
href="/copy-to-clipboard"
on:click={() => handleClick('/copy-to-clipboard')}
on:click={handleClick}
/>
<Menu.Item
key="/encode-search-params"
label="encodeSearchParams"
href="/encode-search-params"
on:click={() => handleClick('/encode-search-params')}
/>
<Menu.Item
key="/format-date"
label="formatDate"
href="/format-date"
on:click={() => handleClick('/format-date')}
on:click={handleClick}
/>
<Menu.Item key="/format-date" label="formatDate" href="/format-date" on:click={handleClick} />
<Menu.Item
key="/format-file-size"
label="formatFileSize"
href="/format-file-size"
on:click={() => handleClick('/format-file-size')}
on:click={handleClick}
/>
<Menu.Item
key="/format-number"
label="formatNumber"
href="/format-number"
on:click={() => handleClick('/format-number')}
on:click={handleClick}
/>
</Menu>
<Divider />
<h3 class={menuTitleClass}>TYPES</h3>
<Menu {active}>
<Menu.Item key="/types" label="Types" href="/types" on:click={() => handleClick('/types')} />
<Menu.Item key="/types" label="Types" href="/types" on:click={handleClick} />
</Menu>
7 changes: 2 additions & 5 deletions src/docs/components/props-table/PropsTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,15 @@
];
</script>

<h1 class="mb-4 mt-8 text-xl font-semibold text-light-content dark:text-dark-content">
<h1 class="mb-4 mt-8 text-xl font-semibold text-content">
{component} Props
</h1>
<Card bordered={false}>
<Table class="rounded-md overflow-hidden h-full" {columns}>
<Table.Header slot="header" sortable={false} />
<Table.Body slot="body">
{#each props as prop}
<Table.Body.Row
id={prop.id}
class="cursor-default hover:bg-light-surface dark:hover:bg-dark-surface"
>
<Table.Body.Row id={prop.id} class="cursor-default hover:bg-surface">
<Table.Body.Row.Cell column={0}>{prop.prop}</Table.Body.Row.Cell>
<Table.Body.Row.Cell column={1}>{@html prop.type}</Table.Body.Row.Cell>
<Table.Body.Row.Cell column={2}>{prop.default}</Table.Body.Row.Cell>
Expand Down
Loading

1 comment on commit c77e8ec

@vercel
Copy link

@vercel vercel bot commented on c77e8ec Mar 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

stwui – ./

stwui-n00nday.vercel.app
stwui.vercel.app
stwui-git-main-n00nday.vercel.app

Please sign in to comment.