@cfx-dev/ui-components 0.0.26 → 1.0.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.
package/dist/main.js CHANGED
@@ -54,7 +54,7 @@ import { Text as gr, TextBlock as hr } from "./components/Text/Text.js";
54
54
  import { Textarea as Cr } from "./components/Textarea/Textarea.js";
55
55
  import { TITLE_OUTLET_ID as Pr, Title as _r } from "./components/Title/Title.js";
56
56
  import { InputDropzone as Fr } from "./components/InputDropzone/InputDropzone.js";
57
- import { B as Ar, I as zr } from "./Icons-BlBKvJD8.js";
57
+ import { B as Ar, I as zr } from "./Icons-CIXYyG0c.js";
58
58
  import { OnScreenSensor as Vr } from "./components/OnScreenSensor.js";
59
59
  import { ui as Nr } from "./components/ui.js";
60
60
  import { Symbols as Gr } from "./components/Symbols.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
- import { I as s } from "../../Icons-BlBKvJD8.js";
2
+ import { I as s } from "../../Icons-CIXYyG0c.js";
3
3
  function a() {
4
4
  const i = Object.entries(s).map(([e, t]) => ({
5
5
  name: e,
@@ -28,6 +28,8 @@ export declare namespace Icons {
28
28
  const serverBoost: import("react/jsx-runtime").JSX.Element;
29
29
  const serverBoostUnstyled: import("react/jsx-runtime").JSX.Element;
30
30
  const serverBurst: import("react/jsx-runtime").JSX.Element;
31
+ const upvotesBurst: import("react/jsx-runtime").JSX.Element;
32
+ const upvotesRecurring: import("react/jsx-runtime").JSX.Element;
31
33
  }
32
34
  export declare const BrandIcon: {
33
35
  gta5: import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
1
  import "react/jsx-runtime";
2
- import { B as n, I as p } from "../../Icons-BlBKvJD8.js";
2
+ import { B as a, I as n } from "../../Icons-CIXYyG0c.js";
3
3
  import "../../index.esm-BkynlSN6.js";
4
+ import "./NewIcons/UpvotesBurst.js";
5
+ import "./NewIcons/UpvotesRecurring.js";
4
6
  export {
5
- n as BrandIcon,
6
- p as Icons
7
+ a as BrandIcon,
8
+ n as Icons
7
9
  };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare function UpvotesBurst(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof UpvotesBurst>;
5
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import r from "react";
3
+ function e(o) {
4
+ return /* @__PURE__ */ t(
5
+ "svg",
6
+ {
7
+ viewBox: "0 0 16 16",
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ ...o,
10
+ children: /* @__PURE__ */ t(
11
+ "path",
12
+ {
13
+ d: "M7.75 2.75V12.75M12.75 7.75H2.75M4.89 4.89L10.61 10.61M10.61 4.89L4.89 10.61",
14
+ stroke: "currentColor",
15
+ strokeWidth: "1.5",
16
+ strokeLinecap: "round",
17
+ strokeLinejoin: "round"
18
+ }
19
+ )
20
+ }
21
+ );
22
+ }
23
+ const i = r.memo(e);
24
+ export {
25
+ i as default
26
+ };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare function UpvotesRecurring(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof UpvotesRecurring>;
5
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import e from "react";
3
+ function t(r) {
4
+ return /* @__PURE__ */ o(
5
+ "svg",
6
+ {
7
+ viewBox: "0 0 16 16",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ ...r,
11
+ children: /* @__PURE__ */ o(
12
+ "path",
13
+ {
14
+ stroke: "currentColor",
15
+ strokeWidth: "1.5",
16
+ strokeLinecap: "round",
17
+ strokeLinejoin: "round",
18
+ d: "M12.33 9.75C11.56 11.52 9.8 12.75 7.75 12.75C4.99 12.75 2.75 10.51 2.75 7.75C2.75 4.99 4.99 2.75 7.75 2.75C9.8 2.75 11.56 3.98 12.33 5.75M13.76 4.13L12.89 7L10.02 6.13M7.53998 5.56995V8.51995L8.68998 9.67995"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ }
24
+ const s = e.memo(t);
25
+ export {
26
+ s as default
27
+ };
@@ -1,211 +1,211 @@
1
- @use "sass:math";
2
- @use "sass:list";
3
-
4
- @function get-luminance($color) {
5
- $colors: (
6
- 'red': red($color),
7
- 'green': green($color),
8
- 'blue': blue($color)
9
- );
10
-
11
- @each $name, $value in $colors {
12
- $adjusted: 0;
13
- $value: math.div($value, 255);
14
-
15
- @if $value < 0.03928 {
16
- $value: math.div($value, 12.92);
17
- } @else {
18
- $value: math.div($value + .055, 1.055);
19
- $value: math.pow($value, 2.4);
20
- }
21
-
22
- $colors: map-merge($colors, ($name: $value));
23
- }
24
-
25
- @return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
26
- }
27
-
28
- @function interpolate($c1, $c2, $f) {
29
- $c1r: red($c1);
30
- $c1g: green($c1);
31
- $c1b: blue($c1);
32
-
33
- $c2r: red($c2);
34
- $c2g: green($c2);
35
- $c2b: blue($c2);
36
-
37
- @return rgb(
38
- $c1r + $f * ($c2r - $c1r),
39
- $c1g + $f * ($c2g - $c1g),
40
- $c1b + $f * ($c2b - $c1b),
41
- );
42
- }
43
-
44
- @function set-luminance($color, $lum) {
45
- $itersLeft: 20;
46
- $low: rgb(0, 0, 0);
47
- $high: rgb(255, 255, 255);
48
-
49
- @if get-luminance($color) > $lum {
50
- $high: $color;
51
- } @else {
52
- $low: $color;
53
- }
54
-
55
- $mid: interpolate($low, $high, .5);
56
- $lm: get-luminance($mid);
57
-
58
- @while math.abs($lum - $lm) >= 1e-7 and $itersLeft > 0 {
59
- $itersLeft: $itersLeft - 1;
60
-
61
- $mid: interpolate($low, $high, .5);
62
- $lm: get-luminance($mid);
63
-
64
- @if $lm > $lum {
65
- $high: $mid;
66
- } @else {
67
- $low: $mid;
68
- }
69
- }
70
-
71
- @return $mid;
72
- }
73
-
74
- @function color-triplet($color) {
75
- @return #{red($color)}, #{green($color)}, #{blue($color)};
76
- }
77
-
78
-
79
- // LAB <-> RGB
80
- $oneThird: math.div(1, 3);
81
- $_16OVER116: math.div(16, 116);
82
- $_1OVER2P4: math.div(1, 2.4);
83
-
84
- @function rgb2lab($color) {
85
- $r: math.div(red($color), 255);
86
- $g: math.div(green($color), 255);
87
- $b: math.div(blue($color), 255);
88
-
89
- @if $r > 0.04045 {
90
- $r: math.pow(math.div($r + 0.055, 1.055), 2.4);
91
- } @else {
92
- $r: math.div($r, 12.92);
93
- }
94
- @if $g > 0.04045 {
95
- $g: math.pow(math.div($g + 0.055, 1.055), 2.4);
96
- } @else {
97
- $g: math.div($g, 12.92);
98
- }
99
- @if $b > 0.04045 {
100
- $b: math.pow(math.div($b + 0.055, 1.055), 2.4);
101
- } @else {
102
- $b: math.div($b, 12.92);
103
- }
104
-
105
- $x: math.div($r * 0.4124 + $g * 0.3576 + $b * 0.1805, 0.95047);
106
- $y: math.div($r * 0.2126 + $g * 0.7152 + $b * 0.0722, 1.00000);
107
- $z: math.div($r * 0.0193 + $g * 0.1192 + $b * 0.9505, 1.08883);
108
-
109
- @if $x > 0.008856 {
110
- $x: math.pow($x, $oneThird);
111
- } @else {
112
- $x: (7.787 * $x) + $_16OVER116;
113
- }
114
- @if $y > 0.008856 {
115
- $y: math.pow($y, $oneThird);
116
- } @else {
117
- $y: (7.787 * $y) + $_16OVER116;
118
- }
119
- @if $z > 0.008856 {
120
- $z: math.pow($z, $oneThird);
121
- } @else {
122
- $z: (7.787 * $z) + $_16OVER116;
123
- }
124
-
125
- @return (
126
- 'L': (116 * $y) - 16,
127
- 'a': 500 * ($x - $y),
128
- 'b': 200 * ($y - $z),
129
- );
130
- }
131
-
132
- @function lab2rgb($lab) {
133
- $y: math.div(map-get($lab, 'L') + 16, 116);
134
- $x: math.div(map-get($lab, 'a'), 500) + $y;
135
- $z: $y - math.div(map-get($lab, 'b'), 200);
136
-
137
- $x3: math.pow($x, 3);
138
- $y3: math.pow($y, 3);
139
- $z3: math.pow($z, 3);
140
-
141
- @if $x3 > 0.008856 {
142
- $x: $x3;
143
- } @else {
144
- $x: math.div($x - $_16OVER116 , 7.787);
145
- }
146
- @if $y3 > 0.008856 {
147
- $y: $y3;
148
- } @else {
149
- $y: math.div($y - $_16OVER116 , 7.787);
150
- }
151
- @if $z3 > 0.008856 {
152
- $z: $z3;
153
- } @else {
154
- $z: math.div($z - $_16OVER116 , 7.787);
155
- }
156
-
157
- $x: $x * 0.95047;
158
- $y: $y * 1.00000;
159
- $z: $z * 1.08883;
160
-
161
- $r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
162
- $g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
163
- $b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
164
-
165
- @if $r > 0.0031308 {
166
- $r: 1.055 * math.pow($r, $_1OVER2P4) - 0.055;
167
- } @else {
168
- $r: 12.92 * $r;
169
- }
170
- @if $g > 0.0031308 {
171
- $g: 1.055 * math.pow($g, $_1OVER2P4) - 0.055;
172
- } @else {
173
- $g: 12.92 * $g;
174
- }
175
- @if $b > 0.0031308 {
176
- $b: 1.055 * math.pow($b, $_1OVER2P4) - 0.055;
177
- } @else {
178
- $b: 12.92 * $b;
179
- }
180
-
181
- @return rgb(
182
- math.clamp(0, $r, 1) * 255,
183
- math.clamp(0, $g, 1) * 255,
184
- math.clamp(0, $b, 1) * 255,
185
- );
186
- }
187
-
188
- @function lab-gradient($s, $e, $start, $stop) {
189
- $lst: ();
190
-
191
- @for $i from $start to $stop {
192
- $lst: list.append($lst, lab-gradient-step($s, $e, $i, $stop));
193
- }
194
-
195
- @return $lst;
196
- }
197
-
198
- @function lab-gradient-step($s, $e, $i, $stop) {
199
- $s: rgb2lab($s);
200
- $e: rgb2lab($e);
201
-
202
- $a: math.div($i, $stop - 1);
203
- $ia: 1 - $a;
204
-
205
- @return lab2rgb((
206
- 'L': $ia * map-get($s, 'L') + $a * map-get($e, 'L'),
207
- 'a': $ia * map-get($s, 'a') + $a * map-get($e, 'a'),
208
- 'b': $ia * map-get($s, 'b') + $a * map-get($e, 'b'),
209
- ));
210
- }
211
-
1
+ @use "sass:math";
2
+ @use "sass:list";
3
+
4
+ @function get-luminance($color) {
5
+ $colors: (
6
+ 'red': red($color),
7
+ 'green': green($color),
8
+ 'blue': blue($color)
9
+ );
10
+
11
+ @each $name, $value in $colors {
12
+ $adjusted: 0;
13
+ $value: math.div($value, 255);
14
+
15
+ @if $value < 0.03928 {
16
+ $value: math.div($value, 12.92);
17
+ } @else {
18
+ $value: math.div($value + .055, 1.055);
19
+ $value: math.pow($value, 2.4);
20
+ }
21
+
22
+ $colors: map-merge($colors, ($name: $value));
23
+ }
24
+
25
+ @return (map-get($colors, 'red') * .2126) + (map-get($colors, 'green') * .7152) + (map-get($colors, 'blue') * .0722);
26
+ }
27
+
28
+ @function interpolate($c1, $c2, $f) {
29
+ $c1r: red($c1);
30
+ $c1g: green($c1);
31
+ $c1b: blue($c1);
32
+
33
+ $c2r: red($c2);
34
+ $c2g: green($c2);
35
+ $c2b: blue($c2);
36
+
37
+ @return rgb(
38
+ $c1r + $f * ($c2r - $c1r),
39
+ $c1g + $f * ($c2g - $c1g),
40
+ $c1b + $f * ($c2b - $c1b),
41
+ );
42
+ }
43
+
44
+ @function set-luminance($color, $lum) {
45
+ $itersLeft: 20;
46
+ $low: rgb(0, 0, 0);
47
+ $high: rgb(255, 255, 255);
48
+
49
+ @if get-luminance($color) > $lum {
50
+ $high: $color;
51
+ } @else {
52
+ $low: $color;
53
+ }
54
+
55
+ $mid: interpolate($low, $high, .5);
56
+ $lm: get-luminance($mid);
57
+
58
+ @while math.abs($lum - $lm) >= 1e-7 and $itersLeft > 0 {
59
+ $itersLeft: $itersLeft - 1;
60
+
61
+ $mid: interpolate($low, $high, .5);
62
+ $lm: get-luminance($mid);
63
+
64
+ @if $lm > $lum {
65
+ $high: $mid;
66
+ } @else {
67
+ $low: $mid;
68
+ }
69
+ }
70
+
71
+ @return $mid;
72
+ }
73
+
74
+ @function color-triplet($color) {
75
+ @return #{red($color)}, #{green($color)}, #{blue($color)};
76
+ }
77
+
78
+
79
+ // LAB <-> RGB
80
+ $oneThird: math.div(1, 3);
81
+ $_16OVER116: math.div(16, 116);
82
+ $_1OVER2P4: math.div(1, 2.4);
83
+
84
+ @function rgb2lab($color) {
85
+ $r: math.div(red($color), 255);
86
+ $g: math.div(green($color), 255);
87
+ $b: math.div(blue($color), 255);
88
+
89
+ @if $r > 0.04045 {
90
+ $r: math.pow(math.div($r + 0.055, 1.055), 2.4);
91
+ } @else {
92
+ $r: math.div($r, 12.92);
93
+ }
94
+ @if $g > 0.04045 {
95
+ $g: math.pow(math.div($g + 0.055, 1.055), 2.4);
96
+ } @else {
97
+ $g: math.div($g, 12.92);
98
+ }
99
+ @if $b > 0.04045 {
100
+ $b: math.pow(math.div($b + 0.055, 1.055), 2.4);
101
+ } @else {
102
+ $b: math.div($b, 12.92);
103
+ }
104
+
105
+ $x: math.div($r * 0.4124 + $g * 0.3576 + $b * 0.1805, 0.95047);
106
+ $y: math.div($r * 0.2126 + $g * 0.7152 + $b * 0.0722, 1.00000);
107
+ $z: math.div($r * 0.0193 + $g * 0.1192 + $b * 0.9505, 1.08883);
108
+
109
+ @if $x > 0.008856 {
110
+ $x: math.pow($x, $oneThird);
111
+ } @else {
112
+ $x: (7.787 * $x) + $_16OVER116;
113
+ }
114
+ @if $y > 0.008856 {
115
+ $y: math.pow($y, $oneThird);
116
+ } @else {
117
+ $y: (7.787 * $y) + $_16OVER116;
118
+ }
119
+ @if $z > 0.008856 {
120
+ $z: math.pow($z, $oneThird);
121
+ } @else {
122
+ $z: (7.787 * $z) + $_16OVER116;
123
+ }
124
+
125
+ @return (
126
+ 'L': (116 * $y) - 16,
127
+ 'a': 500 * ($x - $y),
128
+ 'b': 200 * ($y - $z),
129
+ );
130
+ }
131
+
132
+ @function lab2rgb($lab) {
133
+ $y: math.div(map-get($lab, 'L') + 16, 116);
134
+ $x: math.div(map-get($lab, 'a'), 500) + $y;
135
+ $z: $y - math.div(map-get($lab, 'b'), 200);
136
+
137
+ $x3: math.pow($x, 3);
138
+ $y3: math.pow($y, 3);
139
+ $z3: math.pow($z, 3);
140
+
141
+ @if $x3 > 0.008856 {
142
+ $x: $x3;
143
+ } @else {
144
+ $x: math.div($x - $_16OVER116 , 7.787);
145
+ }
146
+ @if $y3 > 0.008856 {
147
+ $y: $y3;
148
+ } @else {
149
+ $y: math.div($y - $_16OVER116 , 7.787);
150
+ }
151
+ @if $z3 > 0.008856 {
152
+ $z: $z3;
153
+ } @else {
154
+ $z: math.div($z - $_16OVER116 , 7.787);
155
+ }
156
+
157
+ $x: $x * 0.95047;
158
+ $y: $y * 1.00000;
159
+ $z: $z * 1.08883;
160
+
161
+ $r: $x * 3.2406 + $y * -1.5372 + $z * -0.4986;
162
+ $g: $x * -0.9689 + $y * 1.8758 + $z * 0.0415;
163
+ $b: $x * 0.0557 + $y * -0.2040 + $z * 1.0570;
164
+
165
+ @if $r > 0.0031308 {
166
+ $r: 1.055 * math.pow($r, $_1OVER2P4) - 0.055;
167
+ } @else {
168
+ $r: 12.92 * $r;
169
+ }
170
+ @if $g > 0.0031308 {
171
+ $g: 1.055 * math.pow($g, $_1OVER2P4) - 0.055;
172
+ } @else {
173
+ $g: 12.92 * $g;
174
+ }
175
+ @if $b > 0.0031308 {
176
+ $b: 1.055 * math.pow($b, $_1OVER2P4) - 0.055;
177
+ } @else {
178
+ $b: 12.92 * $b;
179
+ }
180
+
181
+ @return rgb(
182
+ math.clamp(0, $r, 1) * 255,
183
+ math.clamp(0, $g, 1) * 255,
184
+ math.clamp(0, $b, 1) * 255,
185
+ );
186
+ }
187
+
188
+ @function lab-gradient($s, $e, $start, $stop) {
189
+ $lst: ();
190
+
191
+ @for $i from $start to $stop {
192
+ $lst: list.append($lst, lab-gradient-step($s, $e, $i, $stop));
193
+ }
194
+
195
+ @return $lst;
196
+ }
197
+
198
+ @function lab-gradient-step($s, $e, $i, $stop) {
199
+ $s: rgb2lab($s);
200
+ $e: rgb2lab($e);
201
+
202
+ $a: math.div($i, $stop - 1);
203
+ $ia: 1 - $a;
204
+
205
+ @return lab2rgb((
206
+ 'L': $ia * map-get($s, 'L') + $a * map-get($e, 'L'),
207
+ 'a': $ia * map-get($s, 'a') + $a * map-get($e, 'a'),
208
+ 'b': $ia * map-get($s, 'b') + $a * map-get($e, 'b'),
209
+ ));
210
+ }
211
+
@@ -1,12 +1,12 @@
1
1
  import { jsx as E } from "react/jsx-runtime";
2
2
  import o from "react";
3
- import { R as m } from "../index-2hJuj4UN.js";
4
- const a = Symbol("Uninitialized");
5
- function h(e, ...t) {
6
- const r = o.useRef(a);
7
- return r.current === a && (r.current = e(...t)), r.current;
3
+ import { $ as m } from "../index-C1KmDBa6.js";
4
+ const l = Symbol("Uninitialized");
5
+ function v(e, ...t) {
6
+ const r = o.useRef(l);
7
+ return r.current === l && (r.current = e(...t)), r.current;
8
8
  }
9
- function l(e) {
9
+ function a(e) {
10
10
  const t = o.useRef(e);
11
11
  return t.current = e, t;
12
12
  }
@@ -36,14 +36,14 @@ i.shouldProcessEvent = (e) => {
36
36
  return !0;
37
37
  };
38
38
  function d(e) {
39
- const t = l((r) => {
39
+ const t = a((r) => {
40
40
  d.isCloseEvent(r) && e();
41
41
  });
42
42
  i(t);
43
43
  }
44
44
  d.isCloseEvent = (e) => e.key === "Escape";
45
- function v(e) {
46
- const t = l(e);
45
+ function R(e) {
46
+ const t = a(e);
47
47
  o.useEffect(() => {
48
48
  const r = () => t.current();
49
49
  return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
@@ -70,10 +70,10 @@ function g(e, t = "original") {
70
70
  }, [e, t]), r;
71
71
  }
72
72
  export {
73
- l as useDynamicRef,
73
+ a as useDynamicRef,
74
74
  i as useGlobalKeyboardEvent,
75
- h as useInstance,
75
+ v as useInstance,
76
76
  d as useKeyboardClose,
77
77
  g as useOutlet,
78
- v as useWindowResize
78
+ R as useWindowResize
79
79
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "0.0.26",
4
+ "version": "1.0.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export declare function attachOutlet(id: string): React.FC<React.PropsWithChildren>;
4
- export declare function createOutlet(): React.FC<React.PropsWithChildren>;
@@ -1,21 +0,0 @@
1
- import { R as o } from "../index-2hJuj4UN.js";
2
- function u(t) {
3
- let e = null;
4
- if (typeof window < "u" && (e = document.getElementById(t)), !e)
5
- throw new Error(`Attempted to connect the outlet to the DOM node with ID #${t}, but no such node exists.`);
6
- return ({
7
- children: n
8
- }) => o.createPortal(n, e);
9
- }
10
- function l() {
11
- let t = null;
12
- if (typeof window < "u" && (t = document.createElement("div"), document.body.appendChild(t)), !t)
13
- throw new Error("Attempted to create an outlet, but no such outlet exists.");
14
- return ({
15
- children: e
16
- }) => o.createPortal(e, t);
17
- }
18
- export {
19
- u as attachOutlet,
20
- l as createOutlet
21
- };