@cfx-dev/ui-components 2.1.3 → 2.1.5

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.
@@ -1,5 +1,6 @@
1
1
  @use "sass:math";
2
2
  @use "sass:map";
3
+ @use "sass:meta";
3
4
  @use "colors";
4
5
 
5
6
  @mixin def($var, $value) {
@@ -197,10 +198,24 @@ $cfxui-color-alpha: (
197
198
  }
198
199
 
199
200
  @mixin animated($props: 'all', $subClass: '&') {
200
- #{$subClass} {
201
- transition: #{$props} .25s ease,
202
- outline-offset 0s,
203
- outline 0s;
201
+ @if type-of($props) == 'list' {
202
+ $transition: ();
203
+ @each $property in $props {
204
+ $transition: append(
205
+ $transition, ($property .25s ease), $separator: comma
206
+ );
207
+ }
208
+ #{$subClass} {
209
+ transition: $transition,
210
+ outline-offset 0s,
211
+ outline 0s;
212
+ }
213
+ } @else {
214
+ #{$subClass} {
215
+ transition: #{$props} .25s ease,
216
+ outline-offset 0s,
217
+ outline 0s;
218
+ }
204
219
  }
205
220
  }
206
221
 
@@ -254,6 +254,19 @@ $control-heights: (
254
254
  @include ui.define-color-token('button-onlight-disabled-border', ui.color('bg-dark', $alpha: .4));
255
255
  @include ui.define-color-token('button-onlight-disabled-background', transparent);
256
256
 
257
+ @include ui.define-color-token('button-linked-text', ui.color('tertiary'));
258
+ @include ui.define-color-token('button-linked-border', transparent);
259
+ @include ui.define-color-token('button-linked-background', transparent);
260
+ @include ui.define-color-token('button-linked-hover-text', ui.color('red'));
261
+ @include ui.define-color-token('button-linked-hover-border', transparent);
262
+ @include ui.define-color-token('button-linked-hover-background', ui.color('bg-dark'));
263
+ @include ui.define-color-token('button-linked-active-text', ui.color('red'));
264
+ @include ui.define-color-token('button-linked-active-border', transparent);
265
+ @include ui.define-color-token('button-linked-active-background', ui.color('bg-dark'));
266
+ @include ui.define-color-token('button-linked-disabled-text', ui.color('tertiary', $alpha: .4));
267
+ @include ui.define-color-token('button-linked-disabled-border', transparent);
268
+ @include ui.define-color-token('button-linked-disabled-background', transparent);
269
+
257
270
  @include ui.define-color-token('button-quicklink-text', ui.color('primary'));
258
271
  @include ui.define-color-token('button-quicklink-border', transparent);
259
272
  @include ui.define-color-token('button-quicklink-background', ui.color('bg-light'));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "2.1.3",
4
+ "version": "2.1.5",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",
@@ -1,81 +0,0 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import r from "react";
3
- import { Interactive as C } from "./components/Interactive/Interactive.js";
4
- import { clsx as S } from "./utils/clsx.js";
5
- import { clamp01 as b } from "./utils/math.js";
6
- import './assets/Rail.css';const q = "_virtual_1ixqf_1", P = "_root_1ixqf_5", T = "_rail_1ixqf_12", R = "_active_1ixqf_12", M = "_scroller_1ixqf_15", y = "_content_1ixqf_25", z = "_thumb_1ixqf_39", a = {
7
- virtual: q,
8
- root: P,
9
- rail: T,
10
- active: R,
11
- scroller: M,
12
- "no-x-scroll": "_no-x-scroll_1ixqf_19",
13
- "no-y-scroll": "_no-y-scroll_1ixqf_22",
14
- content: y,
15
- thumb: z,
16
- "axis-x": "_axis-x_1ixqf_50",
17
- "axis-y": "_axis-y_1ixqf_59"
18
- }, E = {
19
- pos: 0,
20
- ratio: 1,
21
- height: 0,
22
- offset: 0,
23
- dragging: !1,
24
- dragStartAtCursor: 0,
25
- dragStartAtPos: 0,
26
- movementMultiplier: 1
27
- };
28
- function X(v) {
29
- const {
30
- axis: c,
31
- pos: s,
32
- size: o,
33
- scrollSize: m,
34
- rootRef: _,
35
- setRootActive: i,
36
- minThumbSize: n
37
- } = v, [h, x] = r.useState(!1), t = r.useRef({ ...E }), e = r.useMemo(() => c === "x" ? {
38
- sizeCSS: "width",
39
- offsetCSSTransform: "translateX",
40
- scrollToSide: "left",
41
- mousePosAxis: "clientX"
42
- } : {
43
- sizeCSS: "height",
44
- offsetCSSTransform: "translateY",
45
- scrollToSide: "top",
46
- mousePosAxis: "clientY"
47
- }, [c]), p = {
48
- [e.sizeCSS]: `${t.current.height}px`,
49
- transform: `${e.offsetCSSTransform}(${t.current.offset}px)`
50
- }, A = r.useCallback((f) => {
51
- t.current.dragging = !0, t.current.dragStartAtPos = t.current.pos, t.current.dragStartAtCursor = f[e.mousePosAxis], x(!0), i(!0);
52
- }, [e.mousePosAxis, i]), u = r.useCallback((f) => {
53
- var d;
54
- if (!t.current.dragging)
55
- return;
56
- const w = f[e.mousePosAxis] - t.current.dragStartAtCursor;
57
- (d = _.current) == null || d.scrollTo({
58
- [e.scrollToSide]: t.current.dragStartAtPos + w * t.current.movementMultiplier,
59
- behavior: "auto"
60
- });
61
- }, [e.mousePosAxis, e.scrollToSide, _]), l = r.useCallback(() => {
62
- t.current.dragging && (t.current.dragging = !1, x(!1), i(!1));
63
- }, [i]);
64
- return r.useEffect(() => {
65
- t.current.pos = s, t.current.ratio = b(o / m), t.current.height = o * t.current.ratio, t.current.offset = s * t.current.ratio, t.current.height < n && (t.current.height = n, t.current.offset = s * t.current.ratio * ((o - n) / o)), t.current.movementMultiplier = 1 / t.current.ratio;
66
- }, [n, s, m, o]), r.useEffect(() => (window.addEventListener("mousemove", u), window.addEventListener("mouseup", l), () => {
67
- window.removeEventListener("mousemove", u), window.removeEventListener("mouseup", l);
68
- }), [u, l]), /* @__PURE__ */ g("div", { className: S(a.rail, a[`axis-${c}`]), children: /* @__PURE__ */ g(
69
- C,
70
- {
71
- showPointer: !1,
72
- style: p,
73
- className: S(a.thumb, { [a.active]: h }),
74
- onMouseDown: A
75
- }
76
- ) });
77
- }
78
- export {
79
- X as R,
80
- a as s
81
- };