@bccampus/ui-components 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
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.js CHANGED
@@ -1,7 +1,7 @@
1
- import { j as n } from "./jsx-runtime-BzflLqGi.js";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import { c as i } from "./utils-CRiPKpXj.js";
3
- function t({ className: r, ...e }) {
4
- return /* @__PURE__ */ n.jsx(
3
+ function s({ className: r, ...e }) {
4
+ return /* @__PURE__ */ n(
5
5
  "input",
6
6
  {
7
7
  className: i(
@@ -14,5 +14,5 @@ function t({ className: r, ...e }) {
14
14
  );
15
15
  }
16
16
  export {
17
- t as Input
17
+ s as Input
18
18
  };
@@ -1,29 +1,29 @@
1
- import { j as e } from "./jsx-runtime-BzflLqGi.js";
2
- import { useId as c, useMemo as d } from "react";
3
- import { IconGenerator as p } from "./icon-generator.js";
4
- const x = { cover: "slice", contain: "meet", fill: "none" }, l = { top: "xMidYMin", center: "xMidYMid", bottom: "xMidYMax" };
5
- function f({
6
- src: r,
7
- imageFit: o = "cover",
8
- imagePosition: s = "top",
9
- maskType: n = "alpha",
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 { IconGenerator as M } from "./icon-generator.js";
4
+ const h = { cover: "slice", contain: "meet", fill: "none" }, k = { top: "xMidYMin", center: "xMidYMid", bottom: "xMidYMax" };
5
+ function u({
6
+ src: n,
7
+ imageFit: e = "cover",
8
+ imagePosition: r = "top",
9
+ maskType: s = "alpha",
10
10
  ...a
11
11
  }) {
12
- const t = c(), i = d(
13
- () => o !== "fill" ? `${l[s]} ${x[o]}` : "none",
14
- [o, s]
12
+ const t = p(), i = l(
13
+ () => e !== "fill" ? `${k[r]} ${h[e]}` : "none",
14
+ [e, r]
15
15
  );
16
- return /* @__PURE__ */ e.jsx(
17
- p,
16
+ return /* @__PURE__ */ o(
17
+ M,
18
18
  {
19
19
  ...a,
20
- renderChildren: (m) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
21
- /* @__PURE__ */ e.jsx("mask", { id: `svg-mask${t}`, "mask-type": n, children: m }),
22
- /* @__PURE__ */ e.jsx("image", { href: r, width: "100%", height: "100%", mask: `url(#svg-mask${t})`, preserveAspectRatio: i })
20
+ renderChildren: (m) => /* @__PURE__ */ c(d, { children: [
21
+ /* @__PURE__ */ o("mask", { id: `svg-mask${t}`, "mask-type": s, children: m }),
22
+ /* @__PURE__ */ o("image", { href: n, width: "100%", height: "100%", mask: `url(#svg-mask${t})`, preserveAspectRatio: i })
23
23
  ] })
24
24
  }
25
25
  );
26
26
  }
27
27
  export {
28
- f as MaskedImageGenerator
28
+ u as MaskedImageGenerator
29
29
  };
@@ -0,0 +1,27 @@
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 { }