@teach-in/react 1.2.0 → 1.3.0

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 (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +9 -9
  3. package/dist/chunk-3YOW5DEZ.mjs +45 -0
  4. package/dist/{chunk-QCLLPJMB.mjs → chunk-544SDU73.mjs} +2 -2
  5. package/dist/{chunk-2CEZXLZR.mjs → chunk-AFVGHUW2.mjs} +1 -1
  6. package/dist/{chunk-IU2JYI7W.mjs → chunk-CETCW7DS.mjs} +1 -1
  7. package/dist/{chunk-5FFWQB7D.mjs → chunk-JDFRAN4S.mjs} +2 -12
  8. package/dist/{chunk-KTWHCUYV.mjs → chunk-KTUGFQWJ.mjs} +1 -1
  9. package/dist/{chunk-46SKVFMZ.mjs → chunk-LJIVY6GU.mjs} +1 -1
  10. package/dist/{chunk-CKJ5U5Q4.mjs → chunk-NLHQDWUK.mjs} +1 -1
  11. package/dist/{chunk-R46SWVWL.mjs → chunk-R7LDL5CU.mjs} +1 -1
  12. package/dist/chunk-V2G5QHZZ.mjs +14 -0
  13. package/dist/{chunk-2ASQXBDD.mjs → chunk-WFNNN6WU.mjs} +1 -1
  14. package/dist/index.js +230 -575
  15. package/dist/index.mjs +125 -141
  16. package/dist/ui/data/index.mjs +8 -8
  17. package/dist/ui/feedback/index.mjs +14 -14
  18. package/dist/ui/form/index.js +106 -447
  19. package/dist/ui/form/index.mjs +21 -31
  20. package/dist/ui/form/rhf/fields/autocomplete-field.mjs +14 -20
  21. package/dist/ui/form/rhf/fields/checkbox-field.mjs +14 -20
  22. package/dist/ui/form/rhf/fields/date-picker-field.mjs +14 -20
  23. package/dist/ui/form/rhf/fields/email-field.js +10 -147
  24. package/dist/ui/form/rhf/fields/email-field.mjs +15 -21
  25. package/dist/ui/form/rhf/fields/index.d.ts +0 -1
  26. package/dist/ui/form/rhf/fields/index.js +102 -443
  27. package/dist/ui/form/rhf/fields/index.mjs +21 -31
  28. package/dist/ui/form/rhf/fields/input-field.js +6 -153
  29. package/dist/ui/form/rhf/fields/input-field.mjs +15 -21
  30. package/dist/ui/form/rhf/fields/radio-field.mjs +14 -20
  31. package/dist/ui/form/rhf/fields/select-field.js +26 -136
  32. package/dist/ui/form/rhf/fields/select-field.mjs +15 -21
  33. package/dist/ui/form/rhf/fields/switch-field.mjs +14 -20
  34. package/dist/ui/form/rhf/fields/text-field.js +10 -147
  35. package/dist/ui/form/rhf/fields/text-field.mjs +15 -21
  36. package/dist/ui/form/rhf/fields/textarea-field.mjs +14 -20
  37. package/dist/ui/form/rhf/index.js +102 -443
  38. package/dist/ui/form/rhf/index.mjs +21 -31
  39. package/dist/ui/format/index.mjs +3 -3
  40. package/dist/ui/index.js +230 -575
  41. package/dist/ui/index.mjs +125 -141
  42. package/dist/ui/inputs/checkbox/index.mjs +3 -3
  43. package/dist/ui/inputs/email/email.js +7 -144
  44. package/dist/ui/inputs/email/email.mjs +2 -4
  45. package/dist/ui/inputs/email/index.js +7 -144
  46. package/dist/ui/inputs/email/index.mjs +2 -4
  47. package/dist/ui/inputs/index.d.ts +0 -2
  48. package/dist/ui/inputs/index.js +56 -363
  49. package/dist/ui/inputs/index.mjs +25 -37
  50. package/dist/ui/inputs/input/index.js +3 -140
  51. package/dist/ui/inputs/input/index.mjs +1 -3
  52. package/dist/ui/inputs/input/input.d.ts +0 -1
  53. package/dist/ui/inputs/input/input.js +3 -140
  54. package/dist/ui/inputs/input/input.mjs +1 -3
  55. package/dist/ui/inputs/select/index.js +22 -132
  56. package/dist/ui/inputs/select/index.mjs +1 -3
  57. package/dist/ui/inputs/select/select.d.ts +0 -4
  58. package/dist/ui/inputs/select/select.js +22 -132
  59. package/dist/ui/inputs/select/select.mjs +1 -3
  60. package/dist/ui/inputs/text/index.js +7 -144
  61. package/dist/ui/inputs/text/index.mjs +2 -4
  62. package/dist/ui/inputs/text/text.js +7 -144
  63. package/dist/ui/inputs/text/text.mjs +2 -4
  64. package/dist/ui/layout/container/container.mjs +64 -71
  65. package/dist/ui/layout/container/index.mjs +64 -71
  66. package/dist/ui/layout/index.mjs +69 -76
  67. package/dist/ui/layout/page/index.mjs +3 -3
  68. package/dist/ui/layout/page/page-loading.mjs +3 -3
  69. package/dist/ui/layout/page/section-loading.mjs +3 -3
  70. package/dist/ui/navigation/index.mjs +5 -5
  71. package/dist/ui/overlays/index.mjs +4 -4
  72. package/dist/ui/provider/index.mjs +3 -3
  73. package/dist/ui/provider/ui-provider.mjs +3 -3
  74. package/dist/ui/theme/colors/common.mjs +3 -3
  75. package/dist/ui/theme/colors/index.mjs +6 -6
  76. package/dist/ui/theme/colors/semantic.mjs +4 -4
  77. package/dist/ui/theme/colors.mjs +6 -6
  78. package/dist/ui/theme/index.mjs +6 -6
  79. package/dist/ui/theme/theme.mjs +6 -6
  80. package/package.json +1 -1
  81. package/dist/chunk-2UHA3DYG.mjs +0 -62
  82. package/dist/chunk-C2VWADF5.mjs +0 -34
  83. package/dist/chunk-CUEG2BFV.mjs +0 -34
  84. package/dist/chunk-MCQGBAUS.mjs +0 -73
  85. package/dist/chunk-NSU66J5E.mjs +0 -59
  86. package/dist/chunk-SEJXJZSK.mjs +0 -64
  87. package/dist/chunk-TUIN5YJW.mjs +0 -33
  88. package/dist/chunk-UQAG7TKJ.mjs +0 -1
  89. package/dist/chunk-VXYV37IM.mjs +0 -74
  90. package/dist/ui/form/rhf/fields/search-field.d.ts +0 -10
  91. package/dist/ui/form/rhf/fields/search-field.js +0 -296
  92. package/dist/ui/form/rhf/fields/search-field.mjs +0 -37
  93. package/dist/ui/inputs/clear-button.d.ts +0 -5
  94. package/dist/ui/inputs/clear-button.js +0 -67
  95. package/dist/ui/inputs/clear-button.mjs +0 -8
  96. package/dist/ui/inputs/input/use-input.d.ts +0 -19
  97. package/dist/ui/inputs/input/use-input.js +0 -82
  98. package/dist/ui/inputs/input/use-input.mjs +0 -7
  99. package/dist/ui/inputs/search/index.d.ts +0 -1
  100. package/dist/ui/inputs/search/index.js +0 -270
  101. package/dist/ui/inputs/search/index.mjs +0 -13
  102. package/dist/ui/inputs/search/search.d.ts +0 -7
  103. package/dist/ui/inputs/search/search.js +0 -268
  104. package/dist/ui/inputs/search/search.mjs +0 -12
  105. package/dist/ui/inputs/search/use-search.d.ts +0 -12
  106. package/dist/ui/inputs/search/use-search.js +0 -57
  107. package/dist/ui/inputs/search/use-search.mjs +0 -7
  108. package/dist/ui/inputs/select/use-select.d.ts +0 -17
  109. package/dist/ui/inputs/select/use-select.js +0 -85
  110. package/dist/ui/inputs/select/use-select.mjs +0 -7
  111. package/dist/{chunk-IXPMUODA.mjs → chunk-5WDV3PDI.mjs} +6 -6
  112. /package/dist/{chunk-5RNCFTW5.mjs → chunk-CZEO3U25.mjs} +0 -0
  113. /package/dist/{chunk-PTCNYQVY.mjs → chunk-Q6JSJOU4.mjs} +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Next UI Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Next UI Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # @teach-in/react
2
-
3
- ## Installation
4
-
5
- ```sh
6
- yarn add @teach-in/react
7
- # or
8
- npm i @teach-in/react
9
- ```
1
+ # @teach-in/react
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ yarn add @teach-in/react
7
+ # or
8
+ npm i @teach-in/react
9
+ ```
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ // src/ui/inputs/select/select.tsx
4
+ import React from "react";
5
+ import { Select as HeroUISelect, SelectItem as HeroUISelectItem } from "@heroui/select";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var Select = React.forwardRef(
8
+ ({ value, items, onChange, selectionMode, ...props }, ref) => {
9
+ const isMultiple = selectionMode === "multiple";
10
+ const selectedKeys = React.useMemo(() => {
11
+ if (value == null) return /* @__PURE__ */ new Set();
12
+ return new Set(Array.isArray(value) ? value : [value]);
13
+ }, [value]);
14
+ const handleSelectionChange = React.useCallback(
15
+ (keys) => {
16
+ var _a;
17
+ if (keys === "all") return;
18
+ const selected = Array.from(keys).filter((key) => typeof key === "string");
19
+ if (isMultiple) {
20
+ onChange == null ? void 0 : onChange(selected);
21
+ } else {
22
+ onChange == null ? void 0 : onChange((_a = selected[0]) != null ? _a : null);
23
+ }
24
+ },
25
+ [onChange, isMultiple]
26
+ );
27
+ return /* @__PURE__ */ jsx(
28
+ HeroUISelect,
29
+ {
30
+ ref,
31
+ items,
32
+ selectedKeys,
33
+ selectionMode,
34
+ onSelectionChange: handleSelectionChange,
35
+ ...props,
36
+ children: (item) => /* @__PURE__ */ jsx(HeroUISelectItem, { children: item.label }, item.key)
37
+ }
38
+ );
39
+ }
40
+ );
41
+ Select.displayName = "TeachInUI.Select";
42
+
43
+ export {
44
+ Select
45
+ };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  semanticColors
4
- } from "./chunk-2CEZXLZR.mjs";
4
+ } from "./chunk-AFVGHUW2.mjs";
5
5
  import {
6
6
  commonColors
7
- } from "./chunk-IXPMUODA.mjs";
7
+ } from "./chunk-5WDV3PDI.mjs";
8
8
 
9
9
  // src/ui/theme/colors/index.ts
10
10
  var colors = {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  commonColors
4
- } from "./chunk-IXPMUODA.mjs";
4
+ } from "./chunk-5WDV3PDI.mjs";
5
5
  import {
6
6
  swapColorValues
7
7
  } from "./chunk-VIPLRFPR.mjs";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Text
4
- } from "./chunk-KTWHCUYV.mjs";
4
+ } from "./chunk-KTUGFQWJ.mjs";
5
5
 
6
6
  // src/ui/form/rhf/fields/text-field.tsx
7
7
  import { Controller, useFormContext } from "react-hook-form";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "./chunk-MCQGBAUS.mjs";
4
+ } from "./chunk-V2G5QHZZ.mjs";
5
5
 
6
6
  // src/ui/form/rhf/fields/input-field.tsx
7
7
  import { Controller, useFormContext } from "react-hook-form";
@@ -13,17 +13,7 @@ function InputField({ name, ...props }) {
13
13
  {
14
14
  control,
15
15
  name,
16
- render: ({ field: { ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx(
17
- Input,
18
- {
19
- ...props,
20
- ...field,
21
- ref,
22
- errorMessage: error == null ? void 0 : error.message,
23
- isInvalid: !!error,
24
- onValueChange: field.onChange
25
- }
26
- )
16
+ render: ({ field: { ref, ...field }, fieldState: { error } }) => /* @__PURE__ */ jsx(Input, { ...props, ...field, ref, errorMessage: error == null ? void 0 : error.message, isInvalid: !!error })
27
17
  }
28
18
  );
29
19
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "./chunk-MCQGBAUS.mjs";
4
+ } from "./chunk-V2G5QHZZ.mjs";
5
5
 
6
6
  // src/ui/inputs/text/text.tsx
7
7
  import React from "react";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "./chunk-MCQGBAUS.mjs";
4
+ } from "./chunk-V2G5QHZZ.mjs";
5
5
 
6
6
  // src/ui/inputs/email/email.tsx
7
7
  import React from "react";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "./chunk-VXYV37IM.mjs";
4
+ } from "./chunk-3YOW5DEZ.mjs";
5
5
 
6
6
  // src/ui/form/rhf/fields/select-field.tsx
7
7
  import { Controller, useFormContext } from "react-hook-form";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Email
4
- } from "./chunk-46SKVFMZ.mjs";
4
+ } from "./chunk-LJIVY6GU.mjs";
5
5
 
6
6
  // src/ui/form/rhf/fields/email-field.tsx
7
7
  import { Controller, useFormContext } from "react-hook-form";
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ // src/ui/inputs/input/input.tsx
4
+ import React from "react";
5
+ import { Input as HeroUIInput } from "@heroui/input";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var Input = React.forwardRef(({ ...props }, ref) => {
8
+ return /* @__PURE__ */ jsx(HeroUIInput, { ref, ...props });
9
+ });
10
+ Input.displayName = "TeachInUI.Input";
11
+
12
+ export {
13
+ Input
14
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  semanticColors
4
- } from "./chunk-2CEZXLZR.mjs";
4
+ } from "./chunk-AFVGHUW2.mjs";
5
5
 
6
6
  // src/ui/theme/theme.ts
7
7
  import { heroui } from "@heroui/theme";