klun-ui 0.1.10 → 0.1.11
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 +2 -2
- package/dist/{chunk-VFEV4TOL.cjs → chunk-F7D5VPDL.cjs} +53 -2
- package/dist/chunk-F7D5VPDL.cjs.map +1 -0
- package/dist/{chunk-Y5BGEO2J.js → chunk-N4NBEKYR.js} +53 -3
- package/dist/chunk-N4NBEKYR.js.map +1 -0
- package/dist/index.cjs +151 -147
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +76 -0
- package/dist/templates/index.cjs +1047 -82
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +3 -1
- package/dist/templates/index.d.ts +3 -1
- package/dist/templates/index.js +966 -2
- package/dist/templates/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-VFEV4TOL.cjs.map +0 -1
- package/dist/chunk-Y5BGEO2J.js.map +0 -1
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ You can also override tokens directly:
|
|
|
75
75
|
| **Feedback** | Alert, Banner, InlineTip, Toast, NotificationItem, ProgressBar, GaugeBar, CircularProgress, SegmentedProgress, Spinner, Skeleton, EmptyState |
|
|
76
76
|
| **Navigation** | Tabs, SegmentedControl, Breadcrumb, Pagination, StepIndicator, Divider, ContentDivider, HorizontalFilter, PageHeader |
|
|
77
77
|
| **Overlays** | Modal, Drawer, Dropdown, Popover, CommandMenu |
|
|
78
|
-
| **Disclosure** | Accordion |
|
|
78
|
+
| **Disclosure** | Accordion, Collapse |
|
|
79
79
|
| **Layout** | Card, ContentCard, FeatureCard |
|
|
80
80
|
|
|
81
81
|
All components and their prop types are named exports; a `cx` classnames helper is exported too.
|
|
@@ -86,7 +86,7 @@ Full-screen example compositions are available from the `klun-ui/templates` subp
|
|
|
86
86
|
|
|
87
87
|
```tsx
|
|
88
88
|
import "klun-ui/styles.css";
|
|
89
|
-
import { DashboardTemplate, AIAssistantTemplate, CryptoTemplate, MarketingTemplate } from "klun-ui/templates";
|
|
89
|
+
import { DashboardTemplate, AIAssistantTemplate, AgentChatTemplate, CryptoTemplate, MarketingTemplate } from "klun-ui/templates";
|
|
90
90
|
|
|
91
91
|
export default function App() {
|
|
92
92
|
return <DashboardTemplate />;
|
|
@@ -5018,6 +5018,56 @@ var Accordion = react.forwardRef(function Accordion2({ items: items2 = [], defau
|
|
|
5018
5018
|
}) });
|
|
5019
5019
|
});
|
|
5020
5020
|
Accordion.displayName = "Accordion";
|
|
5021
|
+
var Collapse = react.forwardRef(function Collapse2({
|
|
5022
|
+
title,
|
|
5023
|
+
icon,
|
|
5024
|
+
extra,
|
|
5025
|
+
defaultOpen = false,
|
|
5026
|
+
open,
|
|
5027
|
+
onOpenChange,
|
|
5028
|
+
hideChevron = false,
|
|
5029
|
+
contentStyle,
|
|
5030
|
+
contentClassName,
|
|
5031
|
+
className,
|
|
5032
|
+
children,
|
|
5033
|
+
...props
|
|
5034
|
+
}, ref) {
|
|
5035
|
+
const isControlled = open !== void 0;
|
|
5036
|
+
const [internal, setInternal] = react.useState(defaultOpen);
|
|
5037
|
+
const isOpen = isControlled ? open : internal;
|
|
5038
|
+
const toggle = () => {
|
|
5039
|
+
const next = !isOpen;
|
|
5040
|
+
if (!isControlled) setInternal(next);
|
|
5041
|
+
onOpenChange?.(next);
|
|
5042
|
+
};
|
|
5043
|
+
const onKeyDown = (e) => {
|
|
5044
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
5045
|
+
e.preventDefault();
|
|
5046
|
+
toggle();
|
|
5047
|
+
}
|
|
5048
|
+
};
|
|
5049
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkTPGAXYFU_cjs.cx("klun-collapse", className), "data-state": isOpen ? "open" : "closed", ...props, children: [
|
|
5050
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5051
|
+
"div",
|
|
5052
|
+
{
|
|
5053
|
+
className: "klun-collapse__trigger",
|
|
5054
|
+
role: "button",
|
|
5055
|
+
tabIndex: 0,
|
|
5056
|
+
"aria-expanded": isOpen,
|
|
5057
|
+
onClick: toggle,
|
|
5058
|
+
onKeyDown,
|
|
5059
|
+
children: [
|
|
5060
|
+
icon != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-collapse__icon", children: icon }) : null,
|
|
5061
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-collapse__title", children: title }),
|
|
5062
|
+
extra != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-collapse__extra", onClick: (e) => e.stopPropagation(), children: extra }) : null,
|
|
5063
|
+
!hideChevron ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "klun-collapse__chevron", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 8l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : null
|
|
5064
|
+
]
|
|
5065
|
+
}
|
|
5066
|
+
),
|
|
5067
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "klun-collapse__panel", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkTPGAXYFU_cjs.cx("klun-collapse__content", contentClassName), style: contentStyle, children }) })
|
|
5068
|
+
] });
|
|
5069
|
+
});
|
|
5070
|
+
Collapse.displayName = "Collapse";
|
|
5021
5071
|
var Alert = react.forwardRef(function Alert2({ status = "information", variant = "lighter", icon, title, action, onClose, className, children, ...props }, ref) {
|
|
5022
5072
|
const { alert } = useLocale();
|
|
5023
5073
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10636,6 +10686,7 @@ exports.Chip = Chip;
|
|
|
10636
10686
|
exports.CircularProgress = CircularProgress;
|
|
10637
10687
|
exports.CodeViewer = CodeViewer;
|
|
10638
10688
|
exports.Col = Col;
|
|
10689
|
+
exports.Collapse = Collapse;
|
|
10639
10690
|
exports.ColorDot = ColorDot;
|
|
10640
10691
|
exports.ColorPicker = ColorPicker;
|
|
10641
10692
|
exports.ColorSlider = ColorSlider;
|
|
@@ -10758,5 +10809,5 @@ exports.useSize = useSize;
|
|
|
10758
10809
|
exports.viVN = viVN;
|
|
10759
10810
|
exports.zhCN = zhCN;
|
|
10760
10811
|
exports.zhTW = zhTW;
|
|
10761
|
-
//# sourceMappingURL=chunk-
|
|
10762
|
-
//# sourceMappingURL=chunk-
|
|
10812
|
+
//# sourceMappingURL=chunk-F7D5VPDL.cjs.map
|
|
10813
|
+
//# sourceMappingURL=chunk-F7D5VPDL.cjs.map
|