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,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
5
|
+
import { useAsheeConfig as n } from "../../libs/context.js";
|
|
6
|
+
import { resolveClassKey as r, resolveConfigCascade as i, resolveRadiusKey as a } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FieldShell as o } from "../field/FieldShell.js";
|
|
8
|
+
import { FALLBACK_PIN_INPUT_CONFIG as s } from "./pin-input-config.js";
|
|
9
|
+
import { PIN_INPUT_BOX_CLASS as ee, PIN_INPUT_BOX_DEFAULT_CLASS as te, PIN_INPUT_BOX_DISABLED_CLASS as c, PIN_INPUT_BOX_INVALID_CLASS as l, PIN_INPUT_GROUP_CLASS as u, PIN_INPUT_SIZE_CLASS as d } from "./pin-input-styles.js";
|
|
10
|
+
import { Fragment as f, forwardRef as p, useId as ne, useRef as m, useState as h } from "react";
|
|
11
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/pin-input/PinInput.tsx
|
|
13
|
+
function v(e, t) {
|
|
14
|
+
return t === "numeric" ? e.replace(/\D+/g, "") : t === "alphanumeric" ? e.replace(/[^0-9a-zA-Z]+/g, "") : e.replace(/\s+/g, "");
|
|
15
|
+
}
|
|
16
|
+
var y = p(({ value: p, defaultValue: y, onValueChange: re, onComplete: b, length: x, mode: ie, size: ae, masked: oe, radius: S, isDisabled: se, isInvalid: ce, label: C, labelAlign: w, description: T, message: E, status: D, required: O, isLoading: k, groupLabel: A = "Verification code", separatorAfter: j, name: M, className: N, id: P, placeholder: F, ...I }, L) => {
|
|
17
|
+
let R = n(), z = R.components?.pininput, B = i({
|
|
18
|
+
length: x,
|
|
19
|
+
mode: ie,
|
|
20
|
+
size: ae,
|
|
21
|
+
masked: oe,
|
|
22
|
+
isDisabled: se,
|
|
23
|
+
isInvalid: ce,
|
|
24
|
+
radius: S ?? void 0
|
|
25
|
+
}, z, s), V = a(S, z?.radius, R.defaultRadius, s.radius), H = r(V, t, s.radius), U = ne(), W = P ?? U, G = `${W}-label`, K = `${W}-description`, q = `${W}-message`, [le, ue] = h(y ?? ""), J = p !== void 0, Y = J ? p : le, X = m([]), Z = (e) => {
|
|
26
|
+
let t = Math.max(0, Math.min(e, B.length - 1));
|
|
27
|
+
X.current[t]?.focus();
|
|
28
|
+
}, Q = (e) => {
|
|
29
|
+
let t = e.slice(0, B.length);
|
|
30
|
+
J || ue(t), re?.(t), t.length === B.length && b?.(t);
|
|
31
|
+
}, $ = (e, t) => {
|
|
32
|
+
let n = v(t, B.mode), r = (Y.slice(0, e) + n + Y.slice(e + n.length)).slice(0, B.length);
|
|
33
|
+
Q(r), Z(e + n.length);
|
|
34
|
+
}, de = (e, t) => {
|
|
35
|
+
let n = v(t, B.mode);
|
|
36
|
+
if (n.length === 0) {
|
|
37
|
+
Q(Y.slice(0, e) + Y.slice(e + 1));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (n.length > 1) {
|
|
41
|
+
$(e, n);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let r = e >= Y.length ? Y + n : Y.slice(0, e) + n + Y.slice(e + 1);
|
|
45
|
+
Q(r), Z(e + 1);
|
|
46
|
+
}, fe = (e, t) => {
|
|
47
|
+
switch (t.key) {
|
|
48
|
+
case "Backspace":
|
|
49
|
+
t.preventDefault(), e < Y.length && Q(Y.slice(0, e) + Y.slice(e + 1)), Z(e - 1);
|
|
50
|
+
return;
|
|
51
|
+
case "Delete":
|
|
52
|
+
t.preventDefault(), e < Y.length && Q(Y.slice(0, e) + Y.slice(e + 1));
|
|
53
|
+
return;
|
|
54
|
+
case "ArrowLeft":
|
|
55
|
+
t.preventDefault(), Z(e - 1);
|
|
56
|
+
return;
|
|
57
|
+
case "ArrowRight":
|
|
58
|
+
t.preventDefault(), Z(e + 1);
|
|
59
|
+
return;
|
|
60
|
+
case "Home":
|
|
61
|
+
t.preventDefault(), Z(0);
|
|
62
|
+
return;
|
|
63
|
+
case "End":
|
|
64
|
+
t.preventDefault(), Z(B.length - 1);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}, pe = (e, t) => {
|
|
68
|
+
let n = t.clipboardData?.getData("text") ?? "";
|
|
69
|
+
n && (t.preventDefault(), $(e, n));
|
|
70
|
+
}, me = [T ? K : null, E ? q : null].filter(Boolean).join(" ") || void 0;
|
|
71
|
+
return /* @__PURE__ */ g(o, {
|
|
72
|
+
id: W,
|
|
73
|
+
htmlFor: null,
|
|
74
|
+
labelId: G,
|
|
75
|
+
label: C,
|
|
76
|
+
labelAlign: w,
|
|
77
|
+
description: T,
|
|
78
|
+
descriptionId: K,
|
|
79
|
+
message: E,
|
|
80
|
+
messageId: q,
|
|
81
|
+
status: D,
|
|
82
|
+
required: O,
|
|
83
|
+
isLoading: k,
|
|
84
|
+
children: /* @__PURE__ */ _("fieldset", {
|
|
85
|
+
ref: L,
|
|
86
|
+
"aria-labelledby": C ? G : void 0,
|
|
87
|
+
"aria-label": C ? void 0 : A,
|
|
88
|
+
"aria-describedby": me,
|
|
89
|
+
"data-disabled": B.isDisabled ? "true" : void 0,
|
|
90
|
+
className: e(u, N),
|
|
91
|
+
children: [Array.from({ length: B.length }, (t, n) => /* @__PURE__ */ _(f, { children: [/* @__PURE__ */ g("input", {
|
|
92
|
+
ref: (e) => {
|
|
93
|
+
X.current[n] = e;
|
|
94
|
+
},
|
|
95
|
+
id: n === 0 ? W : `${W}-${n}`,
|
|
96
|
+
type: B.masked ? "password" : "text",
|
|
97
|
+
inputMode: B.mode === "numeric" ? "numeric" : "text",
|
|
98
|
+
pattern: B.mode === "numeric" ? "[0-9]*" : void 0,
|
|
99
|
+
autoComplete: n === 0 ? "one-time-code" : "off",
|
|
100
|
+
placeholder: F,
|
|
101
|
+
disabled: B.isDisabled,
|
|
102
|
+
"aria-label": `${A}, character ${n + 1} of ${B.length}`,
|
|
103
|
+
"aria-invalid": B.isInvalid || void 0,
|
|
104
|
+
value: Y[n] ?? "",
|
|
105
|
+
onKeyDown: (e) => fe(n, e),
|
|
106
|
+
onPaste: (e) => pe(n, e),
|
|
107
|
+
onChange: (e) => de(n, e.target.value),
|
|
108
|
+
className: e(ee, d[B.size], H, B.isDisabled ? c : B.isInvalid ? l : te),
|
|
109
|
+
...I
|
|
110
|
+
}), j !== void 0 && j > 0 && n + 1 === j && n + 1 < B.length && /* @__PURE__ */ g("span", {
|
|
111
|
+
"aria-hidden": "true",
|
|
112
|
+
className: "px-1 text-foreground/40",
|
|
113
|
+
children: "-"
|
|
114
|
+
})] }, `pin-${n}`)), M && /* @__PURE__ */ g("input", {
|
|
115
|
+
type: "hidden",
|
|
116
|
+
name: M,
|
|
117
|
+
value: Y
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
y.displayName = "PinInput";
|
|
123
|
+
//#endregion
|
|
124
|
+
export { y as PinInput, v as sanitizePinValue };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pin-input/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Radius } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Characters a PIN field accepts.
|
|
4
|
+
*
|
|
5
|
+
* - `numeric`: digits only, which is what a code sent by SMS contains.
|
|
6
|
+
* - `alphanumeric`: letters and digits, for a code that mixes both.
|
|
7
|
+
* - `text`: any character except whitespace.
|
|
8
|
+
*/
|
|
9
|
+
export type PinInputMode = "numeric" | "alphanumeric" | "text";
|
|
10
|
+
/**
|
|
11
|
+
* Density of a PIN field.
|
|
12
|
+
*/
|
|
13
|
+
export type PinInputSize = "sm" | "md" | "lg";
|
|
14
|
+
/**
|
|
15
|
+
* Theme configuration options for the PinInput component.
|
|
16
|
+
*
|
|
17
|
+
* Set under `components.pininput` in the AsheeUI config. Values feed the
|
|
18
|
+
* component-level fallback tier of the theme cascade.
|
|
19
|
+
*/
|
|
20
|
+
export interface PinInputConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Number of characters the field collects.
|
|
23
|
+
*
|
|
24
|
+
* @default 4
|
|
25
|
+
*/
|
|
26
|
+
length?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Characters the field accepts.
|
|
29
|
+
*
|
|
30
|
+
* @default "numeric"
|
|
31
|
+
*/
|
|
32
|
+
mode?: PinInputMode;
|
|
33
|
+
/**
|
|
34
|
+
* Density of the boxes.
|
|
35
|
+
*
|
|
36
|
+
* @default "md"
|
|
37
|
+
*/
|
|
38
|
+
size?: PinInputSize;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the typed characters are hidden.
|
|
41
|
+
* Use it for a value that must not be readable over a shoulder.
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
masked?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Corner rounding of each box.
|
|
48
|
+
* Defaults to the framework radius, so a PIN field matches the surrounding
|
|
49
|
+
* form.
|
|
50
|
+
*/
|
|
51
|
+
radius?: Radius;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the field is disabled.
|
|
54
|
+
*
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
isDisabled?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the current value is invalid.
|
|
60
|
+
* Marks the group for assistive technology and colours the boxes, so an
|
|
61
|
+
* error is never carried by colour alone.
|
|
62
|
+
*
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
isInvalid?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Default config values registered for the PinInput component.
|
|
69
|
+
*/
|
|
70
|
+
export declare const defaultPinInputConfig: PinInputConfig;
|
|
71
|
+
declare module "../../libs/registry" {
|
|
72
|
+
interface ComponentTypeConfigRegistry {
|
|
73
|
+
pininput: PinInputConfig;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Hard fallback values used when no config tier provides a value.
|
|
78
|
+
*/
|
|
79
|
+
export declare const FALLBACK_PIN_INPUT_CONFIG: Required<Omit<PinInputConfig, "radius">> & {
|
|
80
|
+
radius: Radius;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=pin-input-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin-input-config.d.ts","sourceRoot":"","sources":["../../../src/components/pin-input/pin-input-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,cAAc,GAAG,MAAM,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAOnC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF;AAID;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAC9C,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAC/B,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAQnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/pin-input/pin-input-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
length: 4,
|
|
6
|
+
mode: "numeric",
|
|
7
|
+
size: "md",
|
|
8
|
+
masked: !1,
|
|
9
|
+
isDisabled: !1,
|
|
10
|
+
isInvalid: !1
|
|
11
|
+
};
|
|
12
|
+
e("pininput", t);
|
|
13
|
+
var n = {
|
|
14
|
+
length: 4,
|
|
15
|
+
mode: "numeric",
|
|
16
|
+
size: "md",
|
|
17
|
+
masked: !1,
|
|
18
|
+
isDisabled: !1,
|
|
19
|
+
isInvalid: !1,
|
|
20
|
+
radius: "sm"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as FALLBACK_PIN_INPUT_CONFIG, t as defaultPinInputConfig };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PinInputSize } from './pin-input-config';
|
|
2
|
+
/** The group of boxes. */
|
|
3
|
+
export declare const PIN_INPUT_GROUP_CLASS = "flex flex-wrap items-center gap-2";
|
|
4
|
+
/** Shared base classes for a box. */
|
|
5
|
+
export declare const PIN_INPUT_BOX_CLASS = "border-2 text-center font-semibold tabular-nums transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 disabled:cursor-not-allowed";
|
|
6
|
+
/** Box density classes. */
|
|
7
|
+
export declare const PIN_INPUT_SIZE_CLASS: Record<PinInputSize, string>;
|
|
8
|
+
/** Box state: no error, not disabled. */
|
|
9
|
+
export declare const PIN_INPUT_BOX_DEFAULT_CLASS = "border-border bg-background text-foreground";
|
|
10
|
+
/** Box state: the value is invalid. */
|
|
11
|
+
export declare const PIN_INPUT_BOX_INVALID_CLASS = "border-danger bg-background text-foreground";
|
|
12
|
+
/** Box state: the field is disabled. */
|
|
13
|
+
export declare const PIN_INPUT_BOX_DISABLED_CLASS = "border-border bg-secondary/40 text-foreground/60";
|
|
14
|
+
/** The separator shown between groups of boxes. */
|
|
15
|
+
export declare const PIN_INPUT_SEPARATOR_CLASS = "px-1 text-foreground/40";
|
|
16
|
+
//# sourceMappingURL=pin-input-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin-input-styles.d.ts","sourceRoot":"","sources":["../../../src/components/pin-input/pin-input-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,0BAA0B;AAC1B,eAAO,MAAM,qBAAqB,sCAAsC,CAAC;AAEzE,qCAAqC;AACrC,eAAO,MAAM,mBAAmB,yMACwK,CAAC;AAEzM,2BAA2B;AAC3B,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAI7D,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,2BAA2B,gDACO,CAAC;AAEhD,uCAAuC;AACvC,eAAO,MAAM,2BAA2B,gDACO,CAAC;AAEhD,wCAAwC;AACxC,eAAO,MAAM,4BAA4B,qDACW,CAAC;AAErD,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/pin-input/pin-input-styles.ts
|
|
3
|
+
var e = "flex flex-wrap items-center gap-2", t = "border-2 text-center font-semibold tabular-nums transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 disabled:cursor-not-allowed", n = {
|
|
4
|
+
sm: "h-9 w-8 text-sm",
|
|
5
|
+
md: "h-11 w-10 text-base",
|
|
6
|
+
lg: "h-14 w-12 text-lg"
|
|
7
|
+
}, r = "border-border bg-background text-foreground", i = "border-danger bg-background text-foreground", a = "border-border bg-secondary/40 text-foreground/60", o = "px-1 text-foreground/40";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as PIN_INPUT_BOX_CLASS, r as PIN_INPUT_BOX_DEFAULT_CLASS, a as PIN_INPUT_BOX_DISABLED_CLASS, i as PIN_INPUT_BOX_INVALID_CLASS, e as PIN_INPUT_GROUP_CLASS, o as PIN_INPUT_SEPARATOR_CLASS, n as PIN_INPUT_SIZE_CLASS };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { ActionConfig } from '../../shared';
|
|
3
|
+
import { PricingCardConfig } from './pricing-card-config';
|
|
4
|
+
/**
|
|
5
|
+
* One line of a plan's feature list.
|
|
6
|
+
*/
|
|
7
|
+
export interface PricingFeatureItem {
|
|
8
|
+
/** Stable identifier for the line. Defaults to its position in the list. */
|
|
9
|
+
id?: string | number;
|
|
10
|
+
/** What the line says. */
|
|
11
|
+
label: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the plan includes this line.
|
|
14
|
+
* An excluded line also carries the wording "(not included)" for assistive
|
|
15
|
+
* technology, so the meaning never depends on the visual treatment alone.
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
included?: boolean;
|
|
20
|
+
}
|
|
21
|
+
type BasePricingCardProps = PricingCardConfig & Omit<HTMLAttributes<HTMLDivElement>, "color" | "title">;
|
|
22
|
+
/**
|
|
23
|
+
* Props for the PricingCard component.
|
|
24
|
+
*/
|
|
25
|
+
export interface PricingCardProps extends BasePricingCardProps {
|
|
26
|
+
/** Name of the plan. */
|
|
27
|
+
name: ReactNode;
|
|
28
|
+
/** The amount, shown as the card's leading figure. */
|
|
29
|
+
price: ReactNode;
|
|
30
|
+
/** Billing period shown beside the amount, for example "/month". */
|
|
31
|
+
period?: ReactNode;
|
|
32
|
+
/** One sentence about who the plan is for. */
|
|
33
|
+
description?: ReactNode;
|
|
34
|
+
/** Short label above the plan name, for example "Most popular". */
|
|
35
|
+
badge?: ReactNode;
|
|
36
|
+
/** The plan's feature lines. */
|
|
37
|
+
features?: PricingFeatureItem[];
|
|
38
|
+
/** The emphasised action, typically the plan's signup. */
|
|
39
|
+
primaryAction?: ActionConfig;
|
|
40
|
+
/** The supporting action, typically a sales contact. */
|
|
41
|
+
secondaryAction?: ActionConfig;
|
|
42
|
+
/** Content below the actions. */
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One plan in a pricing table.
|
|
47
|
+
*
|
|
48
|
+
* The amount is a required prop and renders as text rather than being parsed as
|
|
49
|
+
* a number, so a plan can say "Free", "$12" or "Custom" without the framework
|
|
50
|
+
* pretending to understand currency. A recommended plan is marked visually and
|
|
51
|
+
* carries the reason in its `badge`, so the recommendation is never communicated
|
|
52
|
+
* by colour alone.
|
|
53
|
+
*
|
|
54
|
+
* @param props - PricingCard configuration options and element attributes.
|
|
55
|
+
* @param props.name - Name of the plan.
|
|
56
|
+
* @param props.price - The amount.
|
|
57
|
+
* @param props.period - Billing period shown beside the amount.
|
|
58
|
+
* @param props.description - One sentence about the plan.
|
|
59
|
+
* @param props.badge - Short label above the plan name.
|
|
60
|
+
* @param props.features - The plan's feature lines.
|
|
61
|
+
* @param props.primaryAction - The emphasised action.
|
|
62
|
+
* @param props.secondaryAction - The supporting action.
|
|
63
|
+
* @param props.variant - Surface treatment. Defaults to "bordered".
|
|
64
|
+
* @param props.size - Card density. Defaults to "lg".
|
|
65
|
+
* @param props.highlighted - Mark the plan as recommended. Defaults to false.
|
|
66
|
+
*
|
|
67
|
+
* @returns The rendered card.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <PricingCard
|
|
72
|
+
* badge="Most popular"
|
|
73
|
+
* name="Growth"
|
|
74
|
+
* price="$29"
|
|
75
|
+
* period="/month"
|
|
76
|
+
* highlighted
|
|
77
|
+
* features={[{ label: "10,000 messages" }]}
|
|
78
|
+
* primaryAction={{ label: "Choose Growth", href: "/signup" }}
|
|
79
|
+
* />
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @see Grid - Places several plans in a table.
|
|
83
|
+
* @see Card - The surface the plan renders in.
|
|
84
|
+
*/
|
|
85
|
+
export declare const PricingCard: import('react').ForwardRefExoticComponent<PricingCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=PricingCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PricingCard.d.ts","sourceRoot":"","sources":["../../../src/components/pricing-card/PricingCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAY/B;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB,0BAA0B;IAC1B,KAAK,EAAE,SAAS,CAAC;IAEjB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,oBAAoB,GAAG,iBAAiB,GAC3C,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,wBAAwB;IACxB,IAAI,EAAE,SAAS,CAAC;IAEhB,sDAAsD;IACtD,KAAK,EAAE,SAAS,CAAC;IAEjB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,mEAAmE;IACnE,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAEhC,0DAA0D;IAC1D,aAAa,CAAC,EAAE,YAAY,CAAC;IAE7B,wDAAwD;IACxD,eAAe,CAAC,EAAE,YAAY,CAAC;IAE/B,iCAAiC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,WAAW,6GAoGvB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { CheckIcon as r } from "../../icons/CheckIcon.js";
|
|
7
|
+
import { CloseIcon as i } from "../../icons/CloseIcon.js";
|
|
8
|
+
import { Typography as a } from "../typography/Typography.js";
|
|
9
|
+
import { Card as o } from "../card/Card.js";
|
|
10
|
+
import { ActionGroup as s } from "../section-kit/ActionGroup.js";
|
|
11
|
+
import { FALLBACK_PRICING_CARD_CONFIG as c } from "./pricing-card-config.js";
|
|
12
|
+
import { PRICING_BADGE_CLASS as l, PRICING_BODY_CLASS as u, PRICING_PRICE_CLASS as d } from "./pricing-card-styles.js";
|
|
13
|
+
import { forwardRef as f } from "react";
|
|
14
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/pricing-card/PricingCard.tsx
|
|
16
|
+
var h = f(({ name: f, price: h, period: g, description: _, badge: v, features: y, primaryAction: b, secondaryAction: x, variant: S, size: C, highlighted: w, className: T, children: E, ...D }, O) => {
|
|
17
|
+
let k = t(), A = n({
|
|
18
|
+
variant: S,
|
|
19
|
+
size: C,
|
|
20
|
+
highlighted: w
|
|
21
|
+
}, k.components?.pricingcard, c);
|
|
22
|
+
return /* @__PURE__ */ p(o, {
|
|
23
|
+
ref: O,
|
|
24
|
+
variant: A.variant,
|
|
25
|
+
size: A.size,
|
|
26
|
+
title: f,
|
|
27
|
+
description: _,
|
|
28
|
+
header: v ? /* @__PURE__ */ p("span", {
|
|
29
|
+
className: l,
|
|
30
|
+
children: v
|
|
31
|
+
}) : void 0,
|
|
32
|
+
className: e("h-full", A.highlighted && "border-primary ring-1 ring-primary", T),
|
|
33
|
+
...D,
|
|
34
|
+
children: /* @__PURE__ */ m("div", {
|
|
35
|
+
className: u,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ m("p", {
|
|
38
|
+
className: d,
|
|
39
|
+
children: [/* @__PURE__ */ p(a, {
|
|
40
|
+
as: "span",
|
|
41
|
+
role: "heading-xl",
|
|
42
|
+
children: h
|
|
43
|
+
}), g && /* @__PURE__ */ p(a, {
|
|
44
|
+
as: "span",
|
|
45
|
+
role: "body-sm",
|
|
46
|
+
tone: "muted",
|
|
47
|
+
children: g
|
|
48
|
+
})]
|
|
49
|
+
}),
|
|
50
|
+
y && y.length > 0 && /* @__PURE__ */ p("ul", {
|
|
51
|
+
className: "flex flex-col gap-2",
|
|
52
|
+
children: y.map((e, t) => {
|
|
53
|
+
let n = e.included === !1;
|
|
54
|
+
return /* @__PURE__ */ m("li", {
|
|
55
|
+
className: "flex items-start gap-2",
|
|
56
|
+
children: [n ? /* @__PURE__ */ p(i, { className: "mt-1 size-4 shrink-0 text-foreground/40" }) : /* @__PURE__ */ p(r, { className: "mt-1 size-4 shrink-0 text-success" }), /* @__PURE__ */ m(a, {
|
|
57
|
+
role: "body-sm",
|
|
58
|
+
tone: n ? "muted" : "default",
|
|
59
|
+
children: [e.label, n && /* @__PURE__ */ p("span", {
|
|
60
|
+
className: "sr-only",
|
|
61
|
+
children: " (not included)"
|
|
62
|
+
})]
|
|
63
|
+
})]
|
|
64
|
+
}, e.id ?? t);
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ p(s, {
|
|
68
|
+
primaryAction: b,
|
|
69
|
+
secondaryAction: x,
|
|
70
|
+
className: "w-full"
|
|
71
|
+
}),
|
|
72
|
+
E
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
h.displayName = "PricingCard";
|
|
78
|
+
//#endregion
|
|
79
|
+
export { h as PricingCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pricing-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Size } from '../../shared';
|
|
2
|
+
/**
|
|
3
|
+
* Surface treatment of a pricing card.
|
|
4
|
+
* These map to the framework's card variants, so a pricing card looks like the
|
|
5
|
+
* rest of the surface system.
|
|
6
|
+
*/
|
|
7
|
+
export type PricingCardVariant = "bordered" | "elevated";
|
|
8
|
+
/**
|
|
9
|
+
* Theme configuration options for the PricingCard component.
|
|
10
|
+
*
|
|
11
|
+
* Set under `components.pricingcard` in the AsheeUI config. Values feed the
|
|
12
|
+
* component-level fallback tier of the theme cascade.
|
|
13
|
+
*/
|
|
14
|
+
export interface PricingCardConfig {
|
|
15
|
+
/** Surface treatment. @default "bordered" */
|
|
16
|
+
variant?: PricingCardVariant;
|
|
17
|
+
/** Density of the card padding. @default "lg" */
|
|
18
|
+
size?: Size;
|
|
19
|
+
/** Whether the card is the recommended plan. @default false */
|
|
20
|
+
highlighted?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Default config values registered for the PricingCard component.
|
|
24
|
+
*/
|
|
25
|
+
export declare const defaultPricingCardConfig: PricingCardConfig;
|
|
26
|
+
declare module "../../libs/registry" {
|
|
27
|
+
interface ComponentTypeConfigRegistry {
|
|
28
|
+
pricingcard: PricingCardConfig;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hard fallback values used when no config tier provides a value.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FALLBACK_PRICING_CARD_CONFIG: Required<PricingCardConfig>;
|
|
35
|
+
//# sourceMappingURL=pricing-card-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-card-config.d.ts","sourceRoot":"","sources":["../../../src/components/pricing-card/pricing-card-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B,iDAAiD;IACjD,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAItC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,WAAW,EAAE,iBAAiB,CAAC;KAChC;CACF;AAID;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,iBAAiB,CAIpE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/pricing-card/pricing-card-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
variant: "bordered",
|
|
6
|
+
size: "lg",
|
|
7
|
+
highlighted: !1
|
|
8
|
+
};
|
|
9
|
+
e("pricingcard", t);
|
|
10
|
+
var n = {
|
|
11
|
+
variant: "bordered",
|
|
12
|
+
size: "lg",
|
|
13
|
+
highlighted: !1
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as FALLBACK_PRICING_CARD_CONFIG, t as defaultPricingCardConfig };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PricingCard component styles for AsheeUI.
|
|
3
|
+
* This file provides the static class mappings for the PricingCard pattern.
|
|
4
|
+
*/
|
|
5
|
+
/** The price line, where the amount and the period sit on one baseline. */
|
|
6
|
+
export declare const PRICING_PRICE_CLASS = "flex items-baseline gap-1";
|
|
7
|
+
/** The list of included and excluded features. */
|
|
8
|
+
export declare const PRICING_FEATURES_CLASS = "flex flex-col gap-2";
|
|
9
|
+
/** One feature line. */
|
|
10
|
+
export declare const PRICING_FEATURE_CLASS = "flex items-start gap-2";
|
|
11
|
+
/** The marker of an included feature. */
|
|
12
|
+
export declare const PRICING_FEATURE_INCLUDED_CLASS = "mt-1 size-4 shrink-0 text-success";
|
|
13
|
+
/** The marker of an excluded feature. */
|
|
14
|
+
export declare const PRICING_FEATURE_EXCLUDED_CLASS = "mt-1 size-4 shrink-0 text-foreground/40";
|
|
15
|
+
/** The badge above the plan name. */
|
|
16
|
+
export declare const PRICING_BADGE_CLASS = "inline-flex w-fit items-center rounded-sm bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary";
|
|
17
|
+
/** The ring that marks the recommended plan. */
|
|
18
|
+
export declare const PRICING_HIGHLIGHTED_CLASS = "border-primary ring-1 ring-primary";
|
|
19
|
+
/** The body arrangement of the card. */
|
|
20
|
+
export declare const PRICING_BODY_CLASS = "flex flex-col gap-6";
|
|
21
|
+
//# sourceMappingURL=pricing-card-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing-card-styles.d.ts","sourceRoot":"","sources":["../../../src/components/pricing-card/pricing-card-styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,wBAAwB;AACxB,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D,yCAAyC;AACzC,eAAO,MAAM,8BAA8B,sCACN,CAAC;AAEtC,yCAAyC;AACzC,eAAO,MAAM,8BAA8B,4CACA,CAAC;AAE5C,qCAAqC;AACrC,eAAO,MAAM,mBAAmB,yGACwE,CAAC;AAEzG,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAE9E,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/components/pricing-card/pricing-card-styles.ts
|
|
3
|
+
var e = "flex items-baseline gap-1", t = "flex flex-col gap-2", n = "flex items-start gap-2", r = "mt-1 size-4 shrink-0 text-success", i = "mt-1 size-4 shrink-0 text-foreground/40", a = "inline-flex w-fit items-center rounded-sm bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary", o = "border-primary ring-1 ring-primary", s = "flex flex-col gap-6";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { a as PRICING_BADGE_CLASS, s as PRICING_BODY_CLASS, t as PRICING_FEATURES_CLASS, n as PRICING_FEATURE_CLASS, i as PRICING_FEATURE_EXCLUDED_CLASS, r as PRICING_FEATURE_INCLUDED_CLASS, o as PRICING_HIGHLIGHTED_CLASS, e as PRICING_PRICE_CLASS };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AAQA,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAKxB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAExC;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,eAAO,MAAM,UAAU,4GAuGtB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import { Space } from '../../shared';
|
|
3
|
+
import { SectionConfig } from './section-config';
|
|
4
|
+
type BaseSectionProps = SectionConfig & Omit<HTMLAttributes<HTMLElement>, "color">;
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Section component.
|
|
7
|
+
*/
|
|
8
|
+
export interface SectionProps extends BaseSectionProps {
|
|
9
|
+
/**
|
|
10
|
+
* Element to render.
|
|
11
|
+
* Defaults to `section`, which is the correct landmark when the section
|
|
12
|
+
* carries a heading. A section used purely for spacing should render a `div`
|
|
13
|
+
* through this prop, so the page does not gain an unnamed region.
|
|
14
|
+
*
|
|
15
|
+
* @default "section"
|
|
16
|
+
*/
|
|
17
|
+
as?: ElementType;
|
|
18
|
+
/**
|
|
19
|
+
* Vertical padding, from the shared spacing scale.
|
|
20
|
+
* Resolved through the standard cascade: prop, then
|
|
21
|
+
* `components.section.spacing`, then the framework fallback.
|
|
22
|
+
*
|
|
23
|
+
* @default "lg"
|
|
24
|
+
*/
|
|
25
|
+
spacing?: Space;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A full-width band with vertical rhythm.
|
|
29
|
+
*
|
|
30
|
+
* Section owns the vertical space between parts of a page and the background
|
|
31
|
+
* behind them. It does not own the maximum width unless asked to, so it composes
|
|
32
|
+
* either way round: a Section can contain a Container, or a Page can place a
|
|
33
|
+
* Container around several Sections.
|
|
34
|
+
*
|
|
35
|
+
* @param props - Section configuration options and element attributes.
|
|
36
|
+
* @param props.spacing - Vertical padding. Defaults to "lg".
|
|
37
|
+
* @param props.background - Background treatment. Defaults to "none".
|
|
38
|
+
* @param props.contained - Wrap the children in a Container. Defaults to false.
|
|
39
|
+
* @param props.containerSize - Container width when contained. Defaults to "lg".
|
|
40
|
+
* @param props.divider - Draw a separator above the section. Defaults to false.
|
|
41
|
+
* @param props.as - Element to render. Defaults to "section".
|
|
42
|
+
* @returns The rendered section.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <Section spacing="xl" background="muted" contained>
|
|
47
|
+
* <Typography role="heading-xl">Everything your team needs</Typography>
|
|
48
|
+
* </Section>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @see Container - Maximum width and gutter.
|
|
52
|
+
* @see PageContent - The application-page equivalent.
|
|
53
|
+
*/
|
|
54
|
+
export declare const Section: import('react').ForwardRefExoticComponent<SectionProps & import('react').RefAttributes<HTMLElement>>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/section/Section.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,KAAK,WAAW,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAKjE,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAO1B,KAAK,gBAAgB,GAAG,aAAa,GACnC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD;;;;;;;OAOG;IACH,EAAE,CAAC,EAAE,WAAW,CAAC;IAEjB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,OAAO,sGA0EnB,CAAC"}
|