@profiq/ui 0.1.2 → 0.1.4

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,20 +1,17 @@
1
- const j = ["top", "right", "bottom", "left"], m = Math.min, p = Math.max, C = Math.round, L = Math.floor, E = (t) => ({
1
+ const S = ["top", "right", "bottom", "left"], m = Math.min, h = Math.max, w = Math.round, C = Math.floor, j = (t) => ({
2
2
  x: t,
3
3
  y: t
4
- }), h = {
4
+ }), p = {
5
5
  left: "right",
6
6
  right: "left",
7
7
  bottom: "top",
8
8
  top: "bottom"
9
- }, x = {
10
- start: "end",
11
- end: "start"
12
9
  };
13
- function R(t, e, n) {
14
- return p(t, m(e, n));
10
+ function L(t, n, e) {
11
+ return h(t, m(n, e));
15
12
  }
16
- function T(t, e) {
17
- return typeof t == "function" ? t(e) : t;
13
+ function E(t, n) {
14
+ return typeof t == "function" ? t(n) : t;
18
15
  }
19
16
  function g(t) {
20
17
  return t.split("-")[0];
@@ -22,54 +19,55 @@ function g(t) {
22
19
  function a(t) {
23
20
  return t.split("-")[1];
24
21
  }
25
- function b(t) {
22
+ function x(t) {
26
23
  return t === "x" ? "y" : "x";
27
24
  }
28
- function d(t) {
25
+ function b(t) {
29
26
  return t === "y" ? "height" : "width";
30
27
  }
31
- const A = /* @__PURE__ */ new Set(["top", "bottom"]);
32
- function P(t) {
33
- return A.has(g(t)) ? "y" : "x";
28
+ function d(t) {
29
+ const n = t[0];
30
+ return n === "t" || n === "b" ? "y" : "x";
34
31
  }
35
- function y(t) {
36
- return b(P(t));
32
+ function A(t) {
33
+ return x(d(t));
37
34
  }
38
- function k(t, e, n) {
39
- n === void 0 && (n = !1);
40
- const r = a(t), i = y(t), o = d(i);
41
- let c = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
42
- return e.reference[o] > e.floating[o] && (c = f(c)), [c, f(c)];
35
+ function R(t, n, e) {
36
+ e === void 0 && (e = !1);
37
+ const r = a(t), i = A(t), o = b(i);
38
+ let c = i === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
39
+ return n.reference[o] > n.floating[o] && (c = f(c)), [c, f(c)];
43
40
  }
44
- function q(t) {
45
- const e = f(t);
46
- return [s(t), e, s(e)];
41
+ function T(t) {
42
+ const n = f(t);
43
+ return [s(t), n, s(n)];
47
44
  }
48
45
  function s(t) {
49
- return t.replace(/start|end/g, (e) => x[e]);
46
+ return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
50
47
  }
51
- const u = ["left", "right"], l = ["right", "left"], M = ["top", "bottom"], O = ["bottom", "top"];
52
- function S(t, e, n) {
48
+ const u = ["left", "right"], l = ["right", "left"], P = ["top", "bottom"], y = ["bottom", "top"];
49
+ function O(t, n, e) {
53
50
  switch (t) {
54
51
  case "top":
55
52
  case "bottom":
56
- return n ? e ? l : u : e ? u : l;
53
+ return e ? n ? l : u : n ? u : l;
57
54
  case "left":
58
55
  case "right":
59
- return e ? M : O;
56
+ return n ? P : y;
60
57
  default:
61
58
  return [];
62
59
  }
63
60
  }
64
- function z(t, e, n, r) {
61
+ function k(t, n, e, r) {
65
62
  const i = a(t);
66
- let o = S(g(t), n === "start", r);
67
- return i && (o = o.map((c) => c + "-" + i), e && (o = o.concat(o.map(s)))), o;
63
+ let o = O(g(t), e === "start", r);
64
+ return i && (o = o.map((c) => c + "-" + i), n && (o = o.concat(o.map(s)))), o;
68
65
  }
69
66
  function f(t) {
70
- return t.replace(/left|right|bottom|top/g, (e) => h[e]);
67
+ const n = g(t);
68
+ return p[n] + t.slice(n.length);
71
69
  }
72
- function w(t) {
70
+ function M(t) {
73
71
  return {
74
72
  top: 0,
75
73
  right: 0,
@@ -78,53 +76,53 @@ function w(t) {
78
76
  ...t
79
77
  };
80
78
  }
81
- function B(t) {
82
- return typeof t != "number" ? w(t) : {
79
+ function q(t) {
80
+ return typeof t != "number" ? M(t) : {
83
81
  top: t,
84
82
  right: t,
85
83
  bottom: t,
86
84
  left: t
87
85
  };
88
86
  }
89
- function D(t) {
87
+ function z(t) {
90
88
  const {
91
- x: e,
92
- y: n,
89
+ x: n,
90
+ y: e,
93
91
  width: r,
94
92
  height: i
95
93
  } = t;
96
94
  return {
97
95
  width: r,
98
96
  height: i,
99
- top: n,
100
- left: e,
101
- right: e + r,
102
- bottom: n + i,
103
- x: e,
104
- y: n
97
+ top: e,
98
+ left: n,
99
+ right: n + r,
100
+ bottom: e + i,
101
+ x: n,
102
+ y: e
105
103
  };
106
104
  }
107
105
  export {
108
- R as clamp,
109
- E as createCoords,
110
- T as evaluate,
111
- w as expandPaddingObject,
112
- L as floor,
106
+ L as clamp,
107
+ j as createCoords,
108
+ E as evaluate,
109
+ M as expandPaddingObject,
110
+ C as floor,
113
111
  a as getAlignment,
114
- y as getAlignmentAxis,
115
- k as getAlignmentSides,
116
- d as getAxisLength,
117
- q as getExpandedPlacements,
112
+ A as getAlignmentAxis,
113
+ R as getAlignmentSides,
114
+ b as getAxisLength,
115
+ T as getExpandedPlacements,
118
116
  s as getOppositeAlignmentPlacement,
119
- b as getOppositeAxis,
120
- z as getOppositeAxisPlacements,
117
+ x as getOppositeAxis,
118
+ k as getOppositeAxisPlacements,
121
119
  f as getOppositePlacement,
122
- B as getPaddingObject,
120
+ q as getPaddingObject,
123
121
  g as getSide,
124
- P as getSideAxis,
125
- p as max,
122
+ d as getSideAxis,
123
+ h as max,
126
124
  m as min,
127
- D as rectToClientRect,
128
- C as round,
129
- j as sides
125
+ z as rectToClientRect,
126
+ w as round,
127
+ S as sides
130
128
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@profiq/ui",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "description": "A React UI component library built on ShadCN specially for internal use by profiq",
7
7
  "main": "./dist/index.js",
@@ -13,8 +13,10 @@
13
13
  "import": "./dist/index.js"
14
14
  },
15
15
  "./styles": {
16
+ "style": "./dist/index.css",
16
17
  "types": "./dist/styles.d.ts",
17
- "import": "./dist/styles.js"
18
+ "import": "./dist/styles.js",
19
+ "default": "./dist/index.css"
18
20
  },
19
21
  "./lib": {
20
22
  "types": "./dist/lib/index.d.ts",