@deepnoid/ui 0.1.20 → 0.1.22

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 (56) hide show
  1. package/.turbo/turbo-build.log +162 -172
  2. package/dist/{chunk-LNYMVBV5.mjs → chunk-6OMHIMIA.mjs} +8 -6
  3. package/dist/{chunk-3DPVPTHL.mjs → chunk-EAK5DVWA.mjs} +2 -2
  4. package/dist/{chunk-3BKCODIL.mjs → chunk-ICZTNO4V.mjs} +3 -3
  5. package/dist/{chunk-EGHTZLZJ.mjs → chunk-IVK24VIL.mjs} +1 -1
  6. package/dist/chunk-MSAULFDB.mjs +348 -0
  7. package/dist/{chunk-JOCMCOEK.mjs → chunk-P5PJTJLY.mjs} +13 -2
  8. package/dist/{chunk-63WXGSTV.mjs → chunk-XRC5OUYQ.mjs} +23 -13
  9. package/dist/components/input/index.js +13 -2
  10. package/dist/components/input/index.mjs +1 -1
  11. package/dist/components/input/input.js +13 -2
  12. package/dist/components/input/input.mjs +1 -1
  13. package/dist/components/modal/index.mjs +1 -1
  14. package/dist/components/modal/modal.mjs +1 -1
  15. package/dist/components/pagination/index.js +13 -2
  16. package/dist/components/pagination/index.mjs +2 -2
  17. package/dist/components/pagination/pagination.js +13 -2
  18. package/dist/components/pagination/pagination.mjs +2 -2
  19. package/dist/components/select/index.d.mts +1 -1
  20. package/dist/components/select/index.d.ts +1 -1
  21. package/dist/components/select/index.js +301 -286
  22. package/dist/components/select/index.mjs +2 -3
  23. package/dist/components/select/select.d.mts +190 -177
  24. package/dist/components/select/select.d.ts +190 -177
  25. package/dist/components/select/select.js +301 -286
  26. package/dist/components/select/select.mjs +2 -3
  27. package/dist/components/table/form-table.js +3 -3
  28. package/dist/components/table/form-table.mjs +1 -1
  29. package/dist/components/table/index.js +46 -23
  30. package/dist/components/table/index.mjs +6 -6
  31. package/dist/components/table/table-body.d.mts +3 -2
  32. package/dist/components/table/table-body.d.ts +3 -2
  33. package/dist/components/table/table-body.js +23 -13
  34. package/dist/components/table/table-body.mjs +1 -1
  35. package/dist/components/table/table-head.d.mts +2 -2
  36. package/dist/components/table/table-head.d.ts +2 -2
  37. package/dist/components/table/table-head.js +2 -2
  38. package/dist/components/table/table-head.mjs +1 -1
  39. package/dist/components/table/table.d.mts +2 -1
  40. package/dist/components/table/table.d.ts +2 -1
  41. package/dist/components/table/table.js +43 -20
  42. package/dist/components/table/table.mjs +5 -5
  43. package/dist/index.js +493 -497
  44. package/dist/index.mjs +28 -30
  45. package/package.json +1 -1
  46. package/dist/chunk-BXXAMH3R.mjs +0 -255
  47. package/dist/chunk-OF3X4BXG.mjs +0 -76
  48. package/dist/chunk-S3QS5B7F.mjs +0 -61
  49. package/dist/components/select/option.d.mts +0 -17
  50. package/dist/components/select/option.d.ts +0 -17
  51. package/dist/components/select/option.js +0 -4359
  52. package/dist/components/select/option.mjs +0 -12
  53. package/dist/components/select/useSelect.d.mts +0 -31
  54. package/dist/components/select/useSelect.d.ts +0 -31
  55. package/dist/components/select/useSelect.js +0 -84
  56. package/dist/components/select/useSelect.mjs +0 -8
