@bccampus/ui-components 0.4.3 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/.yarn/releases/yarn-4.12.0.cjs +942 -0
  3. package/.yarnrc.yml +3 -0
  4. package/dist/_chunks/createLucideIcon.js +79 -0
  5. package/dist/_chunks/index.js +103 -0
  6. package/dist/_chunks/index2.js +44 -0
  7. package/dist/_chunks/index3.js +39 -0
  8. package/dist/_chunks/index4.js +615 -0
  9. package/dist/{utils-CRiPKpXj.js → _chunks/utils.js} +828 -544
  10. package/dist/components/index.d.ts +16 -0
  11. package/dist/components/index.js +84 -0
  12. package/dist/components/ui/banner.d.ts +10 -0
  13. package/dist/components/ui/banner.js +39 -0
  14. package/dist/components/ui/button.d.ts +11 -0
  15. package/dist/{button.js → components/ui/button.js} +11 -10
  16. package/dist/components/ui/card.d.ts +27 -0
  17. package/dist/components/ui/card.js +109 -0
  18. package/dist/components/ui/composite/CompositeData.d.ts +20 -0
  19. package/dist/components/ui/composite/CompositeData.js +89 -0
  20. package/dist/components/ui/composite/CompositeDataItem.d.ts +28 -0
  21. package/dist/components/ui/composite/CompositeDataItem.js +111 -0
  22. package/dist/components/ui/composite/FocusProvider/AbstractFocusProvider.d.ts +41 -0
  23. package/dist/components/ui/composite/FocusProvider/AbstractFocusProvider.js +36 -0
  24. package/dist/components/ui/composite/FocusProvider/ListboxFocusProvider.d.ts +16 -0
  25. package/dist/components/ui/composite/FocusProvider/ListboxFocusProvider.js +67 -0
  26. package/dist/components/ui/composite/FocusProvider/index.d.ts +2 -0
  27. package/dist/components/ui/composite/FocusProvider/index.js +6 -0
  28. package/dist/components/ui/composite/SelectionProvider/AbstractSelectionProvider.d.ts +23 -0
  29. package/dist/components/ui/composite/SelectionProvider/AbstractSelectionProvider.js +21 -0
  30. package/dist/components/ui/composite/SelectionProvider/MultipleSelectionProvider.d.ts +9 -0
  31. package/dist/components/ui/composite/SelectionProvider/MultipleSelectionProvider.js +20 -0
  32. package/dist/components/ui/composite/SelectionProvider/SingleSelectionProvider.d.ts +9 -0
  33. package/dist/components/ui/composite/SelectionProvider/SingleSelectionProvider.js +25 -0
  34. package/dist/components/ui/composite/SelectionProvider/index.d.ts +3 -0
  35. package/dist/components/ui/composite/SelectionProvider/index.js +8 -0
  36. package/dist/components/ui/composite/composite-component-item.d.ts +2 -0
  37. package/dist/components/ui/composite/composite-component-item.js +52 -0
  38. package/dist/components/ui/composite/composite-component.d.ts +2 -0
  39. package/dist/components/ui/composite/composite-component.js +66 -0
  40. package/dist/components/ui/composite/index.d.ts +8 -0
  41. package/dist/components/ui/composite/index.js +22 -0
  42. package/dist/components/ui/composite/listbox.d.ts +2 -0
  43. package/dist/components/ui/composite/listbox.js +59 -0
  44. package/dist/components/ui/composite/types.d.ts +82 -0
  45. package/dist/components/ui/composite/types.js +1 -0
  46. package/dist/components/ui/horizontal-list.d.ts +10 -0
  47. package/dist/components/ui/horizontal-list.js +70 -0
  48. package/dist/components/ui/icon-generator/generate-tiles.d.ts +4 -0
  49. package/dist/components/ui/icon-generator/generate-tiles.js +223 -0
  50. package/dist/components/ui/icon-generator/icon-generator.d.ts +3 -0
  51. package/dist/components/ui/icon-generator/icon-generator.js +82 -0
  52. package/dist/components/ui/icon-generator/index.d.ts +4 -0
  53. package/dist/components/ui/icon-generator/index.js +11 -0
  54. package/dist/components/ui/icon-generator/masked-image-generator.d.ts +3 -0
  55. package/dist/components/ui/icon-generator/masked-image-generator.js +31 -0
  56. package/dist/{masked-image-generator.d.ts → components/ui/icon-generator/types.d.ts} +48 -58
  57. package/dist/components/ui/icon-generator/types.js +30 -0
  58. package/dist/components/ui/input.d.ts +3 -0
  59. package/dist/{input.js → components/ui/input.js} +8 -8
  60. package/dist/components/ui/navigation-menu.d.ts +16 -0
  61. package/dist/components/ui/navigation-menu.js +1117 -0
  62. package/dist/components/ui/overlay.d.ts +7 -0
  63. package/dist/{overlay.js → components/ui/overlay.js} +7 -7
  64. package/dist/components/ui/page-header.d.ts +5 -0
  65. package/dist/{page-header.js → components/ui/page-header.js} +189 -181
  66. package/dist/components/ui/page-section.d.ts +8 -0
  67. package/dist/{page-section.js → components/ui/page-section.js} +7 -7
  68. package/dist/components/ui/page.d.ts +3 -0
  69. package/dist/components/ui/page.js +8 -0
  70. package/dist/components/ui/popover.d.ts +7 -0
  71. package/dist/components/ui/popover.js +3614 -0
  72. package/dist/components/ui/search-input.d.ts +3 -0
  73. package/dist/components/ui/search-input.js +18 -0
  74. package/dist/components/ui/tag.d.ts +10 -0
  75. package/dist/{tag.js → components/ui/tag.js} +10 -9
  76. package/dist/components/ui/typography/caption.d.ts +8 -0
  77. package/dist/components/ui/typography/caption.js +28 -0
  78. package/dist/components/ui/typography/index.d.ts +1 -0
  79. package/dist/components/ui/typography/index.js +5 -0
  80. package/dist/hooks/index.d.ts +3 -0
  81. package/dist/hooks/index.js +9 -0
  82. package/dist/hooks/use-effect-after-mount.d.ts +2 -0
  83. package/dist/hooks/use-effect-after-mount.js +24 -0
  84. package/dist/hooks/use-id.d.ts +1 -0
  85. package/dist/hooks/use-id.js +7 -0
  86. package/dist/hooks/use-keyboard-event.d.ts +59 -0
  87. package/dist/hooks/use-keyboard-event.js +52 -0
  88. package/dist/lib/index.d.ts +3 -0
  89. package/dist/lib/index.js +16 -0
  90. package/dist/lib/object.d.ts +5 -0
  91. package/dist/lib/object.js +38 -0
  92. package/dist/lib/set-operations.d.ts +5 -0
  93. package/dist/lib/set-operations.js +51 -0
  94. package/dist/{utils.d.ts → lib/utils.d.ts} +2 -5
  95. package/dist/lib/utils.js +4 -0
  96. package/package.json +76 -146
  97. package/src/App.tsx +44 -14
  98. package/src/components/index.ts +17 -0
  99. package/src/components/ui/composite/FocusProvider/index.ts +2 -0
  100. package/src/components/ui/composite/SelectionProvider/MultipleSelectionProvider.ts +1 -1
  101. package/src/components/ui/composite/SelectionProvider/index.ts +3 -0
  102. package/src/components/ui/composite/index.ts +6 -5
  103. package/src/components/ui/icon-generator/index.ts +2 -0
  104. package/src/components/ui/typography/index.ts +1 -0
  105. package/src/hooks/index.ts +3 -0
  106. package/src/index.ts +3 -0
  107. package/src/lib/index.ts +3 -0
  108. package/src/main.tsx +12 -12
  109. package/tsconfig.lib.json +44 -0
  110. package/vite.config.ts +34 -33
  111. package/dist/AbstractFocusProvider-CxvlcEki.js +0 -29
  112. package/dist/AbstractSelectionProvider-BtaROstC.js +0 -30
  113. package/dist/CompositeDataItem-DuHOHCWy.js +0 -158
  114. package/dist/ListboxFocusProvider.d.ts +0 -149
  115. package/dist/ListboxFocusProvider.js +0 -53
  116. package/dist/MultipleSelectionProvider.d.ts +0 -141
  117. package/dist/MultipleSelectionProvider.js +0 -19
  118. package/dist/SingleSelectionProvider.d.ts +0 -141
  119. package/dist/SingleSelectionProvider.js +0 -23
  120. package/dist/banner.d.ts +0 -16
  121. package/dist/banner.js +0 -42
  122. package/dist/button.d.ts +0 -17
  123. package/dist/caption.d.ts +0 -13
  124. package/dist/caption.js +0 -27
  125. package/dist/card.d.ts +0 -46
  126. package/dist/card.js +0 -108
  127. package/dist/composite-component-DSUbd1XS.js +0 -122
  128. package/dist/composite.d.ts +0 -208
  129. package/dist/composite.js +0 -82
  130. package/dist/createLucideIcon-CzehbSja.js +0 -94
  131. package/dist/generate-tiles-DuagGD1d.js +0 -244
  132. package/dist/generate-tiles.d.ts +0 -43
  133. package/dist/generate-tiles.js +0 -7
  134. package/dist/horizontal-list.d.ts +0 -16
  135. package/dist/horizontal-list.js +0 -77
  136. package/dist/icon-generator-tuhuqdpL.js +0 -76
  137. package/dist/icon-generator.d.ts +0 -58
  138. package/dist/icon-generator.js +0 -6
  139. package/dist/index-CQhYMnjT.js +0 -34
  140. package/dist/index-U7DVCmS_.js +0 -76
  141. package/dist/input.d.ts +0 -7
  142. package/dist/listbox.d.ts +0 -171
  143. package/dist/listbox.js +0 -76
  144. package/dist/masked-image-generator.js +0 -29
  145. package/dist/navigation-menu.d.ts +0 -27
  146. package/dist/navigation-menu.js +0 -1139
  147. package/dist/overlay.d.ts +0 -13
  148. package/dist/page-header.d.ts +0 -9
  149. package/dist/page-section.d.ts +0 -14
  150. package/dist/page.d.ts +0 -7
  151. package/dist/page.js +0 -8
  152. package/dist/search-input.d.ts +0 -7
  153. package/dist/search-input.js +0 -23
  154. package/dist/tag.d.ts +0 -16
  155. package/dist/ui-components.d.ts +0 -215
  156. package/dist/ui-components.js +0 -54
  157. package/dist/utils.js +0 -4
  158. package/src/assets/icons/icon_01.svg +0 -6
  159. package/src/assets/icons/icon_02.svg +0 -6
  160. package/src/assets/icons/icon_03.svg +0 -6
  161. package/src/assets/icons/icon_04.svg +0 -6
  162. package/src/assets/icons/icon_05.svg +0 -4
  163. package/src/assets/icons/icon_06.svg +0 -4
  164. package/src/assets/images/image_01.jpg +0 -0
  165. package/src/assets/images/image_02.jpg +0 -0
  166. package/src/assets/images/image_03.webp +0 -0
  167. package/src/assets/images/image_04.png +0 -0
  168. package/src/assets/images/image_05.jpg +0 -0
  169. package/src/assets/images/image_06.jpg +0 -0
  170. package/src/components/ui/index.ts +0 -15
