klun-ui 0.1.12 → 0.1.13
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/CHANGELOG.md +16 -0
- package/dist/{chunk-3XJ5FN4P.js → chunk-O2CR4NDQ.js} +48 -7
- package/dist/chunk-O2CR4NDQ.js.map +1 -0
- package/dist/{chunk-7FELOLAD.cjs → chunk-Y2R5PBYN.cjs} +48 -6
- package/dist/chunk-Y2R5PBYN.cjs.map +1 -0
- package/dist/index.cjs +152 -148
- package/dist/index.d.cts +39 -5
- package/dist/index.d.ts +39 -5
- package/dist/index.js +1 -1
- package/dist/styles.css +28 -0
- package/dist/templates/index.cjs +89 -89
- package/dist/templates/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3XJ5FN4P.js.map +0 -1
- package/dist/chunk-7FELOLAD.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to **klun-ui** are documented here. The format follows
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/) (pre-1.0: minor/patch bumps may carry
|
|
6
6
|
small breaking changes).
|
|
7
7
|
|
|
8
|
+
## [0.1.13] — 2026-06-23
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **`CheckboxGroup` — a set of checkboxes bound to a `string[]` value.**
|
|
12
|
+
antd-aligned API: `options` (a bare string is shorthand for
|
|
13
|
+
`{ label, value }`, or pass `{ label, value, disabled }`), controlled
|
|
14
|
+
`value`/`onChange` or uncontrolled `defaultValue`, `direction`
|
|
15
|
+
(`"horizontal"` | `"vertical"`), `size`, and a group-level `disabled`.
|
|
16
|
+
- **`Checkbox` now renders an optional label.** Pass `children` to show text
|
|
17
|
+
next to the box (backward compatible — box-only usage is unchanged).
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **`Drawer` default size is now `50%`** of the viewport along the slide axis
|
|
21
|
+
(was a fixed `378px`) for both `width` and `height`. Pass an explicit
|
|
22
|
+
`width`/`height` (number or string) to override.
|
|
23
|
+
|
|
8
24
|
## [0.1.10] — 2026-06-21
|
|
9
25
|
|
|
10
26
|
### Added
|
|
@@ -6014,7 +6014,7 @@ var CharacterCounter = forwardRef(
|
|
|
6014
6014
|
}
|
|
6015
6015
|
);
|
|
6016
6016
|
CharacterCounter.displayName = "CharacterCounter";
|
|
6017
|
-
var Checkbox = forwardRef(function Checkbox2({ indeterminate = false, disabled = false, error = false, size: sizeProp, onChange, className, style, ...props }, ref) {
|
|
6017
|
+
var Checkbox = forwardRef(function Checkbox2({ indeterminate = false, disabled = false, error = false, size: sizeProp, onChange, className, style, children, ...props }, ref) {
|
|
6018
6018
|
const size = useSize(sizeProp);
|
|
6019
6019
|
const innerRef = useRef(null);
|
|
6020
6020
|
const setRef = (node) => {
|
|
@@ -6033,6 +6033,7 @@ var Checkbox = forwardRef(function Checkbox2({ indeterminate = false, disabled =
|
|
|
6033
6033
|
`klun-checkbox--${size}`,
|
|
6034
6034
|
disabled && "klun-checkbox--disabled",
|
|
6035
6035
|
error && "klun-checkbox--error",
|
|
6036
|
+
children != null && children !== false && "klun-checkbox--with-label",
|
|
6036
6037
|
className
|
|
6037
6038
|
),
|
|
6038
6039
|
style,
|
|
@@ -6052,12 +6053,52 @@ var Checkbox = forwardRef(function Checkbox2({ indeterminate = false, disabled =
|
|
|
6052
6053
|
/* @__PURE__ */ jsxs("span", { className: "klun-checkbox__box", "aria-hidden": true, children: [
|
|
6053
6054
|
/* @__PURE__ */ jsx("svg", { className: "klun-checkbox__check", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M3.5 8.5l3 3 6-6.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
6054
6055
|
/* @__PURE__ */ jsx("svg", { className: "klun-checkbox__dash", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M3.5 8h9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
6055
|
-
] })
|
|
6056
|
+
] }),
|
|
6057
|
+
children != null && children !== false && /* @__PURE__ */ jsx("span", { className: "klun-checkbox__label", children })
|
|
6056
6058
|
]
|
|
6057
6059
|
}
|
|
6058
6060
|
);
|
|
6059
6061
|
});
|
|
6060
6062
|
Checkbox.displayName = "Checkbox";
|
|
6063
|
+
var CheckboxGroup = forwardRef(function CheckboxGroup2({ options, value, defaultValue, onChange, disabled = false, size, name, direction = "horizontal", className, style, children }, ref) {
|
|
6064
|
+
const [internal, setInternal] = useState(defaultValue ?? []);
|
|
6065
|
+
const controlled = value != null;
|
|
6066
|
+
const current = controlled ? value : internal;
|
|
6067
|
+
const toggle = (val, checked) => {
|
|
6068
|
+
const next = checked ? [...current, val] : current.filter((v) => v !== val);
|
|
6069
|
+
if (!controlled) setInternal(next);
|
|
6070
|
+
onChange?.(next);
|
|
6071
|
+
};
|
|
6072
|
+
const norm2 = (options ?? []).map(
|
|
6073
|
+
(o) => typeof o === "string" ? { label: o, value: o } : o
|
|
6074
|
+
);
|
|
6075
|
+
return /* @__PURE__ */ jsxs(
|
|
6076
|
+
"div",
|
|
6077
|
+
{
|
|
6078
|
+
ref,
|
|
6079
|
+
role: "group",
|
|
6080
|
+
className: cx("klun-checkbox-group", `klun-checkbox-group--${direction}`, className),
|
|
6081
|
+
style,
|
|
6082
|
+
children: [
|
|
6083
|
+
norm2.map((o) => /* @__PURE__ */ jsx(
|
|
6084
|
+
Checkbox,
|
|
6085
|
+
{
|
|
6086
|
+
name,
|
|
6087
|
+
size,
|
|
6088
|
+
value: o.value,
|
|
6089
|
+
checked: current.includes(o.value),
|
|
6090
|
+
disabled: disabled || o.disabled,
|
|
6091
|
+
onChange: (checked) => toggle(o.value, checked),
|
|
6092
|
+
children: o.label
|
|
6093
|
+
},
|
|
6094
|
+
o.value
|
|
6095
|
+
)),
|
|
6096
|
+
children
|
|
6097
|
+
]
|
|
6098
|
+
}
|
|
6099
|
+
);
|
|
6100
|
+
});
|
|
6101
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
6061
6102
|
var CheckboxCard = forwardRef(
|
|
6062
6103
|
function CheckboxCard2({
|
|
6063
6104
|
title,
|
|
@@ -10089,8 +10130,8 @@ var Drawer = forwardRef(function Drawer2({
|
|
|
10089
10130
|
title,
|
|
10090
10131
|
placement,
|
|
10091
10132
|
side,
|
|
10092
|
-
width =
|
|
10093
|
-
height =
|
|
10133
|
+
width = "50%",
|
|
10134
|
+
height = "50%",
|
|
10094
10135
|
size = "default",
|
|
10095
10136
|
closable = true,
|
|
10096
10137
|
maskClosable = true,
|
|
@@ -10678,6 +10719,6 @@ var Popconfirm = forwardRef(function Popconfirm2({
|
|
|
10678
10719
|
});
|
|
10679
10720
|
Popconfirm.displayName = "Popconfirm";
|
|
10680
10721
|
|
|
10681
|
-
export { Accordion, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu2 as ContextMenu, CopyButton, CounterInput, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DigitInput, Divider, Drawer, Dropdown, ExpiryCountdown, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, Kbd, KeyIcon, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListItem, LiveDot, LogViewer, Masonry, Menu, Message, Modal, Money, Notification, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, Radio, RadioCard, RangeSlider, Rating, RelativeTime, RichEditorToolbar, Row, SegmentedControl, SegmentedProgress, Select, SelectMenu, Skeleton, Slider, Space, Spinner2 as Spinner, Splitter2 as Splitter, SplitterPanel, Statistic, StatusBadge, StatusDot, StepIndicator, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Tooltip, Tree, Wizard, arSA, deDE, enUS, esES, fmt, frFR, idID, itIT, jaJP, koKR, locales, nlNL, plPL, primaryColorVars, ptBR, ruRU, toast, trTR, useBreakpoint, useConfig, useContextMenu, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, viVN, zhCN, zhTW };
|
|
10682
|
-
//# sourceMappingURL=chunk-
|
|
10683
|
-
//# sourceMappingURL=chunk-
|
|
10722
|
+
export { Accordion, Alert, AutoComplete, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, BulkAction, BulkActionBar, Button, ButtonGroup, Card, Carousel, Cascader, CharacterCounter, ChartLegend, ChartTooltip, Checkbox, CheckboxCard, CheckboxGroup, Chip, CircularProgress, CodeViewer, Col, Collapse, ColorDot, ColorPicker, ColorSlider, CommandMenu, CompactSelect, CompactSelectForInput, ConfigProvider, Confirm, ContentLabel, ContextMenu2 as ContextMenu, CopyButton, CounterInput, DatePicker, DateRangePicker, DateTimePicker, Descriptions, DigitInput, Divider, Drawer, Dropdown, ExpiryCountdown, FileUpload, Flex, Form, FormItem, FormList, Format, GaugeBar, Grid, Hint, HorizontalFilter, ImageUpload, ImageViewer, InlineInput, InlineSelect, Input, Kbd, KeyIcon, Label, Layout, LayoutContent, LayoutFooter, LayoutHeader, LayoutSider, List, ListItem, LiveDot, LogViewer, Masonry, Menu, Message, Modal, Money, Notification, Pagination, PasswordStrength, Popconfirm, Popover, ProgressBar, Radio, RadioCard, RangeSlider, Rating, RelativeTime, RichEditorToolbar, Row, SegmentedControl, SegmentedProgress, Select, SelectMenu, Skeleton, Slider, Space, Spinner2 as Spinner, Splitter2 as Splitter, SplitterPanel, Statistic, StatusBadge, StatusDot, StepIndicator, Switch, Table, Tabs, Tag, Textarea, TimePicker, Timeline, Toast, Toaster, Tooltip, Tree, Wizard, arSA, deDE, enUS, esES, fmt, frFR, idID, itIT, jaJP, koKR, locales, nlNL, plPL, primaryColorVars, ptBR, ruRU, toast, trTR, useBreakpoint, useConfig, useContextMenu, useForm, useLocale, useMappedSize, useMessage, useNotification, useSize, viVN, zhCN, zhTW };
|
|
10723
|
+
//# sourceMappingURL=chunk-O2CR4NDQ.js.map
|
|
10724
|
+
//# sourceMappingURL=chunk-O2CR4NDQ.js.map
|