diff --git a/bun.lock b/bun.lock index 74629a85..c1b5ba78 100644 --- a/bun.lock +++ b/bun.lock @@ -27,7 +27,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-svelte": "^3.20.0", "globals": "^17.7.0", - "lapikit": "^0.0.0-insiders.a776fc5", + "lapikit": "^0.0.0-insiders.bd3f1f3", "mdsvex": "^0.12.7", "prettier": "^3.9.3", "prettier-plugin-svelte": "^3.5.2", @@ -529,7 +529,7 @@ "known-css-properties": ["known-css-properties@0.37.0", "", {}, "sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ=="], - "lapikit": ["lapikit@0.0.0-insiders.a776fc5", "", { "peerDependencies": { "svelte": "^5.0.0" }, "bin": { "lapikit": "bin/index.js" } }, "sha512-RsjJ5SqB3DaBBlkJPPUZTFehFy4DKTkPR/eGaya7ilciUytdwlSmj4g5/T8RTp9jl259dxqbn12/wvOHp7WKFw=="], + "lapikit": ["lapikit@0.0.0-insiders.bd3f1f3", "", { "peerDependencies": { "svelte": "^5.0.0" }, "bin": { "lapikit": "bin/index.js" } }, "sha512-eGmZvlcC002R1i+k5z3pLAu7Q1TkDePQENDWCpFbLoc1P9XeU8CevMXCsRVPCs7/aoKMxzfirWZWp5nJsl6RLg=="], "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], diff --git a/package.json b/package.json index 888e6e2b..6e8769c2 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "eslint-config-prettier": "^10.1.8", "eslint-plugin-svelte": "^3.20.0", "globals": "^17.7.0", - "lapikit": "^0.0.0-insiders.a776fc5", + "lapikit": "^0.0.0-insiders.bd3f1f3", "mdsvex": "^0.12.7", "prettier": "^3.9.3", "prettier-plugin-svelte": "^3.5.2", diff --git a/src/app.html b/src/app.html index ff310ec1..8d483635 100644 --- a/src/app.html +++ b/src/app.html @@ -3,14 +3,14 @@
- + --> %sveltekit.head% diff --git a/src/content/docs/components/accordion.md b/src/content/docs/components/accordion.md index a6dda995..4cc11800 100644 --- a/src/content/docs/components/accordion.md +++ b/src/content/docs/components/accordion.md @@ -112,31 +112,42 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, import the c **`kit:accordion`** -| props | type | description | default | -| ---------- | ------------------------------------------- | ------------------------------------------------- | ------- | -| spacer | `boolean` | Adds a gap between items. | `false` | -| hideIcon | `boolean` | Hides the indicator icon on all child items. | `false` | -| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Border radius applied to all items. | | -| text | `string` | Applies a text color CSS variable. | | -| color | `string` | Foreground color override (`--kit-accordion-fg`). | | -| background | `string` | Background color override (`--kit-accordion-bg`). | | -| children | `Snippet` | Accordion items to render. | | +| props | type | description | default | +| ------------- | ----------------------------------------------------- | ------------------------------------------------------ | ----------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| is | `div` | Defines the HTML tag used as the root element. | `'div'` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on accordion | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on accordion | | +| spacer | `boolean` | Adds a gap between items. | | +| hideIcon | `boolean` | Hides the indicator icon on all child items. | | +| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | Border radius applied to all items. | `'md'` | +| text | `string` | Applies a text color CSS variable. | | +| density | `'none' \| 'compact' \| 'default' \| 'comfortable'` | Spacing inside accordion. | `'default'` | +| size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Sizing height, font and gap for accordion items. | `'md'` | +| variant | `'filled' \| 'outline' \| 'text'` | Visual style of the accordion items. | `'filled'` | +| color | `string` | Foreground color override (`--kit-accordion-item-fg`). | | +| background | `string` | Background color override (`--kit-accordion-item-bg`). | | +| children | `Snippet` | Accordion items to render. | | **`kit:accordion-item`** -| props | type | description | default | -| ---------- | ------------------------------------------- | ---------------------------------------------------------------- | ------- | -| index | `string \| number` | Unique identifier for this item. **Required.** | | -| open | `boolean` | Whether the item is expanded. | `false` | -| toggle | `(index: string \| number) => void` | Called when the trigger is clicked. Receives the item's `index`. | | -| text | `string` | Label displayed in the trigger button. | | -| activator | `Snippet` | Custom trigger content - replaces `text`. | | -| indicator | `Snippet<[{ open: boolean }]>` | Custom indicator - replaces the default chevron icon. | | -| disabled | `boolean` | Prevents the item from being toggled. | `false` | -| readOnly | `boolean` | Renders the item as non-interactive without disabled styling. | `false` | -| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Per-item border radius override. | | -| color | `string` | Foreground color override (`--kit-accordion-item-fg`). | | -| background | `string` | Background color override (`--kit-accordion-item-bg`). | | -| children | `Snippet` | Content revealed when the item is open. | | +| props | type | description | default | +| ------------- | ---------------------------------------------------------- | ---------------------------------------------------------------- | ------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| is | `div` | Defines the HTML tag used as the root element. | `'div'` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on accordion item | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on accordion item | | +| index | `string \| number` | Unique identifier for this item. **Required.** | | +| open | `boolean` | Whether the item is expanded. | `false` | +| toggle | `(index: string \| number) => void` | Called when the trigger is clicked. Receives the item's `index`. | | +| text | `string` | Label displayed in the trigger button. | | +| activator | `Snippet` | Custom trigger content - replaces `text`. | | +| indicator | `Snippet<[{ open: boolean }]>` | Custom indicator - replaces the default chevron icon. | | +| disabled | `boolean` | Prevents the item from being toggled. | `false` | +| readOnly | `boolean` | Renders the item as non-interactive without disabled styling. | `false` | +| color | `string` | Foreground color override (`--kit-accordion-item-fg`). | | +| background | `string` | Background color override (`--kit-accordion-item-bg`). | | +| children | `Snippet` | Content revealed when the item is open. | | +| elevation | `'0' \| '1' \| '2' \| '3' \| '4' \| '5' \| ElevationState` | Add shadow effect | | For the state hook API, see the dedicated [`useAccordion`](/docs/hooks/use-accordion) page and for complete your `kit:accordion` interface, consider the [Icon](/docs/components/icon) and [Chip](/docs/components/chip) components for dynamic content. diff --git a/src/content/docs/components/alert.md b/src/content/docs/components/alert.md index 597305ac..e255c9de 100644 --- a/src/content/docs/components/alert.md +++ b/src/content/docs/components/alert.md @@ -114,20 +114,26 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, import the c **`kit:alert`** -| props | type | description | default | -| ---------- | ---------------------------------------------------------- | ------------------------------------------------ | ----------- | -| is | `'div' \| 'section' \| 'aside' \| 'article'` | HTML element to render. | `'div'` | -| open | `boolean` | Controls visibility. Bindable. | `true` | -| closable | `boolean` | Adds a close button that sets `open` to `false`. | `false` | -| variant | `'filled' \| 'outline' \| 'text'` | Visual style of the alert. | `'filled'` | -| density | `'compact' \| 'default' \| 'comfortable'` | Spacing inside the alert. | `'default'` | -| tone | `'default' \| 'info' \| 'success' \| 'warning' \| 'error'` | Semantic color tone. | `'default'` | -| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Border radius. | `'md'` | -| color | `string` | Foreground color override (`--kit-alert-fg`). | | -| background | `string` | Background color override (`--kit-alert-bg`). | | -| prepend | `Snippet` | Content rendered before the main text. | | -| append | `Snippet` | Content rendered after the main text. | | -| close | `Snippet` | Custom content inside the close button. | | -| children | `Snippet` | Main alert content. | | +| props | type | description | default | +| -------------- | ---------------------------------------------------------- | ------------------------------------------------ | ----------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| is | `'div' \| 'section' \| 'aside' \| 'article'` | HTML element to render. | `'div'` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on alert. | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on alert. | | +| open $bindable | `boolean` | Controls visibility. Bindable. | `true` | +| closable | `boolean` | Adds a close button that sets `open` to `false`. | `false` | +| variant | `'filled' \| 'outline' \| 'text'` | Visual style of the alert. | `'filled'` | +| density | `'none' \| 'compact' \| 'default' \| 'comfortable'` | Spacing inside the alert. | `'default'` | +| tone | `'default' \| 'info' \| 'success' \| 'warning' \| 'error'` | Semantic color tone. | `'default'` | +| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | Border radius. | `'md'` | +| color | `string` | Foreground color override (`--kit-alert-fg`). | | +| background | `string` | Background color override (`--kit-alert-bg`). | | +| size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Sizing height, font and gap for alert. | `'md'` | +| prepend | `Snippet` | Content rendered before the main text. | | +| append | `Snippet` | Content rendered after the main text. | | +| close | `Snippet` | Custom content inside the close button. | | +| children | `Snippet` | Main alert content. | | +| multiline | `boolean` | Define alert message on one or more line. | | +| elevation | `'0' \| '1' \| '2' \| '3' \| '4' \| '5' \| ElevationState` | Add shadow effect. | | To enhance your `kit:alert`, think of [Icon](/docs/components/icon) for legibility, or [Button](/docs/components/button) for integrated actions. diff --git a/src/content/docs/components/appbar.md b/src/content/docs/components/appbar.md index 9ca95caf..2ea70660 100644 --- a/src/content/docs/components/appbar.md +++ b/src/content/docs/components/appbar.md @@ -64,15 +64,20 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, import the c **`kit:appbar`** -| props | type | description | default | -| ------------ | ----------------------------------------------------- | ----------------------------------------------- | ----------- | -| is | `'div' \| 'header' \| 'nav'` | HTML element to render. | `'header'` | -| variant | `'filled' \| 'outline' \| 'text'` | Visual style of the appbar. | `'filled'` | -| density | `'compact' \| 'default' \| 'comfortable'` | Height and horizontal padding. | `'default'` | -| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| string` | Border radius. Accepts a custom `px` value. | `0` | -| color | `string` | Foreground color override (`--kit-appbar-fg`). | | -| background | `string` | Background color override (`--kit-appbar-bg`). | | -| classContent | `string \| string[]` | Class(es) applied to the inner content wrapper. | | -| children | `Snippet` | Appbar content. | | +| props | type | description | default | +| ------------- | ---------------------------------------------------------- | ----------------------------------------------- | ----------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| is | `'div' \| 'header' \| 'nav'` | HTML element to render. | `'header'` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on appbar. | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on appbar. | | +| variant | `'filled' \| 'outline' \| 'text'` | Visual style of the appbar. | `'filled'` | +| density | `'none' \| 'compact' \| 'default' \| 'comfortable'` | Height and horizontal padding. | `'default'` | +| rounded | `0 \| 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | Border radius. | `0` | +| color | `string` | Foreground color override (`--kit-appbar-fg`). | | +| background | `string` | Background color override (`--kit-appbar-bg`). | | +| classContent | `string \| string[]` | Class(es) applied to the inner content wrapper. | | +| children | `Snippet` | Appbar content. | | +| elevation | `'0' \| '1' \| '2' \| '3' \| '4' \| '5' \| ElevationState` | Add shadow effect. | | +| size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Sizing height, font and gap for appbar. | `'md'` | An effective `kit:appbar` goes well with [Dropdown](/docs/components/dropdown) for menus and [Avatars](/docs/components/avatar) for identification. diff --git a/src/content/docs/components/application.md b/src/content/docs/components/application.md index db3546c9..745597a6 100644 --- a/src/content/docs/components/application.md +++ b/src/content/docs/components/application.md @@ -45,8 +45,11 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, you can impo **Root** -| props | type | description | default | -| -------- | ------------------------ | ------------------------------------------- | ----------- | -| children | `Snippet` \| `undefined` | Child content to be displayed in `kit:app`. | `undefined` | +| props | type | description | default | +| ------------- | --------------------------------- | ----------------------------------------------- | ----------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on app. | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on app. | | +| children | `Snippet` \| `undefined` | Child content to be displayed in `kit:app`. | `undefined` | Then you can explore basic components like [Button](/docs/components/button), [Card](/docs/components/card) or [Dialog](/docs/components/dialog) to enrich your `kit:app`. diff --git a/src/content/docs/components/aspect-ratio.md b/src/content/docs/components/aspect-ratio.md index 51c87672..707dd1ed 100644 --- a/src/content/docs/components/aspect-ratio.md +++ b/src/content/docs/components/aspect-ratio.md @@ -67,13 +67,16 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, import the c **`kit:aspect-ratio`** -| props | type | description | default | -| ----------- | ------------------------------------------------------- | ---------------------------------------------------- | --------- | -| is | `'div' \| 'span' \| 'figure' \| 'section' \| 'article'` | HTML element to render. | `'div'` | -| ratio | `string \| number` | Aspect ratio. Accepts `"w/h"`, `"w:h"`, or a number. | `16/9` | -| aspectRatio | `string \| number` | Alias for `ratio`. | `16/9` | -| fit | `'cover' \| 'contain' \| 'fill'` | `object-fit` applied to child media elements. | `'cover'` | -| inline | `boolean` | Renders as `inline-block` with `width: auto`. | `false` | -| children | `Snippet` | Content to constrain. | | +| props | type | description | default | +| ------------- | ------------------------------------------------------- | ---------------------------------------------------- | --------- | +| ref $bindable | `HTMLElement` | Bindable reference to the rendered DOM element. | `null` | +| is | `'div' \| 'span' \| 'figure' \| 'section' \| 'article'` | HTML element to render. | `'div'` | +| s-class | `'string' \| 'array' \| 'object'` | Sets className on aspect-ratio. | | +| s-style | `'string' \| 'array' \| 'object'` | Sets styles on aspect-ratio. | | +| ratio | `string \| number` | Aspect ratio. Accepts `"w/h"`, `"w:h"`, or a number. | `16/9` | +| aspectRatio | `string \| number` | Alias for `ratio`. | `16/9` | +| fit | `'cover' \| 'contain' \| 'fill'` | `object-fit` applied to child media elements. | `'cover'` | +| inline | `boolean` | Renders as `inline-block` with `width: auto`. | `false` | +| children | `Snippet` | Content to constrain. | | Use `kit:aspect-ratio` on [Icon](/docs/components/icon) to visually structure your media components in a [Card](/docs/components/card). diff --git a/src/content/docs/components/avatar.md b/src/content/docs/components/avatar.md index 67ff9d22..961fad04 100644 --- a/src/content/docs/components/avatar.md +++ b/src/content/docs/components/avatar.md @@ -76,11 +76,18 @@ If you aren't using the Lapikit preprocessor in `svelte.config.js`, import the c **`kit:avatar`** -| props | type | description | default | -| -------- | ----------------------------------------- | ------------------------------------------------------- | ----------- | -| label | `string` | Text displayed inside the avatar (uppercased). | | -| size | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Diameter and font size. Label mode only. | `'md'` | -| density | `'compact' \| 'default' \| 'comfortable'` | Size multiplier applied on top of `size`. Label only. | `'default'` | -| children | `Snippet` | Content when `label` is not set (typically an `Start exploring Lapikit
Design system, themes, components, all in one lib
-