@lanfermann/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +17 -2
- package/TRADEMARK.md +10 -0
- package/brand/app-icon.svg +1 -0
- package/brand/avatar.svg +1 -0
- package/brand/favicon.svg +1 -0
- package/dist/components/accordion/accordion.d.ts +26 -0
- package/dist/components/accordion/accordion.js +78 -0
- package/dist/components/alert/alert.d.ts +19 -0
- package/dist/components/alert/alert.js +68 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +20 -0
- package/dist/components/alert-dialog/alert-dialog.js +75 -0
- package/dist/components/anchor-heading/anchor-heading.d.ts +19 -0
- package/dist/components/anchor-heading/anchor-heading.js +39 -0
- package/dist/components/avatar/avatar.d.ts +14 -0
- package/dist/components/avatar/avatar.js +42 -0
- package/dist/components/badge/badge.d.ts +12 -0
- package/dist/components/badge/badge.js +27 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +23 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +63 -0
- package/dist/components/button/button-variants.d.ts +15 -0
- package/dist/components/button/button-variants.js +76 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.js +50 -0
- package/dist/components/calendar/calendar-selection.js +216 -0
- package/dist/components/calendar/calendar.d.ts +44 -0
- package/dist/components/calendar/calendar.js +208 -0
- package/dist/components/callout/callout.d.ts +21 -0
- package/dist/components/callout/callout.js +75 -0
- package/dist/components/card/card.d.ts +16 -0
- package/dist/components/card/card.js +53 -0
- package/dist/components/checkbox/checkbox.d.ts +9 -0
- package/dist/components/checkbox/checkbox.js +33 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group/checkbox-group.js +33 -0
- package/dist/components/code/code.d.ts +7 -0
- package/dist/components/code/code.js +16 -0
- package/dist/components/code-block/code-block-frame.js +146 -0
- package/dist/components/code-block/code-block-live.d.ts +45 -0
- package/dist/components/code-block/code-block-live.js +51 -0
- package/dist/components/code-block/code-block.d.ts +36 -0
- package/dist/components/code-block/code-block.js +51 -0
- package/dist/components/code-block/code-copy.d.ts +12 -0
- package/dist/components/code-block/code-copy.js +71 -0
- package/dist/components/code-block/code-lines-view.d.ts +16 -0
- package/dist/components/code-block/code-lines-view.js +48 -0
- package/dist/components/code-block/code-lines.js +17 -0
- package/dist/components/code-block/code-scroll.js +29 -0
- package/dist/components/code-block/code-surface.js +13 -0
- package/dist/components/code-block/code-tabs-frame.js +85 -0
- package/dist/components/code-block/code-tabs-store.js +25 -0
- package/dist/components/code-block/code-tabs.d.ts +28 -0
- package/dist/components/code-block/code-tabs.js +29 -0
- package/dist/components/code-block/highlight.d.ts +34 -0
- package/dist/components/code-block/highlight.js +258 -0
- package/dist/components/code-block/lines.d.ts +5 -0
- package/dist/components/code-block/lines.js +40 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +54 -0
- package/dist/components/combobox/combobox.d.ts +84 -0
- package/dist/components/combobox/combobox.js +169 -0
- package/dist/components/container/container.d.ts +16 -0
- package/dist/components/container/container.js +30 -0
- package/dist/components/copy-pill/copy-pill.d.ts +52 -0
- package/dist/components/copy-pill/copy-pill.js +232 -0
- package/dist/components/cta/cta.d.ts +109 -0
- package/dist/components/cta/cta.js +375 -0
- package/dist/components/date-field/date-field.d.ts +40 -0
- package/dist/components/date-field/date-field.js +99 -0
- package/dist/components/date-range-field/date-range-field.d.ts +41 -0
- package/dist/components/date-range-field/date-range-field.js +155 -0
- package/dist/components/dialog/dialog.d.ts +29 -0
- package/dist/components/dialog/dialog.js +96 -0
- package/dist/components/docs-layout/docs-layout.d.ts +17 -0
- package/dist/components/docs-layout/docs-layout.js +46 -0
- package/dist/components/drawer/drawer.d.ts +39 -0
- package/dist/components/drawer/drawer.js +181 -0
- package/dist/components/field/field.d.ts +18 -0
- package/dist/components/field/field.js +77 -0
- package/dist/components/fieldset/fieldset.d.ts +8 -0
- package/dist/components/fieldset/fieldset.js +25 -0
- package/dist/components/figure/figure.d.ts +14 -0
- package/dist/components/figure/figure.js +35 -0
- package/dist/components/form/form.d.ts +31 -0
- package/dist/components/form/form.js +55 -0
- package/dist/components/ground/ground.d.ts +20 -0
- package/dist/components/ground/ground.js +31 -0
- package/dist/components/heading/heading.d.ts +16 -0
- package/dist/components/heading/heading.js +36 -0
- package/dist/components/icon/icon.d.ts +22 -0
- package/dist/components/icon/icon.js +24 -0
- package/dist/components/input/input.d.ts +19 -0
- package/dist/components/input/input.js +46 -0
- package/dist/components/input-group/input-group.d.ts +34 -0
- package/dist/components/input-group/input-group.js +61 -0
- package/dist/components/kbd/kbd.d.ts +6 -0
- package/dist/components/kbd/kbd.js +15 -0
- package/dist/components/link/link-variants.d.ts +13 -0
- package/dist/components/link/link-variants.js +27 -0
- package/dist/components/link/link.d.ts +9 -0
- package/dist/components/link/link.js +18 -0
- package/dist/components/logo/logo-paths.js +22 -0
- package/dist/components/logo/logomark.d.ts +19 -0
- package/dist/components/logo/logomark.js +49 -0
- package/dist/components/logo/wordmark.d.ts +35 -0
- package/dist/components/logo/wordmark.js +48 -0
- package/dist/components/menu/menu.d.ts +26 -0
- package/dist/components/menu/menu.js +132 -0
- package/dist/components/meter/meter.d.ts +29 -0
- package/dist/components/meter/meter.js +68 -0
- package/dist/components/navigation-menu/navigation-menu-variants.d.ts +12 -0
- package/dist/components/navigation-menu/navigation-menu-variants.js +18 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu/navigation-menu.js +128 -0
- package/dist/components/number-field/number-field.d.ts +32 -0
- package/dist/components/number-field/number-field.js +85 -0
- package/dist/components/page-header/page-header.d.ts +27 -0
- package/dist/components/page-header/page-header.js +48 -0
- package/dist/components/pager/pager.d.ts +24 -0
- package/dist/components/pager/pager.js +51 -0
- package/dist/components/parameter-list/parameter-list.d.ts +34 -0
- package/dist/components/parameter-list/parameter-list.js +70 -0
- package/dist/components/popover/popover.d.ts +15 -0
- package/dist/components/popover/popover.js +64 -0
- package/dist/components/progress/progress.d.ts +19 -0
- package/dist/components/progress/progress.js +67 -0
- package/dist/components/prose/prose.d.ts +13 -0
- package/dist/components/prose/prose.js +22 -0
- package/dist/components/quote/quote.d.ts +21 -0
- package/dist/components/quote/quote.js +46 -0
- package/dist/components/radio/radio.d.ts +12 -0
- package/dist/components/radio/radio.js +37 -0
- package/dist/components/reference-entry/reference-entry.d.ts +25 -0
- package/dist/components/reference-entry/reference-entry.js +66 -0
- package/dist/components/section/section.d.ts +13 -0
- package/dist/components/section/section.js +30 -0
- package/dist/components/segmented-control/segmented-control.d.ts +42 -0
- package/dist/components/segmented-control/segmented-control.js +413 -0
- package/dist/components/select/select.d.ts +70 -0
- package/dist/components/select/select.js +189 -0
- package/dist/components/separator/separator.d.ts +12 -0
- package/dist/components/separator/separator.js +29 -0
- package/dist/components/side-nav/side-nav.d.ts +48 -0
- package/dist/components/side-nav/side-nav.js +89 -0
- package/dist/components/site-footer/site-footer-floor.js +48 -0
- package/dist/components/site-footer/site-footer.d.ts +38 -0
- package/dist/components/site-footer/site-footer.js +96 -0
- package/dist/components/site-header/site-header.d.ts +77 -0
- package/dist/components/site-header/site-header.js +214 -0
- package/dist/components/slider/slider.d.ts +42 -0
- package/dist/components/slider/slider.js +279 -0
- package/dist/components/spinner/spinner.d.ts +15 -0
- package/dist/components/spinner/spinner.js +34 -0
- package/dist/components/switch/switch.d.ts +8 -0
- package/dist/components/switch/switch.js +28 -0
- package/dist/components/table/table.d.ts +83 -0
- package/dist/components/table/table.js +123 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +32 -0
- package/dist/components/table-of-contents/table-of-contents.js +187 -0
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.js +124 -0
- package/dist/components/text/text.d.ts +16 -0
- package/dist/components/text/text.js +63 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +30 -0
- package/dist/components/time-field/time-field.d.ts +40 -0
- package/dist/components/time-field/time-field.js +123 -0
- package/dist/components/toast/toast.d.ts +55 -0
- package/dist/components/toast/toast.js +129 -0
- package/dist/components/tooltip/tooltip.d.ts +16 -0
- package/dist/components/tooltip/tooltip.js +41 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +77 -0
- package/dist/internal/arrow.js +41 -0
- package/dist/internal/disclosure.js +20 -0
- package/dist/internal/field-context.js +21 -0
- package/dist/internal/field.d.ts +23 -0
- package/dist/internal/field.js +49 -0
- package/dist/internal/glyphs.js +84 -0
- package/dist/internal/iso-date.d.ts +2 -0
- package/dist/internal/iso-date.js +268 -0
- package/dist/internal/overlay.js +40 -0
- package/dist/internal/picker-sheet.js +74 -0
- package/dist/internal/popup.js +37 -0
- package/dist/internal/range-shape.js +295 -0
- package/dist/internal/reduced-motion.js +19 -0
- package/dist/internal/scroll-edges.js +45 -0
- package/dist/internal/trough.js +39 -0
- package/dist/internal/typed-input.d.ts +16 -0
- package/dist/internal/typed-input.js +133 -0
- package/dist/lib/cn.d.ts +11 -0
- package/dist/lib/cn.js +98 -0
- package/dist/motion/inertia.js +111 -0
- package/dist/motion/spring-step.js +35 -0
- package/dist/motion/springs.d.ts +78 -0
- package/dist/motion/springs.js +81 -0
- package/package.json +107 -4
- package/src/styles/base.css +93 -0
- package/src/styles/calendar.css +117 -0
- package/src/styles/code.css +252 -0
- package/src/styles/density.css +53 -0
- package/src/styles/depth.css +501 -0
- package/src/styles/grounds.css +191 -0
- package/src/styles/marks.css +50 -0
- package/src/styles/motion.css +55 -0
- package/src/styles/motion.generated.css +101 -0
- package/src/styles/prose.css +252 -0
- package/src/styles/radius.css +20 -0
- package/src/styles/segmented.css +208 -0
- package/src/styles/slider.css +110 -0
- package/src/styles/status.css +108 -0
- package/src/styles/tabs.css +39 -0
- package/src/styles/toast.css +106 -0
- package/src/styles/touch.css +41 -0
- package/src/styles/type.css +54 -0
- package/src/styles.css +38 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
2
|
+
/**
|
|
3
|
+
* One label over several controls: an address, a group of checkboxes, the options of a plan. For
|
|
4
|
+
* a radio or checkbox group inside a `Field`, pass the group as `render`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Fieldset({ className, ...props }: Fieldset$1.Root.Props): import("react").JSX.Element;
|
|
7
|
+
/** Names the group, in sentence case. It reads as the heading of the fields below it. */
|
|
8
|
+
export declare function FieldsetLegend({ className, ...props }: Fieldset$1.Legend.Props): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { mergeClassName } from "../../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fieldset as Fieldset$1 } from "@base-ui/react/fieldset";
|
|
5
|
+
// src/components/fieldset/fieldset.tsx
|
|
6
|
+
/**
|
|
7
|
+
* One label over several controls: an address, a group of checkboxes, the options of a plan. For
|
|
8
|
+
* a radio or checkbox group inside a `Field`, pass the group as `render`.
|
|
9
|
+
*/
|
|
10
|
+
function Fieldset({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Fieldset$1.Root, {
|
|
12
|
+
"data-slot": "fieldset",
|
|
13
|
+
className: mergeClassName("flex min-w-0 flex-col gap-4", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Names the group, in sentence case. It reads as the heading of the fields below it. */
|
|
18
|
+
function FieldsetLegend({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Fieldset$1.Legend, {
|
|
20
|
+
"data-slot": "fieldset-legend",
|
|
21
|
+
className: mergeClassName("text-base font-semibold text-fg data-disabled:text-on-disabled", className),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export { Fieldset, FieldsetLegend };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A picture that belongs to the text: a diagram, a screenshot, a chart, with a caption under it
|
|
4
|
+
* that says what it shows. Put the picture in a `FigureFrame` when it is drawn on its own ground,
|
|
5
|
+
* then a `FigureCaption`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Figure({ className, ...props }: ComponentProps<"figure">): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The sheet a drawing stands on, like a code block's: white, a hairline, no shadow. A drawing
|
|
10
|
+
* wider than the column scrolls sideways inside it, never the page.
|
|
11
|
+
*/
|
|
12
|
+
export declare function FigureFrame({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
13
|
+
/** What the picture shows, as a sentence. */
|
|
14
|
+
export declare function FigureCaption({ className, ...props }: ComponentProps<"figcaption">): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/figure/figure.tsx
|
|
4
|
+
/**
|
|
5
|
+
* A picture that belongs to the text: a diagram, a screenshot, a chart, with a caption under it
|
|
6
|
+
* that says what it shows. Put the picture in a `FigureFrame` when it is drawn on its own ground,
|
|
7
|
+
* then a `FigureCaption`.
|
|
8
|
+
*/
|
|
9
|
+
function Figure({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("figure", {
|
|
11
|
+
"data-slot": "figure",
|
|
12
|
+
className: cn("flex min-w-0 flex-col gap-3", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The sheet a drawing stands on, like a code block's: white, a hairline, no shadow. A drawing
|
|
18
|
+
* wider than the column scrolls sideways inside it, never the page.
|
|
19
|
+
*/
|
|
20
|
+
function FigureFrame({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-slot": "figure-frame",
|
|
23
|
+
className: cn("flex justify-center overflow-x-auto rounded-xl border border-hairline bg-sheet px-5 py-6", className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** What the picture shows, as a sentence. */
|
|
28
|
+
function FigureCaption({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("figcaption", {
|
|
30
|
+
"data-slot": "figure-caption",
|
|
31
|
+
className: cn("text-sm text-pretty text-fg-muted", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { Figure, FigureCaption, FigureFrame };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Form as Form$1 } from "@base-ui/react/form";
|
|
2
|
+
/** `FormValues` types what `onFormSubmit` receives: one key per `Field` `name`. */
|
|
3
|
+
export type FormProps<FormValues extends Record<string, any> = Record<string, any>> = Form$1.Props<FormValues>;
|
|
4
|
+
/**
|
|
5
|
+
* A `<form>` that knows its fields. Give each `Field` a `name`; then:
|
|
6
|
+
*
|
|
7
|
+
* - `onFormSubmit` receives the values as an object (`{ email, plan }`) once every field is
|
|
8
|
+
* valid. The page does not reload.
|
|
9
|
+
* - `errors` takes what the server rejected, keyed by field name (`{ email: "…" }`). Each
|
|
10
|
+
* `FieldError` shows its message, and it is gone as soon as that field is changed.
|
|
11
|
+
* - With a Server Action, pass `action` and the action's errors:
|
|
12
|
+
* `<Form action={formAction} errors={state.errors}>` (`useActionState`).
|
|
13
|
+
*
|
|
14
|
+
* A required field left empty only complains once the form is submitted; nobody is scolded for
|
|
15
|
+
* tabbing through. Then the first invalid field takes the focus. To check a field as soon as it
|
|
16
|
+
* is left, give that `Field` `validationMode="onBlur"`.
|
|
17
|
+
*
|
|
18
|
+
* A field the server may reject gets one `<FieldError />` without `match`: it shows the server's
|
|
19
|
+
* message, or the field's own (from `validate`). Do not put matched errors beside it on the same
|
|
20
|
+
* field, or two lines show at once.
|
|
21
|
+
*
|
|
22
|
+
* A date, time or range field hands over its ISO value (`2026-11-14`), not the text it shows.
|
|
23
|
+
*
|
|
24
|
+
* React resets a form once its `action` has run: an `Input` or `Textarea` goes back to its
|
|
25
|
+
* `defaultValue`, while the fields that hold a value of their own (number, combobox, select,
|
|
26
|
+
* date, time, checkbox, switch) keep it. So control the plain inputs (`value`) whose text must
|
|
27
|
+
* survive a rejected submit; to empty the whole form after a success, give it a new `key`.
|
|
28
|
+
*
|
|
29
|
+
* Fields stand 16px apart. Word an error as what to do ("Bitte geben Sie …").
|
|
30
|
+
*/
|
|
31
|
+
export declare function Form<FormValues extends Record<string, any> = Record<string, any>>({ className, onFormSubmit, ...props }: FormProps<FormValues>): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { mergeClassName } from "../../lib/cn.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Form as Form$1 } from "@base-ui/react/form";
|
|
5
|
+
// src/components/form/form.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A `<form>` that knows its fields. Give each `Field` a `name`; then:
|
|
8
|
+
*
|
|
9
|
+
* - `onFormSubmit` receives the values as an object (`{ email, plan }`) once every field is
|
|
10
|
+
* valid. The page does not reload.
|
|
11
|
+
* - `errors` takes what the server rejected, keyed by field name (`{ email: "…" }`). Each
|
|
12
|
+
* `FieldError` shows its message, and it is gone as soon as that field is changed.
|
|
13
|
+
* - With a Server Action, pass `action` and the action's errors:
|
|
14
|
+
* `<Form action={formAction} errors={state.errors}>` (`useActionState`).
|
|
15
|
+
*
|
|
16
|
+
* A required field left empty only complains once the form is submitted; nobody is scolded for
|
|
17
|
+
* tabbing through. Then the first invalid field takes the focus. To check a field as soon as it
|
|
18
|
+
* is left, give that `Field` `validationMode="onBlur"`.
|
|
19
|
+
*
|
|
20
|
+
* A field the server may reject gets one `<FieldError />` without `match`: it shows the server's
|
|
21
|
+
* message, or the field's own (from `validate`). Do not put matched errors beside it on the same
|
|
22
|
+
* field, or two lines show at once.
|
|
23
|
+
*
|
|
24
|
+
* A date, time or range field hands over its ISO value (`2026-11-14`), not the text it shows.
|
|
25
|
+
*
|
|
26
|
+
* React resets a form once its `action` has run: an `Input` or `Textarea` goes back to its
|
|
27
|
+
* `defaultValue`, while the fields that hold a value of their own (number, combobox, select,
|
|
28
|
+
* date, time, checkbox, switch) keep it. So control the plain inputs (`value`) whose text must
|
|
29
|
+
* survive a rejected submit; to empty the whole form after a success, give it a new `key`.
|
|
30
|
+
*
|
|
31
|
+
* Fields stand 16px apart. Word an error as what to do ("Bitte geben Sie …").
|
|
32
|
+
*/
|
|
33
|
+
function Form({ className, onFormSubmit, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Form$1, {
|
|
35
|
+
"data-slot": "form",
|
|
36
|
+
className: mergeClassName("flex flex-col gap-4", className),
|
|
37
|
+
onFormSubmit: onFormSubmit && ((values, details) => onFormSubmit(submittedValues(values, details.event.target), details)),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Some fields show one thing and submit another: a date reads "14.11.2026" and is "2026-11-14".
|
|
43
|
+
* Such a field keeps its value in a hidden input marked `data-form-value` (see `TypedInput`).
|
|
44
|
+
* Base UI collects what the visible control holds, so the values are set right here: what
|
|
45
|
+
* `onFormSubmit` receives is what a posted form would carry.
|
|
46
|
+
*/
|
|
47
|
+
function submittedValues(values, form) {
|
|
48
|
+
if (!(form instanceof HTMLFormElement)) return values;
|
|
49
|
+
const carried = form.querySelectorAll("input[type=\"hidden\"][data-form-value]");
|
|
50
|
+
if (carried.length === 0) return values;
|
|
51
|
+
const next = { ...values };
|
|
52
|
+
for (const input of carried) if (input.name && !input.disabled) next[input.name] = input.value;
|
|
53
|
+
return next;
|
|
54
|
+
}
|
|
55
|
+
export { Form };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
export type GroundName = "paper" | "tint" | "ink" | "indigo";
|
|
3
|
+
export type GroundProps = ComponentProps<"div"> & {
|
|
4
|
+
/** Who is speaking: Paper is evidence, Tint someone else's words, Ink the claim, Indigo the ask. */
|
|
5
|
+
ground: GroundName;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Switches a region to another ground. A plain `data-theme` attribute does the same for
|
|
9
|
+
* everything rendered inside it, but popups (menus, selects, popovers) are portalled to `<body>`
|
|
10
|
+
* and would fall back to the page's ground. `Ground` also tells them which ground they were
|
|
11
|
+
* opened from.
|
|
12
|
+
*
|
|
13
|
+
* For the page as a whole, set `data-theme` on `<html>` instead: nothing is nested there.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Ground({ ground, ...props }: GroundProps): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* The ground of the nearest `Ground`, or `undefined` on the page's own ground. Popup parts put it
|
|
18
|
+
* on their popup as `data-theme`, so a sheet opened on Ink is an Ink sheet.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useGround(): GroundName | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
// src/components/ground/ground.tsx
|
|
5
|
+
const GroundContext = createContext(void 0);
|
|
6
|
+
/**
|
|
7
|
+
* Switches a region to another ground. A plain `data-theme` attribute does the same for
|
|
8
|
+
* everything rendered inside it, but popups (menus, selects, popovers) are portalled to `<body>`
|
|
9
|
+
* and would fall back to the page's ground. `Ground` also tells them which ground they were
|
|
10
|
+
* opened from.
|
|
11
|
+
*
|
|
12
|
+
* For the page as a whole, set `data-theme` on `<html>` instead: nothing is nested there.
|
|
13
|
+
*/
|
|
14
|
+
function Ground({ ground, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(GroundContext, {
|
|
16
|
+
value: ground,
|
|
17
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
18
|
+
"data-slot": "ground",
|
|
19
|
+
"data-theme": ground,
|
|
20
|
+
...props
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The ground of the nearest `Ground`, or `undefined` on the page's own ground. Popup parts put it
|
|
26
|
+
* on their popup as `data-theme`, so a sheet opened on Ink is an Ink sheet.
|
|
27
|
+
*/
|
|
28
|
+
function useGround() {
|
|
29
|
+
return useContext(GroundContext);
|
|
30
|
+
}
|
|
31
|
+
export { Ground, useGround };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
declare const headingVariants: (props?: ({
|
|
4
|
+
size?: "label" | "section" | "sub" | "title" | "display" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export type HeadingProps = ComponentProps<"h2"> & VariantProps<typeof headingVariants> & {
|
|
7
|
+
/** The outline level, `<h1>` to `<h4>`. It sets the tag; `size` sets the look. */
|
|
8
|
+
level?: 1 | 2 | 3 | 4;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A title on the type scale. Write it as a sentence with a full stop ("Bei Lanfermann
|
|
12
|
+
* anmelden."), in sentence case. Pick `level` for the document outline and `size` for the look:
|
|
13
|
+
* they are independent.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Heading({ level, size, className, ...props }: HeadingProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
// src/components/heading/heading.tsx
|
|
5
|
+
const headingVariants = cva("text-balance text-fg", { variants: { size: {
|
|
6
|
+
/** 54px: one per page at most, on a landing view. */
|
|
7
|
+
display: "text-3xl font-medium",
|
|
8
|
+
/** 36px: the title of a page. */
|
|
9
|
+
title: "text-2xl font-medium",
|
|
10
|
+
/** 24px: a section, usually under a rule. */
|
|
11
|
+
section: "text-xl font-semibold",
|
|
12
|
+
/** 20px: a card, a dialog, a group. */
|
|
13
|
+
sub: "text-lg font-semibold",
|
|
14
|
+
/** 16px: a label-sized heading inside dense content. */
|
|
15
|
+
label: "text-base font-semibold"
|
|
16
|
+
} } });
|
|
17
|
+
const sizeForLevel = {
|
|
18
|
+
1: "title",
|
|
19
|
+
2: "section",
|
|
20
|
+
3: "sub",
|
|
21
|
+
4: "label"
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A title on the type scale. Write it as a sentence with a full stop ("Bei Lanfermann
|
|
25
|
+
* anmelden."), in sentence case. Pick `level` for the document outline and `size` for the look:
|
|
26
|
+
* they are independent.
|
|
27
|
+
*/
|
|
28
|
+
function Heading({ level = 2, size, className, ...props }) {
|
|
29
|
+
const Tag = `h${level}`;
|
|
30
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
31
|
+
"data-slot": "heading",
|
|
32
|
+
className: cn(headingVariants({ size: size ?? sizeForLevel[level] }), className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { Heading };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IconSvgElement } from "@hugeicons/react";
|
|
2
|
+
import { SVGProps } from "react";
|
|
3
|
+
export type IconProps = Omit<SVGProps<SVGSVGElement>, "ref" | "stroke" | "strokeWidth"> & {
|
|
4
|
+
/** An icon from `@hugeicons/core-free-icons`, e.g. `Search01Icon`. */
|
|
5
|
+
icon: IconSvgElement;
|
|
6
|
+
/** Edge length in px. 14 in small controls, 16 in default ones, 18 in large ones. */
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Stroke in real pixels, independent of `size`. 1.5 holds its own beside Sofia Sans at weight
|
|
10
|
+
* 500; change it only for icons set larger than 24px.
|
|
11
|
+
*/
|
|
12
|
+
stroke?: number;
|
|
13
|
+
/** An accessible name. Without it the icon is decorative and hidden from assistive tech. */
|
|
14
|
+
label?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The one way icons enter the system. It pins what makes the set look like ours: a stroke that
|
|
18
|
+
* stays 1.5px at every size, `currentColor`, and no layout shift (the icon never shrinks in a
|
|
19
|
+
* flex row). Icons take the text colour of their context and are never Indigo on their own.
|
|
20
|
+
*/
|
|
21
|
+
export declare function Icon({ icon, size, stroke, label, className, ...props }: IconProps): import("react").JSX.Element;
|
|
22
|
+
export type { IconSvgElement };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { HugeiconsIcon } from "@hugeicons/react";
|
|
4
|
+
// src/components/icon/icon.tsx
|
|
5
|
+
/**
|
|
6
|
+
* The one way icons enter the system. It pins what makes the set look like ours: a stroke that
|
|
7
|
+
* stays 1.5px at every size, `currentColor`, and no layout shift (the icon never shrinks in a
|
|
8
|
+
* flex row). Icons take the text colour of their context and are never Indigo on their own.
|
|
9
|
+
*/
|
|
10
|
+
function Icon({ icon, size = 16, stroke = 1.5, label, className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(HugeiconsIcon, {
|
|
12
|
+
"data-slot": "icon",
|
|
13
|
+
icon,
|
|
14
|
+
size,
|
|
15
|
+
strokeWidth: stroke * 24 / size,
|
|
16
|
+
color: "currentColor",
|
|
17
|
+
role: label ? "img" : void 0,
|
|
18
|
+
"aria-label": label,
|
|
19
|
+
"aria-hidden": label ? void 0 : true,
|
|
20
|
+
className: cn("shrink-0", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export { Icon };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
3
|
+
/**
|
|
4
|
+
* A socket for typed values: a white field with a hairline edge. Focus turns the edge Indigo and
|
|
5
|
+
* opens a soft halo (part of the depth recipe, so there is no outline). Text follows the density
|
|
6
|
+
* but is always 16px on touch devices, so iOS never zooms on focus. Inside a `Field` it picks up
|
|
7
|
+
* the label, description and validity.
|
|
8
|
+
*/
|
|
9
|
+
declare const inputVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
export type InputProps = Omit<Input$1.Props, "size"> & VariantProps<typeof inputVariants>;
|
|
13
|
+
/**
|
|
14
|
+
* A placeholder is an example in italics ("z. B. Schreinerei Huber"), never a label.
|
|
15
|
+
*
|
|
16
|
+
* Inside an `InputGroup` the group wears the field and sets the size; the input goes bare.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Input({ className, size, ...props }: InputProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { bareControl, fieldFace, fieldText } from "../../internal/field.js";
|
|
3
|
+
import { FieldShellContext } from "../../internal/field-context.js";
|
|
4
|
+
import { mergeClassName } from "../../lib/cn.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { useContext } from "react";
|
|
8
|
+
import { Input as Input$1 } from "@base-ui/react/input";
|
|
9
|
+
// src/components/input/input.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A socket for typed values: a white field with a hairline edge. Focus turns the edge Indigo and
|
|
12
|
+
* opens a soft halo (part of the depth recipe, so there is no outline). Text follows the density
|
|
13
|
+
* but is always 16px on touch devices, so iOS never zooms on focus. Inside a `Field` it picks up
|
|
14
|
+
* the label, description and validity.
|
|
15
|
+
*/
|
|
16
|
+
const inputVariants = cva([
|
|
17
|
+
"w-full min-w-0",
|
|
18
|
+
fieldFace,
|
|
19
|
+
fieldText,
|
|
20
|
+
"focus:depth-field-focus focus:outline-hidden",
|
|
21
|
+
"data-invalid:depth-field-invalid data-invalid:focus:depth-field-invalid",
|
|
22
|
+
"data-disabled:bg-disabled data-disabled:depth-flat data-disabled:text-on-disabled"
|
|
23
|
+
], {
|
|
24
|
+
variants: { size: {
|
|
25
|
+
sm: "h-(--control-sm) rounded-sm px-(--field-pad-sm)",
|
|
26
|
+
md: "h-(--control-md) rounded-md px-(--field-pad-md)",
|
|
27
|
+
lg: "h-(--control-lg) rounded-lg px-(--field-pad-lg)"
|
|
28
|
+
} },
|
|
29
|
+
defaultVariants: { size: "md" }
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* A placeholder is an example in italics ("z. B. Schreinerei Huber"), never a label.
|
|
33
|
+
*
|
|
34
|
+
* Inside an `InputGroup` the group wears the field and sets the size; the input goes bare.
|
|
35
|
+
*/
|
|
36
|
+
function Input({ className, size, ...props }) {
|
|
37
|
+
const bare = useContext(FieldShellContext);
|
|
38
|
+
return /* @__PURE__ */ jsx(Input$1, {
|
|
39
|
+
"data-slot": "input",
|
|
40
|
+
"data-size": bare ? void 0 : size ?? "md",
|
|
41
|
+
"data-field-control": bare ? "" : void 0,
|
|
42
|
+
className: mergeClassName(bare ? bareControl : inputVariants({ size }), className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export { Input };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ButtonProps } from "../button/button.js";
|
|
2
|
+
import { FieldSize } from "../../internal/field.js";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
export type InputGroupProps = ComponentProps<"div"> & {
|
|
5
|
+
/** The size of the whole field; the `Input` inside follows it. */
|
|
6
|
+
size?: FieldSize;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A field with something standing beside the text: an icon in front of a search, a unit behind an
|
|
10
|
+
* amount, a button that reveals a password. The group wears the field (edge, halo, invalid and
|
|
11
|
+
* disabled look) and the `Input` inside it goes bare, so the two read as one socket.
|
|
12
|
+
*
|
|
13
|
+
* Put an `InputGroupAddon` or an `InputGroupButton` before or after the `Input`; their place in
|
|
14
|
+
* the markup is their place in the field. Label the `Input` as usual, with a `FieldLabel` or an
|
|
15
|
+
* `aria-label`: an adornment is not a label. If a unit matters for understanding the value, say
|
|
16
|
+
* it in the label too ("Betrag in Euro").
|
|
17
|
+
*/
|
|
18
|
+
export declare function InputGroup({ className, size, onMouseDown, children, ...props }: InputGroupProps): import("react").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Something to read beside the value: an `Icon`, or a short text such as a unit ("€", "Std.") or
|
|
21
|
+
* a fixed prefix ("https://"). Muted, so the typed value stays the loudest thing in the field.
|
|
22
|
+
* It keeps 8px to the value, which reads as a space; a prefix that runs on into the value closes
|
|
23
|
+
* that with `className="-mr-1.5"`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function InputGroupAddon({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
26
|
+
export type InputGroupButtonProps = Omit<Extract<ButtonProps, {
|
|
27
|
+
iconOnly: true;
|
|
28
|
+
}>, "iconOnly" | "variant" | "size">;
|
|
29
|
+
/**
|
|
30
|
+
* A quiet icon button inside the field: reveal a password, clear the text, open a picker. It sits
|
|
31
|
+
* 3px inside the edge and takes the concentric corner (the field's radius minus that inset). It
|
|
32
|
+
* has no visible label, so it needs an `aria-label`; a toggle also takes `aria-pressed`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function InputGroupButton({ className, ...props }: InputGroupButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import { fieldShell, fieldShellSize, focusFieldControl } from "../../internal/field.js";
|
|
4
|
+
import { FieldShellContext } from "../../internal/field-context.js";
|
|
5
|
+
import { cn, mergeClassName } from "../../lib/cn.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/components/input-group/input-group.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A field with something standing beside the text: an icon in front of a search, a unit behind an
|
|
10
|
+
* amount, a button that reveals a password. The group wears the field (edge, halo, invalid and
|
|
11
|
+
* disabled look) and the `Input` inside it goes bare, so the two read as one socket.
|
|
12
|
+
*
|
|
13
|
+
* Put an `InputGroupAddon` or an `InputGroupButton` before or after the `Input`; their place in
|
|
14
|
+
* the markup is their place in the field. Label the `Input` as usual, with a `FieldLabel` or an
|
|
15
|
+
* `aria-label`: an adornment is not a label. If a unit matters for understanding the value, say
|
|
16
|
+
* it in the label too ("Betrag in Euro").
|
|
17
|
+
*/
|
|
18
|
+
function InputGroup({ className, size = "md", onMouseDown, children, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(FieldShellContext, {
|
|
20
|
+
value: true,
|
|
21
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-slot": "input-group",
|
|
23
|
+
"data-size": size,
|
|
24
|
+
className: cn(fieldShell, fieldShellSize[size], className),
|
|
25
|
+
onMouseDown: (event) => {
|
|
26
|
+
onMouseDown?.(event);
|
|
27
|
+
if (!event.defaultPrevented) focusFieldControl(event);
|
|
28
|
+
},
|
|
29
|
+
...props,
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Something to read beside the value: an `Icon`, or a short text such as a unit ("€", "Std.") or
|
|
36
|
+
* a fixed prefix ("https://"). Muted, so the typed value stays the loudest thing in the field.
|
|
37
|
+
* It keeps 8px to the value, which reads as a space; a prefix that runs on into the value closes
|
|
38
|
+
* that with `className="-mr-1.5"`.
|
|
39
|
+
*/
|
|
40
|
+
function InputGroupAddon({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx("span", {
|
|
42
|
+
"data-slot": "input-group-addon",
|
|
43
|
+
className: cn("flex shrink-0 items-center gap-1.5 whitespace-nowrap text-fg-muted select-none first:pl-(--field-pad) last:pr-(--field-pad)", "group-has-[[data-field-control][data-disabled]]/field:text-on-disabled", className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A quiet icon button inside the field: reveal a password, clear the text, open a picker. It sits
|
|
49
|
+
* 3px inside the edge and takes the concentric corner (the field's radius minus that inset). It
|
|
50
|
+
* has no visible label, so it needs an `aria-label`; a toggle also takes `aria-pressed`.
|
|
51
|
+
*/
|
|
52
|
+
function InputGroupButton({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
54
|
+
iconOnly: true,
|
|
55
|
+
variant: "quiet",
|
|
56
|
+
className: mergeClassName(["size-[calc(var(--field-height)-6px)] rounded-[calc(var(--field-radius)-3px)] text-fg-muted first:ml-[3px] last:mr-[3px] hover:text-fg", "focus-visible:outline-offset-0"], className),
|
|
57
|
+
...props,
|
|
58
|
+
"data-slot": "input-group-button"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export { InputGroup, InputGroupAddon, InputGroupButton };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A key on the keyboard, as a small keycap: `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. One key per element; set
|
|
4
|
+
* keys of a shortcut next to each other without a plus sign.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Kbd({ className, ...props }: ComponentProps<"kbd">): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/kbd/kbd.tsx
|
|
4
|
+
/**
|
|
5
|
+
* A key on the keyboard, as a small keycap: `<Kbd>⌘</Kbd><Kbd>K</Kbd>`. One key per element; set
|
|
6
|
+
* keys of a shortcut next to each other without a plus sign.
|
|
7
|
+
*/
|
|
8
|
+
function Kbd({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
10
|
+
"data-slot": "kbd",
|
|
11
|
+
className: cn("inline-flex h-5 min-w-5 items-center justify-center rounded-xs bg-raised depth-plug px-1 font-sans text-xs font-medium text-fg-muted", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export { Kbd };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
/**
|
|
3
|
+
* The look of a text link as class names. It lives outside the component so a router's own link
|
|
4
|
+
* can wear it without being wrapped:
|
|
5
|
+
*
|
|
6
|
+
* <NextLink href="/angebote" className={linkVariants()}>Alle Angebote</NextLink>
|
|
7
|
+
*
|
|
8
|
+
* A link is underlined as well as coloured: colour alone never says "this is a link".
|
|
9
|
+
*/
|
|
10
|
+
export declare const linkVariants: (props?: ({
|
|
11
|
+
variant?: "quiet" | "accent" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
13
|
+
export type LinkVariants = VariantProps<typeof linkVariants>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/link/link-variants.ts
|
|
3
|
+
/**
|
|
4
|
+
* The look of a text link as class names. It lives outside the component so a router's own link
|
|
5
|
+
* can wear it without being wrapped:
|
|
6
|
+
*
|
|
7
|
+
* <NextLink href="/angebote" className={linkVariants()}>Alle Angebote</NextLink>
|
|
8
|
+
*
|
|
9
|
+
* A link is underlined as well as coloured: colour alone never says "this is a link".
|
|
10
|
+
*/
|
|
11
|
+
const linkVariants = cva([
|
|
12
|
+
"rounded-xs underline decoration-1 underline-offset-[0.25em]",
|
|
13
|
+
"transition-colors spring-snap",
|
|
14
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
|
|
15
|
+
], {
|
|
16
|
+
variants: { variant: {
|
|
17
|
+
/** Indigo: the link in running text, in a form, at the end of a card. */
|
|
18
|
+
accent: "font-medium text-accent hover:text-accent-hover active:text-accent-pressed",
|
|
19
|
+
/**
|
|
20
|
+
* The colour and weight of the text around it, for a link inside muted text (a helper
|
|
21
|
+
* line, a legal line) where Indigo would shout. It darkens to the text colour on hover.
|
|
22
|
+
*/
|
|
23
|
+
quiet: "text-inherit hover:text-fg"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { variant: "accent" }
|
|
26
|
+
});
|
|
27
|
+
export { linkVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LinkVariants } from "./link-variants.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
export type LinkProps = ComponentProps<"a"> & LinkVariants;
|
|
4
|
+
/**
|
|
5
|
+
* A text link: a plain `<a>`, Indigo and underlined. Word it as where it leads ("Alle Angebote
|
|
6
|
+
* ansehen"), never "hier" or "mehr". For a link that should look like a button, style an `<a>`
|
|
7
|
+
* with `buttonVariants()`; for a router's link component, use `linkVariants()`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Link({ className, variant, ...props }: LinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { linkVariants } from "./link-variants.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/link/link.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A text link: a plain `<a>`, Indigo and underlined. Word it as where it leads ("Alle Angebote
|
|
7
|
+
* ansehen"), never "hier" or "mehr". For a link that should look like a button, style an `<a>`
|
|
8
|
+
* with `buttonVariants()`; for a router's link component, use `linkVariants()`.
|
|
9
|
+
*/
|
|
10
|
+
function Link({ className, variant, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("a", {
|
|
12
|
+
"data-slot": "link",
|
|
13
|
+
"data-variant": variant ?? "accent",
|
|
14
|
+
className: cn(linkVariants({ variant }), className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { Link };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/components/logo/logo-paths.ts
|
|
2
|
+
/**
|
|
3
|
+
* The outlines of the wordmark, copied byte for byte from the brand kit ("Lanfermann Freelance",
|
|
4
|
+
* assets group Logos: `wordmark-ink.svg` and `wordmark-short-ink.svg`). The kit writes them with
|
|
5
|
+
* `scripts/build-logo.mjs`; no font is involved. Do not edit them by hand: a test compares their
|
|
6
|
+
* checksums. To change the logo, change it in the kit and copy the new files' paths here.
|
|
7
|
+
*
|
|
8
|
+
* Units are those of the kit: the baseline is y = 0, the capital L is 660 high, the em is 1000.
|
|
9
|
+
*/
|
|
10
|
+
/** `Lanfermann.dev`: the letters, without the dot. */
|
|
11
|
+
const WORDMARK_LETTERS = "M0,-10v-650h118v548zM129.57,-102h224.43v102h-342.43zM718,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM577.69,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM952,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM1523.16,0v-396.88h-73.16v-99.12l77.54,0c19.59,-93.66 102.64,-164 202.12,-164c18.75,0 37.4,2.55 55.46,7.59v97.94c-15.72,-12.64 -35.29,-19.53 -55.46,-19.53c-45.32,0 -82.69,34.07 -87.88,78h117.38v99.12h-118l0,396.88zM2257.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM2157.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM2377.12,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c16.84,0 33.62,1.97 50,5.87v107.84c-15.13,-8.98 -32.4,-13.71 -50,-13.71c-36.12,0 -70.99,13.25 -98,37.24v368.76zM2687.12,0v-496h118v10.85c28.02,-13.55 59.07,-20.85 91,-20.85c58.85,0 112.02,24.32 150,63.46c39.14,-40.35 93.18,-63.46 150,-63.46c115.43,0 209,93.57 209,209v297h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42zM3817.12,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM3676.81,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM4051.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM4599.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM5704.12,0l0,-14.29c-30.52,15.76 -64.74,24.29 -100,24.29c-120.4,0 -218,-97.6 -218,-218v-80c0,-120.4 97.6,-218 218,-218c35.26,0 69.48,8.53 100,24.29v-178.29h118v660zM5604.12,-406c-55.23,0 -100,44.77 -100,100v116c0,55.23 44.77,100 100,100c36.86,0 72.44,-13.52 100,-38l0,-240c-27.56,-24.48 -63.14,-38 -100,-38zM6346.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM6246.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM6416.12,-496h129.8l99,288.19l99,-288.19h129.8l-170.39,496h-116.82z";
|
|
12
|
+
/** `Lanfermann.dev`: the dot, in the accent of its ground. */
|
|
13
|
+
const WORDMARK_DOT = "M5125.12,-78.5c0,-48.88 39.62,-88.5 88.5,-88.5c48.88,0 88.5,39.62 88.5,88.5c0,48.88 -39.62,88.5 -88.5,88.5c-48.88,0 -88.5,-39.62 -88.5,-88.5z";
|
|
14
|
+
/** The advance width of `Lanfermann.dev`. */
|
|
15
|
+
const WORDMARK_WIDTH = 6873.72;
|
|
16
|
+
/** `Lanfermann.`: the letters of the short form. */
|
|
17
|
+
const WORDMARK_SHORT_LETTERS = "M0,-10v-650h118v548zM129.57,-102h224.43v102h-342.43zM718,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM577.69,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM952,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM1523.16,0v-396.88h-73.16v-99.12l77.54,0c19.59,-93.66 102.64,-164 202.12,-164c18.75,0 37.4,2.55 55.46,7.59v97.94c-15.72,-12.64 -35.29,-19.53 -55.46,-19.53c-45.32,0 -82.69,34.07 -87.88,78h117.38v99.12h-118l0,396.88zM2257.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM2157.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM2377.12,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c16.84,0 33.62,1.97 50,5.87v107.84c-15.13,-8.98 -32.4,-13.71 -50,-13.71c-36.12,0 -70.99,13.25 -98,37.24v368.76zM2687.12,0v-496h118v10.85c28.02,-13.55 59.07,-20.85 91,-20.85c58.85,0 112.02,24.32 150,63.46c39.14,-40.35 93.18,-63.46 150,-63.46c115.43,0 209,93.57 209,209v297h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42zM3817.12,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM3676.81,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM4051.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM4599.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76z";
|
|
18
|
+
/** `Lanfermann.`: its full stop, the same dot. */
|
|
19
|
+
const WORDMARK_SHORT_DOT = "M5125.12,-78.5c0,-48.88 39.62,-88.5 88.5,-88.5c48.88,0 88.5,39.62 88.5,88.5c0,48.88 -39.62,88.5 -88.5,88.5c-48.88,0 -88.5,-39.62 -88.5,-88.5z";
|
|
20
|
+
/** The advance width of `Lanfermann.`. */
|
|
21
|
+
const WORDMARK_SHORT_WIDTH = 5302.12;
|
|
22
|
+
export { WORDMARK_DOT, WORDMARK_LETTERS, WORDMARK_SHORT_DOT, WORDMARK_SHORT_LETTERS, WORDMARK_SHORT_WIDTH, WORDMARK_WIDTH };
|