Skip to content

Commit

Permalink
chore: update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
jer3m01 committed May 30, 2024
1 parent 8e472fd commit 93f70a5
Show file tree
Hide file tree
Showing 44 changed files with 10,140 additions and 4,780 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"import/newline-after-import": "warn",
"import/no-duplicates": "error",
"import/no-named-as-default-member": "off",
"import/no-unresolved": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"@typescript-eslint/ban-ts-comment": "off",
Expand All @@ -22,6 +23,7 @@
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"start": "solid-start start"
},
"dependencies": {
"@kobalte/core": "0.9.6",
"@kobalte/core": "0.13.2",
"@kobalte/pigment": "0.0.0",
"@modular-forms/solid": "0.13.2",
"@solid-primitives/media": "2.1.6",
Expand Down
12 changes: 11 additions & 1 deletion apps/docs/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{
"name": "",
"short_name": "",
"icons": [
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
4 changes: 2 additions & 2 deletions apps/docs/src/components/color-scheme-selector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ToggleButton as KToggleButton } from "@kobalte/core";
import { ToggleButton as KToggleButton } from "@kobalte/core/toggle-button";
import { IconButton, useColorScheme } from "@kobalte/pigment";
import { createSignal, onMount, Show } from "solid-js";

Expand All @@ -16,7 +16,7 @@ export function ColorSchemeSelector() {
return (
<Show when={isMounted()} fallback={<div class="h-9 w-9" />}>
<IconButton
as={KToggleButton.Root}
as={KToggleButton}
variant="text"
size="sm"
aria-label="Toggle color scheme"
Expand Down
46 changes: 24 additions & 22 deletions apps/docs/src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { As, Badge, LinkButton, LinkIconButton } from "@kobalte/pigment";
import { Badge, LinkButton, LinkIconButton } from "@kobalte/pigment";
import { Link, useMatch } from "@solidjs/router";
import { JSX, ParentProps } from "solid-js";

Expand All @@ -17,18 +17,18 @@ interface HeaderLink extends ParentProps {

function HeaderLink(props: HeaderLink) {
return (
<LinkButton variant="text" size="sm" asChild>
<As
component={Link}
href={props.href}
class={
props.isActive
? "text-slate-900 dark:text-slate-50"
: "font-normal text-slate-700 dark:text-slate-200"
}
>
{props.children}
</As>
<LinkButton
variant="text"
size="sm"
as={Link}
href={props.href}
class={
props.isActive
? "text-slate-900 dark:text-slate-50"
: "font-normal text-slate-700 dark:text-slate-200"
}
>
{props.children}
</LinkButton>
);
}
Expand Down Expand Up @@ -61,15 +61,17 @@ export function Header(props: HeaderProps) {
Changelog
</HeaderLink>
</div>
<LinkIconButton variant="text" size="sm" class="me-2.5" aria-label="GitHub" asChild>
<As
component={Link}
href="https://github.com/kobaltedev/pigment"
target="_blank"
rel="noopener noreferrer"
>
<TablerGitHubIcon class="h-5 w-5" />
</As>
<LinkIconButton
variant="text"
size="sm"
class="me-2.5"
aria-label="GitHub"
as={Link}
href="https://github.com/kobaltedev/pigment"
target="_blank"
rel="noopener noreferrer"
>
<TablerGitHubIcon class="h-5 w-5" />
</LinkIconButton>
<ColorSchemeSelector />
</div>
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/src/components/tabs-snippets.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs } from "@kobalte/core";
import { Tabs, TabsTriggerProps } from "@kobalte/core/tabs";
import { clsx } from "clsx";
import { ComponentProps, ParentComponent, splitProps } from "solid-js";

Expand All @@ -8,12 +8,12 @@ type TabsSnippetsComposite = {
Content: typeof Tabs.Content;
};

export const TabsSnippets: ParentComponent<ComponentProps<typeof Tabs.Root>> &
export const TabsSnippets: ParentComponent<ComponentProps<typeof Tabs>> &
TabsSnippetsComposite = props => {
const [local, others] = splitProps(props, ["class"]);

return (
<Tabs.Root
<Tabs
class={clsx(
"pg-tabs-snippets not-prose my-6 overflow-y-auto rounded-lg border border-solid border-slate-200 bg-slate-50 dark:bg-slate-950 dark:border-slate-800",
local.class
Expand Down Expand Up @@ -46,7 +46,7 @@ TabsSnippets.Trigger = (props: ComponentProps<typeof Tabs.Trigger>) => {
"outline-none text-sm px-3 py-2 text-slate-700 ui-selected:font-medium focus-visible:bg-slate-200 dark:text-white/80 dark:focus-visible:bg-slate-800",
local.class
)}
{...others}
{...(others as TabsTriggerProps)}
/>
);
};
Expand Down
8 changes: 3 additions & 5 deletions apps/docs/src/examples/button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, As, Button, IconButton, LinkButton, LinkIconButton } from "@kobalte/pigment";
import { Alert, Button, IconButton, LinkButton, LinkIconButton } from "@kobalte/pigment";
import { Link } from "@solidjs/router";
import { For } from "solid-js";

Expand Down Expand Up @@ -245,10 +245,8 @@ export function WithLinkButton() {

export function WithLinkButtonAsChild() {
return (
<LinkButton asChild>
<As component={Link} href="/" target="_blank">
Back to home
</As>
<LinkButton as={Link} href="/" target="_blank">
Back to home
</LinkButton>
);
}
126 changes: 62 additions & 64 deletions apps/docs/src/examples/modular-forms.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { As } from "@kobalte/core";
import { Anchor, Button, Checkbox, Surface, TextField } from "@kobalte/pigment";
import { createForm, required, email, setValue, SubmitHandler } from "@modular-forms/solid";

Expand All @@ -21,70 +20,69 @@ export function ModularFormsExample() {
variant="raised"
border="all"
class="flex flex-col w-full max-w-sm p-6 rounded-lg"
asChild
as={Form}
onSubmit={handleSubmit}
>
<As component={Form} onSubmit={handleSubmit}>
<h2 class="text-2xl text-content font-bold mb-0.5">Welcome to Pigment</h2>
<p class="text-base text-content-subtle">Sign up to continue</p>
<div class="flex flex-col gap-6 my-6">
<Field name="email" validate={[email("Please enter a valid email address")]}>
{(field, props) => (
<TextField
ref={props.ref}
name={props.name}
value={field.value}
onChange={value => setValue(signupForm, "email", value)}
inputProps={{
onInput: props.onInput,
onChange: props.onChange,
onBlur: props.onBlur,
}}
invalid={!!field.error}
label="Email"
placeholder="[email protected]"
errorMessage={field.error}
/>
)}
</Field>
<Field
name="newsletter"
type="boolean"
validate={[required("You must accept our terms and conditions")]}
>
{(field, props) => (
<Checkbox
ref={props.ref}
name={props.name}
checked={field.value}
onChange={checked => setValue(signupForm, "newsletter", checked)}
inputProps={{
onInput: props.onInput,
onChange: props.onChange,
onBlur: props.onBlur,
}}
invalid={!!field.error}
label={
<>
I agree to the <span class="font-medium">terms and conditions</span>
</>
}
description={
<span>
Read our{" "}
<Anchor href="/" external>
terms and conditions
</Anchor>
</span>
}
errorMessage={field.error}
/>
)}
</Field>
</div>
<Button type="submit" variant="solid">
Sign up
</Button>
</As>
<h2 class="text-2xl text-content font-bold mb-0.5">Welcome to Pigment</h2>
<p class="text-base text-content-subtle">Sign up to continue</p>
<div class="flex flex-col gap-6 my-6">
<Field name="email" validate={[email("Please enter a valid email address")]}>
{(field, props) => (
<TextField
ref={props.ref}
name={props.name}
value={field.value}
onChange={value => setValue(signupForm, "email", value)}
inputProps={{
onInput: props.onInput,
onChange: props.onChange,
onBlur: props.onBlur,
}}
invalid={!!field.error}
label="Email"
placeholder="[email protected]"
errorMessage={field.error}
/>
)}
</Field>
<Field
name="newsletter"
type="boolean"
validate={[required("You must accept our terms and conditions")]}
>
{(field, props) => (
<Checkbox
ref={props.ref}
name={props.name}
checked={field.value}
onChange={checked => setValue(signupForm, "newsletter", checked)}
inputProps={{
onInput: props.onInput,
onChange: props.onChange,
onBlur: props.onBlur,
}}
invalid={!!field.error}
label={
<>
I agree to the <span class="font-medium">terms and conditions</span>
</>
}
description={
<span>
Read our{" "}
<Anchor href="/" external>
terms and conditions
</Anchor>
</span>
}
errorMessage={field.error}
/>
)}
</Field>
</div>
<Button type="submit" variant="solid">
Sign up
</Button>
</Surface>
);
}
8 changes: 4 additions & 4 deletions apps/docs/src/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
border: 1px solid theme("colors.slate.200");
}

[data-pg-color-scheme='dark'] .pg-preview {
[data-pg-color-scheme="dark"] .pg-preview {
background-image: url("/img/grid_dot_dark.svg");
border: 1px solid theme("colors.slate.700");
}
Expand Down Expand Up @@ -138,7 +138,7 @@ pre.shiki {
padding: 12px;

font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
"Courier New", monospace;
}

[data-pg-color-scheme="dark"] pre.shiki {
Expand Down Expand Up @@ -256,7 +256,7 @@ pre code a {
pre data-err {
/* Extracted from VS Code */
background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
repeat-x bottom left;
repeat-x bottom left;
padding-bottom: 3px;
}
pre .query {
Expand Down Expand Up @@ -328,7 +328,7 @@ pre .inline-completions ul.dropdown {
background-color: gainsboro;
color: grey;
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
"Courier New", monospace;
font-size: 0.8rem;
margin: 0;
padding: 0;
Expand Down
8 changes: 3 additions & 5 deletions apps/docs/src/routes/docs/core/components/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,15 @@ Use the `LinkButton` or `LinkIconButton` if you need the style of a button with
</LinkIconButton>
```

If you want to use the `Link` component from the [@solidjs/router](https://github.com/solidjs/solid-router) package, use the `asChild` prop paired with the `As` component to change the rendered element.
If you want to use the `Link` component from the [@solidjs/router](https://github.com/solidjs/solid-router) package, use the `as` prop to change the rendered element.

<Preview>
<WithLinkButtonAsChild />
</Preview>

```tsx
<LinkButton asChild>
<As component={Link} href="/" target="_blank">
Back to home
</As>
<LinkButton as={Link} href="/" target="_blank">
Back to homeQ
</LinkButton>
```

Expand Down
Loading

0 comments on commit 93f70a5

Please sign in to comment.