asheeui 0.6.14 → 0.7.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 +1 -14
- package/dist/AsheeUIProvider.js +22 -24
- package/dist/components/accordion/Accordion.js +79 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/autocomplete/Autocomplete.js +78 -136
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +47 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.js +123 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/date-picker/Calendar.d.ts +3 -3
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +141 -222
- package/dist/components/date-picker/DatePicker.d.ts +5 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +122 -220
- package/dist/components/date-picker/TimeSpinner.js +58 -82
- package/dist/components/date-picker/date-picker-config.d.ts +4 -4
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -11
- package/dist/components/date-picker/date-picker-styles.js +44 -45
- package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.helpers.js +74 -102
- package/dist/components/drawer/Drawer.d.ts +26 -8
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/field/FieldShell.js +49 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/image/Image.d.ts +7 -7
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.js +55 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/modal/Modal.d.ts +26 -10
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -136
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +18 -2
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +149 -283
- package/dist/components/multi-select/multi-select-config.d.ts +23 -18
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/radio/Radio.js +43 -80
- package/dist/components/radio/RadioGroup.js +57 -155
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/select/Select.d.ts +3 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +97 -195
- package/dist/components/select/select-config.js +8 -9
- package/dist/components/select/select-styles.js +5 -5
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +102 -196
- package/dist/components/select-menu/select-menu-config.js +12 -12
- package/dist/components/select-menu/use-select-floating.d.ts +11 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +41 -48
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +146 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.js +62 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.js +82 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/config/default-config.js +11 -34
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.js +65 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +1 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/scripts/AsheeThemeScript.js +35 -44
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +12 -11
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
2
|
import { ButtonConfig } from './button-config';
|
|
3
3
|
/**
|
|
4
4
|
* Visual and behavioural options shared by button-like elements.
|
|
5
5
|
* This type combines the ButtonConfig with native button HTML attributes.
|
|
6
6
|
*/
|
|
7
7
|
type BaseButtonProps = ButtonConfig & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "disabled">;
|
|
8
|
+
/**
|
|
9
|
+
* Props for the button's link behaviour.
|
|
10
|
+
* Holds the instance-only link component and its props.
|
|
11
|
+
*/
|
|
12
|
+
export interface ButtonLinkProps {
|
|
13
|
+
/**
|
|
14
|
+
* Custom link component (e.g. `next/link`, TanStack Router `Link`).
|
|
15
|
+
* When provided, this component is used instead of the native `<a>` tag.
|
|
16
|
+
*/
|
|
17
|
+
component?: ElementType;
|
|
18
|
+
/**
|
|
19
|
+
* Additional props to pass to the link component (e.g. `{ prefetch: true }`).
|
|
20
|
+
* These take precedence over the button's own props.
|
|
21
|
+
*/
|
|
22
|
+
props?: Record<string, unknown>;
|
|
23
|
+
}
|
|
8
24
|
/**
|
|
9
25
|
* Configuration options for the Button component.
|
|
10
26
|
*
|
|
@@ -49,6 +65,16 @@ export interface ButtonProps extends BaseButtonProps {
|
|
|
49
65
|
* Typically an icon, badge, or adornment.
|
|
50
66
|
*/
|
|
51
67
|
endContent?: ReactNode;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the button as a link to this URL.
|
|
70
|
+
* The root element becomes an `<a>`, or `link.component` when provided.
|
|
71
|
+
*/
|
|
72
|
+
href?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Link configuration for the button.
|
|
75
|
+
* Provides the custom link component and props forwarded to it.
|
|
76
|
+
*/
|
|
77
|
+
link?: ButtonLinkProps;
|
|
52
78
|
}
|
|
53
79
|
/**
|
|
54
80
|
* A clickable element that triggers an action or event.
|
|
@@ -76,6 +102,8 @@ export interface ButtonProps extends BaseButtonProps {
|
|
|
76
102
|
* @param props.icon - Icon-only compact layout. Defaults to false.
|
|
77
103
|
* @param props.startContent - Content at the start of the button.
|
|
78
104
|
* @param props.endContent - Content at the end of the button.
|
|
105
|
+
* @param props.href - Renders the button as a link to this URL.
|
|
106
|
+
* @param props.link - Link configuration (custom component and props).
|
|
79
107
|
* @param props.children - Button label content.
|
|
80
108
|
* @param props.className - Extra CSS classes for the button.
|
|
81
109
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,WAAW,EAGhB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import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
e == null ? void 0 : e.radius,
|
|
50
|
-
t.defaultRadius,
|
|
51
|
-
s.radius
|
|
52
|
-
), O = r(
|
|
53
|
-
N,
|
|
54
|
-
e == null ? void 0 : e.animate,
|
|
55
|
-
s.animate,
|
|
56
|
-
s.animate
|
|
57
|
-
), U = r(
|
|
58
|
-
S,
|
|
59
|
-
e == null ? void 0 : e.fullWidth,
|
|
60
|
-
void 0,
|
|
61
|
-
s.fullWidth
|
|
62
|
-
), x = _ ? Z[n] : G[n], l = A || a, D = (m) => {
|
|
63
|
-
if (l) {
|
|
64
|
-
m.preventDefault();
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
i == null || i(m);
|
|
68
|
-
}, W = q(
|
|
69
|
-
"inline-flex items-center justify-center font-medium transition-colors select-none shrink-0",
|
|
70
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",
|
|
71
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
72
|
-
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
73
|
-
U && "w-full",
|
|
74
|
-
O && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]",
|
|
75
|
-
J(o, T),
|
|
76
|
-
x,
|
|
77
|
-
w(
|
|
78
|
-
c(o, z),
|
|
79
|
-
H,
|
|
80
|
-
c(o, s.radius)
|
|
81
|
-
),
|
|
82
|
-
L
|
|
83
|
-
);
|
|
84
|
-
return /* @__PURE__ */ j(
|
|
85
|
-
"button",
|
|
86
|
-
{
|
|
87
|
-
ref: v,
|
|
88
|
-
type: C,
|
|
89
|
-
disabled: l,
|
|
90
|
-
"aria-disabled": l,
|
|
91
|
-
"aria-busy": a,
|
|
92
|
-
onClick: D,
|
|
93
|
-
className: W,
|
|
94
|
-
...R,
|
|
95
|
-
children: [
|
|
96
|
-
a && /* @__PURE__ */ u(E, { className: n }),
|
|
97
|
-
a && /* @__PURE__ */ u("span", { className: "sr-only", children: "Loading" }),
|
|
98
|
-
!a && I,
|
|
99
|
-
!a && B,
|
|
100
|
-
!a && K
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
M.displayName = "Button";
|
|
107
|
-
export {
|
|
108
|
-
M as Button
|
|
109
|
-
};
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { RADIUS_CLASS as n, UnderlineRadius as r } from "../../shared/radius.js";
|
|
6
|
+
import { resolveVariantClass as i } from "../../shared/variant.js";
|
|
7
|
+
import { resolveCascade as a, resolveClassKey as o, resolveRadiusKey as s } from "../../utils/resolve-token.js";
|
|
8
|
+
import { Spinner as c } from "../spinner/spinner.js";
|
|
9
|
+
import { FALLBACK_BUTTON_CONFIG as l } from "./button-config.js";
|
|
10
|
+
import { BUTTON_ICON_SIZE_CLASS as u, BUTTON_SIZE_CLASS as d } from "./button-styles.js";
|
|
11
|
+
import { forwardRef as f } from "react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
13
|
+
//#region src/components/button/Button.tsx
|
|
14
|
+
var h = f((f, h) => {
|
|
15
|
+
let { variant: g, color: _, size: v, radius: y, animate: b, fullWidth: x, isDisabled: S, isLoading: C, icon: w, className: T, children: E, type: D = "button", onClick: O, startContent: k, endContent: A, href: j, link: M, ...N } = f, P = t(), F = P.components?.button, I = a(g, F?.variant, P.defaultVariant, l.variant), L = a(_, F?.color, P.defaultColor, l.color), R = a(v, F?.size, void 0, l.size), z = s(y, F?.radius, P.defaultRadius, l.radius), B = a(b, F?.animate, l.animate, l.animate), V = a(x, F?.fullWidth, void 0, l.fullWidth), H = w ? u[R] : d[R], U = S || C, W = !!(j || M), G = M?.component ?? (W ? "a" : "button"), { onClick: K, ...q } = M?.props ?? {}, J = (e) => {
|
|
16
|
+
if (U) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
O?.(e), K?.(e);
|
|
21
|
+
}, Y = e("inline-flex items-center justify-center font-medium transition-colors select-none shrink-0", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", "aria-disabled:pointer-events-none aria-disabled:opacity-50", V && "w-full", B && "motion-safe:transition-transform motion-safe:duration-100 motion-safe:active:scale-[0.99]", i(I, L), H, o(r(I, z), n, r(I, l.radius)), T);
|
|
22
|
+
return /* @__PURE__ */ m(G, {
|
|
23
|
+
ref: h,
|
|
24
|
+
...W ? { href: j } : {
|
|
25
|
+
type: D,
|
|
26
|
+
disabled: U
|
|
27
|
+
},
|
|
28
|
+
"aria-disabled": U,
|
|
29
|
+
"aria-busy": C,
|
|
30
|
+
onClick: J,
|
|
31
|
+
className: Y,
|
|
32
|
+
...N,
|
|
33
|
+
...q,
|
|
34
|
+
children: [
|
|
35
|
+
C && /* @__PURE__ */ p(c, { className: R }),
|
|
36
|
+
C && /* @__PURE__ */ p("span", {
|
|
37
|
+
className: "sr-only",
|
|
38
|
+
children: "Loading"
|
|
39
|
+
}),
|
|
40
|
+
!C && k,
|
|
41
|
+
!C && E,
|
|
42
|
+
!C && A
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
h.displayName = "Button";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { h as Button };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/button/button-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
animate: !0,
|
|
7
|
+
fullWidth: !1
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
i as FALLBACK_BUTTON_CONFIG,
|
|
19
|
-
e as defaultButtonConfig
|
|
9
|
+
e("button", t);
|
|
10
|
+
var n = {
|
|
11
|
+
size: "md",
|
|
12
|
+
variant: "bordered",
|
|
13
|
+
color: "primary",
|
|
14
|
+
radius: "md",
|
|
15
|
+
animate: !0,
|
|
16
|
+
fullWidth: !1
|
|
20
17
|
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as FALLBACK_BUTTON_CONFIG, t as defaultButtonConfig };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region src/components/button/button-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "h-8 px-3 text-xs gap-1.5",
|
|
5
|
+
md: "h-9 px-3.5 text-xs sm:h-10 sm:px-4 sm:text-sm gap-2",
|
|
6
|
+
lg: "h-11 px-5 text-sm sm:h-12 sm:px-6 sm:text-base gap-2.5"
|
|
6
7
|
}, t = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
t as BUTTON_ICON_SIZE_CLASS,
|
|
13
|
-
s as BUTTON_SIZE_CLASS
|
|
8
|
+
sm: "size-8 p-0 text-xs gap-0",
|
|
9
|
+
md: "size-9 sm:size-10 p-0 text-xs sm:text-sm gap-0",
|
|
10
|
+
lg: "size-11 sm:size-12 p-0 text-sm sm:text-base gap-0"
|
|
14
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as BUTTON_ICON_SIZE_CLASS, e as BUTTON_SIZE_CLASS };
|
|
@@ -23,6 +23,30 @@ export interface CardImageProps extends CardImageConfig {
|
|
|
23
23
|
* the native `<img>` tag (e.g. `next/image`).
|
|
24
24
|
*/
|
|
25
25
|
component?: ElementType;
|
|
26
|
+
/**
|
|
27
|
+
* Additional props forwarded to the image component
|
|
28
|
+
* (e.g. `{ priority: true, sizes: "..." }`).
|
|
29
|
+
* These take precedence over the component's own props.
|
|
30
|
+
*/
|
|
31
|
+
props?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface CardLinkConfig {
|
|
34
|
+
}
|
|
35
|
+
export interface CardLinkProps extends CardLinkConfig {
|
|
36
|
+
/**
|
|
37
|
+
* Custom link component used to render the card as a link instead of the
|
|
38
|
+
* native `<a>` tag (e.g. `next/link`, TanStack Router `Link`).
|
|
39
|
+
*
|
|
40
|
+
* When provided, the card root becomes this component and `props` are
|
|
41
|
+
* forwarded to it.
|
|
42
|
+
*/
|
|
43
|
+
component?: ElementType;
|
|
44
|
+
/**
|
|
45
|
+
* Additional props forwarded to the link component
|
|
46
|
+
* (e.g. `{ href: "/blog/post-1" }`).
|
|
47
|
+
* These take precedence over the component's own props.
|
|
48
|
+
*/
|
|
49
|
+
props?: Record<string, unknown>;
|
|
26
50
|
}
|
|
27
51
|
/**
|
|
28
52
|
* Configuration options for the Card component.
|
|
@@ -31,7 +55,7 @@ export interface CardProps extends BaseCardProps {
|
|
|
31
55
|
/**
|
|
32
56
|
* Whether the card is clickable.
|
|
33
57
|
* When true, the card becomes interactive with hover and focus states.
|
|
34
|
-
* This is automatically enabled when
|
|
58
|
+
* This is automatically enabled when link or onClick is provided.
|
|
35
59
|
*
|
|
36
60
|
* @default false
|
|
37
61
|
*/
|
|
@@ -44,10 +68,11 @@ export interface CardProps extends BaseCardProps {
|
|
|
44
68
|
*/
|
|
45
69
|
isDisabled?: boolean;
|
|
46
70
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
71
|
+
* Link configuration for the card.
|
|
72
|
+
* When provided, the card root renders as the given link component
|
|
73
|
+
* (e.g. `next/link`) with `props` forwarded to it.
|
|
49
74
|
*/
|
|
50
|
-
|
|
75
|
+
link?: CardLinkProps;
|
|
51
76
|
/**
|
|
52
77
|
* Heading content rendered above the body.
|
|
53
78
|
* Typically a string or React element.
|
|
@@ -75,14 +100,10 @@ export interface CardProps extends BaseCardProps {
|
|
|
75
100
|
footer?: ReactNode;
|
|
76
101
|
/**
|
|
77
102
|
* Image configuration for the card.
|
|
78
|
-
* Includes src, alt, position, ratio, fit,
|
|
103
|
+
* Includes src, alt, position, ratio, fit, loading, the custom image
|
|
104
|
+
* component, and props forwarded to it.
|
|
79
105
|
*/
|
|
80
106
|
image?: CardImageProps;
|
|
81
|
-
/**
|
|
82
|
-
* Additional props forwarded to `imageComponent`
|
|
83
|
-
* (e.g. `{ priority: true, sizes: "..." }`).
|
|
84
|
-
*/
|
|
85
|
-
imageProps?: Record<string, unknown>;
|
|
86
107
|
/**
|
|
87
108
|
* Card body content, used when `body` is not provided.
|
|
88
109
|
*/
|
|
@@ -96,7 +117,7 @@ export interface CardProps extends BaseCardProps {
|
|
|
96
117
|
* footer regions. Visual tokens (`variant`, `size`, `radius`,
|
|
97
118
|
* `animate`, `isClickable`) resolve through the standard AsheeUI
|
|
98
119
|
* cascade. When `isClickable` is enabled, the card becomes keyboard
|
|
99
|
-
* accessible and adopts link or button semantics based on `
|
|
120
|
+
* accessible and adopts link or button semantics based on `link`.
|
|
100
121
|
*
|
|
101
122
|
* The component automatically handles accessibility attributes including
|
|
102
123
|
* role, tabIndex, aria-disabled, and proper keyboard interaction with
|
|
@@ -109,14 +130,13 @@ export interface CardProps extends BaseCardProps {
|
|
|
109
130
|
* @param props.animate - Press animation. Defaults to true.
|
|
110
131
|
* @param props.isClickable - Interactive behaviour. Defaults to false.
|
|
111
132
|
* @param props.isDisabled - Disabled state. Defaults to false.
|
|
112
|
-
* @param props.
|
|
133
|
+
* @param props.link - Link configuration for the card (component and props).
|
|
113
134
|
* @param props.title - Heading content.
|
|
114
135
|
* @param props.description - Supporting text.
|
|
115
136
|
* @param props.header - Custom header node.
|
|
116
137
|
* @param props.body - Explicit body content.
|
|
117
138
|
* @param props.footer - Footer node.
|
|
118
|
-
* @param props.image - Image configuration object containing src, alt, position, ratio, fit, and
|
|
119
|
-
* @param props.imageProps - Props forwarded to the image component.
|
|
139
|
+
* @param props.image - Image configuration object containing src, alt, position, ratio, fit, loading, component and props.
|
|
120
140
|
* @param props.children - Card body content.
|
|
121
141
|
* @param props.className - Extra CSS classes for the card.
|
|
122
142
|
* @param props.id - HTML id attribute.
|
|
@@ -146,10 +166,10 @@ export interface CardProps extends BaseCardProps {
|
|
|
146
166
|
*
|
|
147
167
|
* @example
|
|
148
168
|
* ```tsx
|
|
149
|
-
* // Clickable card with image
|
|
169
|
+
* // Clickable card with image and a custom link component
|
|
150
170
|
* <Card
|
|
151
171
|
* isClickable
|
|
152
|
-
* href
|
|
172
|
+
* link={{ component: NextLink, props: { href: "/blog/post-1" } }}
|
|
153
173
|
* image={{
|
|
154
174
|
* src: "/images/post-1.jpg",
|
|
155
175
|
* alt: "Blog post cover",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/card/Card.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EAGnB,KAAK,SAAS,EAEf,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