@cfx-dev/ui-components 4.2.20 → 4.2.22

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 (160) hide show
  1. package/dist/assets/css/Badge.css +1 -1
  2. package/dist/assets/css/Link.css +1 -1
  3. package/dist/assets/general/global.css +1 -1
  4. package/dist/components/Accordion/Accordion.d.ts +1 -7
  5. package/dist/components/Accordion/Accordion.js +1 -1
  6. package/dist/components/Accordion/AccordionShowcase.js +1 -1
  7. package/dist/components/Accordion/index.d.ts +1 -0
  8. package/dist/components/Avatar/AvatarShowcase.js +1 -1
  9. package/dist/components/BackdropPortal/BackdropPortal.d.ts +2 -0
  10. package/dist/components/BackdropPortal/BackdropPortal.js +7 -5
  11. package/dist/components/BackdropPortal/index.d.ts +2 -0
  12. package/dist/components/BackdropPortal/index.js +5 -0
  13. package/dist/components/Badge/Badge.d.ts +9 -2
  14. package/dist/components/Badge/Badge.js +52 -25
  15. package/dist/components/Badge/BadgeShowcase.js +1 -1
  16. package/dist/components/Badge/index.d.ts +1 -1
  17. package/dist/components/BurgerMenu/BurgerMenu.js +1 -1
  18. package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
  19. package/dist/components/Button/ButtonShowcase.js +1 -1
  20. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  21. package/dist/components/ClipboardButton/ClipboardButton.d.ts +3 -3
  22. package/dist/components/ClipboardButton/ClipboardButton.js +10 -9
  23. package/dist/components/ControlBox/ControlBox.d.ts +2 -0
  24. package/dist/components/ControlBox/ControlBox.js +10 -9
  25. package/dist/components/ControlBox/index.d.ts +2 -0
  26. package/dist/components/ControlBox/index.js +4 -0
  27. package/dist/components/CountryFlag/CountryFlag.d.ts +2 -0
  28. package/dist/components/CountryFlag/CountryFlag.js +14 -13
  29. package/dist/components/CountryFlag/index.d.ts +2 -0
  30. package/dist/components/CountryFlag/index.js +4 -0
  31. package/dist/components/Decorate/Decorate.d.ts +2 -0
  32. package/dist/components/Decorate/Decorate.js +15 -14
  33. package/dist/components/Decorate/index.d.ts +2 -0
  34. package/dist/components/Decorate/index.js +4 -0
  35. package/dist/components/DropdownSelect/DropdownSelect.d.ts +1 -1
  36. package/dist/components/DropdownSelect/DropdownSelect.js +801 -1039
  37. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
  38. package/dist/components/DropdownSelect/index.d.ts +1 -0
  39. package/dist/components/Flyout/Flyout.d.ts +2 -1
  40. package/dist/components/Flyout/index.d.ts +2 -0
  41. package/dist/components/Flyout/index.js +5 -0
  42. package/dist/components/Icon/Icon.d.ts +1 -1
  43. package/dist/components/Icon/Icon.js +1 -1
  44. package/dist/components/IconBig/IconBig.js +1 -1
  45. package/dist/components/IconButton/IconButton.d.ts +2 -3
  46. package/dist/components/IconButton/index.d.ts +1 -1
  47. package/dist/components/Indicator/index.d.ts +2 -0
  48. package/dist/components/Indicator/index.js +4 -0
  49. package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
  50. package/dist/components/Input/Input.d.ts +1 -1
  51. package/dist/components/Input/Input.js +6 -6
  52. package/dist/components/Input/InputShowcase.js +1 -1
  53. package/dist/components/Input/RichInput.d.ts +1 -1
  54. package/dist/components/Input/RichInput.js +4 -4
  55. package/dist/components/Input/index.d.ts +1 -1
  56. package/dist/components/InputDropzone/index.d.ts +3 -3
  57. package/dist/components/InputDropzone/index.js +3 -3
  58. package/dist/components/Interactive/index.d.ts +2 -0
  59. package/dist/components/Interactive/index.js +4 -0
  60. package/dist/components/Island/Island.js +4 -4
  61. package/dist/components/Island/index.d.ts +2 -0
  62. package/dist/components/Island/index.js +5 -0
  63. package/dist/components/Layout/Box/Box.d.ts +2 -1
  64. package/dist/components/Layout/Box/Box.js +3 -2
  65. package/dist/components/Layout/Box/index.d.ts +2 -0
  66. package/dist/components/Layout/Box/index.js +5 -0
  67. package/dist/components/Layout/Center/index.d.ts +2 -0
  68. package/dist/components/Layout/Center/index.js +4 -0
  69. package/dist/components/Layout/Flex/Flex.d.ts +4 -4
  70. package/dist/components/Layout/Flex/Flex.js +1 -1
  71. package/dist/components/Layout/Flex/Flex.types.d.ts +7 -0
  72. package/dist/components/Layout/Flex/Flex.types.js +6 -5
  73. package/dist/components/Layout/Flex/index.d.ts +6 -0
  74. package/dist/components/Layout/Flex/index.js +12 -0
  75. package/dist/components/Layout/Pad/index.d.ts +2 -0
  76. package/dist/components/Layout/Pad/index.js +4 -0
  77. package/dist/components/Layout/Page/index.d.ts +2 -0
  78. package/dist/components/Layout/Page/index.js +4 -0
  79. package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -1
  80. package/dist/components/Link/ButtonLink.js +23 -18
  81. package/dist/components/Link/Link.d.ts +3 -1
  82. package/dist/components/Link/Link.js +48 -30
  83. package/dist/components/Link/LinkShowcase.js +46 -41
  84. package/dist/components/Link/index.d.ts +1 -1
  85. package/dist/components/Link/index.js +6 -5
  86. package/dist/components/Loaf/index.d.ts +2 -0
  87. package/dist/components/Loaf/index.js +4 -0
  88. package/dist/components/Logos/LogosShowcase.js +1 -1
  89. package/dist/components/Modal/Modal.js +1 -1
  90. package/dist/components/NavList/index.d.ts +2 -0
  91. package/dist/components/NavList/index.js +4 -0
  92. package/dist/components/Overlay/index.d.ts +2 -0
  93. package/dist/components/Overlay/index.js +5 -0
  94. package/dist/components/PremiumBadge/index.d.ts +2 -0
  95. package/dist/components/PremiumBadge/index.js +4 -0
  96. package/dist/components/Prose/Prose.d.ts +1 -2
  97. package/dist/components/Prose/index.d.ts +2 -0
  98. package/dist/components/Prose/index.js +4 -0
  99. package/dist/components/Radio/index.d.ts +2 -0
  100. package/dist/components/Radio/index.js +4 -0
  101. package/dist/components/Select/Select.d.ts +1 -1
  102. package/dist/components/Select/Select.js +2 -2
  103. package/dist/components/Select/SelectShowcase.js +1 -1
  104. package/dist/components/Separator/Separator.d.ts +1 -1
  105. package/dist/components/Separator/Separator.js +1 -1
  106. package/dist/components/Separator/index.d.ts +2 -0
  107. package/dist/components/Separator/index.js +4 -0
  108. package/dist/components/Shroud/Shroud.js +6 -6
  109. package/dist/components/Shroud/index.d.ts +2 -0
  110. package/dist/components/Shroud/index.js +4 -0
  111. package/dist/components/Skeleton/Skeleton.d.ts +2 -2
  112. package/dist/components/Skeleton/Skeleton.js +1 -1
  113. package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
  114. package/dist/components/Skeleton/index.d.ts +1 -0
  115. package/dist/components/Slider/Slider.js +294 -374
  116. package/dist/components/Slider/SliderShowcase.js +1 -1
  117. package/dist/components/Spacer/Spacer.d.ts +1 -1
  118. package/dist/components/Spacer/index.d.ts +2 -0
  119. package/dist/components/Spacer/index.js +4 -0
  120. package/dist/components/Style/index.d.ts +2 -0
  121. package/dist/components/Style/index.js +5 -0
  122. package/dist/components/Table/Table.d.ts +13 -4
  123. package/dist/components/Table/Table.js +3 -2
  124. package/dist/components/Table/TableShowcase.js +1 -1
  125. package/dist/components/Table/index.d.ts +2 -2
  126. package/dist/components/Table/index.js +5 -2
  127. package/dist/components/Tabular/Tabular.d.ts +1 -1
  128. package/dist/components/Tabular/Tabular.js +1 -1
  129. package/dist/components/Tabular/TabularShowcase.js +1 -1
  130. package/dist/components/Text/Text.js +13 -12
  131. package/dist/components/Text/Text.types.d.ts +3 -2
  132. package/dist/components/Text/TextShowcase.js +12 -15
  133. package/dist/components/Text/index.d.ts +2 -2
  134. package/dist/components/Text/index.js +9 -8
  135. package/dist/components/Textarea/index.d.ts +2 -0
  136. package/dist/components/Textarea/index.js +4 -0
  137. package/dist/components/Title/Title.d.ts +5 -4
  138. package/dist/components/Title/Title.js +4 -2
  139. package/dist/components/Title/TitleShowcase.js +1 -1
  140. package/dist/components/Title/index.d.ts +2 -0
  141. package/dist/components/Title/index.js +7 -0
  142. package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
  143. package/dist/index-AweK2ufS.js +171 -0
  144. package/dist/{index-DBus3GoO.js → index-Bz27DCHt.js} +2 -2
  145. package/dist/main.d.ts +93 -69
  146. package/dist/main.js +217 -191
  147. package/dist/styles-scss/global.scss +2 -2
  148. package/dist/styles-scss/tokens.scss +0 -4
  149. package/dist/utils/color.d.ts +3 -1
  150. package/dist/utils/enum.d.ts +1 -0
  151. package/dist/utils/enum.js +6 -0
  152. package/dist/utils/ui/index.d.ts +3 -0
  153. package/dist/utils/ui/index.js +11 -0
  154. package/dist/{components → utils/ui}/ui.d.ts +2 -68
  155. package/dist/utils/ui/ui.js +68 -0
  156. package/dist/utils/ui/ui.types.d.ts +86 -0
  157. package/dist/utils/ui/ui.types.js +9 -0
  158. package/package.json +1 -1
  159. package/dist/components/ui.js +0 -73
  160. package/dist/index-CjTSD6zB.js +0 -161
