@konstructio/ui 0.0.2

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 (256) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +19 -0
  3. package/dist/AlertDialogTrigger-BIbxXexQ.js +553 -0
  4. package/dist/Combination-Cmu9JRkv.js +479 -0
  5. package/dist/Modal-CO0_SnXD.js +909 -0
  6. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  7. package/dist/chevron-up-Cmu1oXfj.js +54 -0
  8. package/dist/components/AlertDialog/AlertDialog.d.ts +3 -0
  9. package/dist/components/AlertDialog/AlertDialog.js +54 -0
  10. package/dist/components/AlertDialog/AlertDialog.types.d.ts +13 -0
  11. package/dist/components/AlertDialog/AlertDialog.types.js +1 -0
  12. package/dist/components/AlertDialog/AlertDialog.variants.d.ts +3 -0
  13. package/dist/components/AlertDialog/AlertDialog.variants.js +16 -0
  14. package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +3 -0
  15. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +10 -0
  16. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +6 -0
  17. package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +1 -0
  18. package/dist/components/AlertDialog/components/index.d.ts +1 -0
  19. package/dist/components/AlertDialog/components/index.js +4 -0
  20. package/dist/components/AlertDialog/hooks/index.d.ts +1 -0
  21. package/dist/components/AlertDialog/hooks/index.js +4 -0
  22. package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +7 -0
  23. package/dist/components/AlertDialog/hooks/useAlertDialog.js +10 -0
  24. package/dist/components/Autocomplete/Autocomplete.d.ts +3 -0
  25. package/dist/components/Autocomplete/Autocomplete.js +84 -0
  26. package/dist/components/Autocomplete/Autocomplete.types.d.ts +18 -0
  27. package/dist/components/Autocomplete/Autocomplete.types.js +1 -0
  28. package/dist/components/Autocomplete/Autocomplete.variants.d.ts +8 -0
  29. package/dist/components/Autocomplete/Autocomplete.variants.js +61 -0
  30. package/dist/components/Autocomplete/components/List.d.ts +3 -0
  31. package/dist/components/Autocomplete/components/List.js +57 -0
  32. package/dist/components/Autocomplete/components/List.types.d.ts +13 -0
  33. package/dist/components/Autocomplete/components/List.types.js +1 -0
  34. package/dist/components/Autocomplete/components/List.variants.d.ts +16 -0
  35. package/dist/components/Autocomplete/components/List.variants.js +81 -0
  36. package/dist/components/Autocomplete/hooks/index.d.ts +2 -0
  37. package/dist/components/Autocomplete/hooks/index.js +6 -0
  38. package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +17 -0
  39. package/dist/components/Autocomplete/hooks/useAutocomplete.js +81 -0
  40. package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +10 -0
  41. package/dist/components/Autocomplete/hooks/useNavigationList.js +78 -0
  42. package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
  43. package/dist/components/Breadcrumb/Breadcrumb.js +460 -0
  44. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +11 -0
  45. package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
  46. package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +12 -0
  47. package/dist/components/Breadcrumb/Breadcrumb.variants.js +61 -0
  48. package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +3 -0
  49. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +5 -0
  50. package/dist/components/Button/Button.d.ts +4 -0
  51. package/dist/components/Button/Button.js +42 -0
  52. package/dist/components/Button/Button.types.d.ts +7 -0
  53. package/dist/components/Button/Button.types.js +1 -0
  54. package/dist/components/Button/Button.variants.d.ts +6 -0
  55. package/dist/components/Button/Button.variants.js +102 -0
  56. package/dist/components/Checkbox/Checkbox.d.ts +3 -0
  57. package/dist/components/Checkbox/Checkbox.js +233 -0
  58. package/dist/components/Checkbox/Checkbox.types.d.ts +12 -0
  59. package/dist/components/Checkbox/Checkbox.types.js +1 -0
  60. package/dist/components/Checkbox/Checkbox.variants.d.ts +9 -0
  61. package/dist/components/Checkbox/Checkbox.variants.js +82 -0
  62. package/dist/components/Dropdown/Dropdown.d.ts +3 -0
  63. package/dist/components/Dropdown/Dropdown.js +10 -0
  64. package/dist/components/Dropdown/Dropdown.types.d.ts +15 -0
  65. package/dist/components/Dropdown/Dropdown.types.js +1 -0
  66. package/dist/components/Dropdown/Dropdown.variants.d.ts +3 -0
  67. package/dist/components/Dropdown/Dropdown.variants.js +45 -0
  68. package/dist/components/Dropdown/components/EmptyList.d.ts +2 -0
  69. package/dist/components/Dropdown/components/EmptyList.js +5 -0
  70. package/dist/components/Dropdown/components/List/List.d.ts +3 -0
  71. package/dist/components/Dropdown/components/List/List.js +25 -0
  72. package/dist/components/Dropdown/components/List/List.types.d.ts +8 -0
  73. package/dist/components/Dropdown/components/List/List.types.js +1 -0
  74. package/dist/components/Dropdown/components/List/List.variants.d.ts +3 -0
  75. package/dist/components/Dropdown/components/List/List.variants.js +34 -0
  76. package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +3 -0
  77. package/dist/components/Dropdown/components/ListItem/ListItem.js +29 -0
  78. package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +4 -0
  79. package/dist/components/Dropdown/components/ListItem/ListItem.types.js +1 -0
  80. package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +3 -0
  81. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +19 -0
  82. package/dist/components/Dropdown/components/Wrapper.d.ts +3 -0
  83. package/dist/components/Dropdown/components/Wrapper.js +90 -0
  84. package/dist/components/Dropdown/components/index.d.ts +3 -0
  85. package/dist/components/Dropdown/components/index.js +8 -0
  86. package/dist/components/Dropdown/contexts/dropdown.context.d.ts +8 -0
  87. package/dist/components/Dropdown/contexts/dropdown.context.js +14 -0
  88. package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +2 -0
  89. package/dist/components/Dropdown/contexts/dropdown.hook.js +11 -0
  90. package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +2 -0
  91. package/dist/components/Dropdown/contexts/dropdown.provider.js +11 -0
  92. package/dist/components/Dropdown/contexts/index.d.ts +2 -0
  93. package/dist/components/Dropdown/contexts/index.js +6 -0
  94. package/dist/components/Dropdown/hooks/useDropdown.d.ts +11 -0
  95. package/dist/components/Dropdown/hooks/useDropdown.js +65 -0
  96. package/dist/components/Dropdown/hooks/useNavigationList.d.ts +8 -0
  97. package/dist/components/Dropdown/hooks/useNavigationList.js +66 -0
  98. package/dist/components/Input/Input.d.ts +3 -0
  99. package/dist/components/Input/Input.js +178 -0
  100. package/dist/components/Input/Input.types.d.ts +9 -0
  101. package/dist/components/Input/Input.types.js +1 -0
  102. package/dist/components/Input/Input.variants.d.ts +4 -0
  103. package/dist/components/Input/Input.variants.js +43 -0
  104. package/dist/components/Modal/Modal.d.ts +8 -0
  105. package/dist/components/Modal/Modal.js +10 -0
  106. package/dist/components/Modal/Modal.types.d.ts +12 -0
  107. package/dist/components/Modal/Modal.types.js +1 -0
  108. package/dist/components/Modal/components/Body/Body.d.ts +3 -0
  109. package/dist/components/Modal/components/Body/Body.js +7 -0
  110. package/dist/components/Modal/components/Body/Body.types.d.ts +5 -0
  111. package/dist/components/Modal/components/Body/Body.types.js +1 -0
  112. package/dist/components/Modal/components/Footer/Footer.d.ts +3 -0
  113. package/dist/components/Modal/components/Footer/Footer.js +6 -0
  114. package/dist/components/Modal/components/Footer/Footer.types.d.ts +5 -0
  115. package/dist/components/Modal/components/Footer/Footer.types.js +1 -0
  116. package/dist/components/Modal/components/Header/Header.d.ts +3 -0
  117. package/dist/components/Modal/components/Header/Header.js +6 -0
  118. package/dist/components/Modal/components/Header/Header.types.d.ts +5 -0
  119. package/dist/components/Modal/components/Header/Header.types.js +1 -0
  120. package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +3 -0
  121. package/dist/components/Modal/components/Wrapper/Wrapper.js +13 -0
  122. package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +7 -0
  123. package/dist/components/Modal/components/Wrapper/Wrapper.types.js +1 -0
  124. package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +6 -0
  125. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +48 -0
  126. package/dist/components/Modal/components/index.d.ts +4 -0
  127. package/dist/components/Modal/components/index.js +10 -0
  128. package/dist/components/Modal/contexts/Modal.context.d.ts +2 -0
  129. package/dist/components/Modal/contexts/Modal.context.js +20 -0
  130. package/dist/components/Modal/contexts/Modal.provider.d.ts +4 -0
  131. package/dist/components/Modal/contexts/Modal.provider.js +26 -0
  132. package/dist/components/Modal/contexts/Modal.types.d.ts +9 -0
  133. package/dist/components/Modal/contexts/Modal.types.js +1 -0
  134. package/dist/components/Modal/contexts/index.d.ts +1 -0
  135. package/dist/components/Modal/contexts/index.js +4 -0
  136. package/dist/components/Modal/hooks/index.d.ts +1 -0
  137. package/dist/components/Modal/hooks/index.js +4 -0
  138. package/dist/components/Modal/hooks/useModal.d.ts +9 -0
  139. package/dist/components/Modal/hooks/useModal.js +27 -0
  140. package/dist/components/NumberInput/NumberInput.d.ts +3 -0
  141. package/dist/components/NumberInput/NumberInput.js +181 -0
  142. package/dist/components/NumberInput/NumberInput.types.d.ts +11 -0
  143. package/dist/components/NumberInput/NumberInput.types.js +1 -0
  144. package/dist/components/NumberInput/NumberInput.variants.d.ts +11 -0
  145. package/dist/components/NumberInput/NumberInput.variants.js +78 -0
  146. package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
  147. package/dist/components/ProgressBar/ProgressBar.js +37 -0
  148. package/dist/components/ProgressBar/ProgressBar.types.d.ts +8 -0
  149. package/dist/components/ProgressBar/ProgressBar.types.js +1 -0
  150. package/dist/components/ProgressBar/ProgressBar.variants.d.ts +7 -0
  151. package/dist/components/ProgressBar/ProgressBar.variants.js +62 -0
  152. package/dist/components/Radio/Radio.d.ts +3 -0
  153. package/dist/components/Radio/Radio.js +58 -0
  154. package/dist/components/Radio/Radio.types.d.ts +12 -0
  155. package/dist/components/Radio/Radio.types.js +1 -0
  156. package/dist/components/Radio/Radio.variants.d.ts +3 -0
  157. package/dist/components/Radio/Radio.variants.js +49 -0
  158. package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
  159. package/dist/components/RadioGroup/RadioGroup.js +37 -0
  160. package/dist/components/RadioGroup/RadioGroup.types.d.ts +11 -0
  161. package/dist/components/RadioGroup/RadioGroup.types.js +1 -0
  162. package/dist/components/Range/Range.d.ts +3 -0
  163. package/dist/components/Range/Range.js +70 -0
  164. package/dist/components/Range/Range.types.d.ts +13 -0
  165. package/dist/components/Range/Range.types.js +1 -0
  166. package/dist/components/Range/Range.variants.d.ts +14 -0
  167. package/dist/components/Range/Range.variants.js +93 -0
  168. package/dist/components/Slider/Slider.d.ts +3 -0
  169. package/dist/components/Slider/Slider.js +52 -0
  170. package/dist/components/Slider/Slider.types.d.ts +13 -0
  171. package/dist/components/Slider/Slider.types.js +1 -0
  172. package/dist/components/Slider/Slider.variants.d.ts +11 -0
  173. package/dist/components/Slider/Slider.variants.js +69 -0
  174. package/dist/components/Switch/Switch.d.ts +3 -0
  175. package/dist/components/Switch/Switch.js +176 -0
  176. package/dist/components/Switch/Switch.types.d.ts +10 -0
  177. package/dist/components/Switch/Switch.types.js +1 -0
  178. package/dist/components/Switch/Switch.variants.d.ts +6 -0
  179. package/dist/components/Switch/Switch.variants.js +58 -0
  180. package/dist/components/Tag/Tag.d.ts +3 -0
  181. package/dist/components/Tag/Tag.js +6 -0
  182. package/dist/components/Tag/Tag.types.d.ts +4 -0
  183. package/dist/components/Tag/Tag.types.js +1 -0
  184. package/dist/components/Tag/Tag.variants.d.ts +3 -0
  185. package/dist/components/Tag/Tag.variants.js +31 -0
  186. package/dist/components/TagSelect/TagSelect.d.ts +3 -0
  187. package/dist/components/TagSelect/TagSelect.js +75 -0
  188. package/dist/components/TagSelect/TagSelect.types.d.ts +9 -0
  189. package/dist/components/TagSelect/TagSelect.types.js +1 -0
  190. package/dist/components/TagSelect/TagSelect.variants.d.ts +9 -0
  191. package/dist/components/TagSelect/TagSelect.variants.js +83 -0
  192. package/dist/components/TagSelect/hooks/useTagSelect.d.ts +9 -0
  193. package/dist/components/TagSelect/hooks/useTagSelect.js +39 -0
  194. package/dist/components/TextArea/TextArea.d.ts +3 -0
  195. package/dist/components/TextArea/TextArea.js +34 -0
  196. package/dist/components/TextArea/TextArea.types.d.ts +10 -0
  197. package/dist/components/TextArea/TextArea.types.js +1 -0
  198. package/dist/components/TextArea/TextArea.variants.d.ts +3 -0
  199. package/dist/components/TextArea/TextArea.variants.js +34 -0
  200. package/dist/components/Toast/Toast.d.ts +3 -0
  201. package/dist/components/Toast/Toast.js +471 -0
  202. package/dist/components/Toast/Toast.types.d.ts +12 -0
  203. package/dist/components/Toast/Toast.types.js +1 -0
  204. package/dist/components/Toast/Toast.variants.d.ts +9 -0
  205. package/dist/components/Toast/Toast.variants.js +74 -0
  206. package/dist/components/Tooltip/Tooltip.d.ts +3 -0
  207. package/dist/components/Tooltip/Tooltip.js +42 -0
  208. package/dist/components/Tooltip/Tooltip.types.d.ts +8 -0
  209. package/dist/components/Tooltip/Tooltip.types.js +1 -0
  210. package/dist/components/Tooltip/Tooltip.variants.d.ts +8 -0
  211. package/dist/components/Tooltip/Tooltip.variants.js +93 -0
  212. package/dist/components/Tooltip/hooks/useTooltip.d.ts +4 -0
  213. package/dist/components/Tooltip/hooks/useTooltip.js +25 -0
  214. package/dist/components/index.d.ts +19 -0
  215. package/dist/components/index.js +40 -0
  216. package/dist/contexts/index.d.ts +3 -0
  217. package/dist/contexts/index.js +8 -0
  218. package/dist/contexts/theme.context.d.ts +6 -0
  219. package/dist/contexts/theme.context.js +10 -0
  220. package/dist/contexts/theme.hook.d.ts +7 -0
  221. package/dist/contexts/theme.hook.js +9 -0
  222. package/dist/contexts/theme.provider.d.ts +7 -0
  223. package/dist/contexts/theme.provider.js +17 -0
  224. package/dist/hooks/index.d.ts +1 -0
  225. package/dist/hooks/index.js +4 -0
  226. package/dist/hooks/useToggle.d.ts +1 -0
  227. package/dist/hooks/useToggle.js +11 -0
  228. package/dist/index-2K8qjK4R.js +145 -0
  229. package/dist/index-2hJuj4UN.js +19069 -0
  230. package/dist/index-4qm4jAkj.js +92 -0
  231. package/dist/index-8vgf-x5i.js +118 -0
  232. package/dist/index-BJ7FQg17.js +35 -0
  233. package/dist/index-B_GWswUP.js +71 -0
  234. package/dist/index-BqM_XclQ.js +94 -0
  235. package/dist/index-BwYCDOHZ.js +44 -0
  236. package/dist/index-BxeV34ij.js +32 -0
  237. package/dist/index-CCavb-1K.js +57 -0
  238. package/dist/index-DFbnnPzA.js +423 -0
  239. package/dist/index-DQMInta3.js +663 -0
  240. package/dist/index.d.ts +4 -0
  241. package/dist/index.js +50 -0
  242. package/dist/js.cookie-OLEfuq_g.js +74 -0
  243. package/dist/package.json +118 -0
  244. package/dist/plugins/index.d.ts +1 -0
  245. package/dist/plugins/index.js +4 -0
  246. package/dist/plugins/konstruct.d.ts +4 -0
  247. package/dist/plugins/konstruct.js +104 -0
  248. package/dist/plugins/utils/colors.d.ts +206 -0
  249. package/dist/plugins/utils/colors.js +626 -0
  250. package/dist/styles.css +1 -0
  251. package/dist/styles.d.ts +0 -0
  252. package/dist/styles.js +1 -0
  253. package/dist/useBreadcrumb-BSMnc4Fu.js +341 -0
  254. package/dist/utils/index.d.ts +4 -0
  255. package/dist/utils/index.js +2278 -0
  256. package/package.json +118 -0
