@kolking/react-ui 1.0.0

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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +131 -0
  3. package/dist/Input-Lz3ft8Tp.js +96 -0
  4. package/dist/ValidationTooltip-BgSwl0hJ.js +30 -0
  5. package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
  6. package/dist/components/Button/Button.d.ts +26 -0
  7. package/dist/components/Button/Button.js +62 -0
  8. package/dist/components/Button/index.d.ts +1 -0
  9. package/dist/components/Button/index.js +4 -0
  10. package/dist/components/Dialog/Dialog.d.ts +10 -0
  11. package/dist/components/Dialog/Dialog.js +57 -0
  12. package/dist/components/Dialog/DialogFocusTrap.d.ts +2 -0
  13. package/dist/components/Dialog/DialogFocusTrap.js +765 -0
  14. package/dist/components/Dialog/index.d.ts +3 -0
  15. package/dist/components/Dialog/index.js +12 -0
  16. package/dist/components/Dialog/useDialog.d.ts +19 -0
  17. package/dist/components/Dialog/useDialog.js +52 -0
  18. package/dist/components/Dialog/withDialog.d.ts +11 -0
  19. package/dist/components/Dialog/withDialog.js +23 -0
  20. package/dist/components/Fields/Checkbox.d.ts +13 -0
  21. package/dist/components/Fields/Checkbox.js +28 -0
  22. package/dist/components/Fields/Field.d.ts +20 -0
  23. package/dist/components/Fields/Field.js +52 -0
  24. package/dist/components/Fields/Input.d.ts +11 -0
  25. package/dist/components/Fields/Input.js +9 -0
  26. package/dist/components/Fields/Quantity.d.ts +7 -0
  27. package/dist/components/Fields/Quantity.js +61 -0
  28. package/dist/components/Fields/Radio.d.ts +11 -0
  29. package/dist/components/Fields/Radio.js +23 -0
  30. package/dist/components/Fields/Select.d.ts +7 -0
  31. package/dist/components/Fields/Select.js +21 -0
  32. package/dist/components/Fields/Textarea.d.ts +12 -0
  33. package/dist/components/Fields/Textarea.js +185 -0
  34. package/dist/components/Fields/ValidationTooltip.d.ts +2 -0
  35. package/dist/components/Fields/ValidationTooltip.js +6 -0
  36. package/dist/components/Fields/index.d.ts +8 -0
  37. package/dist/components/Fields/index.js +20 -0
  38. package/dist/components/Flex/Flex.d.ts +22 -0
  39. package/dist/components/Flex/Flex.js +36 -0
  40. package/dist/components/Flex/index.d.ts +1 -0
  41. package/dist/components/Flex/index.js +4 -0
  42. package/dist/components/Heading/Heading.d.ts +12 -0
  43. package/dist/components/Heading/Heading.js +57 -0
  44. package/dist/components/Heading/index.d.ts +1 -0
  45. package/dist/components/Heading/index.js +4 -0
  46. package/dist/components/Icon/Icon.d.ts +16 -0
  47. package/dist/components/Icon/Icon.js +125 -0
  48. package/dist/components/Icon/icons.d.ts +2 -0
  49. package/dist/components/Icon/icons.js +91 -0
  50. package/dist/components/Icon/index.d.ts +1 -0
  51. package/dist/components/Icon/index.js +4 -0
  52. package/dist/components/Menu/Menu.d.ts +9 -0
  53. package/dist/components/Menu/Menu.js +77 -0
  54. package/dist/components/Menu/MenuContext.d.ts +8 -0
  55. package/dist/components/Menu/MenuContext.js +5 -0
  56. package/dist/components/Menu/MenuItem.d.ts +7 -0
  57. package/dist/components/Menu/MenuItem.js +50 -0
  58. package/dist/components/Menu/index.d.ts +2 -0
  59. package/dist/components/Menu/index.js +6 -0
  60. package/dist/components/Notice/Notice.d.ts +15 -0
  61. package/dist/components/Notice/Notice.js +56 -0
  62. package/dist/components/Notice/index.d.ts +1 -0
  63. package/dist/components/Notice/index.js +4 -0
  64. package/dist/components/Progress/ProgressBar.d.ts +21 -0
  65. package/dist/components/Progress/ProgressBar.js +47 -0
  66. package/dist/components/Progress/ProgressCircular.d.ts +25 -0
  67. package/dist/components/Progress/ProgressCircular.js +71 -0
  68. package/dist/components/Progress/index.d.ts +2 -0
  69. package/dist/components/Progress/index.js +6 -0
  70. package/dist/components/Segmented/Segmented.d.ts +9 -0
  71. package/dist/components/Segmented/Segmented.js +46 -0
  72. package/dist/components/Segmented/index.d.ts +1 -0
  73. package/dist/components/Segmented/index.js +4 -0
  74. package/dist/components/Spinner/Spinner.d.ts +13 -0
  75. package/dist/components/Spinner/Spinner.js +31 -0
  76. package/dist/components/Spinner/index.d.ts +1 -0
  77. package/dist/components/Spinner/index.js +4 -0
  78. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  79. package/dist/components/Tooltip/Tooltip.js +78 -0
  80. package/dist/components/Tooltip/index.d.ts +1 -0
  81. package/dist/components/Tooltip/index.js +4 -0
  82. package/dist/floating-ui.react-KLg1MUz0.js +22334 -0
  83. package/dist/index-DyIdU--j.js +45 -0
  84. package/dist/index.d.ts +12 -0
  85. package/dist/index.esm-Dkuk1b-q.js +211 -0
  86. package/dist/index.js +54 -0
  87. package/dist/styles/_theme-default.scss +142 -0
  88. package/dist/styles/_theme.scss +40 -0
  89. package/dist/styles/_utils.scss +118 -0
  90. package/dist/styles/style.css +1 -0
  91. package/dist/styles.module-CUhWny5T.js +11 -0
  92. package/dist/utils/helpers.d.ts +13 -0
  93. package/dist/utils/helpers.js +34 -0
  94. package/package.json +79 -0
