@teach-in/react 0.3.0 → 0.4.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 (103) hide show
  1. package/dist/chunk-3YOW5DEZ.mjs +45 -0
  2. package/dist/chunk-4N3FFVKQ.mjs +14 -0
  3. package/dist/{chunk-QCLLPJMB.mjs → chunk-544SDU73.mjs} +2 -2
  4. package/dist/chunk-7BTEKEON.mjs +11 -0
  5. package/dist/{chunk-2CEZXLZR.mjs → chunk-AFVGHUW2.mjs} +1 -1
  6. package/dist/chunk-EEGPGLDC.mjs +26 -0
  7. package/dist/{chunk-GEJLG5RP.mjs → chunk-NLHQDWUK.mjs} +3 -2
  8. package/dist/chunk-PSK7I7V4.mjs +30 -0
  9. package/dist/chunk-Q2ILWL7L.mjs +1 -0
  10. package/dist/chunk-TSD6GU35.mjs +16 -0
  11. package/dist/chunk-UON5ACST.mjs +1 -0
  12. package/dist/chunk-UT5RUCAT.mjs +1 -0
  13. package/dist/{chunk-2ASQXBDD.mjs → chunk-WFNNN6WU.mjs} +1 -1
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +290 -234
  16. package/dist/index.mjs +148 -133
  17. package/dist/ui/data/image/image.d.ts +6 -0
  18. package/dist/ui/data/image/image.js +47 -0
  19. package/dist/ui/data/image/image.mjs +7 -0
  20. package/dist/ui/data/image/index.d.ts +1 -0
  21. package/dist/ui/data/image/index.js +49 -0
  22. package/dist/ui/data/image/index.mjs +8 -0
  23. package/dist/ui/data/index.d.ts +1 -0
  24. package/dist/ui/data/index.js +11 -0
  25. package/dist/ui/data/index.mjs +10 -5
  26. package/dist/ui/feedback/chip/chip.js +18 -1
  27. package/dist/ui/feedback/chip/chip.mjs +3 -1
  28. package/dist/ui/feedback/chip/index.js +18 -1
  29. package/dist/ui/feedback/chip/index.mjs +3 -1
  30. package/dist/ui/feedback/index.js +18 -1
  31. package/dist/ui/feedback/index.mjs +6 -4
  32. package/dist/ui/form/index.js +23 -10
  33. package/dist/ui/form/index.mjs +14 -14
  34. package/dist/ui/form/rhf/fields/autocomplete-field.mjs +10 -10
  35. package/dist/ui/form/rhf/fields/checkbox-field.mjs +10 -10
  36. package/dist/ui/form/rhf/fields/date-picker-field.mjs +10 -10
  37. package/dist/ui/form/rhf/fields/email-field.mjs +10 -10
  38. package/dist/ui/form/rhf/fields/index.js +23 -10
  39. package/dist/ui/form/rhf/fields/index.mjs +11 -11
  40. package/dist/ui/form/rhf/fields/input-field.mjs +10 -10
  41. package/dist/ui/form/rhf/fields/radio-field.mjs +10 -10
  42. package/dist/ui/form/rhf/fields/select-field.d.ts +8 -3
  43. package/dist/ui/form/rhf/fields/select-field.js +23 -10
  44. package/dist/ui/form/rhf/fields/select-field.mjs +11 -11
  45. package/dist/ui/form/rhf/fields/switch-field.mjs +10 -10
  46. package/dist/ui/form/rhf/fields/text-field.mjs +10 -10
  47. package/dist/ui/form/rhf/fields/textarea-field.mjs +10 -10
  48. package/dist/ui/form/rhf/index.js +23 -10
  49. package/dist/ui/form/rhf/index.mjs +11 -11
  50. package/dist/ui/format/index.mjs +12 -12
  51. package/dist/ui/index.js +288 -234
  52. package/dist/ui/index.mjs +145 -133
  53. package/dist/ui/inputs/index.js +21 -9
  54. package/dist/ui/inputs/index.mjs +18 -18
  55. package/dist/ui/inputs/select/index.js +21 -9
  56. package/dist/ui/inputs/select/index.mjs +1 -1
  57. package/dist/ui/inputs/select/select.d.ts +18 -5
  58. package/dist/ui/inputs/select/select.js +21 -9
  59. package/dist/ui/inputs/select/select.mjs +1 -1
  60. package/dist/ui/layout/container/container.mjs +73 -67
  61. package/dist/ui/layout/container/index.mjs +73 -67
  62. package/dist/ui/layout/index.mjs +76 -70
  63. package/dist/ui/layout/page/index.mjs +4 -2
  64. package/dist/ui/layout/page/page-loading.mjs +4 -2
  65. package/dist/ui/layout/page/section-loading.mjs +4 -2
  66. package/dist/ui/navigation/breadcrumbs/breadcrumbs.d.ts +10 -6
  67. package/dist/ui/navigation/breadcrumbs/breadcrumbs.js +4 -24
  68. package/dist/ui/navigation/breadcrumbs/breadcrumbs.mjs +1 -1
  69. package/dist/ui/navigation/breadcrumbs/index.js +4 -24
  70. package/dist/ui/navigation/breadcrumbs/index.mjs +1 -1
  71. package/dist/ui/navigation/index.js +4 -14
  72. package/dist/ui/navigation/index.mjs +9 -9
  73. package/dist/ui/overlays/index.d.ts +1 -0
  74. package/dist/ui/overlays/index.js +25 -2
  75. package/dist/ui/overlays/index.mjs +11 -6
  76. package/dist/ui/overlays/popover/index.d.ts +1 -0
  77. package/dist/ui/overlays/popover/index.js +51 -0
  78. package/dist/ui/overlays/popover/index.mjs +8 -0
  79. package/dist/ui/overlays/popover/popover.d.ts +10 -0
  80. package/dist/ui/overlays/popover/popover.js +49 -0
  81. package/dist/ui/overlays/popover/popover.mjs +7 -0
  82. package/dist/ui/provider/index.mjs +4 -2
  83. package/dist/ui/provider/ui-provider.mjs +4 -2
  84. package/dist/ui/surface/index.mjs +4 -4
  85. package/dist/ui/theme/colors/common.mjs +3 -3
  86. package/dist/ui/theme/colors/index.mjs +5 -5
  87. package/dist/ui/theme/colors/semantic.mjs +4 -4
  88. package/dist/ui/theme/colors.mjs +5 -5
  89. package/dist/ui/theme/index.mjs +6 -6
  90. package/dist/ui/theme/theme.mjs +6 -6
  91. package/dist/utils/extend-variants.d.ts +41 -0
  92. package/dist/utils/extend-variants.js +34 -0
  93. package/dist/utils/extend-variants.mjs +7 -0
  94. package/dist/utils/index.d.ts +1 -0
  95. package/dist/utils/index.js +36 -0
  96. package/dist/utils/index.mjs +8 -0
  97. package/package.json +5 -3
  98. package/dist/chunk-4KPEPEPC.mjs +0 -26
  99. package/dist/chunk-GQ3LBZ2Q.mjs +0 -33
  100. package/dist/chunk-ONQIPN3G.mjs +0 -14
  101. package/dist/{chunk-CYSW4N3T.mjs → chunk-3C4DPNCD.mjs} +0 -0
  102. package/dist/{chunk-IXPMUODA.mjs → chunk-5WDV3PDI.mjs} +6 -6
  103. /package/dist/{chunk-NMMWGIQE.mjs → chunk-DRZAPJZH.mjs} +0 -0
