asheeui 1.0.0 → 1.1.0
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/README.md +61 -166
- package/dist/components/alert/Alert.d.ts.map +1 -1
- package/dist/components/alert/Alert.js +6 -6
- package/dist/components/auth-layout/AuthLayout.d.ts +79 -0
- package/dist/components/auth-layout/AuthLayout.d.ts.map +1 -0
- package/dist/components/auth-layout/AuthLayout.js +54 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts +41 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-config.js +18 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts +25 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-styles.js +11 -0
- package/dist/components/auth-layout/index.d.ts +3 -0
- package/dist/components/auth-layout/index.d.ts.map +1 -0
- package/dist/components/auth-layout/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +7 -7
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +3 -3
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +6 -6
- package/dist/components/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/calendar/Calendar.js +4 -4
- package/dist/components/calendar/DateGrid.d.ts.map +1 -1
- package/dist/components/calendar/DateGrid.js +87 -87
- package/dist/components/clipboard/Clipboard.d.ts +75 -0
- package/dist/components/clipboard/Clipboard.d.ts.map +1 -0
- package/dist/components/clipboard/Clipboard.js +53 -0
- package/dist/components/clipboard/CopyButton.d.ts +64 -0
- package/dist/components/clipboard/CopyButton.d.ts.map +1 -0
- package/dist/components/clipboard/CopyButton.js +44 -0
- package/dist/components/clipboard/clipboard-config.d.ts +42 -0
- package/dist/components/clipboard/clipboard-config.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-config.js +23 -0
- package/dist/components/clipboard/clipboard-styles.d.ts +11 -0
- package/dist/components/clipboard/clipboard-styles.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-styles.js +5 -0
- package/dist/components/clipboard/index.d.ts +4 -0
- package/dist/components/clipboard/index.d.ts.map +1 -0
- package/dist/components/clipboard/index.js +4 -0
- package/dist/components/container/Container.d.ts +51 -0
- package/dist/components/container/Container.d.ts.map +1 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/container/container-config.d.ts +61 -0
- package/dist/components/container/container-config.d.ts.map +1 -0
- package/dist/components/container/container-config.js +16 -0
- package/dist/components/container/container-styles.d.ts +18 -0
- package/dist/components/container/container-styles.d.ts.map +1 -0
- package/dist/components/container/container-styles.js +12 -0
- package/dist/components/container/index.d.ts +3 -0
- package/dist/components/container/index.d.ts.map +1 -0
- package/dist/components/container/index.js +3 -0
- package/dist/components/cta/CTA.d.ts +81 -0
- package/dist/components/cta/CTA.d.ts.map +1 -0
- package/dist/components/cta/CTA.js +60 -0
- package/dist/components/cta/cta-config.d.ts +69 -0
- package/dist/components/cta/cta-config.d.ts.map +1 -0
- package/dist/components/cta/cta-config.js +22 -0
- package/dist/components/cta/cta-styles.d.ts +8 -0
- package/dist/components/cta/cta-styles.d.ts.map +1 -0
- package/dist/components/cta/cta-styles.js +9 -0
- package/dist/components/cta/index.d.ts +3 -0
- package/dist/components/cta/index.d.ts.map +1 -0
- package/dist/components/cta/index.js +3 -0
- package/dist/components/dropmenu/Dropmenu.d.ts.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +77 -0
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -0
- package/dist/components/empty-state/EmptyState.js +46 -0
- package/dist/components/empty-state/empty-state-config.d.ts +44 -0
- package/dist/components/empty-state/empty-state-config.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-config.js +16 -0
- package/dist/components/empty-state/empty-state-styles.d.ts +13 -0
- package/dist/components/empty-state/empty-state-styles.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-styles.js +18 -0
- package/dist/components/empty-state/index.d.ts +3 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +3 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts +107 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts.map +1 -0
- package/dist/components/feature-grid/FeatureGrid.js +94 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts +80 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-config.js +28 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts +11 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-styles.js +5 -0
- package/dist/components/feature-grid/index.d.ts +3 -0
- package/dist/components/feature-grid/index.d.ts.map +1 -0
- package/dist/components/feature-grid/index.js +3 -0
- package/dist/components/footer/Footer.d.ts +73 -0
- package/dist/components/footer/Footer.d.ts.map +1 -0
- package/dist/components/footer/Footer.js +112 -0
- package/dist/components/footer/footer-config.d.ts +40 -0
- package/dist/components/footer/footer-config.d.ts.map +1 -0
- package/dist/components/footer/footer-config.js +18 -0
- package/dist/components/footer/footer-styles.d.ts +22 -0
- package/dist/components/footer/footer-styles.d.ts.map +1 -0
- package/dist/components/footer/footer-styles.js +9 -0
- package/dist/components/footer/index.d.ts +3 -0
- package/dist/components/footer/index.d.ts.map +1 -0
- package/dist/components/footer/index.js +3 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/grid/Grid.d.ts +71 -0
- package/dist/components/grid/Grid.d.ts.map +1 -0
- package/dist/components/grid/Grid.js +23 -0
- package/dist/components/grid/grid-config.d.ts +63 -0
- package/dist/components/grid/grid-config.d.ts.map +1 -0
- package/dist/components/grid/grid-config.js +16 -0
- package/dist/components/grid/grid-styles.d.ts +12 -0
- package/dist/components/grid/grid-styles.d.ts.map +1 -0
- package/dist/components/grid/grid-styles.js +31 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/index.d.ts.map +1 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/hero/Hero.d.ts +90 -0
- package/dist/components/hero/Hero.d.ts.map +1 -0
- package/dist/components/hero/Hero.js +63 -0
- package/dist/components/hero/hero-config.d.ts +71 -0
- package/dist/components/hero/hero-config.d.ts.map +1 -0
- package/dist/components/hero/hero-config.js +22 -0
- package/dist/components/hero/hero-styles.d.ts +19 -0
- package/dist/components/hero/hero-styles.d.ts.map +1 -0
- package/dist/components/hero/hero-styles.js +5 -0
- package/dist/components/hero/index.d.ts +3 -0
- package/dist/components/hero/index.d.ts.map +1 -0
- package/dist/components/hero/index.js +3 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.d.ts +87 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -0
- package/dist/components/navbar/Navbar.js +117 -0
- package/dist/components/navbar/index.d.ts +3 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.js +3 -0
- package/dist/components/navbar/navbar-config.d.ts +52 -0
- package/dist/components/navbar/navbar-config.d.ts.map +1 -0
- package/dist/components/navbar/navbar-config.js +20 -0
- package/dist/components/navbar/navbar-styles.d.ts +28 -0
- package/dist/components/navbar/navbar-styles.d.ts.map +1 -0
- package/dist/components/navbar/navbar-styles.js +9 -0
- package/dist/components/page/Page.d.ts +166 -0
- package/dist/components/page/Page.d.ts.map +1 -0
- package/dist/components/page/Page.js +90 -0
- package/dist/components/page/index.d.ts +3 -0
- package/dist/components/page/index.d.ts.map +1 -0
- package/dist/components/page/index.js +3 -0
- package/dist/components/page/page-config.d.ts +57 -0
- package/dist/components/page/page-config.d.ts.map +1 -0
- package/dist/components/page/page-config.js +20 -0
- package/dist/components/page/page-styles.d.ts +25 -0
- package/dist/components/page/page-styles.d.ts.map +1 -0
- package/dist/components/page/page-styles.js +5 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +8 -8
- package/dist/components/pin-input/PinInput.d.ts +109 -0
- package/dist/components/pin-input/PinInput.d.ts.map +1 -0
- package/dist/components/pin-input/PinInput.js +124 -0
- package/dist/components/pin-input/index.d.ts +3 -0
- package/dist/components/pin-input/index.d.ts.map +1 -0
- package/dist/components/pin-input/index.js +3 -0
- package/dist/components/pin-input/pin-input-config.d.ts +82 -0
- package/dist/components/pin-input/pin-input-config.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-config.js +23 -0
- package/dist/components/pin-input/pin-input-styles.d.ts +16 -0
- package/dist/components/pin-input/pin-input-styles.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-styles.js +9 -0
- package/dist/components/pricing-card/PricingCard.d.ts +87 -0
- package/dist/components/pricing-card/PricingCard.d.ts.map +1 -0
- package/dist/components/pricing-card/PricingCard.js +79 -0
- package/dist/components/pricing-card/index.d.ts +3 -0
- package/dist/components/pricing-card/index.d.ts.map +1 -0
- package/dist/components/pricing-card/index.js +3 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts +35 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-config.js +16 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts +21 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-styles.js +5 -0
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/section/Section.d.ts +56 -0
- package/dist/components/section/Section.d.ts.map +1 -0
- package/dist/components/section/Section.js +27 -0
- package/dist/components/section/index.d.ts +3 -0
- package/dist/components/section/index.d.ts.map +1 -0
- package/dist/components/section/index.js +3 -0
- package/dist/components/section/section-config.d.ts +64 -0
- package/dist/components/section/section-config.d.ts.map +1 -0
- package/dist/components/section/section-config.js +20 -0
- package/dist/components/section/section-styles.d.ts +8 -0
- package/dist/components/section/section-styles.d.ts.map +1 -0
- package/dist/components/section/section-styles.js +9 -0
- package/dist/components/section-kit/ActionGroup.d.ts +47 -0
- package/dist/components/section-kit/ActionGroup.d.ts.map +1 -0
- package/dist/components/section-kit/ActionGroup.js +35 -0
- package/dist/components/section-kit/SectionHeading.d.ts +65 -0
- package/dist/components/section-kit/SectionHeading.d.ts.map +1 -0
- package/dist/components/section-kit/SectionHeading.js +34 -0
- package/dist/components/section-kit/index.d.ts +12 -0
- package/dist/components/section-kit/index.d.ts.map +1 -0
- package/dist/components/section-kit/index.js +2 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts +67 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -0
- package/dist/components/sidebar-layout/SidebarLayout.js +40 -0
- package/dist/components/sidebar-layout/index.d.ts +3 -0
- package/dist/components/sidebar-layout/index.d.ts.map +1 -0
- package/dist/components/sidebar-layout/index.js +3 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts +49 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.js +16 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +21 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.js +9 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/stack/Stack.d.ts +107 -0
- package/dist/components/stack/Stack.d.ts.map +1 -0
- package/dist/components/stack/Stack.js +36 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/stack/index.d.ts.map +1 -0
- package/dist/components/stack/index.js +3 -0
- package/dist/components/stack/stack-config.d.ts +68 -0
- package/dist/components/stack/stack-config.d.ts.map +1 -0
- package/dist/components/stack/stack-config.js +20 -0
- package/dist/components/stack/stack-styles.d.ts +10 -0
- package/dist/components/stack/stack-styles.d.ts.map +1 -0
- package/dist/components/stack/stack-styles.js +21 -0
- package/dist/components/testimonials/Testimonials.d.ts +78 -0
- package/dist/components/testimonials/Testimonials.d.ts.map +1 -0
- package/dist/components/testimonials/Testimonials.js +96 -0
- package/dist/components/testimonials/index.d.ts +3 -0
- package/dist/components/testimonials/index.d.ts.map +1 -0
- package/dist/components/testimonials/index.js +3 -0
- package/dist/components/testimonials/testimonials-config.d.ts +44 -0
- package/dist/components/testimonials/testimonials-config.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-config.js +28 -0
- package/dist/components/testimonials/testimonials-styles.d.ts +11 -0
- package/dist/components/testimonials/testimonials-styles.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-styles.js +5 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -1
- package/dist/config/validate-config.d.ts.map +1 -1
- package/dist/icons/CopyIcon.d.ts +3 -0
- package/dist/icons/CopyIcon.d.ts.map +1 -0
- package/dist/icons/CopyIcon.js +24 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -72
- package/dist/puck/adapters.d.ts +41 -0
- package/dist/puck/adapters.d.ts.map +1 -0
- package/dist/puck/adapters.js +30 -0
- package/dist/puck/blocks/content.d.ts +32 -0
- package/dist/puck/blocks/content.d.ts.map +1 -0
- package/dist/puck/blocks/content.js +54 -0
- package/dist/puck/blocks/layout.d.ts +44 -0
- package/dist/puck/blocks/layout.d.ts.map +1 -0
- package/dist/puck/blocks/layout.js +69 -0
- package/dist/puck/blocks/navigation.d.ts +66 -0
- package/dist/puck/blocks/navigation.d.ts.map +1 -0
- package/dist/puck/blocks/navigation.js +122 -0
- package/dist/puck/blocks/sections.d.ts +134 -0
- package/dist/puck/blocks/sections.d.ts.map +1 -0
- package/dist/puck/blocks/sections.js +232 -0
- package/dist/puck/blocks/utility.d.ts +22 -0
- package/dist/puck/blocks/utility.d.ts.map +1 -0
- package/dist/puck/blocks/utility.js +49 -0
- package/dist/puck/config.d.ts +63 -0
- package/dist/puck/config.d.ts.map +1 -0
- package/dist/puck/config.js +79 -0
- package/dist/puck/fields.d.ts +94 -0
- package/dist/puck/fields.d.ts.map +1 -0
- package/dist/puck/fields.js +116 -0
- package/dist/puck/index.d.ts +21 -0
- package/dist/puck/index.d.ts.map +1 -0
- package/dist/puck/index.js +10 -0
- package/dist/shared/action.d.ts +52 -0
- package/dist/shared/action.d.ts.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/spacing.d.ts +38 -0
- package/dist/shared/spacing.d.ts.map +1 -0
- package/dist/shared/spacing.js +29 -0
- package/dist/shared/typography.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +32 -7
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/dist/utils/resolve-token.js +9 -1
- package/package.json +14 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Hero.d.ts","sourceRoot":"","sources":["../../../src/components/hero/Hero.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOjD,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAUtE,KAAK,aAAa,GAAG,UAAU,GAC7B,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,IAAI,mGAuFhB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { resolveConfigCascade as n } from "../../utils/resolve-token.js";
|
|
6
|
+
import { SectionHeading as r } from "../section-kit/SectionHeading.js";
|
|
7
|
+
import { Container as i } from "../container/Container.js";
|
|
8
|
+
import { Section as a } from "../section/Section.js";
|
|
9
|
+
import { ActionGroup as o } from "../section-kit/ActionGroup.js";
|
|
10
|
+
import { FALLBACK_HERO_CONFIG as s } from "./hero-config.js";
|
|
11
|
+
import { HERO_LAYOUT_CLASS as c, HERO_MEDIA_CLASS as l, HERO_TEXT_COLUMN_CLASS as u } from "./hero-styles.js";
|
|
12
|
+
import { forwardRef as d } from "react";
|
|
13
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
14
|
+
//#region src/components/hero/Hero.tsx
|
|
15
|
+
var m = d(({ eyebrow: d, title: m, description: h, primaryAction: g, secondaryAction: _, media: v, align: y, spacing: b, background: x, mediaPosition: S, containerSize: C, contained: w, as: T, className: E, children: D, ...O }, k) => {
|
|
16
|
+
let A = t(), j = n({
|
|
17
|
+
align: y,
|
|
18
|
+
spacing: b,
|
|
19
|
+
background: x,
|
|
20
|
+
mediaPosition: S,
|
|
21
|
+
containerSize: C,
|
|
22
|
+
contained: w
|
|
23
|
+
}, A.components?.hero, s), M = j.align === "center", N = /* @__PURE__ */ p("div", {
|
|
24
|
+
className: e(u, M && "items-center text-center", !v && "max-w-2xl"),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ f(r, {
|
|
27
|
+
eyebrow: d,
|
|
28
|
+
title: m,
|
|
29
|
+
description: h,
|
|
30
|
+
align: j.align,
|
|
31
|
+
size: "xl"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ f(o, {
|
|
34
|
+
primaryAction: g,
|
|
35
|
+
secondaryAction: _,
|
|
36
|
+
align: j.align
|
|
37
|
+
}),
|
|
38
|
+
D
|
|
39
|
+
]
|
|
40
|
+
}), P = v ? /* @__PURE__ */ p("div", {
|
|
41
|
+
className: c,
|
|
42
|
+
children: [N, /* @__PURE__ */ f("div", {
|
|
43
|
+
className: e(l, j.mediaPosition === "start" && "lg:order-first"),
|
|
44
|
+
children: v
|
|
45
|
+
})]
|
|
46
|
+
}) : N;
|
|
47
|
+
return /* @__PURE__ */ f(a, {
|
|
48
|
+
ref: k,
|
|
49
|
+
as: T,
|
|
50
|
+
spacing: j.spacing,
|
|
51
|
+
background: j.background,
|
|
52
|
+
contained: !1,
|
|
53
|
+
className: E,
|
|
54
|
+
...O,
|
|
55
|
+
children: j.contained ? /* @__PURE__ */ f(i, {
|
|
56
|
+
size: j.containerSize,
|
|
57
|
+
children: P
|
|
58
|
+
}) : P
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
m.displayName = "Hero";
|
|
62
|
+
//#endregion
|
|
63
|
+
export { m as Hero };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Space } from '../../shared';
|
|
2
|
+
import { ContainerSize } from '../container/container-config';
|
|
3
|
+
import { SectionBackground } from '../section/section-config';
|
|
4
|
+
/**
|
|
5
|
+
* Horizontal alignment of a hero's text column.
|
|
6
|
+
*/
|
|
7
|
+
export type HeroAlign = "start" | "center";
|
|
8
|
+
/**
|
|
9
|
+
* Side the media occupies on a wide screen.
|
|
10
|
+
*/
|
|
11
|
+
export type HeroMediaPosition = "end" | "start";
|
|
12
|
+
/**
|
|
13
|
+
* Theme configuration options for the Hero component.
|
|
14
|
+
*
|
|
15
|
+
* Set under `components.hero` in the AsheeUI config. Values feed the
|
|
16
|
+
* component-level fallback tier of the theme cascade.
|
|
17
|
+
*/
|
|
18
|
+
export interface HeroConfig {
|
|
19
|
+
/**
|
|
20
|
+
* Alignment of the text column.
|
|
21
|
+
*
|
|
22
|
+
* @default "start"
|
|
23
|
+
*/
|
|
24
|
+
align?: HeroAlign;
|
|
25
|
+
/**
|
|
26
|
+
* Vertical padding of the hero band.
|
|
27
|
+
*
|
|
28
|
+
* @default "xl"
|
|
29
|
+
*/
|
|
30
|
+
spacing?: Space;
|
|
31
|
+
/**
|
|
32
|
+
* Background treatment of the hero band.
|
|
33
|
+
*
|
|
34
|
+
* @default "none"
|
|
35
|
+
*/
|
|
36
|
+
background?: SectionBackground;
|
|
37
|
+
/**
|
|
38
|
+
* Side the media occupies from the `lg` breakpoint upwards.
|
|
39
|
+
*
|
|
40
|
+
* @default "end"
|
|
41
|
+
*/
|
|
42
|
+
mediaPosition?: HeroMediaPosition;
|
|
43
|
+
/**
|
|
44
|
+
* Maximum content width of the hero.
|
|
45
|
+
*
|
|
46
|
+
* @default "lg"
|
|
47
|
+
*/
|
|
48
|
+
containerSize?: ContainerSize;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the hero wraps its content in a {@link Container}.
|
|
51
|
+
* The hero is contained automatically, so the framework's width and gutter
|
|
52
|
+
* apply; a consumer turns this off to nest the hero in its own layout.
|
|
53
|
+
*
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
contained?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Default config values registered for the Hero component.
|
|
60
|
+
*/
|
|
61
|
+
export declare const defaultHeroConfig: HeroConfig;
|
|
62
|
+
declare module "../../libs/registry" {
|
|
63
|
+
interface ComponentTypeConfigRegistry {
|
|
64
|
+
hero: HeroConfig;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Hard fallback values used when no config tier provides a value.
|
|
69
|
+
*/
|
|
70
|
+
export declare const FALLBACK_HERO_CONFIG: Required<HeroConfig>;
|
|
71
|
+
//# sourceMappingURL=hero-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-config.d.ts","sourceRoot":"","sources":["../../../src/components/hero/hero-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;IAEhB;;;;OAIG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAE/B;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAO/B,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,IAAI,EAAE,UAAU,CAAC;KAClB;CACF;AAID;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,UAAU,CAOrD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/hero/hero-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
align: "start",
|
|
6
|
+
spacing: "xl",
|
|
7
|
+
background: "none",
|
|
8
|
+
mediaPosition: "end",
|
|
9
|
+
containerSize: "lg",
|
|
10
|
+
contained: !0
|
|
11
|
+
};
|
|
12
|
+
e("hero", t);
|
|
13
|
+
var n = {
|
|
14
|
+
align: "start",
|
|
15
|
+
spacing: "xl",
|
|
16
|
+
background: "none",
|
|
17
|
+
mediaPosition: "end",
|
|
18
|
+
containerSize: "lg",
|
|
19
|
+
contained: !0
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as FALLBACK_HERO_CONFIG, t as defaultHeroConfig };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hero component styles for AsheeUI.
|
|
3
|
+
* This file provides the static class mappings for the Hero pattern: the
|
|
4
|
+
* two-column arrangement used when the hero has media, and the measure of the
|
|
5
|
+
* text column.
|
|
6
|
+
*/
|
|
7
|
+
/** The grid that places the text column and the media beside each other. */
|
|
8
|
+
export declare const HERO_LAYOUT_CLASS = "grid items-center gap-10 lg:grid-cols-2";
|
|
9
|
+
/** The text column. */
|
|
10
|
+
export declare const HERO_TEXT_COLUMN_CLASS = "flex min-w-0 flex-col gap-6";
|
|
11
|
+
/** Puts the media column first from the `lg` breakpoint upwards. */
|
|
12
|
+
export declare const HERO_MEDIA_FIRST_CLASS = "lg:order-first";
|
|
13
|
+
/** The media column. */
|
|
14
|
+
export declare const HERO_MEDIA_CLASS = "min-w-0";
|
|
15
|
+
/** Added to the text column when the hero is centred. */
|
|
16
|
+
export declare const HERO_CENTERED_CLASS = "items-center text-center";
|
|
17
|
+
/** Measure of the description when the hero stands alone. */
|
|
18
|
+
export declare const HERO_DESCRIPTION_MEASURE_CLASS = "max-w-2xl";
|
|
19
|
+
//# sourceMappingURL=hero-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hero-styles.d.ts","sourceRoot":"","sources":["../../../src/components/hero/hero-styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,4CAA4C,CAAC;AAE3E,uBAAuB;AACvB,eAAO,MAAM,sBAAsB,gCAAgC,CAAC;AAEpE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD,wBAAwB;AACxB,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D,6DAA6D;AAC7D,eAAO,MAAM,8BAA8B,cAAc,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/hero/hero-styles.ts
|
|
3
|
+
var e = "grid items-center gap-10 lg:grid-cols-2", t = "flex min-w-0 flex-col gap-6", n = "lg:order-first", r = "min-w-0", i = "items-center text-center", a = "max-w-2xl";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { i as HERO_CENTERED_CLASS, a as HERO_DESCRIPTION_MEASURE_CLASS, e as HERO_LAYOUT_CLASS, r as HERO_MEDIA_CLASS, n as HERO_MEDIA_FIRST_CLASS, t as HERO_TEXT_COLUMN_CLASS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/hero/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/MultiSelect.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,SAAS,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../src/components/multi-select/MultiSelect.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAU/B;;;GAGG;AACH,KAAK,qBAAqB,GAAG,IAAI,CAC/B,UAAU,EACR,OAAO,GACP,aAAa,GACb,SAAS,GACT,UAAU,GACV,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,IAAI,GACJ,OAAO,CACV,CAAC;AAEF;;GAEG;AACH,KAAK,uBAAuB,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBACf,SAAQ,qBAAqB,EAC3B,uBAAuB,EACvB,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1C;;;OAGG;IACH,OAAO,EAAE,UAAU,EAAE,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;IAEjD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEjD;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IAE3C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGG;AACH,eAAO,MAAM,WAAW,gHAobvB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { NavbarConfig } from './navbar-config';
|
|
3
|
+
/**
|
|
4
|
+
* One destination in the bar.
|
|
5
|
+
*/
|
|
6
|
+
export interface NavbarLinkItem {
|
|
7
|
+
/** Stable identifier for the link. Defaults to its position in the list. */
|
|
8
|
+
id?: string | number;
|
|
9
|
+
/** Visible name of the link. */
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
/** Destination of the link. */
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether this link leads to the page currently shown.
|
|
15
|
+
* An active link is marked `aria-current="page"`, which is what tells
|
|
16
|
+
* assistive technology where the reader is, and is styled with emphasis as
|
|
17
|
+
* well.
|
|
18
|
+
*/
|
|
19
|
+
isActive?: boolean;
|
|
20
|
+
/** Content before the label, typically an icon. */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** Component that replaces the anchor for this link only. */
|
|
23
|
+
component?: ElementType;
|
|
24
|
+
/** Additional props for that component. */
|
|
25
|
+
componentProps?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Substitution applied to every link in the bar.
|
|
29
|
+
*/
|
|
30
|
+
export interface NavbarLink {
|
|
31
|
+
/** Component that replaces the anchor, such as a framework router link. */
|
|
32
|
+
component?: ElementType;
|
|
33
|
+
/** Additional props for that component. */
|
|
34
|
+
props?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
type BaseNavbarProps = NavbarConfig & Omit<HTMLAttributes<HTMLElement>, "color" | "title">;
|
|
37
|
+
/**
|
|
38
|
+
* Props for the Navbar component.
|
|
39
|
+
*/
|
|
40
|
+
export interface NavbarProps extends BaseNavbarProps {
|
|
41
|
+
/** Brand content, typically a logo and a product name. */
|
|
42
|
+
brand?: ReactNode;
|
|
43
|
+
/** Destination of the brand. */
|
|
44
|
+
brandHref?: string;
|
|
45
|
+
/** The navigation links. */
|
|
46
|
+
links?: NavbarLinkItem[];
|
|
47
|
+
/** Actions shown at the trailing edge, typically a sign-in and a signup. */
|
|
48
|
+
actions?: ReactNode;
|
|
49
|
+
/** Substitution applied to every link the bar renders. */
|
|
50
|
+
link?: NavbarLink;
|
|
51
|
+
/**
|
|
52
|
+
* Name of the navigation landmark.
|
|
53
|
+
* Distinguishes this region from any other navigation on the page.
|
|
54
|
+
*
|
|
55
|
+
* @default "Main"
|
|
56
|
+
*/
|
|
57
|
+
label?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Accessible name of the control that opens the mobile panel.
|
|
60
|
+
*
|
|
61
|
+
* @default "Menu"
|
|
62
|
+
*/
|
|
63
|
+
mobileLabel?: string;
|
|
64
|
+
/** Optional second row under the bar, for a search field or a toolbar. */
|
|
65
|
+
secondary?: ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* Whether the mobile panel is open, for a consumer that owns the state.
|
|
68
|
+
* Leave it unset to let the bar manage its own panel.
|
|
69
|
+
*/
|
|
70
|
+
mobileOpen?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Called when the mobile panel should open or close.
|
|
73
|
+
* A router-integration consumer uses it to close the panel after a
|
|
74
|
+
* navigation.
|
|
75
|
+
*/
|
|
76
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Element to render the bar as.
|
|
79
|
+
* Defaults to `header`, which is the banner landmark.
|
|
80
|
+
*
|
|
81
|
+
* @default "header"
|
|
82
|
+
*/
|
|
83
|
+
as?: ElementType;
|
|
84
|
+
}
|
|
85
|
+
export declare const Navbar: import('react').ForwardRefExoticComponent<NavbarProps & import('react').RefAttributes<HTMLElement>>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=Navbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/components/navbar/Navbar.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EAEnB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AASf,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiB5E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB,gCAAgC;IAChC,KAAK,EAAE,SAAS,CAAC;IAEjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IAEzB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAE7C;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AA8FD,eAAO,MAAM,MAAM,qGAoJlB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { ChevronDownIcon as n } from "../../icons/ChevronDownIcon.js";
|
|
6
|
+
import { resolveConfigCascade as r } from "../../utils/resolve-token.js";
|
|
7
|
+
import { Button as i } from "../button/Button.js";
|
|
8
|
+
import { Link as a } from "../link/Link.js";
|
|
9
|
+
import { ChevronUpIcon as o } from "../../icons/ChevronUpIcon.js";
|
|
10
|
+
import { Container as s } from "../container/Container.js";
|
|
11
|
+
import { FALLBACK_NAVBAR_CONFIG as c } from "./navbar-config.js";
|
|
12
|
+
import { NAVBAR_INNER_CLASS as l, NAVBAR_LINKS_CENTER_CLASS as u, NAVBAR_LINKS_CLASS as d, NAVBAR_LINKS_END_CLASS as f, NAVBAR_LINK_CLASS as p, NAVBAR_VARIANT_CLASS as m } from "./navbar-styles.js";
|
|
13
|
+
import { forwardRef as h, useCallback as g, useId as _, useRef as v, useState as ee } from "react";
|
|
14
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/navbar/Navbar.tsx
|
|
16
|
+
function S({ id: t, links: n, link: r, className: i, onNavigate: o }) {
|
|
17
|
+
return /* @__PURE__ */ b("ul", {
|
|
18
|
+
id: t,
|
|
19
|
+
className: i,
|
|
20
|
+
children: n.map((t, n) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ b(a, {
|
|
21
|
+
href: t.href,
|
|
22
|
+
startIcon: t.icon,
|
|
23
|
+
component: t.component ?? r?.component,
|
|
24
|
+
componentProps: {
|
|
25
|
+
...r?.props,
|
|
26
|
+
...t.componentProps
|
|
27
|
+
},
|
|
28
|
+
"aria-current": t.isActive ? "page" : void 0,
|
|
29
|
+
onClick: o,
|
|
30
|
+
className: e(p, t.isActive && "bg-secondary/60 text-foreground"),
|
|
31
|
+
children: t.label
|
|
32
|
+
}) }, t.id ?? n))
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
var C = h(({ brand: p, brandHref: h, links: C, actions: w, link: T, label: E = "Main", mobileLabel: D = "Menu", secondary: O, mobileOpen: k, onMobileOpenChange: A, position: j, variant: M, align: N, contained: P, containerSize: F, as: I, className: L, children: R, ...z }, B) => {
|
|
36
|
+
let V = t(), H = r({
|
|
37
|
+
position: j,
|
|
38
|
+
variant: M,
|
|
39
|
+
align: N,
|
|
40
|
+
contained: P,
|
|
41
|
+
containerSize: F
|
|
42
|
+
}, V.components?.navbar, c), U = _(), W = v(null), [G, K] = ee(!1), q = k !== void 0, J = q ? k : G, Y = g((e) => {
|
|
43
|
+
q || K(e), A?.(e);
|
|
44
|
+
}, [q, A]), X = (e) => {
|
|
45
|
+
e.key === "Escape" && (Y(!1), W.current?.focus());
|
|
46
|
+
}, Z = H.align === "center" ? u : H.align === "end" ? f : d, Q = I ?? "header", te = /* @__PURE__ */ x("div", {
|
|
47
|
+
className: l,
|
|
48
|
+
children: [
|
|
49
|
+
p && /* @__PURE__ */ b("div", {
|
|
50
|
+
className: "flex shrink-0 items-center gap-2 font-semibold text-foreground",
|
|
51
|
+
children: h ? /* @__PURE__ */ b(a, {
|
|
52
|
+
href: h,
|
|
53
|
+
component: T?.component,
|
|
54
|
+
componentProps: T?.props,
|
|
55
|
+
className: "flex shrink-0 items-center gap-2 font-semibold text-foreground",
|
|
56
|
+
children: p
|
|
57
|
+
}) : p
|
|
58
|
+
}),
|
|
59
|
+
C && C.length > 0 && /* @__PURE__ */ b("nav", {
|
|
60
|
+
"aria-label": E,
|
|
61
|
+
className: e("min-w-0", Z),
|
|
62
|
+
children: /* @__PURE__ */ b(S, {
|
|
63
|
+
links: C,
|
|
64
|
+
link: T,
|
|
65
|
+
className: "flex"
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
68
|
+
C && C.length > 0 && /* @__PURE__ */ b(i, {
|
|
69
|
+
ref: W,
|
|
70
|
+
type: "button",
|
|
71
|
+
variant: "ghost",
|
|
72
|
+
size: "sm",
|
|
73
|
+
icon: !0,
|
|
74
|
+
className: "ml-auto md:hidden",
|
|
75
|
+
"aria-label": D,
|
|
76
|
+
"aria-expanded": J,
|
|
77
|
+
"aria-controls": U,
|
|
78
|
+
onClick: () => Y(!J),
|
|
79
|
+
children: b(J ? o : n, {})
|
|
80
|
+
}),
|
|
81
|
+
w && /* @__PURE__ */ b("div", {
|
|
82
|
+
className: "ml-auto flex shrink-0 items-center gap-2",
|
|
83
|
+
children: w
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
}), ne = J && C && C.length > 0 && /* @__PURE__ */ b("nav", {
|
|
87
|
+
"aria-label": E,
|
|
88
|
+
children: /* @__PURE__ */ b(S, {
|
|
89
|
+
id: U,
|
|
90
|
+
links: C,
|
|
91
|
+
link: T,
|
|
92
|
+
className: "flex flex-col gap-1 border-t border-border pb-3 pt-2 md:hidden",
|
|
93
|
+
onNavigate: () => Y(!1)
|
|
94
|
+
})
|
|
95
|
+
}), $ = /* @__PURE__ */ x(y, { children: [
|
|
96
|
+
te,
|
|
97
|
+
ne,
|
|
98
|
+
O && /* @__PURE__ */ b("div", {
|
|
99
|
+
className: "w-full border-t border-border py-2",
|
|
100
|
+
children: O
|
|
101
|
+
}),
|
|
102
|
+
R
|
|
103
|
+
] });
|
|
104
|
+
return /* @__PURE__ */ b(Q, {
|
|
105
|
+
ref: B,
|
|
106
|
+
className: e(m[H.variant], H.position === "sticky" && "sticky top-0 z-20", L),
|
|
107
|
+
onKeyDown: X,
|
|
108
|
+
...z,
|
|
109
|
+
children: H.contained ? /* @__PURE__ */ b(s, {
|
|
110
|
+
size: H.containerSize,
|
|
111
|
+
children: $
|
|
112
|
+
}) : $
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
C.displayName = "Navbar";
|
|
116
|
+
//#endregion
|
|
117
|
+
export { C as Navbar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/navbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ContainerSize } from '../container/container-config';
|
|
2
|
+
/**
|
|
3
|
+
* How the bar behaves when the page scrolls.
|
|
4
|
+
*
|
|
5
|
+
* - `static`: the bar scrolls away with the page.
|
|
6
|
+
* - `sticky`: the bar stays at the top of the viewport.
|
|
7
|
+
*/
|
|
8
|
+
export type NavbarPosition = "static" | "sticky";
|
|
9
|
+
/**
|
|
10
|
+
* Surface treatment of the bar.
|
|
11
|
+
*
|
|
12
|
+
* - `solid`: the page background, so the bar reads as part of the page.
|
|
13
|
+
* - `ghost`: transparent, so the bar sits on a hero without adding a band.
|
|
14
|
+
* - `bordered`: the page background with a separator below it.
|
|
15
|
+
*/
|
|
16
|
+
export type NavbarVariant = "solid" | "ghost" | "bordered";
|
|
17
|
+
/**
|
|
18
|
+
* Where the navigation links sit in the bar.
|
|
19
|
+
*/
|
|
20
|
+
export type NavbarAlign = "start" | "center" | "end";
|
|
21
|
+
/**
|
|
22
|
+
* Theme configuration options for the Navbar component.
|
|
23
|
+
*
|
|
24
|
+
* Set under `components.navbar` in the AsheeUI config. Values feed the
|
|
25
|
+
* component-level fallback tier of the theme cascade.
|
|
26
|
+
*/
|
|
27
|
+
export interface NavbarConfig {
|
|
28
|
+
/** How the bar behaves when the page scrolls. @default "sticky" */
|
|
29
|
+
position?: NavbarPosition;
|
|
30
|
+
/** Surface treatment of the bar. @default "solid" */
|
|
31
|
+
variant?: NavbarVariant;
|
|
32
|
+
/** Where the navigation links sit. @default "start" */
|
|
33
|
+
align?: NavbarAlign;
|
|
34
|
+
/** Whether the bar wraps its content in a `Container`. @default true */
|
|
35
|
+
contained?: boolean;
|
|
36
|
+
/** Maximum content width of the bar. @default "lg" */
|
|
37
|
+
containerSize?: ContainerSize;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Default config values registered for the Navbar component.
|
|
41
|
+
*/
|
|
42
|
+
export declare const defaultNavbarConfig: NavbarConfig;
|
|
43
|
+
declare module "../../libs/registry" {
|
|
44
|
+
interface ComponentTypeConfigRegistry {
|
|
45
|
+
navbar: NavbarConfig;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Hard fallback values used when no config tier provides a value.
|
|
50
|
+
*/
|
|
51
|
+
export declare const FALLBACK_NAVBAR_CONFIG: Required<NavbarConfig>;
|
|
52
|
+
//# sourceMappingURL=navbar-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-config.d.ts","sourceRoot":"","sources":["../../../src/components/navbar/navbar-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B,qDAAqD;IACrD,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,uDAAuD;IACvD,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sDAAsD;IACtD,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAMjC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF;AAID;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,YAAY,CAMzD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/navbar/navbar-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
position: "sticky",
|
|
6
|
+
variant: "solid",
|
|
7
|
+
align: "start",
|
|
8
|
+
contained: !0,
|
|
9
|
+
containerSize: "lg"
|
|
10
|
+
};
|
|
11
|
+
e("navbar", t);
|
|
12
|
+
var n = {
|
|
13
|
+
position: "sticky",
|
|
14
|
+
variant: "solid",
|
|
15
|
+
align: "start",
|
|
16
|
+
contained: !0,
|
|
17
|
+
containerSize: "lg"
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as FALLBACK_NAVBAR_CONFIG, t as defaultNavbarConfig };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavbarVariant } from './navbar-config';
|
|
2
|
+
/** Surface treatment classes. */
|
|
3
|
+
export declare const NAVBAR_VARIANT_CLASS: Record<NavbarVariant, string>;
|
|
4
|
+
/** Position classes. */
|
|
5
|
+
export declare const NAVBAR_POSITION_CLASS = "sticky top-0 z-20";
|
|
6
|
+
/** The bar's inner row. */
|
|
7
|
+
export declare const NAVBAR_INNER_CLASS = "flex w-full items-center gap-4 py-3";
|
|
8
|
+
/** The brand region. */
|
|
9
|
+
export declare const NAVBAR_BRAND_CLASS = "flex shrink-0 items-center gap-2 font-semibold text-foreground";
|
|
10
|
+
/** The desktop link list, next to the brand. */
|
|
11
|
+
export declare const NAVBAR_LINKS_CLASS = "hidden items-center gap-1 md:flex";
|
|
12
|
+
/** The desktop link list, centred in the bar. */
|
|
13
|
+
export declare const NAVBAR_LINKS_CENTER_CLASS = "hidden flex-1 items-center justify-center gap-1 md:flex";
|
|
14
|
+
/** The desktop link list, pushed to the trailing edge. */
|
|
15
|
+
export declare const NAVBAR_LINKS_END_CLASS = "hidden flex-1 items-center justify-end gap-1 md:flex";
|
|
16
|
+
/** One navigation link. */
|
|
17
|
+
export declare const NAVBAR_LINK_CLASS = "rounded-xs px-3 py-2 text-sm font-medium text-foreground/70 transition-colors hover:bg-secondary/60 hover:text-foreground";
|
|
18
|
+
/** The navigation link of the current page. */
|
|
19
|
+
export declare const NAVBAR_LINK_ACTIVE_CLASS = "bg-secondary/60 text-foreground";
|
|
20
|
+
/** The action region. */
|
|
21
|
+
export declare const NAVBAR_ACTIONS_CLASS = "ml-auto flex shrink-0 items-center gap-2";
|
|
22
|
+
/** The control that opens the mobile panel. */
|
|
23
|
+
export declare const NAVBAR_TOGGLE_CLASS = "ml-auto md:hidden";
|
|
24
|
+
/** The mobile panel, shown only on a narrow screen. */
|
|
25
|
+
export declare const NAVBAR_MOBILE_PANEL_CLASS = "flex flex-col gap-1 border-t border-border pb-3 pt-2 md:hidden";
|
|
26
|
+
/** The optional second row of the bar. */
|
|
27
|
+
export declare const NAVBAR_SECONDARY_CLASS = "w-full border-t border-border py-2";
|
|
28
|
+
//# sourceMappingURL=navbar-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar-styles.d.ts","sourceRoot":"","sources":["../../../src/components/navbar/navbar-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAI9D,CAAC;AAEF,wBAAwB;AACxB,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,2BAA2B;AAC3B,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AAExE,wBAAwB;AACxB,eAAO,MAAM,kBAAkB,mEACmC,CAAC;AAEnE,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAEtE,iDAAiD;AACjD,eAAO,MAAM,yBAAyB,4DACqB,CAAC;AAE5D,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,yDACqB,CAAC;AAEzD,2BAA2B;AAC3B,eAAO,MAAM,iBAAiB,8HAC+F,CAAC;AAE9H,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AAE1E,yBAAyB;AACzB,eAAO,MAAM,oBAAoB,6CAA6C,CAAC;AAE/E,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,uDAAuD;AACvD,eAAO,MAAM,yBAAyB,mEAC4B,CAAC;AAEnE,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/navbar/navbar-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
solid: "bg-background",
|
|
5
|
+
ghost: "bg-transparent",
|
|
6
|
+
bordered: "bg-background border-b border-border"
|
|
7
|
+
}, t = "sticky top-0 z-20", n = "flex w-full items-center gap-4 py-3", r = "flex shrink-0 items-center gap-2 font-semibold text-foreground", i = "hidden items-center gap-1 md:flex", a = "hidden flex-1 items-center justify-center gap-1 md:flex", o = "hidden flex-1 items-center justify-end gap-1 md:flex", s = "rounded-xs px-3 py-2 text-sm font-medium text-foreground/70 transition-colors hover:bg-secondary/60 hover:text-foreground", c = "bg-secondary/60 text-foreground", l = "ml-auto flex shrink-0 items-center gap-2", u = "ml-auto md:hidden", d = "flex flex-col gap-1 border-t border-border pb-3 pt-2 md:hidden", f = "w-full border-t border-border py-2";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { l as NAVBAR_ACTIONS_CLASS, r as NAVBAR_BRAND_CLASS, n as NAVBAR_INNER_CLASS, a as NAVBAR_LINKS_CENTER_CLASS, i as NAVBAR_LINKS_CLASS, o as NAVBAR_LINKS_END_CLASS, c as NAVBAR_LINK_ACTIVE_CLASS, s as NAVBAR_LINK_CLASS, d as NAVBAR_MOBILE_PANEL_CLASS, t as NAVBAR_POSITION_CLASS, f as NAVBAR_SECONDARY_CLASS, u as NAVBAR_TOGGLE_CLASS, e as NAVBAR_VARIANT_CLASS };
|