@jbpark/ui-kit 2.3.2 → 2.3.4
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/README.ko.md +0 -1
- package/README.md +0 -1
- package/dist/Menu.d.mts +62 -2
- package/dist/Menu.d.mts.map +1 -0
- package/dist/Menu.mjs +66 -5
- package/dist/Menu.mjs.map +1 -0
- package/dist/Reveals.d.mts +43 -2
- package/dist/Reveals.d.mts.map +1 -0
- package/dist/Reveals.mjs +28 -3
- package/dist/Reveals.mjs.map +1 -0
- package/dist/Typography.d.mts +40 -2
- package/dist/Typography.d.mts.map +1 -0
- package/dist/Typography.mjs +20 -3
- package/dist/Typography.mjs.map +1 -0
- package/dist/{chunk-BWyCjowX.mjs → _virtual/_rolldown/runtime.mjs} +4 -4
- package/dist/components/atoms/Button/index.d.mts +36 -0
- package/dist/components/atoms/Button/index.d.mts.map +1 -0
- package/dist/components/atoms/Button/index.mjs +56 -0
- package/dist/components/atoms/Button/index.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/Group/index.d.mts +21 -0
- package/dist/components/atoms/Checkbox/Group/index.d.mts.map +1 -0
- package/dist/components/atoms/Checkbox/Group/index.mjs +41 -0
- package/dist/components/atoms/Checkbox/Group/index.mjs.map +1 -0
- package/dist/components/atoms/Checkbox/index.d.mts +45 -0
- package/dist/components/atoms/Checkbox/index.d.mts.map +1 -0
- package/dist/components/atoms/Checkbox/index.mjs +70 -0
- package/dist/components/atoms/Checkbox/index.mjs.map +1 -0
- package/dist/components/atoms/ColorPicker/index.d.mts +18 -0
- package/dist/components/atoms/ColorPicker/index.d.mts.map +1 -0
- package/dist/components/atoms/ColorPicker/index.mjs +39 -0
- package/dist/components/atoms/ColorPicker/index.mjs.map +1 -0
- package/dist/components/atoms/FloatButton/BackTop/index.d.mts +12 -0
- package/dist/components/atoms/FloatButton/BackTop/index.d.mts.map +1 -0
- package/dist/components/atoms/FloatButton/BackTop/index.mjs +27 -0
- package/dist/components/atoms/FloatButton/BackTop/index.mjs.map +1 -0
- package/dist/components/atoms/FloatButton/index.d.mts +22 -0
- package/dist/components/atoms/FloatButton/index.d.mts.map +1 -0
- package/dist/components/atoms/FloatButton/index.mjs +19 -0
- package/dist/components/atoms/FloatButton/index.mjs.map +1 -0
- package/dist/components/atoms/Input/Search/index.d.mts +15 -0
- package/dist/components/atoms/Input/Search/index.d.mts.map +1 -0
- package/dist/components/atoms/Input/Search/index.mjs +57 -0
- package/dist/components/atoms/Input/Search/index.mjs.map +1 -0
- package/dist/components/atoms/Input/TextArea/index.d.mts +1 -0
- package/dist/components/atoms/Input/TextArea/index.mjs +18 -0
- package/dist/components/atoms/Input/TextArea/index.mjs.map +1 -0
- package/dist/components/atoms/Input/index.d.mts +31 -0
- package/dist/components/atoms/Input/index.d.mts.map +1 -0
- package/dist/components/atoms/Input/index.mjs +17 -0
- package/dist/components/atoms/Input/index.mjs.map +1 -0
- package/dist/components/atoms/Popover/index.d.mts +19 -0
- package/dist/components/atoms/Popover/index.d.mts.map +1 -0
- package/dist/components/atoms/Popover/index.mjs +229 -0
- package/dist/components/atoms/Popover/index.mjs.map +1 -0
- package/dist/components/atoms/Progress/index.d.mts +20 -0
- package/dist/components/atoms/Progress/index.d.mts.map +1 -0
- package/dist/components/atoms/Progress/index.mjs +25 -0
- package/dist/components/atoms/Progress/index.mjs.map +1 -0
- package/dist/components/atoms/Radio/Group/index.d.mts +21 -0
- package/dist/components/atoms/Radio/Group/index.d.mts.map +1 -0
- package/dist/components/atoms/Radio/Group/index.mjs +41 -0
- package/dist/components/atoms/Radio/Group/index.mjs.map +1 -0
- package/dist/components/atoms/Radio/index.d.mts +47 -0
- package/dist/components/atoms/Radio/index.d.mts.map +1 -0
- package/dist/components/atoms/Radio/index.mjs +77 -0
- package/dist/components/atoms/Radio/index.mjs.map +1 -0
- package/dist/components/atoms/Select/index.d.mts +31 -0
- package/dist/components/atoms/Select/index.d.mts.map +1 -0
- package/dist/components/atoms/Select/index.mjs +31 -0
- package/dist/components/atoms/Select/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/Button/index.d.mts +2 -0
- package/dist/components/atoms/Skeleton/Button/index.mjs +15 -0
- package/dist/components/atoms/Skeleton/Button/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/Node/index.d.mts +2 -0
- package/dist/components/atoms/Skeleton/Node/index.mjs +16 -0
- package/dist/components/atoms/Skeleton/Node/index.mjs.map +1 -0
- package/dist/components/atoms/Skeleton/index.d.mts +51 -0
- package/dist/components/atoms/Skeleton/index.d.mts.map +1 -0
- package/dist/components/atoms/Skeleton/index.mjs +46 -0
- package/dist/components/atoms/Skeleton/index.mjs.map +1 -0
- package/dist/components/atoms/Spin/index.d.mts +14 -0
- package/dist/components/atoms/Spin/index.d.mts.map +1 -0
- package/dist/components/atoms/Spin/index.mjs +17 -0
- package/dist/components/atoms/Spin/index.mjs.map +1 -0
- package/dist/components/atoms/Switch/index.d.mts +24 -0
- package/dist/components/atoms/Switch/index.d.mts.map +1 -0
- package/dist/components/atoms/Switch/index.mjs +32 -0
- package/dist/components/atoms/Switch/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Link/index.d.mts +12 -0
- package/dist/components/atoms/Typography/Link/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Link/index.mjs +15 -0
- package/dist/components/atoms/Typography/Link/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Paragraph/index.d.mts +12 -0
- package/dist/components/atoms/Typography/Paragraph/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Paragraph/index.mjs +15 -0
- package/dist/components/atoms/Typography/Paragraph/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Text/index.d.mts +17 -0
- package/dist/components/atoms/Typography/Text/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Text/index.mjs +15 -0
- package/dist/components/atoms/Typography/Text/index.mjs.map +1 -0
- package/dist/components/atoms/Typography/Title/index.d.mts +15 -0
- package/dist/components/atoms/Typography/Title/index.d.mts.map +1 -0
- package/dist/components/atoms/Typography/Title/index.mjs +24 -0
- package/dist/components/atoms/Typography/Title/index.mjs.map +1 -0
- package/dist/components/atoms/index.d.mts +13 -0
- package/dist/components/atoms/index.mjs +15 -0
- package/dist/components/molecules/Card/index.d.mts +22 -0
- package/dist/components/molecules/Card/index.d.mts.map +1 -0
- package/dist/components/molecules/Card/index.mjs +21 -0
- package/dist/components/molecules/Card/index.mjs.map +1 -0
- package/dist/components/molecules/Collapse/index.d.mts +36 -0
- package/dist/components/molecules/Collapse/index.d.mts.map +1 -0
- package/dist/components/molecules/Collapse/index.mjs +53 -0
- package/dist/components/molecules/Collapse/index.mjs.map +1 -0
- package/dist/components/molecules/Dropdown/index.d.mts +23 -0
- package/dist/components/molecules/Dropdown/index.d.mts.map +1 -0
- package/dist/components/molecules/Dropdown/index.mjs +66 -0
- package/dist/components/molecules/Dropdown/index.mjs.map +1 -0
- package/dist/components/molecules/Marquees/Item/index.d.mts +17 -0
- package/dist/components/molecules/Marquees/Item/index.d.mts.map +1 -0
- package/dist/components/molecules/Marquees/Item/index.mjs +103 -0
- package/dist/components/molecules/Marquees/Item/index.mjs.map +1 -0
- package/dist/components/molecules/Marquees/index.d.mts +31 -0
- package/dist/components/molecules/Marquees/index.d.mts.map +1 -0
- package/dist/components/molecules/Marquees/index.mjs +63 -0
- package/dist/components/molecules/Marquees/index.mjs.map +1 -0
- package/dist/components/molecules/Menu/Item/Label/index.mjs +18 -0
- package/dist/components/molecules/Menu/Item/Label/index.mjs.map +1 -0
- package/dist/components/molecules/Menu/Item/index.mjs +122 -0
- package/dist/components/molecules/Menu/Item/index.mjs.map +1 -0
- package/dist/{index-BcxCfsJl.d.mts → components/molecules/Reveals/Item/index.d.mts} +4 -41
- package/dist/components/molecules/Reveals/Item/index.d.mts.map +1 -0
- package/dist/{Reveals-Cqo3i2hh.mjs → components/molecules/Reveals/Item/index.mjs} +5 -27
- package/dist/components/molecules/Reveals/Item/index.mjs.map +1 -0
- package/dist/components/molecules/Space/index.d.mts +34 -0
- package/dist/components/molecules/Space/index.d.mts.map +1 -0
- package/dist/components/molecules/Space/index.mjs +41 -0
- package/dist/components/molecules/Space/index.mjs.map +1 -0
- package/dist/components/molecules/index.d.mts +7 -0
- package/dist/components/molecules/index.mjs +9 -0
- package/dist/components/organisms/Drawer/index.d.mts +54 -0
- package/dist/components/organisms/Drawer/index.d.mts.map +1 -0
- package/dist/components/organisms/Drawer/index.mjs +72 -0
- package/dist/components/organisms/Drawer/index.mjs.map +1 -0
- package/dist/components/organisms/List/Item/index.mjs +15 -0
- package/dist/components/organisms/List/Item/index.mjs.map +1 -0
- package/dist/components/organisms/List/index.d.mts +52 -0
- package/dist/components/organisms/List/index.d.mts.map +1 -0
- package/dist/components/organisms/List/index.mjs +77 -0
- package/dist/components/organisms/List/index.mjs.map +1 -0
- package/dist/components/organisms/Modal/index.d.mts +66 -0
- package/dist/components/organisms/Modal/index.d.mts.map +1 -0
- package/dist/components/organisms/Modal/index.mjs +197 -0
- package/dist/components/organisms/Modal/index.mjs.map +1 -0
- package/dist/components/organisms/Swiper/Slide/index.mjs +17 -0
- package/dist/components/organisms/Swiper/Slide/index.mjs.map +1 -0
- package/dist/components/organisms/Swiper/index.d.mts +42 -0
- package/dist/components/organisms/Swiper/index.d.mts.map +1 -0
- package/dist/components/organisms/Swiper/index.mjs +58 -0
- package/dist/components/organisms/Swiper/index.mjs.map +1 -0
- package/dist/components/organisms/index.d.mts +4 -0
- package/dist/components/organisms/index.mjs +6 -0
- package/dist/components/templates/Layout/Content/index.d.mts +1 -0
- package/dist/components/templates/Layout/Content/index.mjs +15 -0
- package/dist/components/templates/Layout/Content/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Footer/index.d.mts +1 -0
- package/dist/components/templates/Layout/Footer/index.mjs +15 -0
- package/dist/components/templates/Layout/Footer/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Header/index.d.mts +7 -0
- package/dist/components/templates/Layout/Header/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/Header/index.mjs +15 -0
- package/dist/components/templates/Layout/Header/index.mjs.map +1 -0
- package/dist/components/templates/Layout/Sider/index.d.mts +1 -0
- package/dist/components/templates/Layout/Sider/index.mjs +15 -0
- package/dist/components/templates/Layout/Sider/index.mjs.map +1 -0
- package/dist/components/templates/Layout/index.d.mts +38 -0
- package/dist/components/templates/Layout/index.d.mts.map +1 -0
- package/dist/components/templates/Layout/index.mjs +23 -0
- package/dist/components/templates/Layout/index.mjs.map +1 -0
- package/dist/components/templates/index.d.mts +1 -0
- package/dist/components/templates/index.mjs +3 -0
- package/dist/core/accordion.d.mts +32 -0
- package/dist/core/accordion.d.mts.map +1 -0
- package/dist/core/accordion.mjs +59 -0
- package/dist/core/accordion.mjs.map +1 -0
- package/dist/core/button.d.mts +26 -0
- package/dist/core/button.d.mts.map +1 -0
- package/dist/core/button.mjs +55 -0
- package/dist/core/button.mjs.map +1 -0
- package/dist/core/checkbox.d.mts +15 -0
- package/dist/core/checkbox.d.mts.map +1 -0
- package/dist/core/checkbox.mjs +34 -0
- package/dist/core/checkbox.mjs.map +1 -0
- package/dist/core/dialog.d.mts +68 -0
- package/dist/core/dialog.d.mts.map +1 -0
- package/dist/core/dialog.mjs +124 -0
- package/dist/core/dialog.mjs.map +1 -0
- package/dist/core/drawer.d.mts +60 -0
- package/dist/core/drawer.d.mts.map +1 -0
- package/dist/core/drawer.mjs +120 -0
- package/dist/core/drawer.mjs.map +1 -0
- package/dist/core/field.d.mts +68 -0
- package/dist/core/field.d.mts.map +1 -0
- package/dist/core/field.mjs +145 -0
- package/dist/core/field.mjs.map +1 -0
- package/dist/core/input.d.mts +15 -0
- package/dist/core/input.d.mts.map +1 -0
- package/dist/core/input.mjs +27 -0
- package/dist/core/input.mjs.map +1 -0
- package/dist/core/label.d.mts +15 -0
- package/dist/core/label.d.mts.map +1 -0
- package/dist/core/label.mjs +24 -0
- package/dist/core/label.mjs.map +1 -0
- package/dist/core/popover.d.mts +38 -0
- package/dist/core/popover.d.mts.map +1 -0
- package/dist/core/popover.mjs +78 -0
- package/dist/core/popover.mjs.map +1 -0
- package/dist/core/progress.d.mts +22 -0
- package/dist/core/progress.d.mts.map +1 -0
- package/dist/core/progress.mjs +29 -0
- package/dist/core/progress.mjs.map +1 -0
- package/dist/core/radio-group.d.mts +19 -0
- package/dist/core/radio-group.d.mts.map +1 -0
- package/dist/core/radio-group.mjs +43 -0
- package/dist/core/radio-group.mjs.map +1 -0
- package/dist/core/select.d.mts +56 -0
- package/dist/core/select.d.mts.map +1 -0
- package/dist/core/select.mjs +144 -0
- package/dist/core/select.mjs.map +1 -0
- package/dist/core/separator.d.mts +17 -0
- package/dist/core/separator.d.mts.map +1 -0
- package/dist/core/separator.mjs +25 -0
- package/dist/core/separator.mjs.map +1 -0
- package/dist/core/skeleton.d.mts +13 -0
- package/dist/core/skeleton.d.mts.map +1 -0
- package/dist/core/skeleton.mjs +17 -0
- package/dist/core/skeleton.mjs.map +1 -0
- package/dist/core/switch.d.mts +22 -0
- package/dist/core/switch.d.mts.map +1 -0
- package/dist/core/switch.mjs +39 -0
- package/dist/core/switch.mjs.map +1 -0
- package/dist/core/textarea.d.mts +14 -0
- package/dist/core/textarea.d.mts.map +1 -0
- package/dist/core/textarea.mjs +25 -0
- package/dist/core/textarea.mjs.map +1 -0
- package/dist/core.d.mts +17 -2
- package/dist/core.mjs +17 -5
- package/dist/enums.d.mts +2 -1
- package/dist/enums.d.mts.map +1 -0
- package/dist/enums.mjs +2 -1
- package/dist/enums.mjs.map +1 -0
- package/dist/index.d.mts +29 -714
- package/dist/index.mjs +31 -5
- package/dist/node_modules/gsap/CSSPlugin.mjs +920 -0
- package/dist/node_modules/gsap/CSSPlugin.mjs.map +1 -0
- package/dist/node_modules/gsap/gsap-core.mjs +2723 -0
- package/dist/node_modules/gsap/gsap-core.mjs.map +1 -0
- package/dist/node_modules/gsap/index.mjs +9 -0
- package/dist/node_modules/gsap/index.mjs.map +1 -0
- package/dist/{output.css → style.css} +3 -196
- package/dist/style.css.map +1 -0
- package/dist/style.mjs +1 -0
- package/dist/utils.d.mts +2 -1
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +16 -2
- package/dist/utils.mjs.map +1 -0
- package/package.json +10 -11
- package/dist/Typography-Dznhj8uL.mjs +0 -71
- package/dist/index-BC23qXS8.d.mts +0 -391
- package/dist/index-tclrN3ts.d.mts +0 -61
- package/dist/index-vBhS7Nno.d.mts +0 -75
- package/dist/src-BzCZ9O6j.css +0 -211
- package/dist/src-CS2dhz2p.mjs +0 -6160
- package/dist/utils-1s_37TSX.mjs +0 -16
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { cn, renderConditional } from "../../../utils.mjs";
|
|
2
|
+
import { popover_exports } from "../../../core/popover.mjs";
|
|
3
|
+
import "../../../core.mjs";
|
|
4
|
+
import Typography from "../../../Typography.mjs";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/atoms/Popover/index.tsx
|
|
8
|
+
const { Popover: CorePopover, PopoverContent, PopoverTrigger } = popover_exports;
|
|
9
|
+
const placementMap = {
|
|
10
|
+
top: {
|
|
11
|
+
side: "top",
|
|
12
|
+
align: "center"
|
|
13
|
+
},
|
|
14
|
+
left: {
|
|
15
|
+
side: "left",
|
|
16
|
+
align: "center"
|
|
17
|
+
},
|
|
18
|
+
right: {
|
|
19
|
+
side: "right",
|
|
20
|
+
align: "center"
|
|
21
|
+
},
|
|
22
|
+
bottom: {
|
|
23
|
+
side: "bottom",
|
|
24
|
+
align: "center"
|
|
25
|
+
},
|
|
26
|
+
topLeft: {
|
|
27
|
+
side: "top",
|
|
28
|
+
align: "start"
|
|
29
|
+
},
|
|
30
|
+
topRight: {
|
|
31
|
+
side: "top",
|
|
32
|
+
align: "end"
|
|
33
|
+
},
|
|
34
|
+
bottomLeft: {
|
|
35
|
+
side: "bottom",
|
|
36
|
+
align: "start"
|
|
37
|
+
},
|
|
38
|
+
bottomRight: {
|
|
39
|
+
side: "bottom",
|
|
40
|
+
align: "end"
|
|
41
|
+
},
|
|
42
|
+
leftTop: {
|
|
43
|
+
side: "left",
|
|
44
|
+
align: "start"
|
|
45
|
+
},
|
|
46
|
+
leftBottom: {
|
|
47
|
+
side: "left",
|
|
48
|
+
align: "end"
|
|
49
|
+
},
|
|
50
|
+
rightTop: {
|
|
51
|
+
side: "right",
|
|
52
|
+
align: "start"
|
|
53
|
+
},
|
|
54
|
+
rightBottom: {
|
|
55
|
+
side: "right",
|
|
56
|
+
align: "end"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const beforeBase = "before:content-[\"\"] before:absolute before:h-0 before:w-0";
|
|
60
|
+
const afterBase = "after:content-[\"\"] after:absolute after:h-0 after:w-0";
|
|
61
|
+
const vBorderShape = "before:border-l-[9px] before:border-r-[9px] before:border-l-transparent before:border-r-transparent";
|
|
62
|
+
const hBorderShape = "before:border-t-[9px] before:border-b-[9px] before:border-t-transparent before:border-b-transparent";
|
|
63
|
+
const vFillShape = "after:border-l-8 after:border-r-8 after:border-l-transparent after:border-r-transparent";
|
|
64
|
+
const hFillShape = "after:border-t-8 after:border-b-8 after:border-t-transparent after:border-b-transparent";
|
|
65
|
+
const topBorder = "before:border-t-[9px] before:border-t-border";
|
|
66
|
+
const bottomBorder = "before:border-b-[9px] before:border-b-border";
|
|
67
|
+
const leftBorder = "before:border-l-[9px] before:border-l-border";
|
|
68
|
+
const rightBorder = "before:border-r-[9px] before:border-r-border";
|
|
69
|
+
const topFill = "after:border-t-8 after:border-t-popover";
|
|
70
|
+
const bottomFill = "after:border-b-8 after:border-b-popover";
|
|
71
|
+
const leftFill = "after:border-l-8 after:border-l-popover";
|
|
72
|
+
const rightFill = "after:border-r-8 after:border-r-popover";
|
|
73
|
+
const arrowStyles = {
|
|
74
|
+
top: [
|
|
75
|
+
"absolute left-1/2 -translate-x-1/2 top-full",
|
|
76
|
+
beforeBase,
|
|
77
|
+
"before:top-0 before:left-1/2 before:-translate-x-1/2",
|
|
78
|
+
vBorderShape,
|
|
79
|
+
topBorder,
|
|
80
|
+
afterBase,
|
|
81
|
+
"after:-top-px after:left-1/2 after:-translate-x-1/2",
|
|
82
|
+
vFillShape,
|
|
83
|
+
topFill
|
|
84
|
+
].join(" "),
|
|
85
|
+
topLeft: [
|
|
86
|
+
"absolute left-4 top-full",
|
|
87
|
+
beforeBase,
|
|
88
|
+
"before:top-0 before:left-0",
|
|
89
|
+
vBorderShape,
|
|
90
|
+
topBorder,
|
|
91
|
+
afterBase,
|
|
92
|
+
"after:-top-px after:left-px",
|
|
93
|
+
vFillShape,
|
|
94
|
+
topFill
|
|
95
|
+
].join(" "),
|
|
96
|
+
topRight: [
|
|
97
|
+
"absolute right-4 top-full",
|
|
98
|
+
beforeBase,
|
|
99
|
+
"before:top-0 before:right-0",
|
|
100
|
+
vBorderShape,
|
|
101
|
+
topBorder,
|
|
102
|
+
afterBase,
|
|
103
|
+
"after:-top-px after:right-px",
|
|
104
|
+
vFillShape,
|
|
105
|
+
topFill
|
|
106
|
+
].join(" "),
|
|
107
|
+
bottom: [
|
|
108
|
+
"absolute left-1/2 -translate-x-1/2 bottom-full",
|
|
109
|
+
beforeBase,
|
|
110
|
+
"before:bottom-0 before:left-1/2 before:-translate-x-1/2",
|
|
111
|
+
vBorderShape,
|
|
112
|
+
bottomBorder,
|
|
113
|
+
afterBase,
|
|
114
|
+
"after:-bottom-px after:left-1/2 after:-translate-x-1/2",
|
|
115
|
+
vFillShape,
|
|
116
|
+
bottomFill
|
|
117
|
+
].join(" "),
|
|
118
|
+
bottomLeft: [
|
|
119
|
+
"absolute left-4 bottom-full",
|
|
120
|
+
beforeBase,
|
|
121
|
+
"before:bottom-0 before:left-0",
|
|
122
|
+
vBorderShape,
|
|
123
|
+
bottomBorder,
|
|
124
|
+
afterBase,
|
|
125
|
+
"after:-bottom-px after:left-px",
|
|
126
|
+
vFillShape,
|
|
127
|
+
bottomFill
|
|
128
|
+
].join(" "),
|
|
129
|
+
bottomRight: [
|
|
130
|
+
"absolute right-4 bottom-full",
|
|
131
|
+
beforeBase,
|
|
132
|
+
"before:bottom-0 before:right-0",
|
|
133
|
+
vBorderShape,
|
|
134
|
+
bottomBorder,
|
|
135
|
+
afterBase,
|
|
136
|
+
"after:-bottom-px after:right-px",
|
|
137
|
+
vFillShape,
|
|
138
|
+
bottomFill
|
|
139
|
+
].join(" "),
|
|
140
|
+
left: [
|
|
141
|
+
"absolute top-1/2 -translate-y-1/2 left-full",
|
|
142
|
+
beforeBase,
|
|
143
|
+
"before:left-0 before:top-1/2 before:-translate-y-1/2",
|
|
144
|
+
hBorderShape,
|
|
145
|
+
leftBorder,
|
|
146
|
+
afterBase,
|
|
147
|
+
"after:-left-px after:top-1/2 after:-translate-y-1/2",
|
|
148
|
+
hFillShape,
|
|
149
|
+
leftFill
|
|
150
|
+
].join(" "),
|
|
151
|
+
leftTop: [
|
|
152
|
+
"absolute top-4 left-full",
|
|
153
|
+
beforeBase,
|
|
154
|
+
"before:left-0 before:top-0",
|
|
155
|
+
hBorderShape,
|
|
156
|
+
leftBorder,
|
|
157
|
+
afterBase,
|
|
158
|
+
"after:-left-px after:top-px",
|
|
159
|
+
hFillShape,
|
|
160
|
+
leftFill
|
|
161
|
+
].join(" "),
|
|
162
|
+
leftBottom: [
|
|
163
|
+
"absolute bottom-4 left-full",
|
|
164
|
+
beforeBase,
|
|
165
|
+
"before:left-0 before:bottom-0",
|
|
166
|
+
hBorderShape,
|
|
167
|
+
leftBorder,
|
|
168
|
+
afterBase,
|
|
169
|
+
"after:-left-px after:bottom-px",
|
|
170
|
+
hFillShape,
|
|
171
|
+
leftFill
|
|
172
|
+
].join(" "),
|
|
173
|
+
right: [
|
|
174
|
+
"absolute top-1/2 -translate-y-1/2 right-full",
|
|
175
|
+
beforeBase,
|
|
176
|
+
"before:right-0 before:top-1/2 before:-translate-y-1/2",
|
|
177
|
+
hBorderShape,
|
|
178
|
+
rightBorder,
|
|
179
|
+
afterBase,
|
|
180
|
+
"after:-right-px after:top-1/2 after:-translate-y-1/2",
|
|
181
|
+
hFillShape,
|
|
182
|
+
rightFill
|
|
183
|
+
].join(" "),
|
|
184
|
+
rightTop: [
|
|
185
|
+
"absolute top-4 right-full",
|
|
186
|
+
beforeBase,
|
|
187
|
+
"before:right-0 before:top-0",
|
|
188
|
+
hBorderShape,
|
|
189
|
+
rightBorder,
|
|
190
|
+
afterBase,
|
|
191
|
+
"after:-right-px after:top-px",
|
|
192
|
+
hFillShape,
|
|
193
|
+
rightFill
|
|
194
|
+
].join(" "),
|
|
195
|
+
rightBottom: [
|
|
196
|
+
"absolute bottom-4 right-full",
|
|
197
|
+
beforeBase,
|
|
198
|
+
"before:right-0 before:bottom-0",
|
|
199
|
+
hBorderShape,
|
|
200
|
+
rightBorder,
|
|
201
|
+
afterBase,
|
|
202
|
+
"after:-right-px after:bottom-px",
|
|
203
|
+
hFillShape,
|
|
204
|
+
rightFill
|
|
205
|
+
].join(" ")
|
|
206
|
+
};
|
|
207
|
+
const Popover = ({ title, placement = "top", className, content, children }) => {
|
|
208
|
+
return /* @__PURE__ */ jsxs(CorePopover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
209
|
+
asChild: true,
|
|
210
|
+
children
|
|
211
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
212
|
+
align: placementMap[placement].align,
|
|
213
|
+
side: placementMap[placement].side,
|
|
214
|
+
sideOffset: 16,
|
|
215
|
+
className: cn("relative w-auto", className),
|
|
216
|
+
children: [
|
|
217
|
+
renderConditional(title, (v) => /* @__PURE__ */ jsx(Typography.Title, {
|
|
218
|
+
level: 6,
|
|
219
|
+
children: v
|
|
220
|
+
})),
|
|
221
|
+
content,
|
|
222
|
+
/* @__PURE__ */ jsx("div", { className: cn(arrowStyles[placement]) })
|
|
223
|
+
]
|
|
224
|
+
})] });
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
export { Popover as default };
|
|
229
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["popover"],"sources":["../../../../src/components/atoms/Popover/index.tsx"],"sourcesContent":["import { popover } from '@repo/ui/core';\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nimport Typography from '../Typography';\n\nconst { Popover: CorePopover, PopoverContent, PopoverTrigger } = popover;\n\ntype Placement =\n | 'top'\n | 'left'\n | 'right'\n | 'bottom'\n | 'topLeft'\n | 'topRight'\n | 'bottomLeft'\n | 'bottomRight'\n | 'leftTop'\n | 'leftBottom'\n | 'rightTop'\n | 'rightBottom';\n\ninterface Props extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'title' | 'content'\n> {\n title?: React.ReactNode;\n placement?: Placement;\n content: React.ReactNode;\n}\n\nconst placementMap = {\n top: {\n side: 'top',\n align: 'center',\n },\n left: {\n side: 'left',\n align: 'center',\n },\n right: {\n side: 'right',\n align: 'center',\n },\n bottom: {\n side: 'bottom',\n align: 'center',\n },\n topLeft: {\n side: 'top',\n align: 'start',\n },\n topRight: {\n side: 'top',\n align: 'end',\n },\n bottomLeft: {\n side: 'bottom',\n align: 'start',\n },\n bottomRight: {\n side: 'bottom',\n align: 'end',\n },\n leftTop: {\n side: 'left',\n align: 'start',\n },\n leftBottom: {\n side: 'left',\n align: 'end',\n },\n rightTop: {\n side: 'right',\n align: 'start',\n },\n rightBottom: {\n side: 'right',\n align: 'end',\n },\n} as const;\n\nconst beforeBase = 'before:content-[\"\"] before:absolute before:h-0 before:w-0';\nconst afterBase = 'after:content-[\"\"] after:absolute after:h-0 after:w-0';\n\nconst vBorderShape =\n 'before:border-l-[9px] before:border-r-[9px] before:border-l-transparent before:border-r-transparent';\nconst hBorderShape =\n 'before:border-t-[9px] before:border-b-[9px] before:border-t-transparent before:border-b-transparent';\nconst vFillShape =\n 'after:border-l-8 after:border-r-8 after:border-l-transparent after:border-r-transparent';\nconst hFillShape =\n 'after:border-t-8 after:border-b-8 after:border-t-transparent after:border-b-transparent';\n\nconst topBorder = 'before:border-t-[9px] before:border-t-border';\nconst bottomBorder = 'before:border-b-[9px] before:border-b-border';\nconst leftBorder = 'before:border-l-[9px] before:border-l-border';\nconst rightBorder = 'before:border-r-[9px] before:border-r-border';\nconst topFill = 'after:border-t-8 after:border-t-popover';\nconst bottomFill = 'after:border-b-8 after:border-b-popover';\nconst leftFill = 'after:border-l-8 after:border-l-popover';\nconst rightFill = 'after:border-r-8 after:border-r-popover';\n\nconst arrowStyles: Record<Placement, string> = {\n top: [\n 'absolute left-1/2 -translate-x-1/2 top-full',\n beforeBase,\n 'before:top-0 before:left-1/2 before:-translate-x-1/2',\n vBorderShape,\n topBorder,\n afterBase,\n 'after:-top-px after:left-1/2 after:-translate-x-1/2',\n vFillShape,\n topFill,\n ].join(' '),\n topLeft: [\n 'absolute left-4 top-full',\n beforeBase,\n 'before:top-0 before:left-0',\n vBorderShape,\n topBorder,\n afterBase,\n 'after:-top-px after:left-px',\n vFillShape,\n topFill,\n ].join(' '),\n topRight: [\n 'absolute right-4 top-full',\n beforeBase,\n 'before:top-0 before:right-0',\n vBorderShape,\n topBorder,\n afterBase,\n 'after:-top-px after:right-px',\n vFillShape,\n topFill,\n ].join(' '),\n bottom: [\n 'absolute left-1/2 -translate-x-1/2 bottom-full',\n beforeBase,\n 'before:bottom-0 before:left-1/2 before:-translate-x-1/2',\n vBorderShape,\n bottomBorder,\n afterBase,\n 'after:-bottom-px after:left-1/2 after:-translate-x-1/2',\n vFillShape,\n bottomFill,\n ].join(' '),\n bottomLeft: [\n 'absolute left-4 bottom-full',\n beforeBase,\n 'before:bottom-0 before:left-0',\n vBorderShape,\n bottomBorder,\n afterBase,\n 'after:-bottom-px after:left-px',\n vFillShape,\n bottomFill,\n ].join(' '),\n bottomRight: [\n 'absolute right-4 bottom-full',\n beforeBase,\n 'before:bottom-0 before:right-0',\n vBorderShape,\n bottomBorder,\n afterBase,\n 'after:-bottom-px after:right-px',\n vFillShape,\n bottomFill,\n ].join(' '),\n left: [\n 'absolute top-1/2 -translate-y-1/2 left-full',\n beforeBase,\n 'before:left-0 before:top-1/2 before:-translate-y-1/2',\n hBorderShape,\n leftBorder,\n afterBase,\n 'after:-left-px after:top-1/2 after:-translate-y-1/2',\n hFillShape,\n leftFill,\n ].join(' '),\n leftTop: [\n 'absolute top-4 left-full',\n beforeBase,\n 'before:left-0 before:top-0',\n hBorderShape,\n leftBorder,\n afterBase,\n 'after:-left-px after:top-px',\n hFillShape,\n leftFill,\n ].join(' '),\n leftBottom: [\n 'absolute bottom-4 left-full',\n beforeBase,\n 'before:left-0 before:bottom-0',\n hBorderShape,\n leftBorder,\n afterBase,\n 'after:-left-px after:bottom-px',\n hFillShape,\n leftFill,\n ].join(' '),\n right: [\n 'absolute top-1/2 -translate-y-1/2 right-full',\n beforeBase,\n 'before:right-0 before:top-1/2 before:-translate-y-1/2',\n hBorderShape,\n rightBorder,\n afterBase,\n 'after:-right-px after:top-1/2 after:-translate-y-1/2',\n hFillShape,\n rightFill,\n ].join(' '),\n rightTop: [\n 'absolute top-4 right-full',\n beforeBase,\n 'before:right-0 before:top-0',\n hBorderShape,\n rightBorder,\n afterBase,\n 'after:-right-px after:top-px',\n hFillShape,\n rightFill,\n ].join(' '),\n rightBottom: [\n 'absolute bottom-4 right-full',\n beforeBase,\n 'before:right-0 before:bottom-0',\n hBorderShape,\n rightBorder,\n afterBase,\n 'after:-right-px after:bottom-px',\n hFillShape,\n rightFill,\n ].join(' '),\n};\n\nconst Popover = ({\n title,\n placement = 'top',\n className,\n content,\n children,\n}: Props) => {\n return (\n <CorePopover>\n <PopoverTrigger asChild>{children}</PopoverTrigger>\n <PopoverContent\n align={placementMap[placement].align}\n side={placementMap[placement].side}\n sideOffset={16}\n className={cn('relative w-auto', className)}\n >\n {renderConditional(title, v => (\n <Typography.Title level={6}>{v}</Typography.Title>\n ))}\n {content}\n <div className={cn(arrowStyles[placement])} />\n </PopoverContent>\n </CorePopover>\n );\n};\n\nexport default Popover;\n"],"mappings":";;;;;;;AAKA,MAAM,EAAE,SAAS,aAAa,gBAAgB,mBAAmBA;AAyBjE,MAAM,eAAe;CACnB,KAAK;EACH,MAAM;EACN,OAAO;EACR;CACD,MAAM;EACJ,MAAM;EACN,OAAO;EACR;CACD,OAAO;EACL,MAAM;EACN,OAAO;EACR;CACD,QAAQ;EACN,MAAM;EACN,OAAO;EACR;CACD,SAAS;EACP,MAAM;EACN,OAAO;EACR;CACD,UAAU;EACR,MAAM;EACN,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACR;CACD,aAAa;EACX,MAAM;EACN,OAAO;EACR;CACD,SAAS;EACP,MAAM;EACN,OAAO;EACR;CACD,YAAY;EACV,MAAM;EACN,OAAO;EACR;CACD,UAAU;EACR,MAAM;EACN,OAAO;EACR;CACD,aAAa;EACX,MAAM;EACN,OAAO;EACR;CACF;AAED,MAAM,aAAa;AACnB,MAAM,YAAY;AAElB,MAAM,eACJ;AACF,MAAM,eACJ;AACF,MAAM,aACJ;AACF,MAAM,aACJ;AAEF,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,aAAa;AACnB,MAAM,WAAW;AACjB,MAAM,YAAY;AAElB,MAAM,cAAyC;CAC7C,KAAK;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,UAAU;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACX,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;CACZ;AAED,MAAM,WAAW,EACf,OACA,YAAY,OACZ,WACA,SACA,eACW;AACX,QACE,qBAAC,0BACC,oBAAC;EAAe;EAAS;GAA0B,EACnD,qBAAC;EACC,OAAO,aAAa,WAAW;EAC/B,MAAM,aAAa,WAAW;EAC9B,YAAY;EACZ,WAAW,GAAG,mBAAmB,UAAU;;GAE1C,kBAAkB,QAAO,MACxB,oBAAC,WAAW;IAAM,OAAO;cAAI;KAAqB,CAClD;GACD;GACD,oBAAC,SAAI,WAAW,GAAG,YAAY,WAAW,GAAI;;GAC/B,IACL"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/components/atoms/Progress/index.d.ts
|
|
4
|
+
interface Props extends React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
value: number;
|
|
6
|
+
direction?: 'horizontal' | 'vertical';
|
|
7
|
+
classNames?: {
|
|
8
|
+
background?: string;
|
|
9
|
+
bar?: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const Progress: ({
|
|
13
|
+
value,
|
|
14
|
+
className,
|
|
15
|
+
direction,
|
|
16
|
+
classNames
|
|
17
|
+
}: Props) => react_jsx_runtime0.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Progress };
|
|
20
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/atoms/Progress/index.tsx"],"mappings":";;;UAKiB,KAAA,SAAc,KAAA,CAAM,wBAAA;EACnC,KAAA;EACA,SAAA;EACA,UAAA;IACE,UAAA;IACA,GAAA;EAAA;AAAA;AAAA,cAIE,QAAA;EAAY,KAAA;EAAA,SAAA;EAAA,SAAA;EAAA;AAAA,GAMf,KAAA,KAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cn } from "../../../utils.mjs";
|
|
2
|
+
import { progress_exports } from "../../../core/progress.mjs";
|
|
3
|
+
import "../../../core.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/atoms/Progress/index.tsx
|
|
7
|
+
const { Progress: Core } = progress_exports;
|
|
8
|
+
const Progress = ({ value, className, direction = "horizontal", classNames }) => {
|
|
9
|
+
const isHorizontal = direction === "horizontal";
|
|
10
|
+
const dimension = isHorizontal ? "width" : "height";
|
|
11
|
+
const normalizedValue = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
12
|
+
return /* @__PURE__ */ jsx(Core, {
|
|
13
|
+
value: normalizedValue,
|
|
14
|
+
className: cn(isHorizontal ? "h-4 w-full" : "flex h-full w-4 flex-col justify-end", className, classNames?.background),
|
|
15
|
+
barClassName: cn("flex-none", classNames?.bar),
|
|
16
|
+
barStyle: {
|
|
17
|
+
transform: "none",
|
|
18
|
+
[dimension]: `${normalizedValue}%`
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { Progress as default };
|
|
25
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["progress"],"sources":["../../../../src/components/atoms/Progress/index.tsx"],"sourcesContent":["import { progress } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nconst { Progress: Core } = progress;\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {\n value: number;\n direction?: 'horizontal' | 'vertical';\n classNames?: {\n background?: string;\n bar?: string;\n };\n}\n\nconst Progress = ({\n value,\n className,\n direction = 'horizontal',\n classNames,\n //\n}: Props) => {\n const isHorizontal = direction === 'horizontal';\n const dimension = isHorizontal ? 'width' : 'height';\n const normalizedValue = Number.isFinite(value)\n ? Math.min(100, Math.max(0, value))\n : 0;\n\n return (\n <Core\n value={normalizedValue}\n className={cn(\n isHorizontal ? 'h-4 w-full' : 'flex h-full w-4 flex-col justify-end',\n className,\n classNames?.background,\n //\n )}\n barClassName={cn('flex-none', classNames?.bar)}\n barStyle={{\n transform: 'none',\n [dimension]: `${normalizedValue}%`,\n //\n }}\n />\n );\n};\n\nexport default Progress;\n"],"mappings":";;;;;;AAGA,MAAM,EAAE,UAAU,SAASA;AAW3B,MAAM,YAAY,EAChB,OACA,WACA,YAAY,cACZ,iBAEW;CACX,MAAM,eAAe,cAAc;CACnC,MAAM,YAAY,eAAe,UAAU;CAC3C,MAAM,kBAAkB,OAAO,SAAS,MAAM,GAC1C,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,MAAM,CAAC,GACjC;AAEJ,QACE,oBAAC;EACC,OAAO;EACP,WAAW,GACT,eAAe,eAAe,wCAC9B,WACA,YAAY,WAEb;EACD,cAAc,GAAG,aAAa,YAAY,IAAI;EAC9C,UAAU;GACR,WAAW;IACV,YAAY,GAAG,gBAAgB;GAEjC;GACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OptionValue } from "../index.mjs";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/components/atoms/Radio/Group/index.d.ts
|
|
5
|
+
type Option = {
|
|
6
|
+
label: string;
|
|
7
|
+
value: OptionValue;
|
|
8
|
+
};
|
|
9
|
+
type Options = string[] | number[] | boolean[] | Option[];
|
|
10
|
+
interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange' | 'defaultValue' | 'value'> {
|
|
11
|
+
options?: Options;
|
|
12
|
+
orientation?: 'vertical' | 'horizontal';
|
|
13
|
+
placement?: 'left' | 'right';
|
|
14
|
+
classNames?: Record<string, string>;
|
|
15
|
+
defaultValue?: OptionValue;
|
|
16
|
+
value?: OptionValue;
|
|
17
|
+
onChange?: (value: OptionValue) => void;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Props };
|
|
21
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../src/components/atoms/Radio/Group/index.tsx"],"mappings":";;;;KAMK,MAAA;EACH,KAAA;EACA,KAAA,EAAO,WAAA;AAAA;AAAA,KAGJ,OAAA,qCAA4C,MAAA;AAAA,UAEhC,KAAA,SAAc,IAAA,CAC7B,KAAA,CAAM,wBAAA;EAGN,OAAA,GAAU,OAAA;EACV,WAAA;EACA,SAAA;EACA,UAAA,GAAa,MAAA;EACb,YAAA,GAAe,WAAA;EACf,KAAA,GAAQ,WAAA;EACR,QAAA,IAAY,KAAA,EAAO,WAAA;AAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import Radio from "../index.mjs";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/atoms/Radio/Group/index.tsx
|
|
7
|
+
const RadioGroup = ({ orientation = "vertical", placement = "left", className, classNames = {}, options: _options = [], defaultValue, value: _value, onChange: _onChange = () => {} }) => {
|
|
8
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
9
|
+
const controlled = _value !== void 0;
|
|
10
|
+
const value = controlled ? _value : uncontrolledValue;
|
|
11
|
+
const options = _options.map((item) => typeof item === "object" ? item : {
|
|
12
|
+
label: `${item}`,
|
|
13
|
+
value: item
|
|
14
|
+
});
|
|
15
|
+
const onChange = (checked, optionValue) => {
|
|
16
|
+
if (!checked) return;
|
|
17
|
+
if (!controlled) setUncontrolledValue(optionValue);
|
|
18
|
+
_onChange(optionValue);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
21
|
+
className: cn(orientation === "vertical" ? "space-y-2" : "flex gap-2", className),
|
|
22
|
+
children: options.map((item) => {
|
|
23
|
+
const checked = value === item.value;
|
|
24
|
+
return /* @__PURE__ */ jsx("li", {
|
|
25
|
+
className: cn("flex", classNames?.wrapper),
|
|
26
|
+
children: /* @__PURE__ */ jsx(Radio, {
|
|
27
|
+
placement,
|
|
28
|
+
className: cn(classNames?.item),
|
|
29
|
+
value: item.value,
|
|
30
|
+
checked,
|
|
31
|
+
onChange: (checked) => onChange(checked, item.value),
|
|
32
|
+
children: item.label
|
|
33
|
+
})
|
|
34
|
+
}, String(item.value));
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { RadioGroup as default };
|
|
41
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/atoms/Radio/Group/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport Radio, { OptionValue } from '..';\n\ntype Option = {\n label: string;\n value: OptionValue;\n};\n\ntype Options = string[] | number[] | boolean[] | Option[];\n\nexport interface Props extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'onChange' | 'defaultValue' | 'value'\n> {\n options?: Options;\n orientation?: 'vertical' | 'horizontal';\n placement?: 'left' | 'right';\n classNames?: Record<string, string>;\n defaultValue?: OptionValue;\n value?: OptionValue;\n onChange?: (value: OptionValue) => void;\n}\n\nconst RadioGroup = ({\n orientation = 'vertical',\n placement = 'left',\n className,\n classNames = {},\n options: _options = [],\n defaultValue,\n value: _value,\n onChange: _onChange = () => {},\n}: Props) => {\n const [uncontrolledValue, setUncontrolledValue] = useState<\n OptionValue | undefined\n >(defaultValue);\n\n const controlled = _value !== undefined;\n const value = controlled ? _value : uncontrolledValue;\n\n const options: Option[] = _options.map(item =>\n typeof item === 'object'\n ? item\n : {\n label: `${item}`,\n value: item,\n },\n );\n\n const onChange = (checked: boolean, optionValue: OptionValue) => {\n if (!checked) {\n return;\n }\n if (!controlled) {\n setUncontrolledValue(optionValue);\n }\n _onChange(optionValue);\n };\n\n return (\n <ul\n className={cn(\n orientation === 'vertical' ? 'space-y-2' : 'flex gap-2',\n className,\n )}\n >\n {options.map((item: Option) => {\n const checked = value === item.value;\n\n return (\n <li\n key={String(item.value)}\n className={cn('flex', classNames?.wrapper)}\n >\n <Radio\n placement={placement}\n className={cn(classNames?.item)}\n value={item.value}\n checked={checked}\n onChange={checked => onChange(checked, item.value)}\n >\n {item.label}\n </Radio>\n </li>\n );\n })}\n </ul>\n );\n};\n\nexport default RadioGroup;\n"],"mappings":";;;;;;AA0BA,MAAM,cAAc,EAClB,cAAc,YACd,YAAY,QACZ,WACA,aAAa,EAAE,EACf,SAAS,WAAW,EAAE,EACtB,cACA,OAAO,QACP,UAAU,kBAAkB,SACjB;CACX,MAAM,CAAC,mBAAmB,wBAAwB,SAEhD,aAAa;CAEf,MAAM,aAAa,WAAW;CAC9B,MAAM,QAAQ,aAAa,SAAS;CAEpC,MAAM,UAAoB,SAAS,KAAI,SACrC,OAAO,SAAS,WACZ,OACA;EACE,OAAO,GAAG;EACV,OAAO;EACR,CACN;CAED,MAAM,YAAY,SAAkB,gBAA6B;AAC/D,MAAI,CAAC,QACH;AAEF,MAAI,CAAC,WACH,sBAAqB,YAAY;AAEnC,YAAU,YAAY;;AAGxB,QACE,oBAAC;EACC,WAAW,GACT,gBAAgB,aAAa,cAAc,cAC3C,UACD;YAEA,QAAQ,KAAK,SAAiB;GAC7B,MAAM,UAAU,UAAU,KAAK;AAE/B,UACE,oBAAC;IAEC,WAAW,GAAG,QAAQ,YAAY,QAAQ;cAE1C,oBAAC;KACY;KACX,WAAW,GAAG,YAAY,KAAK;KAC/B,OAAO,KAAK;KACH;KACT,WAAU,YAAW,SAAS,SAAS,KAAK,MAAM;eAEjD,KAAK;MACA;MAXH,OAAO,KAAK,MAAM,CAYpB;IAEP;GACC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RadioGroup } from "../../../core/radio-group.mjs";
|
|
2
|
+
import "../../../core.mjs";
|
|
3
|
+
import { Props as Props$1 } from "./Group/index.mjs";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/atoms/Radio/index.d.ts
|
|
7
|
+
declare const Core: typeof RadioGroup;
|
|
8
|
+
type OptionValue = string | number | boolean;
|
|
9
|
+
interface Props extends Omit<React.ComponentPropsWithoutRef<typeof Core>, 'onChange' | 'value'> {
|
|
10
|
+
placement?: 'left' | 'right';
|
|
11
|
+
defaultChecked?: boolean;
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
value?: OptionValue;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
icons?: {
|
|
16
|
+
checked: React.ReactNode;
|
|
17
|
+
unchecked: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
onChange?: (checked: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const Radio: {
|
|
22
|
+
({
|
|
23
|
+
placement,
|
|
24
|
+
value,
|
|
25
|
+
children,
|
|
26
|
+
className,
|
|
27
|
+
icons,
|
|
28
|
+
disabled,
|
|
29
|
+
defaultChecked,
|
|
30
|
+
checked: _checked,
|
|
31
|
+
onChange: _onChange,
|
|
32
|
+
...props
|
|
33
|
+
}: Props): react_jsx_runtime0.JSX.Element;
|
|
34
|
+
Group: ({
|
|
35
|
+
orientation,
|
|
36
|
+
placement,
|
|
37
|
+
className,
|
|
38
|
+
classNames,
|
|
39
|
+
options: _options,
|
|
40
|
+
defaultValue,
|
|
41
|
+
value: _value,
|
|
42
|
+
onChange: _onChange
|
|
43
|
+
}: Props$1) => react_jsx_runtime0.JSX.Element;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { OptionValue, Radio };
|
|
47
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/atoms/Radio/index.tsx"],"mappings":";;;;;;cAWoB,IAAA,SAAI,UAAA;AAAA,KAGZ,WAAA;AAAA,UAEK,KAAA,SAAc,IAAA,CAC7B,KAAA,CAAM,wBAAA,QAAgC,IAAA;EAGtC,SAAA;EACA,cAAA;EACA,OAAA;EACA,KAAA,GAAQ,WAAA;EACR,QAAA;EACA,KAAA;IAAU,OAAA,EAAS,KAAA,CAAM,SAAA;IAAW,SAAA,EAAW,KAAA,CAAM,SAAA;EAAA;EACrD,QAAA,IAAY,OAAA;AAAA;AAAA,cAGR,KAAA;EAAA;;;;;;;;;;;KAWH,KAAA,GAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../../utils.mjs";
|
|
4
|
+
import { field_exports } from "../../../core/field.mjs";
|
|
5
|
+
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
6
|
+
import "../../../core.mjs";
|
|
7
|
+
import RadioGroup from "./Group/index.mjs";
|
|
8
|
+
import { Circle, CircleCheck } from "lucide-react";
|
|
9
|
+
import { useId, useState } from "react";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
|
|
12
|
+
//#region src/components/atoms/Radio/index.tsx
|
|
13
|
+
const { RadioGroup: Core, RadioGroupItem: Item } = radio_group_exports;
|
|
14
|
+
const { Field, FieldLabel } = field_exports;
|
|
15
|
+
const Radio = ({ placement = "left", value = "", children, className, icons, disabled, defaultChecked, checked: _checked, onChange: _onChange = () => {}, ...props }) => {
|
|
16
|
+
const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked || false);
|
|
17
|
+
const reactId = useId();
|
|
18
|
+
const id = typeof value === "boolean" || !value ? reactId : String(value);
|
|
19
|
+
const controlled = _checked !== void 0;
|
|
20
|
+
const checked = controlled ? _checked : uncontrolledChecked;
|
|
21
|
+
const cursorClassName = disabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
22
|
+
const onChange = (next) => {
|
|
23
|
+
if (disabled) return;
|
|
24
|
+
if (!controlled) setUncontrolledChecked(next);
|
|
25
|
+
_onChange(next);
|
|
26
|
+
};
|
|
27
|
+
const renderContent = icons ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx("input", {
|
|
29
|
+
id,
|
|
30
|
+
hidden: true,
|
|
31
|
+
type: "radio",
|
|
32
|
+
checked,
|
|
33
|
+
onChange: (e) => {
|
|
34
|
+
onChange(e.target.checked);
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: cn(cursorClassName, disabled && "opacity-50"),
|
|
39
|
+
onClick: () => {
|
|
40
|
+
document.getElementById(id)?.click();
|
|
41
|
+
},
|
|
42
|
+
children: checked ? icons.checked ?? /* @__PURE__ */ jsx(CircleCheck, {}) : icons.unchecked ?? /* @__PURE__ */ jsx(Circle, {})
|
|
43
|
+
}),
|
|
44
|
+
children && /* @__PURE__ */ jsx("label", {
|
|
45
|
+
className: cn(cursorClassName, disabled && "opacity-50"),
|
|
46
|
+
htmlFor: id,
|
|
47
|
+
children
|
|
48
|
+
})
|
|
49
|
+
] }) : /* @__PURE__ */ jsx(Core, {
|
|
50
|
+
value: checked ? id : "",
|
|
51
|
+
onValueChange: () => onChange(true),
|
|
52
|
+
children: /* @__PURE__ */ jsxs(Field, {
|
|
53
|
+
orientation: "horizontal",
|
|
54
|
+
className: cn("flex", placement === "right" && "flex-row-reverse"),
|
|
55
|
+
"data-disabled": disabled,
|
|
56
|
+
children: [/* @__PURE__ */ jsx(Item, {
|
|
57
|
+
value: id,
|
|
58
|
+
id,
|
|
59
|
+
checked,
|
|
60
|
+
disabled
|
|
61
|
+
}), /* @__PURE__ */ jsx(FieldLabel, {
|
|
62
|
+
htmlFor: id,
|
|
63
|
+
children
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
return /* @__PURE__ */ jsx("div", {
|
|
68
|
+
className: cn("flex items-center gap-x-2", icons && placement === "right" && "flex-row-reverse", cursorClassName, className),
|
|
69
|
+
...props,
|
|
70
|
+
children: renderContent
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
Radio.Group = RadioGroup;
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { Radio as default };
|
|
77
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["radio","field","Group"],"sources":["../../../../src/components/atoms/Radio/index.tsx"],"sourcesContent":["'use client';\n\nimport { useId, useState } from 'react';\n\nimport { Circle, CircleCheck } from 'lucide-react';\n\nimport { field, radio } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nimport Group from './Group';\n\nconst { RadioGroup: Core, RadioGroupItem: Item } = radio;\nconst { Field, FieldLabel } = field;\n\nexport type OptionValue = string | number | boolean;\n\nexport interface Props extends Omit<\n React.ComponentPropsWithoutRef<typeof Core>,\n 'onChange' | 'value'\n> {\n placement?: 'left' | 'right';\n defaultChecked?: boolean;\n checked?: boolean;\n value?: OptionValue;\n disabled?: boolean;\n icons?: { checked: React.ReactNode; unchecked: React.ReactNode };\n onChange?: (checked: boolean) => void;\n}\n\nconst Radio = ({\n placement = 'left',\n value = '',\n children,\n className,\n icons,\n disabled,\n defaultChecked,\n checked: _checked,\n onChange: _onChange = () => {},\n ...props\n}: Props) => {\n const [uncontrolledChecked, setUncontrolledChecked] = useState<boolean>(\n defaultChecked || false,\n );\n\n const reactId = useId();\n const id = typeof value === 'boolean' || !value ? reactId : String(value);\n const controlled = _checked !== undefined;\n const checked = controlled ? _checked : uncontrolledChecked;\n\n const cursorClassName = disabled ? 'cursor-not-allowed' : 'cursor-pointer';\n\n const onChange = (next: boolean) => {\n if (disabled) {\n return;\n }\n\n if (!controlled) {\n setUncontrolledChecked(next);\n }\n _onChange(next);\n };\n\n const renderContent = icons ? (\n <>\n <input\n id={id}\n hidden\n type=\"radio\"\n checked={checked}\n onChange={e => {\n onChange(e.target.checked);\n }}\n />\n <span\n className={cn(cursorClassName, disabled && 'opacity-50')}\n onClick={() => {\n document.getElementById(id)?.click();\n }}\n >\n {checked\n ? (icons.checked ?? <CircleCheck />)\n : (icons.unchecked ?? <Circle />)}\n </span>\n {children && (\n <label\n className={cn(cursorClassName, disabled && 'opacity-50')}\n htmlFor={id}\n >\n {children}\n </label>\n )}\n </>\n ) : (\n <Core value={checked ? id : ''} onValueChange={() => onChange(true)}>\n <Field\n orientation=\"horizontal\"\n className={cn('flex', placement === 'right' && 'flex-row-reverse')}\n data-disabled={disabled}\n >\n <Item value={id} id={id} checked={checked} disabled={disabled} />\n <FieldLabel htmlFor={id}>{children}</FieldLabel>\n </Field>\n </Core>\n );\n\n return (\n <div\n className={cn(\n 'flex items-center gap-x-2',\n icons && placement === 'right' && 'flex-row-reverse',\n cursorClassName,\n className,\n //\n )}\n {...props}\n >\n {renderContent}\n </div>\n );\n};\n\nRadio.Group = Group;\n\nexport default Radio;\n"],"mappings":";;;;;;;;;;;;AAWA,MAAM,EAAE,YAAY,MAAM,gBAAgB,SAASA;AACnD,MAAM,EAAE,OAAO,eAAeC;AAiB9B,MAAM,SAAS,EACb,YAAY,QACZ,QAAQ,IACR,UACA,WACA,OACA,UACA,gBACA,SAAS,UACT,UAAU,kBAAkB,IAC5B,GAAG,YACQ;CACX,MAAM,CAAC,qBAAqB,0BAA0B,SACpD,kBAAkB,MACnB;CAED,MAAM,UAAU,OAAO;CACvB,MAAM,KAAK,OAAO,UAAU,aAAa,CAAC,QAAQ,UAAU,OAAO,MAAM;CACzE,MAAM,aAAa,aAAa;CAChC,MAAM,UAAU,aAAa,WAAW;CAExC,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,YAAY,SAAkB;AAClC,MAAI,SACF;AAGF,MAAI,CAAC,WACH,wBAAuB,KAAK;AAE9B,YAAU,KAAK;;CAGjB,MAAM,gBAAgB,QACpB;EACE,oBAAC;GACK;GACJ;GACA,MAAK;GACI;GACT,WAAU,MAAK;AACb,aAAS,EAAE,OAAO,QAAQ;;IAE5B;EACF,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,eAAe;AACb,aAAS,eAAe,GAAG,EAAE,OAAO;;aAGrC,UACI,MAAM,WAAW,oBAAC,gBAAc,GAChC,MAAM,aAAa,oBAAC,WAAS;IAC7B;EACN,YACC,oBAAC;GACC,WAAW,GAAG,iBAAiB,YAAY,aAAa;GACxD,SAAS;GAER;IACK;KAET,GAEH,oBAAC;EAAK,OAAO,UAAU,KAAK;EAAI,qBAAqB,SAAS,KAAK;YACjE,qBAAC;GACC,aAAY;GACZ,WAAW,GAAG,QAAQ,cAAc,WAAW,mBAAmB;GAClE,iBAAe;cAEf,oBAAC;IAAK,OAAO;IAAQ;IAAa;IAAmB;KAAY,EACjE,oBAAC;IAAW,SAAS;IAAK;KAAsB;IAC1C;GACH;AAGT,QACE,oBAAC;EACC,WAAW,GACT,6BACA,SAAS,cAAc,WAAW,oBAClC,iBACA,UAED;EACD,GAAI;YAEH;GACG;;AAIV,MAAM,QAAQC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Select as Select$1 } from "../../../core/select.mjs";
|
|
2
|
+
import "../../../core.mjs";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/atoms/Select/index.d.ts
|
|
7
|
+
declare const Core: typeof Select$1;
|
|
8
|
+
interface Option {
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
interface OptionGroup {
|
|
13
|
+
label: React.ReactNode;
|
|
14
|
+
options: Option[];
|
|
15
|
+
}
|
|
16
|
+
interface Props extends React.ComponentProps<typeof Core> {
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
options?: (Option | OptionGroup)[];
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const Select: ({
|
|
23
|
+
className,
|
|
24
|
+
placeholder,
|
|
25
|
+
options,
|
|
26
|
+
onChange,
|
|
27
|
+
...props
|
|
28
|
+
}: Props) => react_jsx_runtime0.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Select };
|
|
31
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/atoms/Select/index.tsx"],"mappings":";;;;;;cAMU,IAAA,SAAI,QAAA;AAAA,UASJ,MAAA;EACR,KAAA,EAAO,KAAA,CAAM,SAAA;EACb,KAAA;AAAA;AAAA,UAGQ,WAAA;EACR,KAAA,EAAO,KAAA,CAAM,SAAA;EACb,OAAA,EAAS,MAAA;AAAA;AAAA,UAOD,KAAA,SAAc,KAAA,CAAM,cAAA,QAAsB,IAAA;EAClD,WAAA;EACA,SAAA;EACA,OAAA,IAAW,MAAA,GAAS,WAAA;EACpB,QAAA,IAAY,KAAA;AAAA;AAAA,cAGR,MAAA;EAAU,SAAA;EAAA,WAAA;EAAA,OAAA;EAAA,QAAA;EAAA,GAAA;AAAA,GAMb,KAAA,KAAK,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from "../../../utils.mjs";
|
|
2
|
+
import { select_exports } from "../../../core/select.mjs";
|
|
3
|
+
import "../../../core.mjs";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/atoms/Select/index.tsx
|
|
8
|
+
const { Select: Core, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } = select_exports;
|
|
9
|
+
const isGroup = (option) => {
|
|
10
|
+
return "options" in option && Array.isArray(option.options);
|
|
11
|
+
};
|
|
12
|
+
const Select = ({ className, placeholder, options, onChange, ...props }) => {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Core, {
|
|
14
|
+
onValueChange: onChange,
|
|
15
|
+
...props,
|
|
16
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
17
|
+
className: cn("w-full max-w-48", className),
|
|
18
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
|
|
19
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: options?.map((option, index) => isGroup(option) ? /* @__PURE__ */ jsxs(SelectGroup, { children: [/* @__PURE__ */ jsx(SelectLabel, { children: option.label }), option.options.map((item) => /* @__PURE__ */ jsx(SelectItem, {
|
|
20
|
+
value: item.value,
|
|
21
|
+
children: item.label
|
|
22
|
+
}, item.value))] }, index) : /* @__PURE__ */ jsx(SelectItem, {
|
|
23
|
+
value: option.value,
|
|
24
|
+
children: option.label
|
|
25
|
+
}, option.value)) })]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Select as default };
|
|
31
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["select"],"sources":["../../../../src/components/atoms/Select/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { select } from '@repo/ui/core';\nimport { cn } from '@repo/ui/utils';\n\nconst {\n Select: Core,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectTrigger,\n SelectValue,\n} = select;\n\ninterface Option {\n label: React.ReactNode;\n value: string;\n}\n\ninterface OptionGroup {\n label: React.ReactNode;\n options: Option[];\n}\n\nconst isGroup = (option: Option | OptionGroup): option is OptionGroup => {\n return 'options' in option && Array.isArray(option.options);\n};\n\ninterface Props extends React.ComponentProps<typeof Core> {\n placeholder?: string;\n className?: string;\n options?: (Option | OptionGroup)[];\n onChange?: (value: string) => void;\n}\n\nconst Select = ({\n className,\n placeholder,\n options,\n onChange,\n ...props\n}: Props) => {\n return (\n <Core onValueChange={onChange} {...props}>\n <SelectTrigger className={cn('w-full max-w-48', className)}>\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent>\n {options?.map((option, index) =>\n isGroup(option) ? (\n <SelectGroup key={index}>\n <SelectLabel>{option.label}</SelectLabel>\n {option.options.map(item => (\n <SelectItem key={item.value} value={item.value}>\n {item.label}\n </SelectItem>\n ))}\n </SelectGroup>\n ) : (\n <SelectItem key={option.value} value={option.value}>\n {option.label}\n </SelectItem>\n ),\n )}\n </SelectContent>\n </Core>\n );\n};\n\nexport default Select;\n"],"mappings":";;;;;;;AAKA,MAAM,EACJ,QAAQ,MACR,eACA,aACA,YACA,aACA,eACA,gBACEA;AAYJ,MAAM,WAAW,WAAwD;AACvE,QAAO,aAAa,UAAU,MAAM,QAAQ,OAAO,QAAQ;;AAU7D,MAAM,UAAU,EACd,WACA,aACA,SACA,UACA,GAAG,YACQ;AACX,QACE,qBAAC;EAAK,eAAe;EAAU,GAAI;aACjC,oBAAC;GAAc,WAAW,GAAG,mBAAmB,UAAU;aACxD,oBAAC,eAAyB,cAAe;IAC3B,EAChB,oBAAC,2BACE,SAAS,KAAK,QAAQ,UACrB,QAAQ,OAAO,GACb,qBAAC,0BACC,oBAAC,yBAAa,OAAO,QAAoB,EACxC,OAAO,QAAQ,KAAI,SAClB,oBAAC;GAA4B,OAAO,KAAK;aACtC,KAAK;KADS,KAAK,MAET,CACb,KANc,MAOJ,GAEd,oBAAC;GAA8B,OAAO,OAAO;aAC1C,OAAO;KADO,OAAO,MAEX,CAEhB,GACa;GACX"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import Skeleton from "../index.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/atoms/Skeleton/Button/index.tsx
|
|
6
|
+
const Button = ({ className, ...props }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
8
|
+
className: cn("h-9 w-15", "rounded-2xl", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Button as default };
|
|
15
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/atoms/Skeleton/Button/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nimport Skeleton, { type Props as SkeletonProps } from '..';\n\nconst Button = ({ className, ...props }: SkeletonProps) => {\n return (\n <Skeleton\n className={cn(\n 'h-9 w-15',\n 'rounded-2xl',\n className,\n //\n )}\n {...props}\n />\n );\n};\nexport default Button;\n"],"mappings":";;;;;AAIA,MAAM,UAAU,EAAE,WAAW,GAAG,YAA2B;AACzD,QACE,oBAAC;EACC,WAAW,GACT,YACA,eACA,UAED;EACD,GAAI;GACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../../../../utils.mjs";
|
|
2
|
+
import Skeleton from "../index.mjs";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/components/atoms/Skeleton/Node/index.tsx
|
|
6
|
+
const Node = ({ className, ...props }) => {
|
|
7
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
8
|
+
...props,
|
|
9
|
+
avatar: false,
|
|
10
|
+
className: cn("h-50 w-full min-w-80", "rounded-3xl", className)
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Node as default };
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../src/components/atoms/Skeleton/Node/index.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nimport Skeleton, { type Props as SkeletonProps } from '..';\n\nconst Node = ({ className, ...props }: SkeletonProps) => {\n return (\n <Skeleton\n {...props}\n avatar={false}\n className={cn(\n 'h-50 w-full min-w-80',\n 'rounded-3xl',\n className,\n //\n )}\n />\n );\n};\nexport default Node;\n"],"mappings":";;;;;AAIA,MAAM,QAAQ,EAAE,WAAW,GAAG,YAA2B;AACvD,QACE,oBAAC;EACC,GAAI;EACJ,QAAQ;EACR,WAAW,GACT,wBACA,eACA,UAED;GACD"}
|