@@ -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
+ };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ // src/ui/data/image/image.tsx
4
+ import React from "react";
5
+ import { Image as HeroUIImage } from "@heroui/image";
6
+ import { jsx } from "react/jsx-runtime";
7
+ var Image = React.forwardRef(({ ...props }, ref) => {
8
+ return /* @__PURE__ */ jsx(HeroUIImage, { ref, ...props });
9
+ });
10
+ Image.displayName = "TeachInUI.Image";
11
+
12
+ export {
13
+ Image
14
+ };
@@ -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 = {
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ // src/utils/extend-variants.ts
4
+ import { extendVariants as heroUIExtendVariants } from "@heroui/system";
5
+ var extendVariants = (component, config) => {
6
+ return heroUIExtendVariants(component, config);
7
+ };
8
+
9
+ export {
10
+ extendVariants
11
+ };
@@ -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";
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import {
3
+ extendVariants
4
+ } from "./chunk-7BTEKEON.mjs";
5
+
6
+ // src/ui/feedback/chip/chip.tsx
7
+ import React from "react";
8
+ import { Chip as HeroUIChip } from "@heroui/chip";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var ChipCustom = extendVariants(HeroUIChip, {
11
+ variants: {
12
+ variant: {
13
+ bordered: { base: "border-1" },
14
+ faded: { base: "border-1" },
15
+ dot: { base: "border-1" }
16
+ }
17
+ }
18
+ });
19
+ var Chip = React.forwardRef(({ variant = "flat", ...props }, ref) => {
20
+ return /* @__PURE__ */ jsx(ChipCustom, { ref, variant, ...props });
21
+ });
22
+ Chip.displayName = "TeachInUI.Chip";
23
+
24
+ export {
25
+ Chip
26
+ };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "./chunk-GQ3LBZ2Q.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";
8
8
  import { jsx } from "react/jsx-runtime";
9
- function SelectField({ name, ...props }) {
9
+ function SelectField({ name, selectionMode, ...props }) {
10
10
  const { control } = useFormContext();
11
11
  return /* @__PURE__ */ jsx(
12
12
  Controller,
@@ -16,6 +16,7 @@ function SelectField({ name, ...props }) {
16
16
  render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
17
17
  Select,
18
18
  {
19
+ selectionMode,
19
20
  value: field.value,
20
21
  onChange: (value) => field.onChange(value),
21
22
  ...props,
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ // src/ui/overlays/popover/popover.tsx
4
+ import {
5
+ Popover as HeroUIPopover,
6
+ PopoverTrigger as HeroUIPopoverTrigger,
7
+ PopoverContent as HeroUIPopoverContent
8
+ } from "@heroui/popover";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var Root = ({ children, ...props }) => {
11
+ return /* @__PURE__ */ jsx(HeroUIPopover, { ...props, children });
12
+ };
13
+ Root.displayName = "TeachInUI.Popover.Root";
14
+ var Trigger = ({ children, ...props }) => {
15
+ return /* @__PURE__ */ jsx(HeroUIPopoverTrigger, { ...props, children });
16
+ };
17
+ Trigger.displayName = "TeachInUI.Popover.Trigger";
18
+ var Content = ({ children, ...props }) => {
19
+ return /* @__PURE__ */ jsx(HeroUIPopoverContent, { ...props, children });
20
+ };
21
+ Content.displayName = "TeachInUI.Popover.Content";
22
+ var Popover = {
23
+ Root,
24
+ Trigger,
25
+ Content
26
+ };
27
+
28
+ export {
29
+ Popover
30
+ };
@@ -0,0 +1 @@
1
+ "use client";
@@ -0,0 +1,16 @@
1
+ "use client";
2
+
3
+ // src/ui/navigation/breadcrumbs/breadcrumbs.tsx
4
+ import {
5
+ Breadcrumbs as HeroUIBreadcrumbs,
6
+ BreadcrumbItem as HeroUIBreadcrumbItem
7
+ } from "@heroui/breadcrumbs";
8
+ var Breadcrumbs = Object.assign(HeroUIBreadcrumbs, { displayName: "TeachInUI.Breadcrumbs" });
9
+ var BreadcrumbItem = Object.assign(HeroUIBreadcrumbItem, {
10
+ displayName: "TeachInUI.BreadcrumbItem"
11
+ });
12
+
13
+ export {
14
+ Breadcrumbs,
15
+ BreadcrumbItem
16
+ };
@@ -0,0 +1 @@
1
+ "use client";
@@ -0,0 +1 @@
1
+ "use client";
@@ -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";
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./ui";
2
+ export * from "./utils";