@bccampus/ui-components 0.4.2 → 0.5.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/_chunks/CompositeDataItem.js +204 -0
- package/dist/_chunks/createLucideIcon.js +103 -0
- package/dist/_chunks/index.js +125 -0
- package/dist/_chunks/index2.js +44 -0
- package/dist/_chunks/index3.js +533 -0
- package/dist/{utils-CRiPKpXj.js → _chunks/utils.js} +754 -526
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +84 -0
- package/dist/components/ui/banner.d.ts +10 -0
- package/dist/components/ui/banner.js +45 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/{button.js → components/ui/button.js} +11 -10
- package/dist/components/ui/card.d.ts +27 -0
- package/dist/components/ui/card.js +109 -0
- package/dist/components/ui/composite/CompositeData.d.ts +20 -0
- package/dist/components/ui/composite/CompositeData.js +89 -0
- package/dist/components/ui/composite/CompositeDataItem.d.ts +28 -0
- package/dist/components/ui/composite/CompositeDataItem.js +5 -0
- package/dist/components/ui/composite/FocusProvider/AbstractFocusProvider.d.ts +41 -0
- package/dist/components/ui/composite/FocusProvider/AbstractFocusProvider.js +35 -0
- package/dist/components/ui/composite/FocusProvider/ListboxFocusProvider.d.ts +16 -0
- package/dist/components/ui/composite/FocusProvider/ListboxFocusProvider.js +67 -0
- package/dist/components/ui/composite/FocusProvider/index.d.ts +2 -0
- package/dist/components/ui/composite/FocusProvider/index.js +6 -0
- package/dist/components/ui/composite/SelectionProvider/AbstractSelectionProvider.d.ts +23 -0
- package/dist/components/ui/composite/SelectionProvider/AbstractSelectionProvider.js +20 -0
- package/dist/components/ui/composite/SelectionProvider/MultipleSelectionProvider.d.ts +9 -0
- package/dist/components/ui/composite/SelectionProvider/MultipleSelectionProvider.js +20 -0
- package/dist/components/ui/composite/SelectionProvider/SingleSelectionProvider.d.ts +9 -0
- package/dist/components/ui/composite/SelectionProvider/SingleSelectionProvider.js +25 -0
- package/dist/components/ui/composite/SelectionProvider/index.d.ts +3 -0
- package/dist/components/ui/composite/SelectionProvider/index.js +8 -0
- package/dist/components/ui/composite/composite-component-item.d.ts +2 -0
- package/dist/components/ui/composite/composite-component-item.js +74 -0
- package/dist/components/ui/composite/composite-component.d.ts +2 -0
- package/dist/components/ui/composite/composite-component.js +66 -0
- package/dist/components/ui/composite/index.d.ts +7 -0
- package/dist/components/ui/composite/index.js +22 -0
- package/dist/components/ui/composite/listbox.d.ts +2 -0
- package/dist/components/ui/composite/listbox.js +58 -0
- package/dist/components/ui/composite/types.d.ts +82 -0
- package/dist/components/ui/composite/types.js +1 -0
- package/dist/components/ui/horizontal-list.d.ts +10 -0
- package/dist/components/ui/horizontal-list.js +82 -0
- package/dist/components/ui/icon-generator/generate-tiles.d.ts +4 -0
- package/dist/components/ui/icon-generator/generate-tiles.js +223 -0
- package/dist/components/ui/icon-generator/icon-generator.d.ts +3 -0
- package/dist/components/ui/icon-generator/icon-generator.js +82 -0
- package/dist/components/ui/icon-generator/index.d.ts +4 -0
- package/dist/components/ui/icon-generator/index.js +11 -0
- package/dist/components/ui/icon-generator/masked-image-generator.d.ts +3 -0
- package/dist/components/ui/icon-generator/masked-image-generator.js +31 -0
- package/dist/{masked-image-generator.d.ts → components/ui/icon-generator/types.d.ts} +48 -58
- package/dist/components/ui/icon-generator/types.js +30 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/{input.js → components/ui/input.js} +8 -8
- package/dist/components/ui/navigation-menu.d.ts +16 -0
- package/dist/components/ui/navigation-menu.js +1041 -0
- package/dist/components/ui/overlay.d.ts +7 -0
- package/dist/{overlay.js → components/ui/overlay.js} +7 -7
- package/dist/components/ui/page-header.d.ts +5 -0
- package/dist/{page-header.js → components/ui/page-header.js} +189 -181
- package/dist/components/ui/page-section.d.ts +8 -0
- package/dist/{page-section.js → components/ui/page-section.js} +7 -7
- package/dist/components/ui/page.d.ts +3 -0
- package/dist/components/ui/page.js +8 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.js +3532 -0
- package/dist/components/ui/search-input.d.ts +3 -0
- package/dist/components/ui/search-input.js +24 -0
- package/dist/components/ui/tag.d.ts +10 -0
- package/dist/{tag.js → components/ui/tag.js} +10 -9
- package/dist/components/ui/typography/caption.d.ts +8 -0
- package/dist/components/ui/typography/caption.js +28 -0
- package/dist/components/ui/typography/index.d.ts +1 -0
- package/dist/components/ui/typography/index.js +5 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/use-effect-after-mount.d.ts +2 -0
- package/dist/hooks/use-effect-after-mount.js +24 -0
- package/dist/hooks/use-id.d.ts +1 -0
- package/dist/hooks/use-id.js +7 -0
- package/dist/hooks/use-keyboard-event.d.ts +59 -0
- package/dist/hooks/use-keyboard-event.js +52 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +16 -0
- package/dist/lib/object.d.ts +5 -0
- package/dist/lib/object.js +38 -0
- package/dist/lib/set-operations.d.ts +5 -0
- package/dist/lib/set-operations.js +51 -0
- package/dist/{utils.d.ts → lib/utils.d.ts} +2 -5
- package/dist/lib/utils.js +4 -0
- package/package.json +9 -76
- package/src/components/index.ts +17 -0
- package/src/components/ui/composite/FocusProvider/index.ts +2 -0
- package/src/components/ui/composite/SelectionProvider/MultipleSelectionProvider.ts +1 -1
- package/src/components/ui/composite/SelectionProvider/index.ts +3 -0
- package/src/components/ui/composite/index.ts +5 -5
- package/src/components/ui/icon-generator/index.ts +2 -0
- package/src/components/ui/typography/index.ts +1 -0
- package/src/hooks/index.ts +3 -0
- package/src/index.ts +3 -0
- package/src/lib/index.ts +3 -0
- package/tsconfig.lib.json +44 -0
- package/vite.config.ts +28 -31
- package/dist/AbstractFocusProvider-CxvlcEki.js +0 -29
- package/dist/AbstractSelectionProvider-BtaROstC.js +0 -30
- package/dist/CompositeDataItem-DuHOHCWy.js +0 -158
- package/dist/ListboxFocusProvider.d.ts +0 -149
- package/dist/ListboxFocusProvider.js +0 -53
- package/dist/MultipleSelectionProvider.d.ts +0 -141
- package/dist/MultipleSelectionProvider.js +0 -19
- package/dist/SingleSelectionProvider.d.ts +0 -141
- package/dist/SingleSelectionProvider.js +0 -23
- package/dist/banner.d.ts +0 -16
- package/dist/banner.js +0 -42
- package/dist/button.d.ts +0 -17
- package/dist/caption.d.ts +0 -13
- package/dist/caption.js +0 -27
- package/dist/card.d.ts +0 -46
- package/dist/card.js +0 -108
- package/dist/composite-component-DSUbd1XS.js +0 -122
- package/dist/composite.d.ts +0 -208
- package/dist/composite.js +0 -82
- package/dist/createLucideIcon-CzehbSja.js +0 -94
- package/dist/generate-tiles-DuagGD1d.js +0 -244
- package/dist/generate-tiles.d.ts +0 -43
- package/dist/generate-tiles.js +0 -7
- package/dist/horizontal-list.d.ts +0 -16
- package/dist/horizontal-list.js +0 -77
- package/dist/icon-generator-tuhuqdpL.js +0 -76
- package/dist/icon-generator.d.ts +0 -58
- package/dist/icon-generator.js +0 -6
- package/dist/index-CQhYMnjT.js +0 -34
- package/dist/index-U7DVCmS_.js +0 -76
- package/dist/input.d.ts +0 -7
- package/dist/listbox.d.ts +0 -171
- package/dist/listbox.js +0 -76
- package/dist/masked-image-generator.js +0 -29
- package/dist/navigation-menu.d.ts +0 -27
- package/dist/navigation-menu.js +0 -1139
- package/dist/overlay.d.ts +0 -13
- package/dist/page-header.d.ts +0 -9
- package/dist/page-section.d.ts +0 -14
- package/dist/page.d.ts +0 -7
- package/dist/page.js +0 -8
- package/dist/search-input.d.ts +0 -7
- package/dist/search-input.js +0 -23
- package/dist/tag.d.ts +0 -16
- package/dist/ui-components.d.ts +0 -215
- package/dist/ui-components.js +0 -54
- package/dist/utils.js +0 -4
- package/src/assets/icons/icon_01.svg +0 -6
- package/src/assets/icons/icon_02.svg +0 -6
- package/src/assets/icons/icon_03.svg +0 -6
- package/src/assets/icons/icon_04.svg +0 -6
- package/src/assets/icons/icon_05.svg +0 -4
- package/src/assets/icons/icon_06.svg +0 -4
- package/src/assets/images/image_01.jpg +0 -0
- package/src/assets/images/image_02.jpg +0 -0
- package/src/assets/images/image_03.webp +0 -0
- package/src/assets/images/image_04.png +0 -0
- package/src/assets/images/image_05.jpg +0 -0
- package/src/assets/images/image_06.jpg +0 -0
- package/src/components/ui/index.ts +0 -15
package/dist/horizontal-list.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { c as r } from "./utils-CRiPKpXj.js";
|
|
3
|
-
import { Button as c } from "./button.js";
|
|
4
|
-
import { useRef as u, useCallback as a } from "react";
|
|
5
|
-
import { c as v } from "./index-CQhYMnjT.js";
|
|
6
|
-
import { c as i } from "./createLucideIcon-CzehbSja.js";
|
|
7
|
-
/**
|
|
8
|
-
* @license lucide-react v0.544.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
const x = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], g = i("chevron-left", x);
|
|
14
|
-
/**
|
|
15
|
-
* @license lucide-react v0.544.0 - ISC
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the ISC license.
|
|
18
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
const w = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], N = i("chevron-right", w), k = v(
|
|
21
|
-
"scrollbar-hidden overscroll-x-contain flex flex-row flex-nowrap py-1 gap-(--gap-card) overflow-x-auto snap-x snap-mandatory touch-pan-x scroll-smooth *:shrink-0 *:grow-0 *:snap-center *:select-none",
|
|
22
|
-
{
|
|
23
|
-
variants: {
|
|
24
|
-
variant: {
|
|
25
|
-
contain: "w-full ",
|
|
26
|
-
overflow: "w-screen px-(--spacing-section) -ms-(--spacing-section) scroll-px-(--spacing-section)"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: "contain"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
function _({
|
|
35
|
-
variant: l,
|
|
36
|
-
className: f,
|
|
37
|
-
children: m,
|
|
38
|
-
toolbarLocation: t = "bottom",
|
|
39
|
-
scrollBy: e = 360,
|
|
40
|
-
...p
|
|
41
|
-
}) {
|
|
42
|
-
const n = u(null), h = a(() => {
|
|
43
|
-
n.current?.scrollBy({ left: -e });
|
|
44
|
-
}, [e]), d = a(() => {
|
|
45
|
-
n.current?.scrollBy({ left: e });
|
|
46
|
-
}, [e]);
|
|
47
|
-
return /* @__PURE__ */ s(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: r("flex gap-4", {
|
|
51
|
-
"flex-col": t === "bottom",
|
|
52
|
-
"flex-col-reverse": t === "top"
|
|
53
|
-
}),
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ o(
|
|
56
|
-
"div",
|
|
57
|
-
{
|
|
58
|
-
ref: n,
|
|
59
|
-
className: r(
|
|
60
|
-
k({ variant: l }),
|
|
61
|
-
f
|
|
62
|
-
),
|
|
63
|
-
...p,
|
|
64
|
-
children: m
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ s("div", { className: "flex justify-center sm:justify-start", children: [
|
|
68
|
-
/* @__PURE__ */ o(c, { size: "icon", variant: "ghost", className: "rounded-full", onClick: h, children: /* @__PURE__ */ o(g, { className: "size-9" }) }),
|
|
69
|
-
/* @__PURE__ */ o(c, { size: "icon", variant: "ghost", className: "rounded-full", onClick: d, children: /* @__PURE__ */ o(N, { className: "size-9" }) })
|
|
70
|
-
] })
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
export {
|
|
76
|
-
_ as HorizontalList
|
|
77
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as r } from "react";
|
|
3
|
-
import { T as o, g as l } from "./generate-tiles-DuagGD1d.js";
|
|
4
|
-
import { c as m } from "./utils-CRiPKpXj.js";
|
|
5
|
-
const k = [
|
|
6
|
-
[o.PieRand, o.PieRand],
|
|
7
|
-
[o.PieRand, o.PieRand]
|
|
8
|
-
];
|
|
9
|
-
function b({
|
|
10
|
-
pattern: e = k,
|
|
11
|
-
tileSize: h = 64,
|
|
12
|
-
tileClassName: c,
|
|
13
|
-
tileBgClassName: s,
|
|
14
|
-
renderChildren: d,
|
|
15
|
-
fit: i = "none",
|
|
16
|
-
...g
|
|
17
|
-
}) {
|
|
18
|
-
const t = r(
|
|
19
|
-
() => ({
|
|
20
|
-
width: e.reduce((n, v) => Math.max(n, v.length), 0) * h,
|
|
21
|
-
height: e.length * h
|
|
22
|
-
}),
|
|
23
|
-
[e, h]
|
|
24
|
-
), a = r(() => {
|
|
25
|
-
const n = l(e, h, c);
|
|
26
|
-
return s && n.unshift(
|
|
27
|
-
/* @__PURE__ */ u(
|
|
28
|
-
"rect",
|
|
29
|
-
{
|
|
30
|
-
x: 0,
|
|
31
|
-
y: 0,
|
|
32
|
-
width: t.width,
|
|
33
|
-
height: t.height,
|
|
34
|
-
className: m("fill-black stroke-2 stroke-black", s)
|
|
35
|
-
},
|
|
36
|
-
"svg-mask-invert"
|
|
37
|
-
)
|
|
38
|
-
), n;
|
|
39
|
-
}, [e, t, c, s, h]), w = r(() => {
|
|
40
|
-
switch (i) {
|
|
41
|
-
case "fill":
|
|
42
|
-
return t.width <= t.height ? "100%" : void 0;
|
|
43
|
-
case "width":
|
|
44
|
-
return "100%";
|
|
45
|
-
case "none":
|
|
46
|
-
return t.width;
|
|
47
|
-
default:
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
}, [i, t]), f = r(() => {
|
|
51
|
-
switch (i) {
|
|
52
|
-
case "fill":
|
|
53
|
-
return t.height < t.width ? "100%" : void 0;
|
|
54
|
-
case "height":
|
|
55
|
-
return "100%";
|
|
56
|
-
case "none":
|
|
57
|
-
return t.height;
|
|
58
|
-
default:
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}, [i, t]);
|
|
62
|
-
return /* @__PURE__ */ u(
|
|
63
|
-
"svg",
|
|
64
|
-
{
|
|
65
|
-
width: w,
|
|
66
|
-
height: f,
|
|
67
|
-
viewBox: `0 0 ${t.width} ${t.height}`,
|
|
68
|
-
overflow: "visible",
|
|
69
|
-
...g,
|
|
70
|
-
children: d ? d(a, t.width, t.height) : a
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
b as I
|
|
76
|
-
};
|
package/dist/icon-generator.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react';
|
|
2
|
-
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
export declare function IconGenerator({ pattern, tileSize, tileClassName, tileBgClassName, renderChildren, fit, ...props }: IconGeneratorProps): JSX_2.Element;
|
|
5
|
-
|
|
6
|
-
export declare interface IconGeneratorProps extends Omit<React.ComponentProps<"svg">, "children" | "width" | "height" | "overflow"> {
|
|
7
|
-
pattern?: (TileShape | TileConfig)[][];
|
|
8
|
-
tileSize?: number;
|
|
9
|
-
tileClassName?: string;
|
|
10
|
-
tileBgClassName?: string;
|
|
11
|
-
fit?: "none" | "fill" | "width" | "height";
|
|
12
|
-
renderChildren?: (paths: (JSX.Element | null)[], width: number, height: number) => React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export declare interface MaskedImageGeneratorProps extends IconGeneratorProps {
|
|
16
|
-
src: string;
|
|
17
|
-
imageFit?: "cover" | "contain" | "fill";
|
|
18
|
-
imagePosition?: "top" | "center" | "bottom";
|
|
19
|
-
maskType?: "alpha" | "luminance";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export declare interface TileConfig {
|
|
23
|
-
shape: TileShape;
|
|
24
|
-
scale?: number;
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export declare const TileShape: {
|
|
29
|
-
readonly Blank: 0;
|
|
30
|
-
readonly Rand: 1;
|
|
31
|
-
readonly Mosaic: 2;
|
|
32
|
-
readonly MosaicCircle: 3;
|
|
33
|
-
readonly MosaicDiamond: 4;
|
|
34
|
-
readonly Square: 6;
|
|
35
|
-
readonly Circle: 7;
|
|
36
|
-
readonly Diamond: 8;
|
|
37
|
-
readonly Hexagon: 9;
|
|
38
|
-
readonly RandBasic: 10;
|
|
39
|
-
readonly TriangleSE: 11;
|
|
40
|
-
readonly TriangleSW: 12;
|
|
41
|
-
readonly TriangleNW: 13;
|
|
42
|
-
readonly TriangleNE: 14;
|
|
43
|
-
readonly TriangleRand: 15;
|
|
44
|
-
readonly CaretN: 16;
|
|
45
|
-
readonly CaretE: 17;
|
|
46
|
-
readonly CaretS: 18;
|
|
47
|
-
readonly CaretW: 19;
|
|
48
|
-
readonly CaretRand: 20;
|
|
49
|
-
readonly PieSE: 21;
|
|
50
|
-
readonly PieSW: 22;
|
|
51
|
-
readonly PieNW: 23;
|
|
52
|
-
readonly PieNE: 24;
|
|
53
|
-
readonly PieRand: 25;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export declare type TileShape = (typeof TileShape)[keyof typeof TileShape];
|
|
57
|
-
|
|
58
|
-
export { }
|
package/dist/icon-generator.js
DELETED
package/dist/index-CQhYMnjT.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { a as O } from "./utils-CRiPKpXj.js";
|
|
2
|
-
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
-
var u;
|
|
4
|
-
if (l?.variants == null) return y(e, n?.class, n?.className);
|
|
5
|
-
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
-
const a = n?.[t], s = d?.[t];
|
|
7
|
-
if (a === null) return null;
|
|
8
|
-
const i = m(a) || m(s);
|
|
9
|
-
return r[t][i];
|
|
10
|
-
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
-
let [s, i] = a;
|
|
12
|
-
return i === void 0 || (t[s] = i), t;
|
|
13
|
-
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
-
let { class: s, className: i, ...f } = a;
|
|
15
|
-
return Object.entries(f).every((C) => {
|
|
16
|
-
let [c, o] = C;
|
|
17
|
-
return Array.isArray(o) ? o.includes({
|
|
18
|
-
...d,
|
|
19
|
-
...v
|
|
20
|
-
}[c]) : {
|
|
21
|
-
...d,
|
|
22
|
-
...v
|
|
23
|
-
}[c] === o;
|
|
24
|
-
}) ? [
|
|
25
|
-
...t,
|
|
26
|
-
s,
|
|
27
|
-
i
|
|
28
|
-
] : t;
|
|
29
|
-
}, []);
|
|
30
|
-
return y(e, V, N, n?.class, n?.className);
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
j as c
|
|
34
|
-
};
|
package/dist/index-U7DVCmS_.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as i from "react";
|
|
2
|
-
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
-
function d(e, t) {
|
|
4
|
-
if (typeof e == "function")
|
|
5
|
-
return e(t);
|
|
6
|
-
e != null && (e.current = t);
|
|
7
|
-
}
|
|
8
|
-
function y(...e) {
|
|
9
|
-
return (t) => {
|
|
10
|
-
let r = !1;
|
|
11
|
-
const o = e.map((n) => {
|
|
12
|
-
const l = d(n, t);
|
|
13
|
-
return !r && typeof l == "function" && (r = !0), l;
|
|
14
|
-
});
|
|
15
|
-
if (r)
|
|
16
|
-
return () => {
|
|
17
|
-
for (let n = 0; n < o.length; n++) {
|
|
18
|
-
const l = o[n];
|
|
19
|
-
typeof l == "function" ? l() : d(e[n], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function V(...e) {
|
|
25
|
-
return i.useCallback(y(...e), e);
|
|
26
|
-
}
|
|
27
|
-
// @__NO_SIDE_EFFECTS__
|
|
28
|
-
function C(e) {
|
|
29
|
-
const t = /* @__PURE__ */ S(e), r = i.forwardRef((o, n) => {
|
|
30
|
-
const { children: l, ...c } = o, s = i.Children.toArray(l), a = s.find(E);
|
|
31
|
-
if (a) {
|
|
32
|
-
const u = a.props.children, m = s.map((f) => f === a ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : f);
|
|
33
|
-
return /* @__PURE__ */ p(t, { ...c, ref: n, children: i.isValidElement(u) ? i.cloneElement(u, void 0, m) : null });
|
|
34
|
-
}
|
|
35
|
-
return /* @__PURE__ */ p(t, { ...c, ref: n, children: l });
|
|
36
|
-
});
|
|
37
|
-
return r.displayName = `${e}.Slot`, r;
|
|
38
|
-
}
|
|
39
|
-
var x = /* @__PURE__ */ C("Slot");
|
|
40
|
-
// @__NO_SIDE_EFFECTS__
|
|
41
|
-
function S(e) {
|
|
42
|
-
const t = i.forwardRef((r, o) => {
|
|
43
|
-
const { children: n, ...l } = r;
|
|
44
|
-
if (i.isValidElement(n)) {
|
|
45
|
-
const c = h(n), s = R(l, n.props);
|
|
46
|
-
return n.type !== i.Fragment && (s.ref = o ? y(o, c) : c), i.cloneElement(n, s);
|
|
47
|
-
}
|
|
48
|
-
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
49
|
-
});
|
|
50
|
-
return t.displayName = `${e}.SlotClone`, t;
|
|
51
|
-
}
|
|
52
|
-
var g = Symbol("radix.slottable");
|
|
53
|
-
function E(e) {
|
|
54
|
-
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
|
|
55
|
-
}
|
|
56
|
-
function R(e, t) {
|
|
57
|
-
const r = { ...t };
|
|
58
|
-
for (const o in t) {
|
|
59
|
-
const n = e[o], l = t[o];
|
|
60
|
-
/^on[A-Z]/.test(o) ? n && l ? r[o] = (...s) => {
|
|
61
|
-
const a = l(...s);
|
|
62
|
-
return n(...s), a;
|
|
63
|
-
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...l } : o === "className" && (r[o] = [n, l].filter(Boolean).join(" "));
|
|
64
|
-
}
|
|
65
|
-
return { ...e, ...r };
|
|
66
|
-
}
|
|
67
|
-
function h(e) {
|
|
68
|
-
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
69
|
-
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
x as S,
|
|
73
|
-
y as a,
|
|
74
|
-
C as c,
|
|
75
|
-
V as u
|
|
76
|
-
};
|
package/dist/input.d.ts
DELETED
package/dist/listbox.d.ts
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import { KeyboardEventHandler } from 'react';
|
|
3
|
-
import { MouseEventHandler } from 'react';
|
|
4
|
-
import { PreinitializedMapStore } from 'nanostores';
|
|
5
|
-
import { PreinitializedWritableAtom } from 'nanostores';
|
|
6
|
-
import { ReactNode } from 'react';
|
|
7
|
-
|
|
8
|
-
declare abstract class AbstractFocusProvider<T extends object> implements FocusProvider {
|
|
9
|
-
protected data: CompositeData<T>;
|
|
10
|
-
protected dataOptions: CompositeDataOptions<T>;
|
|
11
|
-
firstFocusableItem: CompositeDataItem<T> | null;
|
|
12
|
-
lastFocusableItem: CompositeDataItem<T> | null;
|
|
13
|
-
focusedItem: PreinitializedWritableAtom<CompositeDataItem<T> | null>;
|
|
14
|
-
init(data: CompositeData<T>, dataOptions: CompositeDataOptions<T>): void;
|
|
15
|
-
isFocusable(itemAtom: CompositeDataItem<T>): boolean;
|
|
16
|
-
focus(itemKey: CompositeItemKey): void;
|
|
17
|
-
focus(item: CompositeDataItem<T>): void;
|
|
18
|
-
abstract setFocusPointers(): readonly [first: CompositeDataItem<T> | null, last: CompositeDataItem<T> | null];
|
|
19
|
-
abstract focusUp(): void;
|
|
20
|
-
abstract focusDown(): void;
|
|
21
|
-
abstract focusLeft(): void;
|
|
22
|
-
abstract focusRight(): void;
|
|
23
|
-
abstract focusPageUp(): void;
|
|
24
|
-
abstract focesPageDown(): void;
|
|
25
|
-
abstract focusToFirst(): void;
|
|
26
|
-
abstract focusToLast(): void;
|
|
27
|
-
abstract focusToFirstInRow(): void;
|
|
28
|
-
abstract focusToLastInRow(): void;
|
|
29
|
-
abstract focusToTypeAheadMatch(): void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare abstract class AbstractSelectionProvider<T extends object> {
|
|
33
|
-
protected data: CompositeData<T>;
|
|
34
|
-
protected dataOptions: CompositeDataOptions<T>;
|
|
35
|
-
selectedKeys: PreinitializedWritableAtom<Set<CompositeItemKey>>;
|
|
36
|
-
init(data: CompositeData<T>, dataOptions: CompositeDataOptions<T>): void;
|
|
37
|
-
abstract select(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
38
|
-
abstract select(item: CompositeDataItem<T>, recursive?: boolean): void;
|
|
39
|
-
abstract select(item?: CompositeDataItem<T> | CompositeItemKey, recursive?: boolean): void;
|
|
40
|
-
abstract deselect(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
41
|
-
abstract deselect(item: CompositeDataItem<T>, recursive?: boolean): void;
|
|
42
|
-
abstract deselect(item?: CompositeDataItem<T> | CompositeItemKey, recursive?: boolean): void;
|
|
43
|
-
toggleSelect(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
44
|
-
toggleSelect(item: CompositeDataItem<T>, recursive?: boolean): void;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare interface BaseCompositeProps<T extends object> extends React.ComponentPropsWithoutRef<"div"> {
|
|
48
|
-
data: CompositeData<T>;
|
|
49
|
-
className?: string;
|
|
50
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
51
|
-
handleRef?: React.Ref<CompositeHandle>;
|
|
52
|
-
renderItem: CompositeItemRenderFn<T>;
|
|
53
|
-
itemClassName?: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
declare class CompositeData<T extends object> implements Iterable<CompositeDataItem<T>> {
|
|
57
|
-
#private;
|
|
58
|
-
lookup: Map<CompositeItemKey, CompositeDataItem<T>>;
|
|
59
|
-
focusProvider: AbstractFocusProvider<T>;
|
|
60
|
-
selectionProvider?: AbstractSelectionProvider<T>;
|
|
61
|
-
disabledKeys: Set<CompositeItemKey>;
|
|
62
|
-
root: CompositeDataItem<T>;
|
|
63
|
-
constructor(items: T[], providerOptions: CompositeProviderOptions<T>, options?: CompositeOptions);
|
|
64
|
-
[Symbol.iterator](): Iterator<CompositeDataItem<T>>;
|
|
65
|
-
toJSON(): T[];
|
|
66
|
-
init(items: T[]): void;
|
|
67
|
-
item(key: CompositeItemKey): CompositeDataItem<T> | undefined;
|
|
68
|
-
descendants(itemKey: CompositeItemKey): CompositeDataItem<T>[] | undefined;
|
|
69
|
-
ancestors(itemKey: CompositeItemKey): CompositeDataItem<T>[] | undefined;
|
|
70
|
-
updateItem(key: CompositeItemKey, data: Partial<T> | ((item: T) => Partial<T>)): void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
declare class CompositeDataItem<T extends object> implements Iterable<CompositeDataItem<T>> {
|
|
74
|
-
#private;
|
|
75
|
-
parent: CompositeDataItem<T> | null;
|
|
76
|
-
children?: CompositeDataItem<T>[];
|
|
77
|
-
level: number;
|
|
78
|
-
data: PreinitializedMapStore<T>;
|
|
79
|
-
state: PreinitializedMapStore<CompositeDataItemState>;
|
|
80
|
-
pointers: {
|
|
81
|
-
left?: CompositeItemKey;
|
|
82
|
-
right?: CompositeItemKey;
|
|
83
|
-
up?: CompositeItemKey;
|
|
84
|
-
down?: CompositeItemKey;
|
|
85
|
-
};
|
|
86
|
-
childrenProp: string;
|
|
87
|
-
constructor(item: T, options: CompositeDataItemOptions<T>, parent: CompositeDataItem<T> | null);
|
|
88
|
-
get key(): CompositeItemKey;
|
|
89
|
-
[Symbol.iterator](): Iterator<CompositeDataItem<T>>;
|
|
90
|
-
toJSON(): T;
|
|
91
|
-
descendants(): CompositeDataItem<T>[];
|
|
92
|
-
ancestors(): CompositeDataItem<T>[];
|
|
93
|
-
toggleSelect(recursive?: boolean): void;
|
|
94
|
-
select(recursive?: boolean): CompositeItemKey[];
|
|
95
|
-
deselect(recursive?: boolean): CompositeItemKey[];
|
|
96
|
-
disable(recursive?: boolean): CompositeItemKey[];
|
|
97
|
-
enable(recursive?: boolean): CompositeItemKey[];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
declare type CompositeDataItemOptions<T> = CompositeDataPropGetters<T> & {
|
|
101
|
-
initialState?: CompositeDataItemState;
|
|
102
|
-
itemChildrenProp: string;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
declare interface CompositeDataItemState {
|
|
106
|
-
focused: boolean;
|
|
107
|
-
selected: boolean;
|
|
108
|
-
disabled: boolean;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
declare type CompositeDataOptions<T> = Required<CompositeOptions> & CompositeDataPropGetters<T>;
|
|
112
|
-
|
|
113
|
-
declare interface CompositeDataPropGetters<T> {
|
|
114
|
-
getItemKey: (item: T) => CompositeItemKey;
|
|
115
|
-
getItemChildren: (item: T) => T[] | undefined;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
declare interface CompositeEventHandlers {
|
|
119
|
-
mouseEventHandler?: MouseEventHandler<HTMLElement>;
|
|
120
|
-
keyboardEventHandler?: KeyboardEventHandler<HTMLElement>;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare interface CompositeHandle {
|
|
124
|
-
focusProvider: FocusProvider;
|
|
125
|
-
selectionProvider?: SelectionProvider;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
declare type CompositeItemKey = string | number;
|
|
129
|
-
|
|
130
|
-
declare type CompositeItemRenderFn<T extends object> = (item: {
|
|
131
|
-
data: T;
|
|
132
|
-
level: number;
|
|
133
|
-
key: CompositeItemKey;
|
|
134
|
-
}, state: CompositeDataItemState, eventHandlers: CompositeEventHandlers) => ReactNode;
|
|
135
|
-
|
|
136
|
-
declare interface CompositeOptions {
|
|
137
|
-
disabledKeys?: CompositeItemKey[];
|
|
138
|
-
selectedKeys?: CompositeItemKey[];
|
|
139
|
-
itemKeyProp?: string;
|
|
140
|
-
itemChildrenProp?: string;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare interface CompositeProviderOptions<T extends object> {
|
|
144
|
-
focusProvider: AbstractFocusProvider<T>;
|
|
145
|
-
selectionProvider?: AbstractSelectionProvider<T>;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
declare interface FocusProvider {
|
|
149
|
-
focus(itemKey: CompositeItemKey): void;
|
|
150
|
-
focusUp(): void;
|
|
151
|
-
focusDown(): void;
|
|
152
|
-
focusLeft(): void;
|
|
153
|
-
focusRight(): void;
|
|
154
|
-
focusPageUp(): void;
|
|
155
|
-
focesPageDown(): void;
|
|
156
|
-
focusToFirst(): void;
|
|
157
|
-
focusToLast(): void;
|
|
158
|
-
focusToFirstInRow(): void;
|
|
159
|
-
focusToLastInRow(): void;
|
|
160
|
-
focusToTypeAheadMatch(): void;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export declare function Listbox<T extends object>({ data, ...props }: BaseCompositeProps<T>): JSX.Element;
|
|
164
|
-
|
|
165
|
-
declare interface SelectionProvider {
|
|
166
|
-
select(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
167
|
-
deselect(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
168
|
-
toggleSelect(itemKey?: CompositeItemKey, recursive?: boolean): void;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { }
|
package/dist/listbox.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { C as d } from "./composite-component-DSUbd1XS.js";
|
|
3
|
-
import { useMemo as m, useRef as a, useCallback as u } from "react";
|
|
4
|
-
const h = /* @__PURE__ */ new Set(["ctrl", "shift", "alt", "meta"]), f = {
|
|
5
|
-
" ": "space"
|
|
6
|
-
};
|
|
7
|
-
function K(e) {
|
|
8
|
-
const r = [];
|
|
9
|
-
for (const [t, n] of Object.entries(e)) {
|
|
10
|
-
const o = t.toLowerCase().trim().split(/\s*\+\s*/g);
|
|
11
|
-
o.length === 1 && h.has(o[0]) ? console.error(`[useKeyboardEvent] '${t}': A key sequence cannot be only a modifier key.`) : o.includes("") ? console.error(`[useKeyboardEvent] '${t}': Invalid key sequence defined in the sequence.`) : r.push({
|
|
12
|
-
sequence: new RegExp("^" + o.join("\\+") + "$"),
|
|
13
|
-
handler: n
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return r;
|
|
17
|
-
}
|
|
18
|
-
const l = {
|
|
19
|
-
eventKeyProp: "key"
|
|
20
|
-
};
|
|
21
|
-
function v(e, r = l) {
|
|
22
|
-
const t = { ...r, ...l }, n = K(e);
|
|
23
|
-
return (o) => {
|
|
24
|
-
const c = o[t.eventKeyProp], s = [];
|
|
25
|
-
o.ctrlKey && s.push("ctrl"), o.shiftKey && s.push("shift"), o.altKey && s.push("alt"), o.metaKey && s.push("meta"), f[c] ? s.push(f[c]) : s.push(c.toLowerCase());
|
|
26
|
-
const i = n.find((p) => p.sequence.test(s.join("+")));
|
|
27
|
-
i && (o.preventDefault(), o.stopPropagation(), i.handler(o));
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function P(e, r) {
|
|
31
|
-
return m(() => v(e, r), [e, r]);
|
|
32
|
-
}
|
|
33
|
-
function k({ data: e, ...r }) {
|
|
34
|
-
const t = a(null), n = u(() => {
|
|
35
|
-
const s = e.focusProvider.focusedItem.get()?.key;
|
|
36
|
-
if (s && t.current) {
|
|
37
|
-
const i = t.current.querySelector(`[data-key="${s}"]`);
|
|
38
|
-
i && i.focus();
|
|
39
|
-
}
|
|
40
|
-
}, [e]), o = P({
|
|
41
|
-
ArrowUp: () => {
|
|
42
|
-
e.focusProvider.focusUp(), n();
|
|
43
|
-
},
|
|
44
|
-
ArrowDown: () => {
|
|
45
|
-
e.focusProvider.focusDown(), n();
|
|
46
|
-
},
|
|
47
|
-
Home: () => {
|
|
48
|
-
e.focusProvider.focusToFirst(), n();
|
|
49
|
-
},
|
|
50
|
-
End: () => {
|
|
51
|
-
e.focusProvider.focusToLast(), n();
|
|
52
|
-
},
|
|
53
|
-
Space: () => {
|
|
54
|
-
e.selectionProvider?.toggleSelect(), n();
|
|
55
|
-
}
|
|
56
|
-
}), c = u(
|
|
57
|
-
(s) => {
|
|
58
|
-
e.focusProvider.focus(s.key), e.selectionProvider?.toggleSelect(s), n();
|
|
59
|
-
},
|
|
60
|
-
[e.focusProvider, e.selectionProvider, n]
|
|
61
|
-
);
|
|
62
|
-
return /* @__PURE__ */ y(
|
|
63
|
-
d,
|
|
64
|
-
{
|
|
65
|
-
ref: t,
|
|
66
|
-
variant: "listbox",
|
|
67
|
-
data: e,
|
|
68
|
-
onKeyDown: o,
|
|
69
|
-
itemMouseEventHandler: c,
|
|
70
|
-
...r
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
k as Listbox
|
|
76
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as o, jsxs as c, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { useId as p, useMemo as l } from "react";
|
|
3
|
-
import { I as M } from "./icon-generator-tuhuqdpL.js";
|
|
4
|
-
const h = { cover: "slice", contain: "meet", fill: "none" }, k = { top: "xMidYMin", center: "xMidYMid", bottom: "xMidYMax" };
|
|
5
|
-
function g({
|
|
6
|
-
src: s,
|
|
7
|
-
imageFit: e = "cover",
|
|
8
|
-
imagePosition: r = "top",
|
|
9
|
-
maskType: n = "alpha",
|
|
10
|
-
...a
|
|
11
|
-
}) {
|
|
12
|
-
const t = p(), i = l(
|
|
13
|
-
() => e !== "fill" ? `${k[r]} ${h[e]}` : "none",
|
|
14
|
-
[e, r]
|
|
15
|
-
);
|
|
16
|
-
return /* @__PURE__ */ o(
|
|
17
|
-
M,
|
|
18
|
-
{
|
|
19
|
-
...a,
|
|
20
|
-
renderChildren: (m) => /* @__PURE__ */ c(d, { children: [
|
|
21
|
-
/* @__PURE__ */ o("mask", { id: `svg-mask${t}`, "mask-type": n, children: m }),
|
|
22
|
-
/* @__PURE__ */ o("image", { href: s, width: "100%", height: "100%", mask: `url(#svg-mask${t})`, preserveAspectRatio: i })
|
|
23
|
-
] })
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
g as MaskedImageGenerator
|
|
29
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { JSX } from 'react/jsx-runtime';
|
|
2
|
-
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
|
-
|
|
4
|
-
export declare function NavigationMenu({ className, children, noViewport, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
5
|
-
noViewport?: boolean;
|
|
6
|
-
mega?: boolean;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
|
|
9
|
-
export declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): JSX.Element;
|
|
10
|
-
|
|
11
|
-
export declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): JSX.Element;
|
|
12
|
-
|
|
13
|
-
export declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): JSX.Element;
|
|
14
|
-
|
|
15
|
-
export declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): JSX.Element;
|
|
16
|
-
|
|
17
|
-
export declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): JSX.Element;
|
|
18
|
-
|
|
19
|
-
export declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): JSX.Element;
|
|
20
|
-
|
|
21
|
-
export declare const navigationMenuTriggerStyle: string;
|
|
22
|
-
|
|
23
|
-
export declare function NavigationMenuViewport({ className, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport> & {
|
|
24
|
-
mega?: boolean;
|
|
25
|
-
}): JSX.Element;
|
|
26
|
-
|
|
27
|
-
export { }
|