@kkcompany/app-ui 0.1.23 → 0.1.25
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/dist/index.cjs +16 -8
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +16 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -236,12 +236,19 @@ const Menu = ({ menuTitle, items, activeIndex = -1, onClickItem, onClickClose })
|
|
|
236
236
|
children: items.map((item, index) => {
|
|
237
237
|
const { id, label, route, value } = item;
|
|
238
238
|
const isActive = activeIndex === index;
|
|
239
|
-
return /* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsx)("li", {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
return /* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsx)("li", {
|
|
240
|
+
className: isActive ? "kks-dropdown__menu-item--active" : "",
|
|
241
|
+
children: /* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsxs)("a", {
|
|
242
|
+
className: "item-row kks-dropdown__menu-link",
|
|
243
|
+
href: route || "#",
|
|
244
|
+
onClick: onClickItem(item, index),
|
|
245
|
+
"data-value": value,
|
|
246
|
+
children: [/* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsx)("span", {
|
|
247
|
+
className: "font text-truncate",
|
|
248
|
+
children: label || value
|
|
249
|
+
}), isActive && /* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsx)("span", { className: "icon kks-dropdown__check-icon" })]
|
|
250
|
+
})
|
|
251
|
+
}, `item_${id || value || index}`);
|
|
245
252
|
})
|
|
246
253
|
})]
|
|
247
254
|
})
|
|
@@ -275,13 +282,14 @@ const Dropdown = ({ className, options = [], value = null, activeIndex = -1, pla
|
|
|
275
282
|
let selectedIndex = options.findIndex((item) => value && item.value === value);
|
|
276
283
|
if (selectedIndex === -1) selectedIndex = activeIndex;
|
|
277
284
|
const selectedOption = options[selectedIndex];
|
|
285
|
+
const selectedLabel = selectedOption?.label || selectedOption?.value;
|
|
278
286
|
return /* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsxs)("div", {
|
|
279
287
|
css: dropdownStyle,
|
|
280
|
-
className
|
|
288
|
+
className: `kks-dropdown ${className || ""}`,
|
|
281
289
|
ref: dropdownRef,
|
|
282
290
|
children: [/* @__PURE__ */ (0, __emotion_react_jsx_runtime.jsx)(Button, {
|
|
283
291
|
showMenu,
|
|
284
|
-
label:
|
|
292
|
+
label: selectedLabel,
|
|
285
293
|
placeholder,
|
|
286
294
|
disabled,
|
|
287
295
|
onClick: toggleMenu
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSObject } from "@emotion/react";
|
|
2
2
|
import { ElementType, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _emotion_react_jsx_runtime1 from "@emotion/react/jsx-runtime";
|
|
4
4
|
import Link from "next/link";
|
|
5
5
|
|
|
6
6
|
//#region src/Dropdown.d.ts
|
|
@@ -54,7 +54,7 @@ declare const HiddenToggle: ({
|
|
|
54
54
|
defaultEnabled?: boolean;
|
|
55
55
|
children: any;
|
|
56
56
|
onChange: any;
|
|
57
|
-
}) =>
|
|
57
|
+
}) => _emotion_react_jsx_runtime1.JSX.Element;
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/Icon.d.ts
|
|
60
60
|
declare const Icon: ({
|
|
@@ -63,7 +63,7 @@ declare const Icon: ({
|
|
|
63
63
|
}: {
|
|
64
64
|
style?: {};
|
|
65
65
|
src: any;
|
|
66
|
-
}) =>
|
|
66
|
+
}) => _emotion_react_jsx_runtime1.JSX.Element;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/SeeMore.d.ts
|
|
69
69
|
declare const defaultMessages: {
|
|
@@ -79,7 +79,7 @@ declare const SeeMore: ({
|
|
|
79
79
|
style?: CSSObject;
|
|
80
80
|
messages?: typeof defaultMessages;
|
|
81
81
|
children?: ReactNode;
|
|
82
|
-
}) =>
|
|
82
|
+
}) => _emotion_react_jsx_runtime1.JSX.Element;
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/VideoItem.d.ts
|
|
85
85
|
type VideoDetail = {
|
|
@@ -143,6 +143,6 @@ declare const VideoThumbnail: ({
|
|
|
143
143
|
Image?: ElementType;
|
|
144
144
|
};
|
|
145
145
|
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
146
|
-
}) =>
|
|
146
|
+
}) => _emotion_react_jsx_runtime1.JSX.Element;
|
|
147
147
|
//#endregion
|
|
148
148
|
export { Dropdown, HiddenToggle, Icon, SeeMore, VideoItem, VideoThumbnail };
|
package/dist/index.mjs
CHANGED
|
@@ -236,12 +236,19 @@ const Menu = ({ menuTitle, items, activeIndex = -1, onClickItem, onClickClose })
|
|
|
236
236
|
children: items.map((item, index) => {
|
|
237
237
|
const { id, label, route, value } = item;
|
|
238
238
|
const isActive = activeIndex === index;
|
|
239
|
-
return /* @__PURE__ */ jsx("li", {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
return /* @__PURE__ */ jsx("li", {
|
|
240
|
+
className: isActive ? "kks-dropdown__menu-item--active" : "",
|
|
241
|
+
children: /* @__PURE__ */ jsxs("a", {
|
|
242
|
+
className: "item-row kks-dropdown__menu-link",
|
|
243
|
+
href: route || "#",
|
|
244
|
+
onClick: onClickItem(item, index),
|
|
245
|
+
"data-value": value,
|
|
246
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
247
|
+
className: "font text-truncate",
|
|
248
|
+
children: label || value
|
|
249
|
+
}), isActive && /* @__PURE__ */ jsx("span", { className: "icon kks-dropdown__check-icon" })]
|
|
250
|
+
})
|
|
251
|
+
}, `item_${id || value || index}`);
|
|
245
252
|
})
|
|
246
253
|
})]
|
|
247
254
|
})
|
|
@@ -275,13 +282,14 @@ const Dropdown = ({ className, options = [], value = null, activeIndex = -1, pla
|
|
|
275
282
|
let selectedIndex = options.findIndex((item) => value && item.value === value);
|
|
276
283
|
if (selectedIndex === -1) selectedIndex = activeIndex;
|
|
277
284
|
const selectedOption = options[selectedIndex];
|
|
285
|
+
const selectedLabel = selectedOption?.label || selectedOption?.value;
|
|
278
286
|
return /* @__PURE__ */ jsxs("div", {
|
|
279
287
|
css: dropdownStyle,
|
|
280
|
-
className
|
|
288
|
+
className: `kks-dropdown ${className || ""}`,
|
|
281
289
|
ref: dropdownRef,
|
|
282
290
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
283
291
|
showMenu,
|
|
284
|
-
label:
|
|
292
|
+
label: selectedLabel,
|
|
285
293
|
placeholder,
|
|
286
294
|
disabled,
|
|
287
295
|
onClick: toggleMenu
|