@teach-in/react 0.3.0 → 1.0.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.
- package/dist/{chunk-2CEZXLZR.mjs → chunk-3VAZY2QK.mjs} +1 -1
- package/dist/chunk-3YOW5DEZ.mjs +45 -0
- package/dist/{chunk-TYMUQULA.mjs → chunk-4BGIUXAF.mjs} +1 -1
- package/dist/chunk-4N3FFVKQ.mjs +14 -0
- package/dist/chunk-7BTEKEON.mjs +11 -0
- package/dist/{chunk-2ASQXBDD.mjs → chunk-AMNORHD6.mjs} +1 -1
- package/dist/{chunk-QCLLPJMB.mjs → chunk-CFG5V7VB.mjs} +2 -2
- package/dist/chunk-EEGPGLDC.mjs +26 -0
- package/dist/{chunk-GEJLG5RP.mjs → chunk-NLHQDWUK.mjs} +3 -2
- package/dist/chunk-PSK7I7V4.mjs +30 -0
- package/dist/chunk-Q2ILWL7L.mjs +1 -0
- package/dist/chunk-TSD6GU35.mjs +16 -0
- package/dist/chunk-UON5ACST.mjs +1 -0
- package/dist/chunk-UT5RUCAT.mjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +291 -235
- package/dist/index.mjs +157 -142
- package/dist/ui/actions/button/button.js +1 -1
- package/dist/ui/actions/button/button.mjs +1 -1
- package/dist/ui/actions/button/index.js +1 -1
- package/dist/ui/actions/button/index.mjs +1 -1
- package/dist/ui/actions/index.js +1 -1
- package/dist/ui/actions/index.mjs +1 -1
- package/dist/ui/data/image/image.d.ts +6 -0
- package/dist/ui/data/image/image.js +47 -0
- package/dist/ui/data/image/image.mjs +7 -0
- package/dist/ui/data/image/index.d.ts +1 -0
- package/dist/ui/data/image/index.js +49 -0
- package/dist/ui/data/image/index.mjs +8 -0
- package/dist/ui/data/index.d.ts +1 -0
- package/dist/ui/data/index.js +11 -0
- package/dist/ui/data/index.mjs +18 -13
- package/dist/ui/feedback/chip/chip.js +18 -1
- package/dist/ui/feedback/chip/chip.mjs +3 -1
- package/dist/ui/feedback/chip/index.js +18 -1
- package/dist/ui/feedback/chip/index.mjs +3 -1
- package/dist/ui/feedback/index.js +18 -1
- package/dist/ui/feedback/index.mjs +13 -11
- package/dist/ui/form/index.js +23 -10
- package/dist/ui/form/index.mjs +12 -12
- package/dist/ui/form/rhf/fields/autocomplete-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/checkbox-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/date-picker-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/email-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/index.js +23 -10
- package/dist/ui/form/rhf/fields/index.mjs +12 -12
- package/dist/ui/form/rhf/fields/input-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/radio-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/select-field.d.ts +8 -3
- package/dist/ui/form/rhf/fields/select-field.js +23 -10
- package/dist/ui/form/rhf/fields/select-field.mjs +12 -12
- package/dist/ui/form/rhf/fields/switch-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/text-field.mjs +11 -11
- package/dist/ui/form/rhf/fields/textarea-field.mjs +11 -11
- package/dist/ui/form/rhf/index.js +23 -10
- package/dist/ui/form/rhf/index.mjs +12 -12
- package/dist/ui/format/index.mjs +6 -6
- package/dist/ui/index.js +289 -235
- package/dist/ui/index.mjs +155 -143
- package/dist/ui/inputs/index.js +21 -9
- package/dist/ui/inputs/index.mjs +22 -22
- package/dist/ui/inputs/radio/index.mjs +3 -3
- package/dist/ui/inputs/select/index.js +21 -9
- package/dist/ui/inputs/select/index.mjs +1 -1
- package/dist/ui/inputs/select/select.d.ts +18 -5
- package/dist/ui/inputs/select/select.js +21 -9
- package/dist/ui/inputs/select/select.mjs +1 -1
- package/dist/ui/layout/container/container.mjs +71 -65
- package/dist/ui/layout/container/index.mjs +71 -65
- package/dist/ui/layout/index.mjs +81 -75
- package/dist/ui/layout/page/index.mjs +7 -5
- package/dist/ui/layout/page/page-loading.mjs +4 -2
- package/dist/ui/layout/page/section-loading.mjs +4 -2
- package/dist/ui/navigation/breadcrumbs/breadcrumbs.d.ts +10 -6
- package/dist/ui/navigation/breadcrumbs/breadcrumbs.js +4 -24
- package/dist/ui/navigation/breadcrumbs/breadcrumbs.mjs +1 -1
- package/dist/ui/navigation/breadcrumbs/index.js +4 -24
- package/dist/ui/navigation/breadcrumbs/index.mjs +1 -1
- package/dist/ui/navigation/index.js +4 -14
- package/dist/ui/navigation/index.mjs +11 -11
- package/dist/ui/overlays/index.d.ts +1 -0
- package/dist/ui/overlays/index.js +25 -2
- package/dist/ui/overlays/index.mjs +10 -5
- package/dist/ui/overlays/popover/index.d.ts +1 -0
- package/dist/ui/overlays/popover/index.js +51 -0
- package/dist/ui/overlays/popover/index.mjs +8 -0
- package/dist/ui/overlays/popover/popover.d.ts +10 -0
- package/dist/ui/overlays/popover/popover.js +49 -0
- package/dist/ui/overlays/popover/popover.mjs +7 -0
- package/dist/ui/provider/index.mjs +4 -2
- package/dist/ui/provider/ui-provider.mjs +4 -2
- package/dist/ui/theme/colors/common.mjs +5 -5
- package/dist/ui/theme/colors/index.mjs +8 -8
- package/dist/ui/theme/colors/semantic.mjs +6 -6
- package/dist/ui/theme/colors.mjs +8 -8
- package/dist/ui/theme/index.mjs +8 -8
- package/dist/ui/theme/theme.mjs +8 -8
- package/dist/utils/extend-variants.d.ts +41 -0
- package/dist/utils/extend-variants.js +34 -0
- package/dist/utils/extend-variants.mjs +7 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +36 -0
- package/dist/utils/index.mjs +8 -0
- package/package.json +5 -3
- package/dist/chunk-4KPEPEPC.mjs +0 -26
- package/dist/chunk-GQ3LBZ2Q.mjs +0 -33
- package/dist/chunk-ONQIPN3G.mjs +0 -14
- package/dist/{chunk-CYSW4N3T.mjs → chunk-3C4DPNCD.mjs} +0 -0
- package/dist/{chunk-NMMWGIQE.mjs → chunk-DRZAPJZH.mjs} +0 -0
- package/dist/{chunk-IXPMUODA.mjs → chunk-STVN4B47.mjs} +12 -12
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -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-
|
|
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";
|
package/dist/index.d.ts
CHANGED