@@ -0,0 +1,86 @@
1
+ export declare enum ColorEnum {
2
+ accent = "accent",
3
+ primary = "primary",
4
+ secondary = "secondary",
5
+ tertiary = "tertiary",
6
+ green = "green",
7
+ yellow = "yellow",
8
+ red = "red",
9
+ argentum = "argentum",
10
+ aurum = "aurum",
11
+ platinum = "platinum",
12
+ bg = "bg",
13
+ 'bg-light' = "bg-light",
14
+ 'bg-dark' = "bg-dark",
15
+ 'bg-dark-grey' = "bg-dark-grey",
16
+ 'bg-black' = "bg-black"
17
+ }
18
+ export type ColorType = keyof typeof ColorEnum;
19
+ export declare enum TextSizeEnum {
20
+ xxsmall = "xxsmall",
21
+ xsmall = "xsmall",
22
+ small = "small",
23
+ normal = "normal",
24
+ medium = "medium",
25
+ large = "large",
26
+ xlarge = "xlarge",
27
+ xxlarge = "xxlarge",
28
+ xxxlarge = "xxxlarge"
29
+ }
30
+ export type TextSize = keyof typeof TextSizeEnum;
31
+ export declare enum BorderRadiusEnum {
32
+ none = "none",
33
+ xxsmall = "xxsmall",
34
+ xsmall = "xsmall",
35
+ small = "small",
36
+ normal = "normal",
37
+ pill = "pill"
38
+ }
39
+ export type BorderRadiusType = keyof typeof BorderRadiusEnum;
40
+ export declare enum ZIndexEnum {
41
+ zero = "zero",
42
+ first = "first",
43
+ second = "second",
44
+ max = "max"
45
+ }
46
+ export type ZIndexType = keyof typeof ZIndexEnum;
47
+ export declare enum OffsetEnum {
48
+ none = "none",
49
+ hairthin = "hairthin",
50
+ thin = "thin",
51
+ xxsmall = "xxsmall",
52
+ xsmall = "xsmall",
53
+ small = "small",
54
+ normal = "normal",
55
+ medium = "medium",
56
+ large = "large",
57
+ xlarge = "xlarge",
58
+ safezone = "safezone"
59
+ }
60
+ export type OffsetType = keyof typeof OffsetEnum;
61
+ export declare enum MediaQueryEnum {
62
+ initial = "initial",
63
+ small = "small",
64
+ 'small-medium' = "small-medium",
65
+ medium = "medium",
66
+ 'medium-large' = "medium-large",
67
+ large = "large",
68
+ xlarge = "xlarge"
69
+ }
70
+ export type MediaQueryType = keyof typeof MediaQueryEnum;
71
+ export type ResponsiveValueType<T = string | number> = T | {
72
+ [key in MediaQueryType]?: T;
73
+ };
74
+ export type ResponsiveOffsetType = ResponsiveValueType<OffsetType | number>;
75
+ export interface MPProps {
76
+ m?: ResponsiveOffsetType;
77
+ mt?: ResponsiveOffsetType;
78
+ mr?: ResponsiveOffsetType;
79
+ mb?: ResponsiveOffsetType;
80
+ ml?: ResponsiveOffsetType;
81
+ p?: ResponsiveOffsetType;
82
+ pt?: ResponsiveOffsetType;
83
+ pr?: ResponsiveOffsetType;
84
+ pb?: ResponsiveOffsetType;
85
+ pl?: ResponsiveOffsetType;
86
+ }
@@ -0,0 +1,9 @@
1
+ var a = /* @__PURE__ */ ((l) => (l.accent = "accent", l.primary = "primary", l.secondary = "secondary", l.tertiary = "tertiary", l.green = "green", l.yellow = "yellow", l.red = "red", l.argentum = "argentum", l.aurum = "aurum", l.platinum = "platinum", l.bg = "bg", l["bg-light"] = "bg-light", l["bg-dark"] = "bg-dark", l["bg-dark-grey"] = "bg-dark-grey", l["bg-black"] = "bg-black", l))(a || {}), r = /* @__PURE__ */ ((l) => (l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.xxlarge = "xxlarge", l.xxxlarge = "xxxlarge", l))(r || {}), g = /* @__PURE__ */ ((l) => (l.none = "none", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.pill = "pill", l))(g || {}), x = /* @__PURE__ */ ((l) => (l.zero = "zero", l.first = "first", l.second = "second", l.max = "max", l))(x || {}), e = /* @__PURE__ */ ((l) => (l.none = "none", l.hairthin = "hairthin", l.thin = "thin", l.xxsmall = "xxsmall", l.xsmall = "xsmall", l.small = "small", l.normal = "normal", l.medium = "medium", l.large = "large", l.xlarge = "xlarge", l.safezone = "safezone", l))(e || {}), i = /* @__PURE__ */ ((l) => (l.initial = "initial", l.small = "small", l["small-medium"] = "small-medium", l.medium = "medium", l["medium-large"] = "medium-large", l.large = "large", l.xlarge = "xlarge", l))(i || {});
2
+ export {
3
+ g as BorderRadiusEnum,
4
+ a as ColorEnum,
5
+ i as MediaQueryEnum,
6
+ e as OffsetEnum,
7
+ r as TextSizeEnum,
8
+ x as ZIndexEnum
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "4.2.20",
4
+ "version": "4.2.22",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",
@@ -1,73 +0,0 @@
1
- import { clsx as $ } from "../utils/clsx.js";
2
- var j = /* @__PURE__ */ ((r) => (r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.medium = "medium", r.large = "large", r.xlarge = "xlarge", r.xxlarge = "xxlarge", r.xxxlarge = "xxxlarge", r))(j || {}), R = /* @__PURE__ */ ((r) => (r.none = "none", r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.pill = "pill", r))(R || {}), u = /* @__PURE__ */ ((r) => (r.zero = "zero", r.first = "first", r.second = "second", r.max = "max", r))(u || {}), F = /* @__PURE__ */ ((r) => (r.none = "none", r.hairthin = "hairthin", r.thin = "thin", r.xxsmall = "xxsmall", r.xsmall = "xsmall", r.small = "small", r.normal = "normal", r.medium = "medium", r.large = "large", r.xlarge = "xlarge", r.safezone = "safezone", r))(F || {}), P = /* @__PURE__ */ ((r) => (r.initial = "initial", r.small = "small", r["small-medium"] = "small-medium", r.medium = "medium", r["medium-large"] = "medium-large", r.large = "large", r.xlarge = "xlarge", r))(P || {}), p;
3
- ((r) => {
4
- function s(e = 1) {
5
- return `calc(var(--quant) * ${e})`;
6
- }
7
- r.q = s;
8
- function f(e) {
9
- return `var(--offset-${e})`;
10
- }
11
- r.offset = f;
12
- function h(e = "normal") {
13
- return `var(--font-size-${e})`;
14
- }
15
- r.fontSize = h;
16
- function b(e = "first") {
17
- return `var(--zindex-${e})`;
18
- }
19
- r.zindex = b;
20
- function d(e = "normal") {
21
- return `var(--line-height-${e})`;
22
- }
23
- r.lineHeight = d;
24
- function v(e = "normal") {
25
- return `var(--border-radius-${e})`;
26
- }
27
- r.borderRadius = v;
28
- function y(e, l, n = 1) {
29
- let t = l;
30
- return t === "pure" && (t = ""), typeof t == "number" && (t = `${t}`), `rgba(var(--color-${e}${t ? `-${t}` : ""}), ${n})`;
31
- }
32
- r.color = y, ((e) => {
33
- e.fullWidth = "util-full-width", e.fullHeight = "util-full-height", e.flexGrow = "util-flex-grow", e.flexNoShrink = "util-flex-no-shrink", e.userSelectableText = "util-text-selectable", e.zIndex9000 = "util-z-index-9000";
34
- })(r.cls || (r.cls = {})), r.pc = (e) => `${e}%`, r.px = (e) => `${e}px`, r.ch = (e) => `${e}ch`, r.em = (e) => `${e}em`, r.rem = (e) => `${e}rem`, r.vh = (e) => `${e}vh`, r.vw = (e) => `${e}vw`, r.url = (e) => `url(${e})`;
35
- function a(e) {
36
- return e == null ? "" : typeof e == "number" ? s(e) : e.toString();
37
- }
38
- r.defaultResponsiveValueFormatter = a;
39
- function x(e, l, n = a) {
40
- return l == null ? {} : typeof l == "object" && !Array.isArray(l) ? Object.entries(l).reduce((t, [o, i]) => (t[`--${e}-${o}`] = n(i), t), {}) : {
41
- [`--${e}-initial`]: n(l)
42
- };
43
- }
44
- r.getResponsiveStyles = x;
45
- function g(e, l) {
46
- return l == null ? "" : typeof l == "object" && !Array.isArray(l) ? $(Object.keys(l).map((n) => `ui-${e}-${n}`)) : `ui-${e}-initial`;
47
- }
48
- r.getResponsiveClassnames = g;
49
- function A(e, l, n = a) {
50
- return l == null ? [] : typeof l == "object" && !Array.isArray(l) ? Object.entries(l).reduce((t, [o, i]) => (t.push(`${e}-${o}-${n(i)}`), t), []) : [`${e}-initial-${n(l)}`];
51
- }
52
- r.getResponsiveFlatClassnames = A;
53
- function m(e) {
54
- return typeof e == "number" ? s(e) : f(e);
55
- }
56
- r.offsetResponsiveValueFormatter = m, r.getOffsetStyles = (e, l) => x(e, l, m);
57
- function c(e, l) {
58
- return Object.entries(e).reduce((n, [t, o]) => (Object.assign(n, l(t, o)), n), {});
59
- }
60
- r.callAllMPProps = c, r.getAllMPStyles = (e) => c(e, r.getOffsetStyles), r.getAllMPClassnames = (e) => $(
61
- Object.entries(e).map(
62
- ([l, n]) => g(l, n)
63
- )
64
- );
65
- })(p || (p = {}));
66
- export {
67
- R as BorderRadiusEnum,
68
- P as MediaQueryEnum,
69
- F as OffsetEnum,
70
- j as TextSizeEnum,
71
- u as ZIndexEnum,
72
- p as ui
73
- };
@@ -1,161 +0,0 @@
1
- import * as s from "react";
2
- import y from "react";
3
- import { jsx as h, Fragment as O } from "react/jsx-runtime";
4
- function w(e, t = []) {
5
- let n = [];
6
- function r(c, l) {
7
- const i = s.createContext(l), a = n.length;
8
- n = [...n, l];
9
- const S = (R) => {
10
- var d;
11
- const { scope: C, children: f, ...u } = R, p = ((d = C == null ? void 0 : C[e]) == null ? void 0 : d[a]) || i, m = s.useMemo(() => u, Object.values(u));
12
- return /* @__PURE__ */ h(p.Provider, { value: m, children: f });
13
- };
14
- S.displayName = c + "Provider";
15
- function v(R, C) {
16
- var p;
17
- const f = ((p = C == null ? void 0 : C[e]) == null ? void 0 : p[a]) || i, u = s.useContext(f);
18
- if (u) return u;
19
- if (l !== void 0) return l;
20
- throw new Error(`\`${R}\` must be used within \`${c}\``);
21
- }
22
- return [S, v];
23
- }
24
- const o = () => {
25
- const c = n.map((l) => s.createContext(l));
26
- return function(i) {
27
- const a = (i == null ? void 0 : i[e]) || c;
28
- return s.useMemo(
29
- () => ({ [`__scope${e}`]: { ...i, [e]: a } }),
30
- [i, a]
31
- );
32
- };
33
- };
34
- return o.scopeName = e, [r, b(o, ...t)];
35
- }
36
- function b(...e) {
37
- const t = e[0];
38
- if (e.length === 1) return t;
39
- const n = () => {
40
- const r = e.map((o) => ({
41
- useScope: o(),
42
- scopeName: o.scopeName
43
- }));
44
- return function(c) {
45
- const l = r.reduce((i, { useScope: a, scopeName: S }) => {
46
- const R = a(c)[`__scope${S}`];
47
- return { ...i, ...R };
48
- }, {});
49
- return s.useMemo(() => ({ [`__scope${t.scopeName}`]: l }), [l]);
50
- };
51
- };
52
- return n.scopeName = t.scopeName, n;
53
- }
54
- function _(e, t) {
55
- if (typeof e == "function")
56
- return e(t);
57
- e != null && (e.current = t);
58
- }
59
- function A(...e) {
60
- return (t) => {
61
- let n = !1;
62
- const r = e.map((o) => {
63
- const c = _(o, t);
64
- return !n && typeof c == "function" && (n = !0), c;
65
- });
66
- if (n)
67
- return () => {
68
- for (let o = 0; o < r.length; o++) {
69
- const c = r[o];
70
- typeof c == "function" ? c() : _(e[o], null);
71
- }
72
- };
73
- };
74
- }
75
- function N(...e) {
76
- return s.useCallback(A(...e), e);
77
- }
78
- var g = s.forwardRef((e, t) => {
79
- const { children: n, ...r } = e, o = s.Children.toArray(n), c = o.find(V);
80
- if (c) {
81
- const l = c.props.children, i = o.map((a) => a === c ? s.Children.count(l) > 1 ? s.Children.only(null) : s.isValidElement(l) ? l.props.children : null : a);
82
- return /* @__PURE__ */ h(M, { ...r, ref: t, children: s.isValidElement(l) ? s.cloneElement(l, void 0, i) : null });
83
- }
84
- return /* @__PURE__ */ h(M, { ...r, ref: t, children: n });
85
- });
86
- g.displayName = "Slot";
87
- var M = s.forwardRef((e, t) => {
88
- const { children: n, ...r } = e;
89
- if (s.isValidElement(n)) {
90
- const o = j(n);
91
- return s.cloneElement(n, {
92
- ...$(r, n.props),
93
- // @ts-ignore
94
- ref: t ? A(t, o) : o
95
- });
96
- }
97
- return s.Children.count(n) > 1 ? s.Children.only(null) : null;
98
- });
99
- M.displayName = "SlotClone";
100
- var T = ({ children: e }) => /* @__PURE__ */ h(O, { children: e });
101
- function V(e) {
102
- return s.isValidElement(e) && e.type === T;
103
- }
104
- function $(e, t) {
105
- const n = { ...t };
106
- for (const r in t) {
107
- const o = e[r], c = t[r];
108
- /^on[A-Z]/.test(r) ? o && c ? n[r] = (...i) => {
109
- c(...i), o(...i);
110
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...c } : r === "className" && (n[r] = [o, c].filter(Boolean).join(" "));
111
- }
112
- return { ...e, ...n };
113
- }
114
- function j(e) {
115
- var r, o;
116
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
117
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
118
- }
119
- function L(e) {
120
- const t = e + "CollectionProvider", [n, r] = w(t), [o, c] = n(
121
- t,
122
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
123
- ), l = (f) => {
124
- const { scope: u, children: p } = f, m = y.useRef(null), d = y.useRef(/* @__PURE__ */ new Map()).current;
125
- return /* @__PURE__ */ h(o, { scope: u, itemMap: d, collectionRef: m, children: p });
126
- };
127
- l.displayName = t;
128
- const i = e + "CollectionSlot", a = y.forwardRef(
129
- (f, u) => {
130
- const { scope: p, children: m } = f, d = c(i, p), x = N(u, d.collectionRef);
131
- return /* @__PURE__ */ h(g, { ref: x, children: m });
132
- }
133
- );
134
- a.displayName = i;
135
- const S = e + "CollectionItemSlot", v = "data-radix-collection-item", R = y.forwardRef(
136
- (f, u) => {
137
- const { scope: p, children: m, ...d } = f, x = y.useRef(null), P = N(u, x), E = c(S, p);
138
- return y.useEffect(() => (E.itemMap.set(x, { ref: x, ...d }), () => void E.itemMap.delete(x))), /* @__PURE__ */ h(g, { [v]: "", ref: P, children: m });
139
- }
140
- );
141
- R.displayName = S;
142
- function C(f) {
143
- const u = c(e + "CollectionConsumer", f);
144
- return y.useCallback(() => {
145
- const m = u.collectionRef.current;
146
- if (!m) return [];
147
- const d = Array.from(m.querySelectorAll(`[${v}]`));
148
- return Array.from(u.itemMap.values()).sort(
149
- (E, I) => d.indexOf(E.ref.current) - d.indexOf(I.ref.current)
150
- );
151
- }, [u.collectionRef, u.itemMap]);
152
- }
153
- return [
154
- { Provider: l, Slot: a, ItemSlot: R },
155
- C,
156
- r
157
- ];
158
- }
159
- export {
160
- L as c
161
- };