@konstructio/ui 0.1.2-alpha.35 → 0.1.2-alpha.36

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.
@@ -1,14 +1,14 @@
1
1
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
2
- import { useRef as y, useState as v, useCallback as N, useEffect as g } from "react";
3
- import { L as x } from "../../loader-H82RiE-I.js";
2
+ import { useRef as v, useState as y, useCallback as g, useEffect as N } from "react";
3
+ import { S as x } from "../../loader-juvMSJ9L.js";
4
4
  import { cn as d } from "../../utils/index.js";
5
- import { buttonDismissVariants as w, badgeVariants as L } from "./Badge.variants.js";
5
+ import { buttonDismissVariants as S, badgeVariants as w } from "./Badge.variants.js";
6
6
  import { S as V } from "../../index-BtQfgaSF.js";
7
7
  import { c as D } from "../../createLucideIcon-D4r5Phnh.js";
8
- const S = [
8
+ const L = [
9
9
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
10
10
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
11
- ], j = D("x", S), B = ({
11
+ ], j = D("x", L), B = ({
12
12
  className: u,
13
13
  dismissible: p = !1,
14
14
  label: r,
@@ -19,13 +19,13 @@ const S = [
19
19
  onClick: e,
20
20
  onDismiss: m
21
21
  }) => {
22
- const s = y(null), [b, f] = v("visible"), h = N(
22
+ const s = v(null), [b, f] = y("visible"), h = g(
23
23
  (a) => {
24
24
  a.stopPropagation(), m?.(), f("hidden");
25
25
  },
26
26
  [m]
27
27
  );
28
- return g(() => {
28
+ return N(() => {
29
29
  const a = new AbortController();
30
30
  return s.current?.addEventListener(
31
31
  "animationend",
@@ -39,7 +39,7 @@ const S = [
39
39
  {
40
40
  ref: s,
41
41
  className: d(
42
- L({ variant: l, size: n, className: u }),
42
+ w({ variant: l, size: n, className: u }),
43
43
  e && "cursor-pointer"
44
44
  ),
45
45
  role: e ? "button" : void 0,
@@ -57,7 +57,7 @@ const S = [
57
57
  "button",
58
58
  {
59
59
  type: "button",
60
- className: d(w({ size: n, variant: l })),
60
+ className: d(S({ size: n, variant: l })),
61
61
  onClick: h,
62
62
  "aria-label": "Dismiss",
63
63
  children: [
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as Z, useId as ee, useRef as C, useMemo as te, useImperativeHandle as ae, useEffect as re } from "react";
3
- import { L as ne } from "../../../loader-H82RiE-I.js";
3
+ import { S as ne } from "../../../loader-juvMSJ9L.js";
4
4
  import { Typography as se } from "../../Typography/Typography.js";
5
5
  import { cn as o } from "../../../utils/index.js";
6
6
  import { labelVariants as oe, inputVariants as le, dropdownVariants as ie } from "../Dropdown.variants.js";
@@ -30,34 +30,34 @@ const de = [
30
30
  listItemSecondRowClassName: M,
31
31
  name: f,
32
32
  placeholder: N,
33
- searchable: y = !1,
33
+ searchable: g = !1,
34
34
  showSearchIcon: w,
35
- theme: W,
36
- wrapperClassName: _,
37
- isInfiniteScrollEnabled: $ = !1,
38
- onFetchMoreOptions: H,
39
- onBlur: P,
40
- onSearchChange: U,
41
- noOptionsText: q,
42
- ...g
43
- }, A) => {
44
- const I = ee(), l = C(null), L = C(null), B = C(0), {
35
+ theme: S,
36
+ wrapperClassName: W,
37
+ isInfiniteScrollEnabled: _ = !1,
38
+ onFetchMoreOptions: $,
39
+ onBlur: H,
40
+ onSearchChange: P,
41
+ noOptionsText: U,
42
+ ...y
43
+ }, q) => {
44
+ const I = ee(), l = C(null), L = C(null), A = C(0), {
45
45
  isOpen: i,
46
- searchTerm: G,
46
+ searchTerm: B,
47
47
  value: s,
48
48
  options: n,
49
49
  setValue: c,
50
- setSearchTerm: J,
51
- setCanFilter: K,
52
- toggleOpen: Q
53
- } = fe(), e = te(() => n.find(({ value: r }) => r === s), [n, s]), { wrapperRef: S, wrapperInputRef: j, handleOpen: b } = ce({
50
+ setSearchTerm: G,
51
+ setCanFilter: J,
52
+ toggleOpen: K
53
+ } = fe(), e = te(() => n.find(({ value: r }) => r === s), [n, s]), { wrapperRef: Q, wrapperInputRef: j, handleOpen: b } = ce({
54
54
  ulRef: L,
55
55
  inputRef: l,
56
56
  disabled: a,
57
57
  internalValue: e,
58
- onBlur: P
58
+ onBlur: H
59
59
  }), p = f ? `${I}-${f}` : I;
60
- ae(A, () => l.current, [l]), re(() => {
60
+ ae(q, () => l.current, [l]), re(() => {
61
61
  if (x && !s) {
62
62
  const r = n && n.find((u) => u.value === x);
63
63
  r && c(r.value);
@@ -65,7 +65,7 @@ const de = [
65
65
  }, [x, n, c, s]);
66
66
  const X = (r) => {
67
67
  const u = r.target.value;
68
- K(!0), c(""), J(u ?? ""), U?.(u);
68
+ J(!0), c(""), G(u ?? ""), P?.(u);
69
69
  const z = n.find(
70
70
  (Y) => Y.value.toLocaleLowerCase() === u.toLocaleLowerCase()
71
71
  );
@@ -74,9 +74,9 @@ const de = [
74
74
  return /* @__PURE__ */ d(
75
75
  "div",
76
76
  {
77
- ref: S,
78
- className: o("flex flex-col w-full relative", _),
79
- "data-theme": W,
77
+ ref: Q,
78
+ className: o("flex flex-col w-full relative", W),
79
+ "data-theme": S,
80
80
  children: [
81
81
  v ? /* @__PURE__ */ d(
82
82
  "label",
@@ -100,19 +100,19 @@ const de = [
100
100
  ie({ className: O, hasError: !!m, disabled: a })
101
101
  ),
102
102
  role: "combobox",
103
- onClick: () => !a && Q(!i),
103
+ onClick: () => !a && K(!i),
104
104
  "aria-expanded": i,
105
- tabIndex: B.current,
105
+ tabIndex: A.current,
106
106
  "aria-labelledby": p,
107
107
  children: [
108
108
  /* @__PURE__ */ d("div", { className: "flex gap-2.5 items-center flex-1", children: [
109
109
  e?.leftIcon && !w && /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center dark:text-slate-50", children: e.leftIcon }),
110
110
  w && /* @__PURE__ */ t(xe, { className: "w-4 h-4 text-zinc-500 select-none dark:text-slate-300 dark:group-focus-within:text-slate-50 transition-colors duration-300" }),
111
- y ? /* @__PURE__ */ t(
111
+ g ? /* @__PURE__ */ t(
112
112
  "input",
113
113
  {
114
114
  type: "text",
115
- value: i ? G : e?.label ?? s ?? "",
115
+ value: i ? B : e?.label ?? s ?? "",
116
116
  onChange: X,
117
117
  placeholder: N,
118
118
  className: o(le({ className: F }), {
@@ -128,7 +128,7 @@ const de = [
128
128
  autoCapitalize: "words",
129
129
  disabled: a,
130
130
  tabIndex: -1,
131
- ...g
131
+ ...y
132
132
  }
133
133
  ) : /* @__PURE__ */ t(
134
134
  se,
@@ -175,7 +175,7 @@ const de = [
175
175
  required: h,
176
176
  inert: !0,
177
177
  defaultValue: e?.value ?? s ?? void 0,
178
- ...g
178
+ ...y
179
179
  }
180
180
  ),
181
181
  i && /* @__PURE__ */ t(
@@ -190,11 +190,11 @@ const de = [
190
190
  inputRef: l,
191
191
  options: n,
192
192
  isLoading: !!k,
193
- searchable: y,
193
+ searchable: g,
194
194
  listItemSecondRowClassName: M,
195
- isInfiniteScrollEnabled: $,
196
- onFetchMoreOptions: H,
197
- noOptionsText: q
195
+ isInfiniteScrollEnabled: _,
196
+ onFetchMoreOptions: $,
197
+ noOptionsText: U
198
198
  }
199
199
  )
200
200
  ]
@@ -0,0 +1,5 @@
1
+ import * as C from "react";
2
+ const t = (e) => /* @__PURE__ */ C.createElement("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M7.05002 1.45002C7.05002 1.17155 6.9394 0.904476 6.74249 0.707562C6.54557 0.510649 6.2785 0.400024 6.00002 0.400024C5.72155 0.400024 5.45448 0.510649 5.25756 0.707562C5.06065 0.904476 4.95002 1.17155 4.95002 1.45002C4.95002 1.7285 5.06065 1.99557 5.25756 2.19249C5.45448 2.3894 5.72155 2.50002 6.00002 2.50002C6.2785 2.50002 6.54557 2.3894 6.74249 2.19249C6.9394 1.99557 7.05002 1.7285 7.05002 1.45002ZM7.05002 10.55C7.05002 10.2715 6.9394 10.0045 6.74249 9.80756C6.54557 9.61065 6.2785 9.50002 6.00002 9.50002C5.72155 9.50002 5.45448 9.61065 5.25756 9.80756C5.06065 10.0045 4.95002 10.2715 4.95002 10.55C4.95002 10.8285 5.06065 11.0956 5.25756 11.2925C5.45448 11.4894 5.72155 11.6 6.00002 11.6C6.2785 11.6 6.54557 11.4894 6.74249 11.2925C6.9394 11.0956 7.05002 10.8285 7.05002 10.55ZM1.45002 7.05002C1.7285 7.05002 1.99557 6.9394 2.19249 6.74249C2.3894 6.54557 2.50002 6.2785 2.50002 6.00002C2.50002 5.72155 2.3894 5.45448 2.19249 5.25756C1.99557 5.06065 1.7285 4.95002 1.45002 4.95002C1.17155 4.95002 0.904476 5.06065 0.707562 5.25756C0.510649 5.45448 0.400024 5.72155 0.400024 6.00002C0.400024 6.2785 0.510649 6.54557 0.707562 6.74249C0.904476 6.9394 1.17155 7.05002 1.45002 7.05002ZM11.6 6.00002C11.6 5.72155 11.4894 5.45448 11.2925 5.25756C11.0956 5.06065 10.8285 4.95002 10.55 4.95002C10.2715 4.95002 10.0045 5.06065 9.80756 5.25756C9.61065 5.45448 9.50002 5.72155 9.50002 6.00002C9.50002 6.2785 9.61065 6.54557 9.80756 6.74249C10.0045 6.9394 10.2715 7.05002 10.55 7.05002C10.8285 7.05002 11.0956 6.9394 11.2925 6.74249C11.4894 6.54557 11.6 6.2785 11.6 6.00002ZM3.52596 9.9594C3.62349 9.86187 3.70085 9.74609 3.75363 9.61867C3.80641 9.49124 3.83358 9.35467 3.83358 9.21674C3.83358 9.07882 3.80641 8.94225 3.75363 8.81482C3.70085 8.6874 3.62349 8.57161 3.52596 8.47409C3.42844 8.37656 3.31265 8.2992 3.18523 8.24642C3.0578 8.19364 2.92123 8.16647 2.78331 8.16647C2.50476 8.16647 2.23761 8.27712 2.04065 8.47409C1.84368 8.67105 1.73303 8.93819 1.73303 9.21674C1.73303 9.49529 1.84368 9.76243 2.04065 9.9594C2.23761 10.1564 2.50476 10.267 2.78331 10.267C3.06186 10.267 3.329 10.1564 3.52596 9.9594ZM3.52596 3.52377C3.62833 3.42738 3.7103 3.31141 3.76701 3.18274C3.82371 3.05407 3.85399 2.91532 3.85605 2.77472C3.85812 2.63413 3.83192 2.49455 3.77902 2.36427C3.72611 2.23399 3.64758 2.11566 3.54808 2.01631C3.44858 1.91695 3.33014 1.8386 3.19978 1.78589C3.06942 1.73318 2.92981 1.70718 2.78921 1.70945C2.64862 1.71172 2.50992 1.74221 2.38133 1.7991C2.25274 1.85599 2.13689 1.93814 2.04065 2.04065C1.84368 2.23761 1.73303 2.50476 1.73303 2.78331C1.73303 3.06186 1.84368 3.329 2.04065 3.52596C2.23761 3.72293 2.50476 3.83358 2.78331 3.83358C3.06186 3.83358 3.329 3.72293 3.52596 3.52596V3.52377ZM8.47409 9.9594C8.57161 10.0569 8.6874 10.1343 8.81482 10.1871C8.94225 10.2399 9.07882 10.267 9.21674 10.267C9.35467 10.267 9.49124 10.2399 9.61867 10.1871C9.74609 10.1343 9.86187 10.0569 9.9594 9.9594C10.0569 9.86187 10.1343 9.74609 10.1871 9.61867C10.2399 9.49124 10.267 9.35467 10.267 9.21674C10.267 9.07882 10.2399 8.94225 10.1871 8.81482C10.1343 8.6874 10.0569 8.57161 9.9594 8.47409C9.86187 8.37656 9.74609 8.2992 9.61867 8.24642C9.49124 8.19364 9.35467 8.16647 9.21674 8.16647C9.07882 8.16647 8.94225 8.19364 8.81482 8.24642C8.6874 8.2992 8.57161 8.37656 8.47409 8.47409C8.37656 8.57161 8.2992 8.6874 8.24642 8.81482C8.19364 8.94225 8.16647 9.07882 8.16647 9.21674C8.16647 9.35467 8.19364 9.49124 8.24642 9.61867C8.2992 9.74609 8.37656 9.86187 8.47409 9.9594Z", fill: "currentColor" }));
3
+ export {
4
+ t as S
5
+ };
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.2-alpha.34",
5
+ "version": "0.1.2-alpha.35",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
package/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.2-alpha.35",
5
+ "version": "0.1.2-alpha.36",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "main": "dist/index.js",
@@ -1,4 +0,0 @@
1
- const C = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='currentColor'%20xmlns='http://www.w3.org/2000/svg'%20%3e%3cpath%20d='M7.05002%201.45002C7.05002%201.17155%206.9394%200.904476%206.74249%200.707562C6.54557%200.510649%206.2785%200.400024%206.00002%200.400024C5.72155%200.400024%205.45448%200.510649%205.25756%200.707562C5.06065%200.904476%204.95002%201.17155%204.95002%201.45002C4.95002%201.7285%205.06065%201.99557%205.25756%202.19249C5.45448%202.3894%205.72155%202.50002%206.00002%202.50002C6.2785%202.50002%206.54557%202.3894%206.74249%202.19249C6.9394%201.99557%207.05002%201.7285%207.05002%201.45002ZM7.05002%2010.55C7.05002%2010.2715%206.9394%2010.0045%206.74249%209.80756C6.54557%209.61065%206.2785%209.50002%206.00002%209.50002C5.72155%209.50002%205.45448%209.61065%205.25756%209.80756C5.06065%2010.0045%204.95002%2010.2715%204.95002%2010.55C4.95002%2010.8285%205.06065%2011.0956%205.25756%2011.2925C5.45448%2011.4894%205.72155%2011.6%206.00002%2011.6C6.2785%2011.6%206.54557%2011.4894%206.74249%2011.2925C6.9394%2011.0956%207.05002%2010.8285%207.05002%2010.55ZM1.45002%207.05002C1.7285%207.05002%201.99557%206.9394%202.19249%206.74249C2.3894%206.54557%202.50002%206.2785%202.50002%206.00002C2.50002%205.72155%202.3894%205.45448%202.19249%205.25756C1.99557%205.06065%201.7285%204.95002%201.45002%204.95002C1.17155%204.95002%200.904476%205.06065%200.707562%205.25756C0.510649%205.45448%200.400024%205.72155%200.400024%206.00002C0.400024%206.2785%200.510649%206.54557%200.707562%206.74249C0.904476%206.9394%201.17155%207.05002%201.45002%207.05002ZM11.6%206.00002C11.6%205.72155%2011.4894%205.45448%2011.2925%205.25756C11.0956%205.06065%2010.8285%204.95002%2010.55%204.95002C10.2715%204.95002%2010.0045%205.06065%209.80756%205.25756C9.61065%205.45448%209.50002%205.72155%209.50002%206.00002C9.50002%206.2785%209.61065%206.54557%209.80756%206.74249C10.0045%206.9394%2010.2715%207.05002%2010.55%207.05002C10.8285%207.05002%2011.0956%206.9394%2011.2925%206.74249C11.4894%206.54557%2011.6%206.2785%2011.6%206.00002ZM3.52596%209.9594C3.62349%209.86187%203.70085%209.74609%203.75363%209.61867C3.80641%209.49124%203.83358%209.35467%203.83358%209.21674C3.83358%209.07882%203.80641%208.94225%203.75363%208.81482C3.70085%208.6874%203.62349%208.57161%203.52596%208.47409C3.42844%208.37656%203.31265%208.2992%203.18523%208.24642C3.0578%208.19364%202.92123%208.16647%202.78331%208.16647C2.50476%208.16647%202.23761%208.27712%202.04065%208.47409C1.84368%208.67105%201.73303%208.93819%201.73303%209.21674C1.73303%209.49529%201.84368%209.76243%202.04065%209.9594C2.23761%2010.1564%202.50476%2010.267%202.78331%2010.267C3.06186%2010.267%203.329%2010.1564%203.52596%209.9594ZM3.52596%203.52377C3.62833%203.42738%203.7103%203.31141%203.76701%203.18274C3.82371%203.05407%203.85399%202.91532%203.85605%202.77472C3.85812%202.63413%203.83192%202.49455%203.77902%202.36427C3.72611%202.23399%203.64758%202.11566%203.54808%202.01631C3.44858%201.91695%203.33014%201.8386%203.19978%201.78589C3.06942%201.73318%202.92981%201.70718%202.78921%201.70945C2.64862%201.71172%202.50992%201.74221%202.38133%201.7991C2.25274%201.85599%202.13689%201.93814%202.04065%202.04065C1.84368%202.23761%201.73303%202.50476%201.73303%202.78331C1.73303%203.06186%201.84368%203.329%202.04065%203.52596C2.23761%203.72293%202.50476%203.83358%202.78331%203.83358C3.06186%203.83358%203.329%203.72293%203.52596%203.52596V3.52377ZM8.47409%209.9594C8.57161%2010.0569%208.6874%2010.1343%208.81482%2010.1871C8.94225%2010.2399%209.07882%2010.267%209.21674%2010.267C9.35467%2010.267%209.49124%2010.2399%209.61867%2010.1871C9.74609%2010.1343%209.86187%2010.0569%209.9594%209.9594C10.0569%209.86187%2010.1343%209.74609%2010.1871%209.61867C10.2399%209.49124%2010.267%209.35467%2010.267%209.21674C10.267%209.07882%2010.2399%208.94225%2010.1871%208.81482C10.1343%208.6874%2010.0569%208.57161%209.9594%208.47409C9.86187%208.37656%209.74609%208.2992%209.61867%208.24642C9.49124%208.19364%209.35467%208.16647%209.21674%208.16647C9.07882%208.16647%208.94225%208.19364%208.81482%208.24642C8.6874%208.2992%208.57161%208.37656%208.47409%208.47409C8.37656%208.57161%208.2992%208.6874%208.24642%208.81482C8.19364%208.94225%208.16647%209.07882%208.16647%209.21674C8.16647%209.35467%208.19364%209.49124%208.24642%209.61867C8.2992%209.74609%208.37656%209.86187%208.47409%209.9594Z'%20fill='currentColor'%20/%3e%3c/svg%3e";
2
- export {
3
- C as L
4
- };