@deepnoid/ui 0.0.105 → 0.0.107

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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-S4DTK5GI.mjs → chunk-BEPW5BXD.mjs} +1 -1
  3. package/dist/{chunk-FNPWLOGV.mjs → chunk-HFJF2TTY.mjs} +337 -336
  4. package/dist/chunk-L3EXRVWC.mjs +12813 -0
  5. package/dist/chunk-LXPWTJ3F.mjs +58 -0
  6. package/dist/{chunk-R2E7UZZO.mjs → chunk-QGZEHOKA.mjs} +2 -1
  7. package/dist/components/accordion/accordion.test.js +337 -335
  8. package/dist/components/accordion/accordion.test.mjs +1 -1
  9. package/dist/components/button/button-group.test.js +337 -335
  10. package/dist/components/button/button-group.test.mjs +2 -2
  11. package/dist/components/button/button.test.js +7296 -443
  12. package/dist/components/button/button.test.mjs +2 -2
  13. package/dist/components/card/card.test.js +337 -335
  14. package/dist/components/card/card.test.mjs +1 -1
  15. package/dist/components/checkbox/checkbox.test.js +337 -335
  16. package/dist/components/checkbox/checkbox.test.mjs +2 -2
  17. package/dist/components/dateTimePicker/dateTimePicker.mjs +2 -2
  18. package/dist/components/dateTimePicker/index.mjs +2 -2
  19. package/dist/components/dropdown/dropdown.d.mts +121 -0
  20. package/dist/components/dropdown/dropdown.d.ts +121 -0
  21. package/dist/components/dropdown/dropdown.js +122 -0
  22. package/dist/components/dropdown/dropdown.mjs +10 -0
  23. package/dist/components/dropdown/dropdown.test.d.mts +2 -0
  24. package/dist/components/dropdown/dropdown.test.d.ts +2 -0
  25. package/dist/components/dropdown/dropdown.test.js +12997 -0
  26. package/dist/components/dropdown/dropdown.test.mjs +25 -0
  27. package/dist/components/dropdown/index.d.mts +5 -0
  28. package/dist/components/dropdown/index.d.ts +5 -0
  29. package/dist/components/dropdown/index.js +128 -0
  30. package/dist/components/dropdown/index.mjs +10 -0
  31. package/dist/components/input/input.test.js +7296 -443
  32. package/dist/components/input/input.test.mjs +2 -2
  33. package/dist/components/list/list.test.js +337 -335
  34. package/dist/components/list/list.test.mjs +1 -1
  35. package/dist/components/modal/modal.test.js +337 -335
  36. package/dist/components/modal/modal.test.mjs +1 -1
  37. package/dist/components/pagination/pagination.test.js +337 -335
  38. package/dist/components/pagination/pagination.test.mjs +1 -1
  39. package/dist/components/progress/progress.test.js +337 -335
  40. package/dist/components/progress/progress.test.mjs +1 -1
  41. package/dist/components/radio/radio.test.js +337 -335
  42. package/dist/components/radio/radio.test.mjs +1 -1
  43. package/dist/components/select/select.test.js +337 -335
  44. package/dist/components/select/select.test.mjs +2 -2
  45. package/dist/components/slider/slider.test.js +337 -335
  46. package/dist/components/slider/slider.test.mjs +1 -1
  47. package/dist/components/switch/switch.test.js +337 -335
  48. package/dist/components/switch/switch.test.mjs +1 -1
  49. package/dist/components/table/index.js +2 -1
  50. package/dist/components/table/index.mjs +1 -1
  51. package/dist/components/table/table.js +2 -1
  52. package/dist/components/table/table.mjs +1 -1
  53. package/dist/components/table/table.test.js +339 -336
  54. package/dist/components/table/table.test.mjs +2 -2
  55. package/dist/components/tabs/tabs.test.js +337 -335
  56. package/dist/components/tabs/tabs.test.mjs +2 -2
  57. package/dist/components/textarea/textarea.test.js +7296 -443
  58. package/dist/components/textarea/textarea.test.mjs +2 -2
  59. package/dist/components/toast/toast.test.js +337 -335
  60. package/dist/components/toast/toast.test.mjs +1 -1
  61. package/dist/components/tooltip/tooltip.test.js +337 -335
  62. package/dist/components/tooltip/tooltip.test.mjs +1 -1
  63. package/dist/index.js +3 -2
  64. package/dist/index.mjs +40 -40
  65. package/package.json +1 -1
  66. package/dist/chunk-H7BLXC5M.mjs +0 -5965
  67. package/dist/{chunk-466PGIGU.mjs → chunk-C2FQHRLB.mjs} +3 -3
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import {
3
+ dropdown_default
4
+ } from "../../chunk-LXPWTJ3F.mjs";
5
+ import {
6
+ render
7
+ } from "../../chunk-HFJF2TTY.mjs";
8
+ import "../../chunk-E3G5QXSH.mjs";
9
+ import "../../chunk-J725QONZ.mjs";
10
+ import "../../chunk-IZ6II3QA.mjs";
11
+
12
+ // src/components/dropdown/dropdown.test.tsx
13
+ import { createRef } from "react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ describe("Dropdown", () => {
16
+ it("should render correctly", () => {
17
+ const wrapper = render(/* @__PURE__ */ jsx(dropdown_default, {}));
18
+ expect(() => wrapper.unmount()).not.toThrow();
19
+ });
20
+ it("ref should be forwarded", () => {
21
+ const ref = createRef();
22
+ render(/* @__PURE__ */ jsx(dropdown_default, { ref }));
23
+ expect(ref.current).not.toBeNull();
24
+ });
25
+ });
@@ -0,0 +1,5 @@
1
+ export { default as Dropdown, DropdownProps } from './dropdown.mjs';
2
+ import 'tailwind-variants';
3
+ import 'tailwind-variants/dist/config';
4
+ import 'react';
5
+ import '../../utils/types.mjs';
@@ -0,0 +1,5 @@
1
+ export { default as Dropdown, DropdownProps } from './dropdown.js';
2
+ import 'tailwind-variants';
3
+ import 'tailwind-variants/dist/config';
4
+ import 'react';
5
+ import '../../utils/types.js';
@@ -0,0 +1,128 @@
1
+ "use client";
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/components/dropdown/index.ts
32
+ var dropdown_exports = {};
33
+ __export(dropdown_exports, {
34
+ Dropdown: () => dropdown_default
35
+ });
36
+ module.exports = __toCommonJS(dropdown_exports);
37
+
38
+ // src/components/dropdown/dropdown.tsx
39
+ var import_react = __toESM(require("react"));
40
+
41
+ // src/utils/tailwind-variants.ts
42
+ var import_tailwind_variants = require("tailwind-variants");
43
+ var COMMON_SIZE = ["sm", "md", "lg"];
44
+ var COMMON_RADIUS = ["xlg", "xxlg", "none", "full"];
45
+ var COMMON_FONTSIZE = ["h1", "h2", "h3", "h4", "h5"];
46
+ var COMMON_SHADOW = ["inner", "drop"];
47
+ var tv = (0, import_tailwind_variants.createTV)({
48
+ // twMerge: false,
49
+ twMergeConfig: {
50
+ classGroups: {
51
+ fontSize: [{ text: [...COMMON_SIZE, ...COMMON_FONTSIZE] }],
52
+ borderRadius: [{ rounded: [...COMMON_RADIUS, ...COMMON_SIZE] }],
53
+ boxShadow: [{ shadow: [...COMMON_SHADOW] }],
54
+ padding: [{ p: [...COMMON_SIZE] }],
55
+ gap: [{ gap: [...COMMON_SIZE] }]
56
+ }
57
+ }
58
+ });
59
+
60
+ // src/utils/props.ts
61
+ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
62
+ if (!variantKeys) {
63
+ return [props, {}];
64
+ }
65
+ const picked = variantKeys.reduce((acc, key) => {
66
+ if (key in props) {
67
+ return { ...acc, [key]: props[key] };
68
+ } else {
69
+ return acc;
70
+ }
71
+ }, {});
72
+ if (removeVariantProps) {
73
+ const omitted = Object.keys(props).filter((key) => !variantKeys.includes(key)).reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
74
+ return [omitted, picked];
75
+ } else {
76
+ return [props, picked];
77
+ }
78
+ };
79
+
80
+ // src/components/dropdown/dropdown.tsx
81
+ var import_jsx_runtime = require("react/jsx-runtime");
82
+ var Dropdown = (0, import_react.forwardRef)((originalProps, ref) => {
83
+ const [props, variantProps] = mapPropsVariants(originalProps, dropdown.variantKeys);
84
+ const { children, classNames } = props;
85
+ const slots = (0, import_react.useMemo)(() => dropdown({ ...variantProps }), [...Object.values(variantProps)]);
86
+ const getBaseProps = (0, import_react.useCallback)(() => {
87
+ return {
88
+ className: slots.base({ class: classNames == null ? void 0 : classNames.base })
89
+ };
90
+ }, [slots, classNames == null ? void 0 : classNames.base]);
91
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, ...getBaseProps(), children: import_react.default.Children.map(children, (child, index) => {
92
+ return import_react.default.cloneElement(child, {
93
+ ...variantProps,
94
+ ...child.props
95
+ });
96
+ }) });
97
+ });
98
+ Dropdown.displayName = "Dropdown";
99
+ var dropdown_default = Dropdown;
100
+ var dropdown = tv({
101
+ slots: {
102
+ base: ["flex", "flex-col"]
103
+ },
104
+ variants: {
105
+ variant: {
106
+ solid: {},
107
+ line: {}
108
+ },
109
+ size: {
110
+ sm: {},
111
+ md: {},
112
+ lg: {}
113
+ },
114
+ color: {
115
+ primary: {},
116
+ secondary: {}
117
+ }
118
+ },
119
+ defaultVariants: {
120
+ variant: "solid",
121
+ color: "primary",
122
+ size: "md"
123
+ }
124
+ });
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ Dropdown
128
+ });
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import {
3
+ dropdown_default
4
+ } from "../../chunk-LXPWTJ3F.mjs";
5
+ import "../../chunk-E3G5QXSH.mjs";
6
+ import "../../chunk-J725QONZ.mjs";
7
+ import "../../chunk-IZ6II3QA.mjs";
8
+ export {
9
+ dropdown_default as Dropdown
10
+ };