@@ -1,12 +0,0 @@
1
- "use client";
2
- import {
3
- option_default
4
- } from "../../chunk-OF3X4BXG.mjs";
5
- import "../../chunk-ZYIIXWVY.mjs";
6
- import "../../chunk-HWL7TPUN.mjs";
7
- import "../../chunk-3IU2RPSM.mjs";
8
- import "../../chunk-4ZJFD3L3.mjs";
9
- import "../../chunk-AC6TWLRT.mjs";
10
- export {
11
- option_default as default
12
- };
@@ -1,31 +0,0 @@
1
- import * as react from 'react';
2
- import { SelectOption } from './select.mjs';
3
- import 'tailwind-variants';
4
- import '../../utils/types.mjs';
5
-
6
- interface SelectHookProps {
7
- options: SelectOption[];
8
- defaultOption?: SelectOption;
9
- onChange?: (option: SelectOption) => void;
10
- }
11
- type TargetRect = {
12
- x: number;
13
- y: number;
14
- width: number;
15
- height: number;
16
- };
17
- declare const useSelect: ({ options, defaultOption, onChange }: SelectHookProps) => {
18
- selectedOption: SelectOption | undefined;
19
- targetRect: TargetRect | null;
20
- optionWrapperHeight: number;
21
- selectWrapperRef: react.RefObject<HTMLDivElement | null>;
22
- optionWrapperRef: react.RefObject<HTMLDivElement | null>;
23
- handleToggleSelect: () => void;
24
- handleChangeOption: (option: SelectOption) => void;
25
- calculatePositionWithScroll: (targetRect: TargetRect, optionWrapperHeight: number) => {
26
- top: number;
27
- left: number;
28
- };
29
- };
30
-
31
- export { useSelect };
@@ -1,31 +0,0 @@
1
- import * as react from 'react';
2
- import { SelectOption } from './select.js';
3
- import 'tailwind-variants';
4
- import '../../utils/types.js';
5
-
6
- interface SelectHookProps {
7
- options: SelectOption[];
8
- defaultOption?: SelectOption;
9
- onChange?: (option: SelectOption) => void;
10
- }
11
- type TargetRect = {
12
- x: number;
13
- y: number;
14
- width: number;
15
- height: number;
16
- };
17
- declare const useSelect: ({ options, defaultOption, onChange }: SelectHookProps) => {
18
- selectedOption: SelectOption | undefined;
19
- targetRect: TargetRect | null;
20
- optionWrapperHeight: number;
21
- selectWrapperRef: react.RefObject<HTMLDivElement | null>;
22
- optionWrapperRef: react.RefObject<HTMLDivElement | null>;
23
- handleToggleSelect: () => void;
24
- handleChangeOption: (option: SelectOption) => void;
25
- calculatePositionWithScroll: (targetRect: TargetRect, optionWrapperHeight: number) => {
26
- top: number;
27
- left: number;
28
- };
29
- };
30
-
31
- export { useSelect };
@@ -1,84 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/components/select/useSelect.tsx
22
- var useSelect_exports = {};
23
- __export(useSelect_exports, {
24
- useSelect: () => useSelect
25
- });
26
- module.exports = __toCommonJS(useSelect_exports);
27
- var import_react = require("react");
28
- var useSelect = ({ options, defaultOption, onChange }) => {
29
- const [selectedOption, setSelectedOption] = (0, import_react.useState)(defaultOption);
30
- const [targetRect, setTargetRect] = (0, import_react.useState)(null);
31
- const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react.useState)(0);
32
- const selectWrapperRef = (0, import_react.useRef)(null);
33
- const optionWrapperRef = (0, import_react.useRef)(null);
34
- const calculatePositionWithScroll = (targetRect2, optionWrapperHeight2) => {
35
- const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
36
- const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
37
- const spaceBelow = window.innerHeight - (targetRect2.y + targetRect2.height + 4);
38
- const spaceAbove = targetRect2.y - 4;
39
- const top = spaceBelow < optionWrapperHeight2 && spaceAbove > optionWrapperHeight2 ? targetRect2.y - optionWrapperHeight2 - 4 : targetRect2.y + targetRect2.height + 4;
40
- return {
41
- top: top + scrollTop,
42
- left: targetRect2.x + scrollLeft
43
- };
44
- };
45
- const handleToggleSelect = () => {
46
- if (selectWrapperRef.current) {
47
- const rect = selectWrapperRef.current.getBoundingClientRect();
48
- setTargetRect((prevRect) => prevRect ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height });
49
- }
50
- };
51
- const handleChangeOption = (option) => {
52
- onChange == null ? void 0 : onChange(option);
53
- setSelectedOption(option);
54
- handleToggleSelect();
55
- };
56
- (0, import_react.useEffect)(() => {
57
- const onClickOutside = (e) => {
58
- if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target)) {
59
- setTargetRect(null);
60
- }
61
- };
62
- window.addEventListener("mousedown", onClickOutside);
63
- return () => window.removeEventListener("mousedown", onClickOutside);
64
- }, []);
65
- (0, import_react.useEffect)(() => {
66
- if (optionWrapperRef.current) {
67
- setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
68
- }
69
- }, [targetRect]);
70
- return {
71
- selectedOption,
72
- targetRect,
73
- optionWrapperHeight,
74
- selectWrapperRef,
75
- optionWrapperRef,
76
- handleToggleSelect,
77
- handleChangeOption,
78
- calculatePositionWithScroll
79
- };
80
- };
81
- // Annotate the CommonJS export names for ESM import in node:
82
- 0 && (module.exports = {
83
- useSelect
84
- });
@@ -1,8 +0,0 @@
1
- "use client";
2
- import {
3
- useSelect
4
- } from "../../chunk-S3QS5B7F.mjs";
5
- import "../../chunk-AC6TWLRT.mjs";
6
- export {
7
- useSelect
8
- };