package/.yarnrc.yml ADDED
@@ -0,0 +1,3 @@
1
+ nodeLinker: node-modules
2
+
3
+ yarnPath: .yarn/releases/yarn-4.12.0.cjs
@@ -0,0 +1,79 @@
1
+ import { forwardRef, createElement } from "react";
2
+ const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3
+ const toCamelCase = (string) => string.replace(
4
+ /^([A-Z])|[\s-_]+(\w)/g,
5
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
6
+ );
7
+ const toPascalCase = (string) => {
8
+ const camelCase = toCamelCase(string);
9
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
10
+ };
11
+ const mergeClasses = (...classes) => classes.filter((className, index, array) => {
12
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
13
+ }).join(" ").trim();
14
+ const hasA11yProp = (props) => {
15
+ for (const prop in props) {
16
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
17
+ return true;
18
+ }
19
+ }
20
+ };
21
+ var defaultAttributes = {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ width: 24,
24
+ height: 24,
25
+ viewBox: "0 0 24 24",
26
+ fill: "none",
27
+ stroke: "currentColor",
28
+ strokeWidth: 2,
29
+ strokeLinecap: "round",
30
+ strokeLinejoin: "round"
31
+ };
32
+ const Icon = forwardRef(
33
+ ({
34
+ color = "currentColor",
35
+ size = 24,
36
+ strokeWidth = 2,
37
+ absoluteStrokeWidth,
38
+ className = "",
39
+ children,
40
+ iconNode,
41
+ ...rest
42
+ }, ref) => createElement(
43
+ "svg",
44
+ {
45
+ ref,
46
+ ...defaultAttributes,
47
+ width: size,
48
+ height: size,
49
+ stroke: color,
50
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
51
+ className: mergeClasses("lucide", className),
52
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
53
+ ...rest
54
+ },
55
+ [
56
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
57
+ ...Array.isArray(children) ? children : [children]
58
+ ]
59
+ )
60
+ );
61
+ const createLucideIcon = (iconName, iconNode) => {
62
+ const Component = forwardRef(
63
+ ({ className, ...props }, ref) => createElement(Icon, {
64
+ ref,
65
+ iconNode,
66
+ className: mergeClasses(
67
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
68
+ `lucide-${iconName}`,
69
+ className
70
+ ),
71
+ ...props
72
+ })
73
+ );
74
+ Component.displayName = toPascalCase(iconName);
75
+ return Component;
76
+ };
77
+ export {
78
+ createLucideIcon as c
79
+ };
@@ -0,0 +1,103 @@
1
+ import * as React from "react";
2
+ import { c as composeRefs } from "./index3.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
5
+ var use = React[" use ".trim().toString()];
6
+ function isPromiseLike(value) {
7
+ return typeof value === "object" && value !== null && "then" in value;
8
+ }
9
+ function isLazyComponent(element) {
10
+ return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
11
+ }
12
+ // @__NO_SIDE_EFFECTS__
13
+ function createSlot(ownerName) {
14
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
15
+ const Slot2 = React.forwardRef((props, forwardedRef) => {
16
+ let { children, ...slotProps } = props;
17
+ if (isLazyComponent(children) && typeof use === "function") {
18
+ children = use(children._payload);
19
+ }
20
+ const childrenArray = React.Children.toArray(children);
21
+ const slottable = childrenArray.find(isSlottable);
22
+ if (slottable) {
23
+ const newElement = slottable.props.children;
24
+ const newChildren = childrenArray.map((child) => {
25
+ if (child === slottable) {
26
+ if (React.Children.count(newElement) > 1) return React.Children.only(null);
27
+ return React.isValidElement(newElement) ? newElement.props.children : null;
28
+ } else {
29
+ return child;
30
+ }
31
+ });
32
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
33
+ }
34
+ return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
35
+ });
36
+ Slot2.displayName = `${ownerName}.Slot`;
37
+ return Slot2;
38
+ }
39
+ var Slot = /* @__PURE__ */ createSlot("Slot");
40
+ // @__NO_SIDE_EFFECTS__
41
+ function createSlotClone(ownerName) {
42
+ const SlotClone = React.forwardRef((props, forwardedRef) => {
43
+ let { children, ...slotProps } = props;
44
+ if (isLazyComponent(children) && typeof use === "function") {
45
+ children = use(children._payload);
46
+ }
47
+ if (React.isValidElement(children)) {
48
+ const childrenRef = getElementRef(children);
49
+ const props2 = mergeProps(slotProps, children.props);
50
+ if (children.type !== React.Fragment) {
51
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
52
+ }
53
+ return React.cloneElement(children, props2);
54
+ }
55
+ return React.Children.count(children) > 1 ? React.Children.only(null) : null;
56
+ });
57
+ SlotClone.displayName = `${ownerName}.SlotClone`;
58
+ return SlotClone;
59
+ }
60
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
61
+ function isSlottable(child) {
62
+ return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
63
+ }
64
+ function mergeProps(slotProps, childProps) {
65
+ const overrideProps = { ...childProps };
66
+ for (const propName in childProps) {
67
+ const slotPropValue = slotProps[propName];
68
+ const childPropValue = childProps[propName];
69
+ const isHandler = /^on[A-Z]/.test(propName);
70
+ if (isHandler) {
71
+ if (slotPropValue && childPropValue) {
72
+ overrideProps[propName] = (...args) => {
73
+ const result = childPropValue(...args);
74
+ slotPropValue(...args);
75
+ return result;
76
+ };
77
+ } else if (slotPropValue) {
78
+ overrideProps[propName] = slotPropValue;
79
+ }
80
+ } else if (propName === "style") {
81
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
82
+ } else if (propName === "className") {
83
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
84
+ }
85
+ }
86
+ return { ...slotProps, ...overrideProps };
87
+ }
88
+ function getElementRef(element) {
89
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
90
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
91
+ if (mayWarn) {
92
+ return element.ref;
93
+ }
94
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
95
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
96
+ if (mayWarn) {
97
+ return element.props.ref;
98
+ }
99
+ return element.props.ref || element.ref;
100
+ }
101
+ export {
102
+ Slot as S
103
+ };
@@ -0,0 +1,44 @@
1
+ import { a as clsx } from "./utils.js";
2
+ const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
3
+ const cx = clsx;
4
+ const cva = (base, config) => (props) => {
5
+ var _config_compoundVariants;
6
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
7
+ const { variants, defaultVariants } = config;
8
+ const getVariantClassNames = Object.keys(variants).map((variant) => {
9
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
10
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
11
+ if (variantProp === null) return null;
12
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
13
+ return variants[variant][variantKey];
14
+ });
15
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
16
+ let [key, value] = param;
17
+ if (value === void 0) {
18
+ return acc;
19
+ }
20
+ acc[key] = value;
21
+ return acc;
22
+ }, {});
23
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
24
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
25
+ return Object.entries(compoundVariantOptions).every((param2) => {
26
+ let [key, value] = param2;
27
+ return Array.isArray(value) ? value.includes({
28
+ ...defaultVariants,
29
+ ...propsWithoutUndefined
30
+ }[key]) : {
31
+ ...defaultVariants,
32
+ ...propsWithoutUndefined
33
+ }[key] === value;
34
+ }) ? [
35
+ ...acc,
36
+ cvClass,
37
+ cvClassName
38
+ ] : acc;
39
+ }, []);
40
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
41
+ };
42
+ export {
43
+ cva as c
44
+ };
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ function setRef(ref, value) {
3
+ if (typeof ref === "function") {
4
+ return ref(value);
5
+ } else if (ref !== null && ref !== void 0) {
6
+ ref.current = value;
7
+ }
8
+ }
9
+ function composeRefs(...refs) {
10
+ return (node) => {
11
+ let hasCleanup = false;
12
+ const cleanups = refs.map((ref) => {
13
+ const cleanup = setRef(ref, node);
14
+ if (!hasCleanup && typeof cleanup == "function") {
15
+ hasCleanup = true;
16
+ }
17
+ return cleanup;
18
+ });
19
+ if (hasCleanup) {
20
+ return () => {
21
+ for (let i = 0; i < cleanups.length; i++) {
22
+ const cleanup = cleanups[i];
23
+ if (typeof cleanup == "function") {
24
+ cleanup();
25
+ } else {
26
+ setRef(refs[i], null);
27
+ }
28
+ }
29
+ };
30
+ }
31
+ };
32
+ }
33
+ function useComposedRefs(...refs) {
34
+ return React.useCallback(composeRefs(...refs), refs);
35
+ }
36
+ export {
37
+ composeRefs as c,
38
+ useComposedRefs as u
39
+ };