@konstructio/ui 0.1.0-alpha.13 → 0.1.0-alpha.15
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/{chevron-down-UW8ts6wI.js → chevron-down-1hnuqhTt.js} +2 -2
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Datepicker/DatePicker.js +367 -361
- package/dist/components/DropdownButton/DropdownButton.js +136 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
- package/dist/components/Loading/Loading.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-qZIN4i94.js} +4 -4
- package/dist/index.d.ts +3 -0
- package/dist/package.json +21 -21
- package/dist/styles.css +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +21 -21
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsxs as v, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import w, { forwardRef as E, useState as P, useRef as b, useCallback as y, useEffect as z } from "react";
|
|
3
|
+
import { cn as l } from "../../utils/index.js";
|
|
4
|
+
import { Button as C } from "../Button/Button.js";
|
|
5
|
+
import { P as c } from "../../index-h-Ul0anl.js";
|
|
6
|
+
function m() {
|
|
7
|
+
return m = Object.assign || function(e) {
|
|
8
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
9
|
+
var n = arguments[a];
|
|
10
|
+
for (var t in n)
|
|
11
|
+
Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
12
|
+
}
|
|
13
|
+
return e;
|
|
14
|
+
}, m.apply(this, arguments);
|
|
15
|
+
}
|
|
16
|
+
function L(e, a) {
|
|
17
|
+
if (e == null) return {};
|
|
18
|
+
var n = N(e, a), t, r;
|
|
19
|
+
if (Object.getOwnPropertySymbols) {
|
|
20
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
21
|
+
for (r = 0; r < o.length; r++)
|
|
22
|
+
t = o[r], !(a.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
|
|
23
|
+
}
|
|
24
|
+
return n;
|
|
25
|
+
}
|
|
26
|
+
function N(e, a) {
|
|
27
|
+
if (e == null) return {};
|
|
28
|
+
var n = {}, t = Object.keys(e), r, o;
|
|
29
|
+
for (o = 0; o < t.length; o++)
|
|
30
|
+
r = t[o], !(a.indexOf(r) >= 0) && (n[r] = e[r]);
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
var g = E(function(e, a) {
|
|
34
|
+
var n = e.color, t = n === void 0 ? "currentColor" : n, r = e.size, o = r === void 0 ? 24 : r, s = L(e, ["color", "size"]);
|
|
35
|
+
return /* @__PURE__ */ w.createElement("svg", m({
|
|
36
|
+
ref: a,
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
width: o,
|
|
39
|
+
height: o,
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
fill: "none",
|
|
42
|
+
stroke: t,
|
|
43
|
+
strokeWidth: "2",
|
|
44
|
+
strokeLinecap: "round",
|
|
45
|
+
strokeLinejoin: "round"
|
|
46
|
+
}, s), /* @__PURE__ */ w.createElement("polyline", {
|
|
47
|
+
points: "6 9 12 15 18 9"
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
g.propTypes = {
|
|
51
|
+
color: c.string,
|
|
52
|
+
size: c.oneOfType([c.string, c.number])
|
|
53
|
+
};
|
|
54
|
+
g.displayName = "ChevronDown";
|
|
55
|
+
const T = ({
|
|
56
|
+
buttonClassName: e,
|
|
57
|
+
className: a,
|
|
58
|
+
itemClassName: n,
|
|
59
|
+
listClassName: t,
|
|
60
|
+
options: r
|
|
61
|
+
}) => {
|
|
62
|
+
const [o, s] = P(!1), O = b(null), f = b(null), j = y(() => s((i) => !i), []), x = y((i) => {
|
|
63
|
+
s(!1), i == null || i();
|
|
64
|
+
}, []);
|
|
65
|
+
return z(() => {
|
|
66
|
+
const i = new AbortController(), u = (d) => {
|
|
67
|
+
d.key === "Escape" && s(!1);
|
|
68
|
+
}, k = (d) => {
|
|
69
|
+
var h;
|
|
70
|
+
(h = f.current) != null && h.contains(d.target) || s(!1);
|
|
71
|
+
};
|
|
72
|
+
return document.addEventListener("keydown", u, {
|
|
73
|
+
signal: i.signal
|
|
74
|
+
}), document.addEventListener("mousedown", k, {
|
|
75
|
+
signal: i.signal
|
|
76
|
+
}), document.addEventListener(
|
|
77
|
+
"visibilitychange",
|
|
78
|
+
() => {
|
|
79
|
+
document.hidden && s(!1);
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
signal: i.signal
|
|
83
|
+
}
|
|
84
|
+
), () => {
|
|
85
|
+
i.abort();
|
|
86
|
+
};
|
|
87
|
+
}, [f]), /* @__PURE__ */ v("div", { ref: f, className: l("relative w-full", a), children: [
|
|
88
|
+
/* @__PURE__ */ v(
|
|
89
|
+
C,
|
|
90
|
+
{
|
|
91
|
+
ref: O,
|
|
92
|
+
className: l(
|
|
93
|
+
"flex gap-2 items-center justify-between w-full",
|
|
94
|
+
e
|
|
95
|
+
),
|
|
96
|
+
onClick: j,
|
|
97
|
+
children: [
|
|
98
|
+
"Download Invoice as",
|
|
99
|
+
/* @__PURE__ */ p(
|
|
100
|
+
g,
|
|
101
|
+
{
|
|
102
|
+
className: l({
|
|
103
|
+
"transform rotate-180": o,
|
|
104
|
+
"transition-transform duration-200": !0
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
o && /* @__PURE__ */ p(
|
|
112
|
+
"ul",
|
|
113
|
+
{
|
|
114
|
+
className: l(
|
|
115
|
+
"absolute z-10 mt-1 w-full bg-white border border-gray-200 rounded shadow-xs animate-in fade-in-0 py-2",
|
|
116
|
+
t
|
|
117
|
+
),
|
|
118
|
+
children: r.map((i, u) => /* @__PURE__ */ p(
|
|
119
|
+
"li",
|
|
120
|
+
{
|
|
121
|
+
className: l(
|
|
122
|
+
"hover:bg-gray-50 px-6 py-1.5 hover:cursor-pointer",
|
|
123
|
+
n
|
|
124
|
+
),
|
|
125
|
+
onClick: () => x(i.onClick),
|
|
126
|
+
children: i.label
|
|
127
|
+
},
|
|
128
|
+
u
|
|
129
|
+
))
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] });
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
T as DropdownButton
|
|
136
|
+
};
|
|
@@ -5,7 +5,7 @@ import { Checkbox as C } from "../../../Checkbox/Checkbox.js";
|
|
|
5
5
|
import { cn as n } from "../../../../utils/index.js";
|
|
6
6
|
import { filterButtonIconVariants as y, filterButtonVariants as N } from "../../Filter.variants.js";
|
|
7
7
|
import { useBadgeMultiSelect as B } from "./BadgeMultiSelect.hook.js";
|
|
8
|
-
import { C as O } from "../../../../chevron-down-
|
|
8
|
+
import { C as O } from "../../../../chevron-down-1hnuqhTt.js";
|
|
9
9
|
const $ = ({
|
|
10
10
|
options: i,
|
|
11
11
|
label: p,
|
|
@@ -5,7 +5,7 @@ import { DatePicker as w } from "../../../Datepicker/DatePicker.js";
|
|
|
5
5
|
import { cn as o } from "../../../../utils/index.js";
|
|
6
6
|
import { filterButtonIconVariants as x, filterButtonVariants as N } from "../../Filter.variants.js";
|
|
7
7
|
import { useDateFilterDropdown as b } from "./DateFilterDropdown.hook.js";
|
|
8
|
-
import { C as y } from "../../../../chevron-down-
|
|
8
|
+
import { C as y } from "../../../../chevron-down-1hnuqhTt.js";
|
|
9
9
|
const R = ({
|
|
10
10
|
label: p,
|
|
11
11
|
position: l = "left",
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as a } from "react";
|
|
3
|
+
import { Button as m } from "../../../Button/Button.js";
|
|
4
|
+
import { resetEvent as n } from "../../events/index.js";
|
|
5
|
+
const f = ({ disabled: e, onClick: t }) => {
|
|
6
|
+
const r = a(() => {
|
|
7
|
+
n(), t == null || t();
|
|
8
|
+
}, [t]);
|
|
9
|
+
return /* @__PURE__ */ o(
|
|
10
|
+
m,
|
|
11
|
+
{
|
|
12
|
+
type: "button",
|
|
13
|
+
variant: "text",
|
|
14
|
+
appearance: "compact",
|
|
15
|
+
version: "alternate",
|
|
16
|
+
onClick: r,
|
|
17
|
+
disabled: e,
|
|
18
|
+
children: "Reset"
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
16
22
|
export {
|
|
17
|
-
|
|
23
|
+
f as ResetButton
|
|
18
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as c } from "../../utils/index.js";
|
|
3
3
|
import { loadingVariants as i } from "./Loading.variants.js";
|
|
4
|
-
import { c as t } from "../../createLucideIcon-
|
|
4
|
+
import { c as t } from "../../createLucideIcon-qZIN4i94.js";
|
|
5
5
|
/**
|
|
6
|
-
* @license lucide-react v0.
|
|
6
|
+
* @license lucide-react v0.525.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -3,7 +3,7 @@ import { useId as y, useState as E, useRef as O, useCallback as I, useEffect as
|
|
|
3
3
|
import { cn as d } from "../../../../utils/index.js";
|
|
4
4
|
import { timePickerVariants as j } from "../../TimePicker.variants.js";
|
|
5
5
|
import { WrapperList as P } from "../WrapperList/WrapperList.js";
|
|
6
|
-
import { C as R } from "../../../../chevron-down-
|
|
6
|
+
import { C as R } from "../../../../chevron-down-1hnuqhTt.js";
|
|
7
7
|
import { useTimePickerContext as T } from "../../contexts/time-picker.hook.js";
|
|
8
8
|
const $ = ({
|
|
9
9
|
name: p,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef as l, createElement as n } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* @license lucide-react v0.
|
|
3
|
+
* @license lucide-react v0.525.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -17,7 +17,7 @@ const w = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (t)
|
|
|
17
17
|
return !0;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* @license lucide-react v0.
|
|
20
|
+
* @license lucide-react v0.525.0 - ISC
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
23
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -34,7 +34,7 @@ var g = {
|
|
|
34
34
|
strokeLinejoin: "round"
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* @license lucide-react v0.
|
|
37
|
+
* @license lucide-react v0.525.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -69,7 +69,7 @@ const A = l(
|
|
|
69
69
|
)
|
|
70
70
|
);
|
|
71
71
|
/**
|
|
72
|
-
* @license lucide-react v0.
|
|
72
|
+
* @license lucide-react v0.525.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
75
75
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
15
15
|
import { PropsWithChildren } from 'react';
|
|
16
16
|
import { ReactNode } from 'react';
|
|
17
17
|
import * as ReactTabs from '@radix-ui/react-tabs';
|
|
18
|
+
import { Ref } from 'react';
|
|
18
19
|
import { RefAttributes } from 'react';
|
|
19
20
|
import { SliderProps } from '@radix-ui/react-slider';
|
|
20
21
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -122,6 +123,7 @@ declare type ButtonCancelProps = ButtonBaseProps;
|
|
|
122
123
|
declare type ButtonConfirmProps = ButtonBaseProps;
|
|
123
124
|
|
|
124
125
|
declare interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'>, VariantProps<typeof buttonVariants> {
|
|
126
|
+
ref?: Ref<HTMLButtonElement>;
|
|
125
127
|
asChild?: boolean;
|
|
126
128
|
disabled?: boolean;
|
|
127
129
|
theme?: Theme;
|
|
@@ -499,6 +501,7 @@ declare const rangeVariants: (props?: ClassProp | undefined) => string;
|
|
|
499
501
|
|
|
500
502
|
declare type ResetButtonProps = {
|
|
501
503
|
disabled?: boolean;
|
|
504
|
+
onClick?: VoidFunction;
|
|
502
505
|
};
|
|
503
506
|
|
|
504
507
|
declare interface RowProps extends React.HTMLAttributes<HTMLTableRowElement>, PropsWithChildren, VariantProps<typeof rowVariants> {
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.0-alpha.
|
|
5
|
+
"version": "0.1.0-alpha.14",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"cmdk": "^1.1.1",
|
|
70
70
|
"countries-and-timezones": "^3.8.0",
|
|
71
71
|
"js-cookie": "^3.0.5",
|
|
72
|
-
"lucide-react": "^0.
|
|
73
|
-
"react-day-picker": "^9.
|
|
72
|
+
"lucide-react": "^0.525.0",
|
|
73
|
+
"react-day-picker": "^9.8.0",
|
|
74
74
|
"react-feather": "^2.0.10",
|
|
75
75
|
"react-focus-lock": "^2.13.6",
|
|
76
76
|
"react-remove-scroll": "^2.7.1",
|
|
77
|
-
"tailwind-merge": "^3.3.
|
|
77
|
+
"tailwind-merge": "^3.3.1"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@types/react": "*",
|
|
@@ -106,37 +106,37 @@
|
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@rollup/plugin-alias": "^5.1.1",
|
|
109
|
-
"@storybook/addon-docs": "^9.1.0-alpha.
|
|
110
|
-
"@storybook/addon-links": "^9.1.0-alpha.
|
|
111
|
-
"@storybook/react-vite": "^9.1.0-alpha.
|
|
112
|
-
"@tailwindcss/vite": "^4.1.
|
|
109
|
+
"@storybook/addon-docs": "^9.1.0-alpha.6",
|
|
110
|
+
"@storybook/addon-links": "^9.1.0-alpha.6",
|
|
111
|
+
"@storybook/react-vite": "^9.1.0-alpha.6",
|
|
112
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
113
113
|
"@testing-library/jest-dom": "^6.6.3",
|
|
114
114
|
"@testing-library/react": "^16.3.0",
|
|
115
115
|
"@testing-library/user-event": "^14.6.1",
|
|
116
116
|
"@types/jest-axe": "^3.5.9",
|
|
117
117
|
"@types/js-cookie": "^3.0.6",
|
|
118
|
-
"@types/lodash": "^4.17.
|
|
119
|
-
"@types/react": "^19.1.
|
|
118
|
+
"@types/lodash": "^4.17.20",
|
|
119
|
+
"@types/react": "^19.1.8",
|
|
120
120
|
"@types/react-dom": "^19.1.6",
|
|
121
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
122
|
-
"@typescript-eslint/parser": "^8.
|
|
123
|
-
"@vitejs/plugin-react": "^4.
|
|
124
|
-
"@vitest/coverage-v8": "^3.2.
|
|
121
|
+
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
|
122
|
+
"@typescript-eslint/parser": "^8.35.1",
|
|
123
|
+
"@vitejs/plugin-react": "^4.6.0",
|
|
124
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
125
125
|
"autoprefixer": "^10.4.21",
|
|
126
126
|
"eslint": "^8.57.0",
|
|
127
127
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
128
128
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
129
|
-
"eslint-plugin-storybook": "^9.1.0-alpha.
|
|
130
|
-
"glob": "^11.0.
|
|
129
|
+
"eslint-plugin-storybook": "^9.1.0-alpha.6",
|
|
130
|
+
"glob": "^11.0.3",
|
|
131
131
|
"husky": "^9.1.7",
|
|
132
132
|
"jest-axe": "^10.0.0",
|
|
133
133
|
"jsdom": "^26.1.0",
|
|
134
134
|
"lodash": "^4.17.21",
|
|
135
|
-
"postcss": "^8.5.
|
|
136
|
-
"prettier": "^3.
|
|
135
|
+
"postcss": "^8.5.6",
|
|
136
|
+
"prettier": "^3.6.2",
|
|
137
137
|
"rimraf": "^6.0.1",
|
|
138
|
-
"storybook": "^9.1.0-alpha.
|
|
139
|
-
"tailwindcss": "^4.1.
|
|
138
|
+
"storybook": "^9.1.0-alpha.6",
|
|
139
|
+
"tailwindcss": "^4.1.11",
|
|
140
140
|
"ts-node": "^10.9.2",
|
|
141
141
|
"typescript": "^5.8.3",
|
|
142
142
|
"vite": "^6.3.5",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
145
145
|
"vite-plugin-svgr": "^4.3.0",
|
|
146
146
|
"vite-tsconfig-paths": "^5.1.4",
|
|
147
|
-
"vitest": "^3.2.
|
|
147
|
+
"vitest": "^3.2.4"
|
|
148
148
|
},
|
|
149
149
|
"overrides": {
|
|
150
150
|
"storybook": "$storybook"
|