@@ -0,0 +1,45 @@
1
+ import { g as c } from "./_commonjsHelpers-B52_cu2H.js";
2
+ var s = { exports: {} };
3
+ /*!
4
+ Copyright (c) 2018 Jed Watson.
5
+ Licensed under the MIT License (MIT), see
6
+ http://jedwatson.github.io/classnames
7
+ */
8
+ var a;
9
+ function p() {
10
+ return a || (a = 1, function(o) {
11
+ (function() {
12
+ var f = {}.hasOwnProperty;
13
+ function e() {
14
+ for (var t = "", r = 0; r < arguments.length; r++) {
15
+ var n = arguments[r];
16
+ n && (t = i(t, u(n)));
17
+ }
18
+ return t;
19
+ }
20
+ function u(t) {
21
+ if (typeof t == "string" || typeof t == "number")
22
+ return t;
23
+ if (typeof t != "object")
24
+ return "";
25
+ if (Array.isArray(t))
26
+ return e.apply(null, t);
27
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
28
+ return t.toString();
29
+ var r = "";
30
+ for (var n in t)
31
+ f.call(t, n) && t[n] && (r = i(r, n));
32
+ return r;
33
+ }
34
+ function i(t, r) {
35
+ return r ? t ? t + " " + r : t + r : t;
36
+ }
37
+ o.exports ? (e.default = e, o.exports = e) : window.classNames = e;
38
+ })();
39
+ }(s)), s.exports;
40
+ }
41
+ var l = p();
42
+ const x = /* @__PURE__ */ c(l);
43
+ export {
44
+ x as c
45
+ };
@@ -0,0 +1,12 @@
1
+ export * from './components/Button';
2
+ export * from './components/Dialog';
3
+ export * from './components/Flex';
4
+ export * from './components/Fields';
5
+ export * from './components/Heading';
6
+ export * from './components/Icon';
7
+ export * from './components/Menu';
8
+ export * from './components/Notice';
9
+ export * from './components/Progress';
10
+ export * from './components/Segmented';
11
+ export * from './components/Spinner';
12
+ export * from './components/Tooltip';
@@ -0,0 +1,211 @@
1
+ /*!
2
+ * tabbable 6.2.0
3
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
+ */
5
+ var T = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], v = /* @__PURE__ */ T.join(","), m = typeof Element > "u", d = m ? function() {
6
+ } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, b = !m && Element.prototype.getRootNode ? function(i) {
7
+ var t;
8
+ return i == null || (t = i.getRootNode) === null || t === void 0 ? void 0 : t.call(i);
9
+ } : function(i) {
10
+ return i == null ? void 0 : i.ownerDocument;
11
+ }, h = function i(t, e) {
12
+ var r;
13
+ e === void 0 && (e = !0);
14
+ var a = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), l = a === "" || a === "true", n = l || e && t && i(t.parentNode);
15
+ return n;
16
+ }, x = function(t) {
17
+ var e, r = t == null || (e = t.getAttribute) === null || e === void 0 ? void 0 : e.call(t, "contenteditable");
18
+ return r === "" || r === "true";
19
+ }, I = function(t, e, r) {
20
+ if (h(t))
21
+ return [];
22
+ var a = Array.prototype.slice.apply(t.querySelectorAll(v));
23
+ return e && d.call(t, v) && a.unshift(t), a = a.filter(r), a;
24
+ }, N = function i(t, e, r) {
25
+ for (var a = [], l = Array.from(t); l.length; ) {
26
+ var n = l.shift();
27
+ if (!h(n, !1))
28
+ if (n.tagName === "SLOT") {
29
+ var u = n.assignedElements(), c = u.length ? u : n.children, s = i(c, !0, r);
30
+ r.flatten ? a.push.apply(a, s) : a.push({
31
+ scopeParent: n,
32
+ candidates: s
33
+ });
34
+ } else {
35
+ var f = d.call(n, v);
36
+ f && r.filter(n) && (e || !t.includes(n)) && a.push(n);
37
+ var o = n.shadowRoot || // check for an undisclosed shadow
38
+ typeof r.getShadowRoot == "function" && r.getShadowRoot(n), E = !h(o, !1) && (!r.shadowRootFilter || r.shadowRootFilter(n));
39
+ if (o && E) {
40
+ var p = i(o === !0 ? n.children : o.children, !0, r);
41
+ r.flatten ? a.push.apply(a, p) : a.push({
42
+ scopeParent: n,
43
+ candidates: p
44
+ });
45
+ } else
46
+ l.unshift.apply(l, n.children);
47
+ }
48
+ }
49
+ return a;
50
+ }, R = function(t) {
51
+ return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
52
+ }, y = function(t) {
53
+ if (!t)
54
+ throw new Error("No node provided");
55
+ return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || x(t)) && !R(t) ? 0 : t.tabIndex;
56
+ }, A = function(t, e) {
57
+ var r = y(t);
58
+ return r < 0 && e && !R(t) ? 0 : r;
59
+ }, O = function(t, e) {
60
+ return t.tabIndex === e.tabIndex ? t.documentOrder - e.documentOrder : t.tabIndex - e.tabIndex;
61
+ }, C = function(t) {
62
+ return t.tagName === "INPUT";
63
+ }, F = function(t) {
64
+ return C(t) && t.type === "hidden";
65
+ }, D = function(t) {
66
+ var e = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
67
+ return r.tagName === "SUMMARY";
68
+ });
69
+ return e;
70
+ }, M = function(t, e) {
71
+ for (var r = 0; r < t.length; r++)
72
+ if (t[r].checked && t[r].form === e)
73
+ return t[r];
74
+ }, k = function(t) {
75
+ if (!t.name)
76
+ return !0;
77
+ var e = t.form || b(t), r = function(u) {
78
+ return e.querySelectorAll('input[type="radio"][name="' + u + '"]');
79
+ }, a;
80
+ if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
81
+ a = r(window.CSS.escape(t.name));
82
+ else
83
+ try {
84
+ a = r(t.name);
85
+ } catch (n) {
86
+ return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", n.message), !1;
87
+ }
88
+ var l = M(a, t.form);
89
+ return !l || l === t;
90
+ }, L = function(t) {
91
+ return C(t) && t.type === "radio";
92
+ }, P = function(t) {
93
+ return L(t) && !k(t);
94
+ }, B = function(t) {
95
+ var e, r = t && b(t), a = (e = r) === null || e === void 0 ? void 0 : e.host, l = !1;
96
+ if (r && r !== t) {
97
+ var n, u, c;
98
+ for (l = !!((n = a) !== null && n !== void 0 && (u = n.ownerDocument) !== null && u !== void 0 && u.contains(a) || t != null && (c = t.ownerDocument) !== null && c !== void 0 && c.contains(t)); !l && a; ) {
99
+ var s, f, o;
100
+ r = b(a), a = (s = r) === null || s === void 0 ? void 0 : s.host, l = !!((f = a) !== null && f !== void 0 && (o = f.ownerDocument) !== null && o !== void 0 && o.contains(a));
101
+ }
102
+ }
103
+ return l;
104
+ }, w = function(t) {
105
+ var e = t.getBoundingClientRect(), r = e.width, a = e.height;
106
+ return r === 0 && a === 0;
107
+ }, j = function(t, e) {
108
+ var r = e.displayCheck, a = e.getShadowRoot;
109
+ if (getComputedStyle(t).visibility === "hidden")
110
+ return !0;
111
+ var l = d.call(t, "details>summary:first-of-type"), n = l ? t.parentElement : t;
112
+ if (d.call(n, "details:not([open]) *"))
113
+ return !0;
114
+ if (!r || r === "full" || r === "legacy-full") {
115
+ if (typeof a == "function") {
116
+ for (var u = t; t; ) {
117
+ var c = t.parentElement, s = b(t);
118
+ if (c && !c.shadowRoot && a(c) === !0)
119
+ return w(t);
120
+ t.assignedSlot ? t = t.assignedSlot : !c && s !== t.ownerDocument ? t = s.host : t = c;
121
+ }
122
+ t = u;
123
+ }
124
+ if (B(t))
125
+ return !t.getClientRects().length;
126
+ if (r !== "legacy-full")
127
+ return !0;
128
+ } else if (r === "non-zero-area")
129
+ return w(t);
130
+ return !1;
131
+ }, q = function(t) {
132
+ if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
133
+ for (var e = t.parentElement; e; ) {
134
+ if (e.tagName === "FIELDSET" && e.disabled) {
135
+ for (var r = 0; r < e.children.length; r++) {
136
+ var a = e.children.item(r);
137
+ if (a.tagName === "LEGEND")
138
+ return d.call(e, "fieldset[disabled] *") ? !0 : !a.contains(t);
139
+ }
140
+ return !0;
141
+ }
142
+ e = e.parentElement;
143
+ }
144
+ return !1;
145
+ }, g = function(t, e) {
146
+ return !(e.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
147
+ // because we're limited in the type of selectors we can use in JSDom (see related
148
+ // note related to `candidateSelectors`)
149
+ h(e) || F(e) || j(e, t) || // For a details element with a summary, the summary element gets the focus
150
+ D(e) || q(e));
151
+ }, S = function(t, e) {
152
+ return !(P(e) || y(e) < 0 || !g(t, e));
153
+ }, U = function(t) {
154
+ var e = parseInt(t.getAttribute("tabindex"), 10);
155
+ return !!(isNaN(e) || e >= 0);
156
+ }, V = function i(t) {
157
+ var e = [], r = [];
158
+ return t.forEach(function(a, l) {
159
+ var n = !!a.scopeParent, u = n ? a.scopeParent : a, c = A(u, n), s = n ? i(a.candidates) : u;
160
+ c === 0 ? n ? e.push.apply(e, s) : e.push(u) : r.push({
161
+ documentOrder: l,
162
+ tabIndex: c,
163
+ item: a,
164
+ isScope: n,
165
+ content: s
166
+ });
167
+ }), r.sort(O).reduce(function(a, l) {
168
+ return l.isScope ? a.push.apply(a, l.content) : a.push(l.content), a;
169
+ }, []).concat(e);
170
+ }, z = function(t, e) {
171
+ e = e || {};
172
+ var r;
173
+ return e.getShadowRoot ? r = N([t], e.includeContainer, {
174
+ filter: S.bind(null, e),
175
+ flatten: !1,
176
+ getShadowRoot: e.getShadowRoot,
177
+ shadowRootFilter: U
178
+ }) : r = I(t, e.includeContainer, S.bind(null, e)), V(r);
179
+ }, W = function(t, e) {
180
+ e = e || {};
181
+ var r;
182
+ return e.getShadowRoot ? r = N([t], e.includeContainer, {
183
+ filter: g.bind(null, e),
184
+ flatten: !0,
185
+ getShadowRoot: e.getShadowRoot
186
+ }) : r = I(t, e.includeContainer, g.bind(null, e)), r;
187
+ }, Z = function(t, e) {
188
+ if (e = e || {}, !t)
189
+ throw new Error("No node provided");
190
+ return d.call(t, v) === !1 ? !1 : S(e, t);
191
+ }, G = /* @__PURE__ */ T.concat("iframe").join(","), X = function(t, e) {
192
+ if (e = e || {}, !t)
193
+ throw new Error("No node provided");
194
+ return d.call(t, G) === !1 ? !1 : g(e, t);
195
+ };
196
+ const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
197
+ __proto__: null,
198
+ focusable: W,
199
+ getTabIndex: y,
200
+ isFocusable: X,
201
+ isTabbable: Z,
202
+ tabbable: z
203
+ }, Symbol.toStringTag, { value: "Module" }));
204
+ export {
205
+ X as a,
206
+ Y as b,
207
+ W as f,
208
+ y as g,
209
+ Z as i,
210
+ z as t
211
+ };
package/dist/index.js ADDED
@@ -0,0 +1,54 @@
1
+ import { Button as e } from "./components/Button/Button.js";
2
+ import { Dialog as p, DialogClose as x, DialogContent as m, DialogFooter as i, DialogTitle as f } from "./components/Dialog/Dialog.js";
3
+ import { useDialog as l } from "./components/Dialog/useDialog.js";
4
+ import { withDialog as g } from "./components/Dialog/withDialog.js";
5
+ import { Flex as D } from "./components/Flex/Flex.js";
6
+ import { Checkbox as u } from "./components/Fields/Checkbox.js";
7
+ import { Field as F, FieldDescription as C, FieldLabel as I } from "./components/Fields/Field.js";
8
+ import { I as S } from "./Input-Lz3ft8Tp.js";
9
+ import { Quantity as h } from "./components/Fields/Quantity.js";
10
+ import { Radio as M } from "./components/Fields/Radio.js";
11
+ import { Select as V } from "./components/Fields/Select.js";
12
+ import { Textarea as w } from "./components/Fields/Textarea.js";
13
+ import { V as H } from "./ValidationTooltip-BgSwl0hJ.js";
14
+ import { Heading as N } from "./components/Heading/Heading.js";
15
+ import { Icon as R } from "./components/Icon/Icon.js";
16
+ import { Menu as q } from "./components/Menu/Menu.js";
17
+ import { MenuItem as z } from "./components/Menu/MenuItem.js";
18
+ import { Notice as E } from "./components/Notice/Notice.js";
19
+ import { ProgressBar as J } from "./components/Progress/ProgressBar.js";
20
+ import { ProgressCircular as O } from "./components/Progress/ProgressCircular.js";
21
+ import { Segmented as W } from "./components/Segmented/Segmented.js";
22
+ import { Spinner as Y } from "./components/Spinner/Spinner.js";
23
+ import { Tooltip as _ } from "./components/Tooltip/Tooltip.js";
24
+ export {
25
+ e as Button,
26
+ u as Checkbox,
27
+ p as Dialog,
28
+ x as DialogClose,
29
+ m as DialogContent,
30
+ i as DialogFooter,
31
+ f as DialogTitle,
32
+ F as Field,
33
+ C as FieldDescription,
34
+ I as FieldLabel,
35
+ D as Flex,
36
+ N as Heading,
37
+ R as Icon,
38
+ S as Input,
39
+ q as Menu,
40
+ z as MenuItem,
41
+ E as Notice,
42
+ J as ProgressBar,
43
+ O as ProgressCircular,
44
+ h as Quantity,
45
+ M as Radio,
46
+ W as Segmented,
47
+ V as Select,
48
+ Y as Spinner,
49
+ w as Textarea,
50
+ _ as Tooltip,
51
+ H as ValidationTooltip,
52
+ l as useDialog,
53
+ g as withDialog
54
+ };
@@ -0,0 +1,142 @@
1
+ $font-family: (
2
+ body: (-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"),
3
+ mono: (Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace),
4
+ heading: var(--font-family-body),
5
+ );
6
+
7
+ $font-weight: (
8
+ normal: 400,
9
+ medium: 600,
10
+ bold: 700,
11
+ black: 800,
12
+ );
13
+
14
+ $font-size: (
15
+ em: 16px,
16
+ xs: 0.750rem,
17
+ sm: 0.875rem,
18
+ md: 1.000rem,
19
+ lg: 1.125rem,
20
+ xl: 1.250rem,
21
+ h6: clamp(1.000rem, 2.25vw, 1.125rem),
22
+ h5: clamp(1.125rem, 2.50vw, 1.250rem),
23
+ h4: clamp(1.250rem, 3.00vw, 1.500rem),
24
+ h3: clamp(1.500rem, 3.50vw, 1.750rem),
25
+ h2: clamp(1.750rem, 4.00vw, 2.000rem),
26
+ h1: clamp(2.000rem, 5.00vw, 2.500rem),
27
+ );
28
+
29
+ $line-height: (
30
+ xs: 1.125,
31
+ sm: 1.250,
32
+ md: 1.500,
33
+ lg: 1.750,
34
+ xl: 2.000,
35
+ );
36
+
37
+ $border-radius: (
38
+ xs: 0.1875rem, // 3px
39
+ sm: 0.3125rem, // 5px
40
+ md: 0.5000rem, // 8px
41
+ lg: 0.7500rem, // 12px
42
+ xl: 1.1250rem, // 18px
43
+ );
44
+
45
+ $spacing: (
46
+ xs: clamp(0.5rem, 0.9765625vw, 0.625rem), // 8 → 10
47
+ sm: clamp(1.0rem, 1.7578125vw, 1.125rem), // 16 → 18
48
+ md: clamp(1.5rem, 2.7343750vw, 1.750rem), // 24 → 28
49
+ lg: clamp(2.0rem, 3.5156250vw, 2.250rem), // 32 → 36
50
+ xl: clamp(2.5rem, 4.4921875vw, 2.875rem), // 40 → 46
51
+ );
52
+
53
+ $drop-shadow: (
54
+ rgb(0 0 0 / 10%) 0 0 0 1px,
55
+ rgb(0 0 0 / 5%) 0 80px 80px,
56
+ rgb(0 0 0 / 4%) 0 40px 40px,
57
+ rgb(0 0 0 / 3%) 0 20px 20px,
58
+ rgb(0 0 0 / 2%) 0 10px 10px
59
+ );
60
+
61
+ $ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
62
+ $ease-out-bounce: cubic-bezier(0.1, 1.3, 0.7, 1.1);
63
+
64
+ $light-colors: (
65
+ black: #000000,
66
+ white: #FFFFFF,
67
+ fg: #191919,
68
+ bg: #FFFFFF,
69
+ popup: #FFFFFF,
70
+ dialog: #FFFFFF,
71
+ input: #FFFFFF,
72
+ backdrop: rgb(0 0 0 / 50%),
73
+ focus: var(--color-accent-400),
74
+ link: var(--color-blue-500),
75
+ link-hover: var(--color-blue-600),
76
+ heading: var(--color-fg),
77
+ );
78
+
79
+ $dark-colors: (
80
+ fg: #E6E6E6,
81
+ bg: #161616,
82
+ popup: #262626,
83
+ dialog: #191919,
84
+ input: #101010,
85
+ backdrop: rgb(0 0 0 / 65%),
86
+ );
87
+
88
+ $light-palette: (
89
+ colors: (
90
+ gray: #8E8E99,
91
+ red: #FF3B30,
92
+ orange: #FF9500,
93
+ yellow: #FFCC00,
94
+ green: #34C759,
95
+ teal: #30B0C7,
96
+ cyan: #32ADE6,
97
+ blue: #007AFF,
98
+ indigo: #5856D6,
99
+ purple: #AF52DE,
100
+ brown: #A2845E,
101
+ accent: #007AFF,
102
+ ),
103
+ tints: (
104
+ 50: 95%,
105
+ 100: 90%,
106
+ 200: 80%,
107
+ 300: 60%,
108
+ 400: 30%,
109
+ 500: 0%,
110
+ 600: -20%,
111
+ 700: -40%,
112
+ 800: -60%,
113
+ ),
114
+ );
115
+
116
+ $dark-palette: (
117
+ colors: (
118
+ gray: #737380,
119
+ red: #FF453A,
120
+ orange: #FF9E0B,
121
+ yellow: #FED709,
122
+ green: #31D158,
123
+ teal: #40C8E0,
124
+ cyan: #64D3FF,
125
+ blue: #0B84FF,
126
+ indigo: #5E5CE6,
127
+ purple: #BF5AF2,
128
+ brown: #AC8E68,
129
+ accent: #0B84FF,
130
+ ),
131
+ tints: (
132
+ 50: 95%,
133
+ 100: 90%,
134
+ 200: 80%,
135
+ 300: 60%,
136
+ 400: 30%,
137
+ 500: 0%,
138
+ 600: -20%,
139
+ 700: -40%,
140
+ 800: -60%,
141
+ ),
142
+ );
@@ -0,0 +1,40 @@
1
+ @use 'sass:map';
2
+ @use './utils' as *;
3
+ @use './theme-default' as default;
4
+
5
+ $font-family: () !default;
6
+ $font-weight: () !default;
7
+ $font-size: () !default;
8
+ $line-height: () !default;
9
+ $border-radius: () !default;
10
+ $spacing: () !default;
11
+ $drop-shadow: default.$drop-shadow !default;
12
+ $ease-out-cubic: default.$ease-out-cubic !default;
13
+ $ease-out-bounce: default.$ease-out-bounce !default;
14
+
15
+ $light-colors: () !default;
16
+ $light-palette: () !default;
17
+ $dark-colors: () !default;
18
+ $dark-palette: () !default;
19
+
20
+ $variables: (
21
+ font-family: map.merge(default.$font-family, $font-family),
22
+ font-weight: map.merge(default.$font-weight, $font-weight),
23
+ font-size: map.merge(default.$font-size, $font-size),
24
+ line-height: map.merge(default.$line-height, $line-height),
25
+ border-radius: map.merge(default.$border-radius, $border-radius),
26
+ spacing: map.merge(default.$spacing, $spacing),
27
+ drop-shadow: $drop-shadow,
28
+ ease-out-cubic: $ease-out-cubic,
29
+ ease-out-bounce: $ease-out-bounce,
30
+ );
31
+
32
+ $light-colors: colors-map(
33
+ map.merge(default.$light-colors, $light-colors),
34
+ map.deep-merge(default.$light-palette, $light-palette),
35
+ );
36
+
37
+ $dark-colors: colors-map(
38
+ map.merge(default.$dark-colors, $dark-colors),
39
+ map.deep-merge(default.$dark-palette, $dark-palette),
40
+ );
@@ -0,0 +1,118 @@
1
+ @use 'sass:map';
2
+ @use 'sass:math';
3
+ @use 'sass:meta';
4
+ @use 'sass:color';
5
+ @use 'sass:string';
6
+
7
+ // Define CSS variables recursively from a map
8
+ @mixin vars($map, $prefix: null) {
9
+ @each $name, $value in $map {
10
+ @if meta.type-of($value) == map {
11
+ $new-prefix: $prefix;
12
+ @if string.slice($name, 1, 1) != '-' {
13
+ $new-prefix: if($prefix, #{$prefix}-#{$name}, #{$name});
14
+ }
15
+ @include vars($value, $new-prefix);
16
+ } @else {
17
+ $var-name: if($prefix, --#{$prefix}-#{$name}, --#{$name});
18
+ #{$var-name}: #{$value};
19
+ }
20
+ }
21
+ }
22
+
23
+ // Define tints/shades for colors in a palette
24
+ // $palette map must contain 'colors' and 'tints' keys
25
+ @function color-palette($palette, $bg, $fg) {
26
+ $output: ();
27
+ @each $name, $color in map.get($palette, colors) {
28
+ @each $level, $amount in map.get($palette, tints) {
29
+ $var-name: #{$name}-#{$level};
30
+ $mix-with: if($amount > 0, $bg, $fg);
31
+ $mixed-color: color.mix($mix-with, $color, math.abs($amount), $method: rgb);
32
+ $output: map.set($output, $var-name, to-hex($mixed-color));
33
+ }
34
+ }
35
+ @return $output;
36
+ }
37
+
38
+ // Generate colors map for building a theme
39
+ // $colors map must contain 'bg' and 'fg' keys
40
+ // $palette map must contain 'colors' and 'tints' keys
41
+ @function colors-map($colors, $palette) {
42
+ $bg: map.get($colors, 'bg');
43
+ $fg: map.get($colors, 'fg');
44
+ @return map.merge($colors, color-palette($palette, $bg, $fg));
45
+ }
46
+
47
+ // Shortcut to set an opacity for a CSS variable
48
+ @function color-opacity($hex, $opacity) {
49
+ @return color-mix(in srgb, $hex $opacity, transparent);
50
+ }
51
+
52
+ // Display SVG as background image
53
+ @function svg-uri($width, $height, $svg) {
54
+ $encoded: '';
55
+ $slice: 2000;
56
+ $index: 0;
57
+ $svg: '<svg xmlns="http://www.w3.org/2000/svg" width="#{$width}" height="#{$height}" viewBox="0 0 #{$width} #{$height}">#{$svg}</svg>';
58
+ $loops: math.ceil(calc(string.length($svg) / $slice));
59
+ @for $i from 1 through $loops {
60
+ $chunk: string.slice($svg, $index, $index + $slice - 1);
61
+ $chunk: str-replace($chunk, '"', "'");
62
+ $chunk: str-replace($chunk, '<', '%3C');
63
+ $chunk: str-replace($chunk, '>', '%3E');
64
+ $chunk: str-replace($chunk, '&', '%26');
65
+ $chunk: str-replace($chunk, '#', '%23');
66
+ $encoded: #{$encoded}#{$chunk};
67
+ $index: $index + $slice;
68
+ }
69
+ @return url("data:image/svg+xml;charset=utf8,#{$encoded}");
70
+ }
71
+
72
+ // Replace string
73
+ @function str-replace($string, $search, $replace: '') {
74
+ $index: string.index($string, $search);
75
+ @if $index {
76
+ @return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + string.length($search)), $search, $replace);
77
+ }
78
+ @return $string;
79
+ }
80
+
81
+ // Convert color to #HEX
82
+ @function to-hex($color) {
83
+ $ie-hex: color.ie-hex-str($color);
84
+ @return string.unquote('#' + string.slice($ie-hex, 4));
85
+ }
86
+
87
+ @mixin focus-visible($color: var(--color-focus)) {
88
+ outline-width: 3px;
89
+ outline-offset: 2px;
90
+ outline-style: solid;
91
+ outline-color: $color;
92
+ }
93
+
94
+ @mixin required-sign($symbol: var(--field-required-symbol), $color: var(--field-required-color)) {
95
+ color: $color;
96
+ line-height: 0;
97
+ font-size: 125%;
98
+ content: $symbol;
99
+ margin-inline: 1px;
100
+ vertical-align: middle;
101
+ }
102
+
103
+ %truncate-text {
104
+ overflow: hidden;
105
+ white-space: nowrap;
106
+ text-overflow: ellipsis;
107
+ }
108
+
109
+ %absolute-fill {
110
+ inset: 0;
111
+ position: absolute;
112
+ }
113
+
114
+ %flex-centered {
115
+ display: flex;
116
+ align-items: center;
117
+ justify-content: center;
118
+ }