@@ -0,0 +1,11 @@
1
+ export declare const sliderVariants: (props?: ({
2
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const trackVariants: (props?: ({
5
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
6
+ size?: "sm" | "lg" | "md" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export declare const thumbVariants: (props?: ({
9
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
10
+ size?: "sm" | "lg" | "md" | null | undefined;
11
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,69 @@
1
+ import { c as e } from "../../index-BwYCDOHZ.js";
2
+ const r = e(
3
+ ["relative", "flex", "items-center", "w-full"],
4
+ {
5
+ variants: {
6
+ theme: {
7
+ kubefirst: "",
8
+ konstruct: "",
9
+ colony: ""
10
+ }
11
+ },
12
+ defaultVariants: {
13
+ theme: "kubefirst"
14
+ }
15
+ }
16
+ ), s = e(["relative", "flex-grow", "rounded-full"], {
17
+ variants: {
18
+ theme: {
19
+ kubefirst: ["bg-kubefirst-purple-dark"],
20
+ konstruct: ["bg-orange-500"],
21
+ colony: ["bg-red-500"]
22
+ },
23
+ size: {
24
+ sm: ["h-1"],
25
+ md: ["h-2"],
26
+ lg: ["h-3"]
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ theme: "kubefirst",
31
+ size: "md"
32
+ }
33
+ }), a = e(
34
+ [
35
+ "block",
36
+ "w-5",
37
+ "h-5",
38
+ "rounded-full",
39
+ "cursor-pointer",
40
+ "focus-visible:outline-none",
41
+ "shadow-md",
42
+ "bg-white",
43
+ "border",
44
+ "border-gray-300"
45
+ ],
46
+ {
47
+ variants: {
48
+ theme: {
49
+ kubefirst: "",
50
+ konstruct: "",
51
+ colony: ""
52
+ },
53
+ size: {
54
+ sm: ["w-5", "h-5"],
55
+ md: ["w-6", "h-6"],
56
+ lg: ["w-7", "h-7"]
57
+ }
58
+ },
59
+ defaultVariants: {
60
+ theme: "kubefirst",
61
+ size: "md"
62
+ }
63
+ }
64
+ );
65
+ export {
66
+ r as sliderVariants,
67
+ a as thumbVariants,
68
+ s as trackVariants
69
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { SwitchProps } from './Switch.types';
3
+ export declare const Switch: FC<SwitchProps>;
@@ -0,0 +1,176 @@
1
+ import { jsxs as x, jsx as l } from "react/jsx-runtime";
2
+ import * as h from "react";
3
+ import { forwardRef as I, useState as _, useRef as H, useId as A, useImperativeHandle as M, useEffect as $, useCallback as j } from "react";
4
+ import { c as z, a as B, d as q } from "../../index-8vgf-x5i.js";
5
+ import { u as F } from "../../index-CCavb-1K.js";
6
+ import { u as O, a as V } from "../../index-BxeV34ij.js";
7
+ import { P } from "../../index-BJ7FQg17.js";
8
+ import { cn as D } from "../../utils/index.js";
9
+ import "../../contexts/theme.context.js";
10
+ import { useTheme as L } from "../../contexts/theme.hook.js";
11
+ import "../../js.cookie-OLEfuq_g.js";
12
+ import { switchVariants as U, thumbVariants as W } from "./Switch.variants.js";
13
+ var k = "Switch", [X, ue] = z(k), [G, J] = X(k), g = h.forwardRef(
14
+ (e, r) => {
15
+ const {
16
+ __scopeSwitch: t,
17
+ name: s,
18
+ checked: c,
19
+ defaultChecked: p,
20
+ required: n,
21
+ disabled: a,
22
+ value: i = "on",
23
+ onCheckedChange: m,
24
+ form: o,
25
+ ...u
26
+ } = e, [d, b] = h.useState(null), v = F(r, (C) => b(C)), f = h.useRef(!1), w = d ? o || !!d.closest("form") : !0, [S = !1, E] = B({
27
+ prop: c,
28
+ defaultProp: p,
29
+ onChange: m
30
+ });
31
+ return /* @__PURE__ */ x(G, { scope: t, checked: S, disabled: a, children: [
32
+ /* @__PURE__ */ l(
33
+ P.button,
34
+ {
35
+ type: "button",
36
+ role: "switch",
37
+ "aria-checked": S,
38
+ "aria-required": n,
39
+ "data-state": N(S),
40
+ "data-disabled": a ? "" : void 0,
41
+ disabled: a,
42
+ value: i,
43
+ ...u,
44
+ ref: v,
45
+ onClick: q(e.onClick, (C) => {
46
+ E((T) => !T), w && (f.current = C.isPropagationStopped(), f.current || C.stopPropagation());
47
+ })
48
+ }
49
+ ),
50
+ w && /* @__PURE__ */ l(
51
+ K,
52
+ {
53
+ control: d,
54
+ bubbles: !f.current,
55
+ name: s,
56
+ value: i,
57
+ checked: S,
58
+ required: n,
59
+ disabled: a,
60
+ form: o,
61
+ style: { transform: "translateX(-100%)" }
62
+ }
63
+ )
64
+ ] });
65
+ }
66
+ );
67
+ g.displayName = k;
68
+ var R = "SwitchThumb", y = h.forwardRef(
69
+ (e, r) => {
70
+ const { __scopeSwitch: t, ...s } = e, c = J(R, t);
71
+ return /* @__PURE__ */ l(
72
+ P.span,
73
+ {
74
+ "data-state": N(c.checked),
75
+ "data-disabled": c.disabled ? "" : void 0,
76
+ ...s,
77
+ ref: r
78
+ }
79
+ );
80
+ }
81
+ );
82
+ y.displayName = R;
83
+ var K = (e) => {
84
+ const { control: r, checked: t, bubbles: s = !0, ...c } = e, p = h.useRef(null), n = O(t), a = V(r);
85
+ return h.useEffect(() => {
86
+ const i = p.current, m = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(m, "checked").set;
87
+ if (n !== t && u) {
88
+ const d = new Event("click", { bubbles: s });
89
+ u.call(i, t), i.dispatchEvent(d);
90
+ }
91
+ }, [n, t, s]), /* @__PURE__ */ l(
92
+ "input",
93
+ {
94
+ type: "checkbox",
95
+ "aria-hidden": !0,
96
+ defaultChecked: t,
97
+ ...c,
98
+ tabIndex: -1,
99
+ ref: p,
100
+ style: {
101
+ ...e.style,
102
+ ...a,
103
+ position: "absolute",
104
+ pointerEvents: "none",
105
+ opacity: 0,
106
+ margin: 0
107
+ }
108
+ }
109
+ );
110
+ };
111
+ function N(e) {
112
+ return e ? "checked" : "unchecked";
113
+ }
114
+ var Q = g, Y = y;
115
+ const de = I(
116
+ ({
117
+ name: e,
118
+ defaultChecked: r,
119
+ alignment: t = "horizontal",
120
+ theme: s,
121
+ thumbClassName: c,
122
+ className: p,
123
+ label: n
124
+ }, a) => {
125
+ const [i, m] = _(r ?? !1), o = H(null), u = A(), { theme: d } = L(), b = s ?? d, v = e ? `${u}-${e}` : u;
126
+ M(a, () => o.current, [o]), $(() => {
127
+ o.current && (o.current.value = `${i}`);
128
+ }, [i]);
129
+ const f = j(
130
+ (w) => m(w),
131
+ []
132
+ );
133
+ return /* @__PURE__ */ x(
134
+ "div",
135
+ {
136
+ className: D(
137
+ "w-full flex gap-3",
138
+ t === "vertical" ? "flex-col" : "flex-row"
139
+ ),
140
+ children: [
141
+ n ? /* @__PURE__ */ l(
142
+ "label",
143
+ {
144
+ className: "text-base",
145
+ htmlFor: v,
146
+ style: { paddingRight: 15 },
147
+ children: n
148
+ }
149
+ ) : null,
150
+ /* @__PURE__ */ l(
151
+ Q,
152
+ {
153
+ id: v,
154
+ defaultChecked: r,
155
+ onCheckedChange: f,
156
+ className: U({ theme: b, className: p }),
157
+ children: /* @__PURE__ */ l(
158
+ Y,
159
+ {
160
+ className: W({
161
+ theme: b,
162
+ className: c
163
+ })
164
+ }
165
+ )
166
+ }
167
+ ),
168
+ /* @__PURE__ */ l("input", { ref: o, name: e, type: "text", className: "hidden" })
169
+ ]
170
+ }
171
+ );
172
+ }
173
+ );
174
+ export {
175
+ de as Switch
176
+ };
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { switchVariants } from './Switch.variants';
3
+ export interface SwitchProps extends VariantProps<typeof switchVariants> {
4
+ alignment?: 'horizontal' | 'vertical';
5
+ className?: string;
6
+ defaultChecked?: boolean;
7
+ label?: string;
8
+ name?: string;
9
+ thumbClassName?: string;
10
+ }
@@ -0,0 +1,6 @@
1
+ export declare const switchVariants: (props?: ({
2
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const thumbVariants: (props?: ({
5
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,58 @@
1
+ import { c as t } from "../../index-BwYCDOHZ.js";
2
+ const e = t(
3
+ [
4
+ "w-12",
5
+ "h-7",
6
+ "flex",
7
+ "items-center",
8
+ "rounded-full",
9
+ "shadow",
10
+ "focus:shadow-md",
11
+ "data-[state=unchecked]:bg-zinc-200",
12
+ "transition-all",
13
+ "delay-10",
14
+ "duration-250"
15
+ ],
16
+ {
17
+ variants: {
18
+ theme: {
19
+ konstruct: "bg-orange-600",
20
+ kubefirst: "bg-kubefirst-purple-light",
21
+ colony: "bg-red-600"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ theme: "kubefirst"
26
+ }
27
+ }
28
+ ), r = t(
29
+ [
30
+ "block",
31
+ "w-6",
32
+ "h-6",
33
+ "bg-white",
34
+ "rounded-full",
35
+ "shadow-md",
36
+ "transition-all",
37
+ "translate-x-1",
38
+ "data-[state=checked]:translate-x-5",
39
+ "delay-10",
40
+ "duration-300"
41
+ ],
42
+ {
43
+ variants: {
44
+ theme: {
45
+ konstruct: "",
46
+ kubefirst: "",
47
+ colony: ""
48
+ }
49
+ },
50
+ defaultVariants: {
51
+ theme: "kubefirst"
52
+ }
53
+ }
54
+ );
55
+ export {
56
+ e as switchVariants,
57
+ r as thumbVariants
58
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { TagProps } from './Tag.types';
3
+ export declare const Tag: FC<TagProps>;
@@ -0,0 +1,6 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { tagVariants as i } from "./Tag.variants.js";
3
+ const m = ({ label: r, color: t }) => /* @__PURE__ */ a("div", { className: i({ color: t }), children: /* @__PURE__ */ a("span", { className: "text-inherit", children: r }) });
4
+ export {
5
+ m as Tag
6
+ };
@@ -0,0 +1,4 @@
1
+ export type TagProps = {
2
+ label: string;
3
+ color?: 'gray' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
4
+ };
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,3 @@
1
+ export declare const tagVariants: (props?: ({
2
+ color?: "default" | "gray" | "cyan" | "gold" | "green" | "light blue" | "lime" | "pink" | "purple" | "emerald" | "fuscia" | "indigo" | "light-orange" | "dark-sky-blue" | "mistery" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,31 @@
1
+ import { c as e } from "../../index-BwYCDOHZ.js";
2
+ const f = e(
3
+ ["px-2", "py-1", "rounded-md", "w-max", "text-xs"],
4
+ {
5
+ variants: {
6
+ color: {
7
+ gray: ["bg-[#f4f4f5]", "text-[#71717a]"],
8
+ cyan: ["bg-[#ecfeff]", "text-[#0e7490]"],
9
+ gold: ["bg-[#fef9c3]", "text-[#a16207]"],
10
+ green: ["bg-[#dcfce7]", "text-[#15803d]"],
11
+ "light blue": ["bg-[#e0f2fe]", "text-[#0369a1]"],
12
+ lime: ["bg-[#ecfccb]", "text-[#4d7c0f]"],
13
+ pink: ["bg-[#fce7f3]", "text-[#be185d]"],
14
+ purple: ["bg-[#ede9fe]", "text-[#6d28d9]"],
15
+ emerald: ["bg-[#ecfdf5]", "text-[#047857]"],
16
+ fuscia: ["bg-[#fdf4ff]", "text-[#a21caf]"],
17
+ indigo: ["bg-[#e0e7ff]", "text-[#4338ca]"],
18
+ "light-orange": ["bg-[#fef3c7]", "text-[#d97706]"],
19
+ "dark-sky-blue": ["bg-[#dbeafe]", "text-[#1d4ed8]"],
20
+ mistery: ["bg-[#1e2235]", "text-[#81e2b4]"],
21
+ default: ["bg-transparent", "text-[#71717A]"]
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ color: "default"
26
+ }
27
+ }
28
+ );
29
+ export {
30
+ f as tagVariants
31
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { TagSelectProps } from './TagSelect.types';
3
+ export declare const TagSelect: FC<TagSelectProps>;
@@ -0,0 +1,75 @@
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as g, useId as w, useRef as C, useImperativeHandle as T, useEffect as R } from "react";
3
+ import "../../contexts/theme.context.js";
4
+ import { useTheme as S } from "../../contexts/theme.hook.js";
5
+ import "../../js.cookie-OLEfuq_g.js";
6
+ import { cn as u } from "../../utils/index.js";
7
+ import { Tag as d } from "../Tag/Tag.js";
8
+ import { useTagSelect as k } from "./hooks/useTagSelect.js";
9
+ import { tagSelectVariants as I, tagListVariants as V, tagItemVariants as j } from "./TagSelect.variants.js";
10
+ import { C as y } from "../../chevron-up-Cmu1oXfj.js";
11
+ const B = g(({ label: n, name: r, options: f, placeholder: h = "Select a value...", theme: l }, x) => {
12
+ const s = w(), { theme: o } = S(), t = C(null), {
13
+ isOpen: a,
14
+ selectedTag: c,
15
+ value: m,
16
+ wrapperRef: b,
17
+ handleClickTag: N,
18
+ handleOpenDropdown: v
19
+ } = k();
20
+ return T(x, () => t.current, [t]), R(() => {
21
+ t.current && (t.current.value = m);
22
+ }, [m]), /* @__PURE__ */ p("div", { ref: b, className: "flex flex-col w-full relative", children: [
23
+ n ? /* @__PURE__ */ e("label", { className: "m-2 cursor-pointer", htmlFor: r ?? s, children: n }) : null,
24
+ /* @__PURE__ */ p(
25
+ "div",
26
+ {
27
+ id: r ?? s,
28
+ className: I({ theme: l ?? o }),
29
+ role: "combobox",
30
+ onClick: v,
31
+ "aria-expanded": a,
32
+ children: [
33
+ c ? /* @__PURE__ */ e(d, { ...c }) : /* @__PURE__ */ e("span", { className: "text-base text-inherit", children: h }),
34
+ /* @__PURE__ */ e(
35
+ y,
36
+ {
37
+ className: u(
38
+ "w-4 h-4 text-inherit transition-all duration-50",
39
+ a ? "rotate-0" : "rotate-180"
40
+ )
41
+ }
42
+ )
43
+ ]
44
+ }
45
+ ),
46
+ /* @__PURE__ */ e("input", { ref: t, type: "text", name: r, className: "hidden" }),
47
+ a ? /* @__PURE__ */ e(
48
+ "ul",
49
+ {
50
+ role: "listbox",
51
+ className: u(V({ theme: l ?? o })),
52
+ children: f.map((i) => /* @__PURE__ */ e(
53
+ "li",
54
+ {
55
+ className: j({ theme: l ?? o }),
56
+ role: "option",
57
+ children: /* @__PURE__ */ e(
58
+ "button",
59
+ {
60
+ type: "button",
61
+ role: "button",
62
+ className: "m-0 p-0 w-full",
63
+ onClick: () => N(i),
64
+ children: /* @__PURE__ */ e(d, { label: i.label, color: i.color })
65
+ }
66
+ )
67
+ }
68
+ ))
69
+ }
70
+ ) : null
71
+ ] });
72
+ });
73
+ export {
74
+ B as TagSelect
75
+ };
@@ -0,0 +1,9 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { TagProps } from '../Tag/Tag.types';
3
+ import { tagSelectVariants } from './TagSelect.variants';
4
+ export interface TagSelectProps extends VariantProps<typeof tagSelectVariants> {
5
+ label?: string;
6
+ options: TagProps[];
7
+ name?: string;
8
+ placeholder?: string;
9
+ }
@@ -0,0 +1,9 @@
1
+ export declare const tagSelectVariants: (props?: ({
2
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const tagListVariants: (props?: ({
5
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ export declare const tagItemVariants: (props?: ({
8
+ theme?: "kubefirst" | "konstruct" | "colony" | null | undefined;
9
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,83 @@
1
+ import { c as e } from "../../index-BwYCDOHZ.js";
2
+ const t = e(
3
+ [
4
+ "border",
5
+ "cursor-pointer",
6
+ "duration-250",
7
+ "ease-in-out",
8
+ "flex",
9
+ "items-center",
10
+ "justify-between",
11
+ "px-3",
12
+ "py-1",
13
+ "rounded-md",
14
+ "transition-all",
15
+ "w-full"
16
+ ],
17
+ {
18
+ variants: {
19
+ theme: {
20
+ colony: ["aria-expanded:border-red-400", "aria-expanded:text-red-400"],
21
+ konstruct: [
22
+ "aria-expanded:border-orange-400",
23
+ "aria-expanded:text-orange-400"
24
+ ],
25
+ kubefirst: [
26
+ "aria-expanded:border-kubefirst-purple-light",
27
+ "aria-expanded:text-kubefirst-purple-dark"
28
+ ]
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ theme: "kubefirst"
33
+ }
34
+ }
35
+ ), a = e(
36
+ [
37
+ "absolute",
38
+ "bg-white",
39
+ "border",
40
+ "duration-100",
41
+ "ease-in-out",
42
+ "flex",
43
+ "flex-col",
44
+ "mt-1",
45
+ "rounded-md",
46
+ "shadow-sm",
47
+ "top-full",
48
+ "transition-all",
49
+ "w-full",
50
+ "z-10"
51
+ ],
52
+ {
53
+ variants: {
54
+ theme: {
55
+ colony: ["border-red-400"],
56
+ konstruct: ["border-orange-400"],
57
+ kubefirst: ["border-kubefirst-purple-light"]
58
+ }
59
+ },
60
+ defaultVariants: {
61
+ theme: "kubefirst"
62
+ }
63
+ }
64
+ ), o = e(
65
+ ["cursor-pointer", "py-1", "px-2", "last:mb-2", "first:mt-2", "h-full"],
66
+ {
67
+ variants: {
68
+ theme: {
69
+ colony: "hover:bg-red-100",
70
+ konstruct: "hover:bg-orange-100",
71
+ kubefirst: "hover:bg-purple-100"
72
+ }
73
+ },
74
+ defaultVariants: {
75
+ theme: "kubefirst"
76
+ }
77
+ }
78
+ );
79
+ export {
80
+ o as tagItemVariants,
81
+ a as tagListVariants,
82
+ t as tagSelectVariants
83
+ };
@@ -0,0 +1,9 @@
1
+ import { TagProps } from '../../Tag/Tag.types';
2
+ export declare const useTagSelect: () => {
3
+ isOpen: boolean;
4
+ selectedTag: TagProps | null;
5
+ value: string;
6
+ wrapperRef: import('react').RefObject<HTMLDivElement>;
7
+ handleClickTag: (tag: TagProps) => void;
8
+ handleOpenDropdown: () => void;
9
+ };
@@ -0,0 +1,39 @@
1
+ import { useRef as b, useState as o, useEffect as k, useCallback as a } from "react";
2
+ import { useToggle as w } from "../../../hooks/useToggle.js";
3
+ const C = () => {
4
+ const t = b(null), [r, e] = w(!1), [c, d] = o(null), [u, i] = o("");
5
+ k(() => {
6
+ const n = new AbortController(), p = (s) => {
7
+ s.key === "Escape" && e(!1);
8
+ }, m = (s) => {
9
+ var l;
10
+ (l = t.current) != null && l.contains(s.target) || e(!1);
11
+ };
12
+ return document.addEventListener("keydown", p, {
13
+ signal: n.signal
14
+ }), document.addEventListener("mousedown", m, {
15
+ signal: n.signal
16
+ }), () => {
17
+ n.abort();
18
+ };
19
+ }, [e, t]);
20
+ const f = a(() => {
21
+ e();
22
+ }, [e]), g = a(
23
+ (n) => {
24
+ d(n), e(!1), i(n.label);
25
+ },
26
+ [e]
27
+ );
28
+ return {
29
+ isOpen: r,
30
+ selectedTag: c,
31
+ value: u,
32
+ wrapperRef: t,
33
+ handleClickTag: g,
34
+ handleOpenDropdown: f
35
+ };
36
+ };
37
+ export {
38
+ C as useTagSelect
39
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { TextAreaProps } from './TextArea.types';
3
+ export declare const TextArea: FC<TextAreaProps>;
@@ -0,0 +1,34 @@
1
+ import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as v, useId as N, useState as T, useCallback as j } from "react";
3
+ import { textAreaVariants as A } from "./TextArea.variants.js";
4
+ import "../../contexts/theme.context.js";
5
+ import { useTheme as I } from "../../contexts/theme.hook.js";
6
+ import "../../js.cookie-OLEfuq_g.js";
7
+ const S = v(
8
+ ({ initialValue: m, label: t, name: o, placeholder: l, rows: c = 3, theme: i, onChange: e }, u) => {
9
+ const r = N(), { theme: d } = I(), s = o ? `${r}-name` : r, [p, x] = T(m ?? ""), f = j(
10
+ (n) => {
11
+ x(n.target.value), e == null || e();
12
+ },
13
+ [e]
14
+ );
15
+ return /* @__PURE__ */ h("div", { className: "flex flex-col gap-2", children: [
16
+ t ? /* @__PURE__ */ a("label", { htmlFor: s, className: "cursor-pointer", children: t }) : null,
17
+ /* @__PURE__ */ a(
18
+ "textarea",
19
+ {
20
+ id: s,
21
+ ref: u,
22
+ className: A({ theme: i ?? d }),
23
+ rows: c,
24
+ placeholder: l,
25
+ value: p,
26
+ onChange: f
27
+ }
28
+ )
29
+ ] });
30
+ }
31
+ );
32
+ export {
33
+ S as TextArea
34
+ };