@cfx-dev/ui-components 2.0.9 → 2.1.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.
- package/dist/assets/Box.css +1 -1
- package/dist/assets/Flex.css +1 -1
- package/dist/assets/FlexShowcase.css +1 -0
- package/dist/assets/Pad.css +1 -1
- package/dist/assets/Separator.css +1 -1
- package/dist/assets/Spacer.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/global.css +1 -1
- package/dist/components/Layout/Box/Box.d.ts +4 -1
- package/dist/components/Layout/Box/Box.js +97 -31
- package/dist/components/Layout/Flex/Flex.d.ts +4 -5
- package/dist/components/Layout/Flex/Flex.js +64 -59
- package/dist/components/Layout/Flex/FlexShowcase.d.ts +6 -0
- package/dist/components/Layout/Flex/FlexShowcase.js +19 -0
- package/dist/components/Layout/Pad/Pad.js +30 -29
- package/dist/components/Separator/Separator.js +32 -31
- package/dist/components/Spacer/Spacer.js +21 -20
- package/dist/components/Table/Table.d.ts +21 -9
- package/dist/components/Table/Table.js +129 -70
- package/dist/components/Table/TableShowcase.js +7 -1
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +4 -0
- package/dist/components/ui.d.ts +60 -14
- package/dist/components/ui.js +52 -17
- package/dist/main.d.ts +1 -0
- package/dist/styles-scss/_ui.scss +29 -31
- package/dist/styles-scss/global.scss +1 -0
- package/dist/styles-scss/tokens.scss +26 -14
- package/package.json +1 -1
|
@@ -1,86 +1,145 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as t, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import l, { useState as C } from "react";
|
|
3
|
+
import N from "../Checkbox/Checkbox.js";
|
|
4
|
+
import B from "../IconButton/IconButton.js";
|
|
5
|
+
import { Text as v } from "../Text/Text.js";
|
|
6
|
+
import { clsx as z } from "../../utils/clsx.js";
|
|
7
|
+
import '../../assets/Table.css';const $ = "_root_jdj5z_1", T = "_radio_jdj5z_15", A = "_pointer_jdj5z_21", E = "_selectedRow_jdj5z_24", O = "_headerContent_jdj5z_34", S = "_sortable_jdj5z_40", F = "_empty_jdj5z_40", H = "_sortButton_jdj5z_43", r = {
|
|
8
|
+
root: $,
|
|
9
|
+
radio: T,
|
|
10
|
+
pointer: A,
|
|
11
|
+
selectedRow: E,
|
|
12
|
+
headerContent: O,
|
|
13
|
+
sortable: S,
|
|
14
|
+
empty: F,
|
|
15
|
+
sortButton: H
|
|
11
16
|
};
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
function V(h) {
|
|
18
|
+
const {
|
|
19
|
+
item: e,
|
|
20
|
+
onSortClick: o
|
|
21
|
+
} = h, s = l.useCallback(() => {
|
|
22
|
+
o && o(e.sortKey || e.text);
|
|
23
|
+
}, [e.sortKey, e.text, o]), b = z(r.headerContent, {
|
|
24
|
+
[r.sortable]: e.sortable,
|
|
25
|
+
[r.empty]: !e.text
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ t(
|
|
28
|
+
"th",
|
|
29
|
+
{
|
|
30
|
+
className: e.sortable ? r.pointer : void 0,
|
|
31
|
+
onClick: e.sortable ? s : void 0,
|
|
32
|
+
children: /* @__PURE__ */ j("div", { className: b, children: [
|
|
33
|
+
/* @__PURE__ */ t(v, { color: "secondary", weight: "bold", uppercase: !0, size: "xxsmall", children: e.text }),
|
|
34
|
+
!!e.sortable && /* @__PURE__ */ t(
|
|
35
|
+
B,
|
|
36
|
+
{
|
|
37
|
+
className: r.sortButton,
|
|
38
|
+
color: "secondary",
|
|
39
|
+
name: "Sort",
|
|
40
|
+
onClick: s
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] })
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function q(h) {
|
|
48
|
+
const {
|
|
49
|
+
index: e,
|
|
50
|
+
includeRadio: o = !1,
|
|
51
|
+
selectedRow: s,
|
|
52
|
+
item: b,
|
|
53
|
+
dataContainer: m,
|
|
54
|
+
onSelectChange: a
|
|
55
|
+
} = h, f = l.useCallback((n) => {
|
|
56
|
+
a(
|
|
57
|
+
n ? e : null
|
|
58
|
+
);
|
|
59
|
+
}, [a, e]), _ = l.useCallback(() => {
|
|
60
|
+
a(e);
|
|
61
|
+
}, [a, e]), p = z({
|
|
62
|
+
[r.selectedRow]: s === e,
|
|
63
|
+
[r.pointer]: o
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ j(
|
|
66
|
+
"tr",
|
|
67
|
+
{
|
|
68
|
+
className: p,
|
|
69
|
+
onClick: o ? _ : void 0,
|
|
70
|
+
children: [
|
|
71
|
+
o && /* @__PURE__ */ t("td", { className: r.radio, children: /* @__PURE__ */ t(
|
|
72
|
+
N,
|
|
73
|
+
{
|
|
74
|
+
size: "small",
|
|
75
|
+
onCheckedChange: f,
|
|
76
|
+
"aria-label": `${e}`,
|
|
77
|
+
checked: s === e
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
b.map((n, u) => {
|
|
81
|
+
let i;
|
|
82
|
+
return l.isValidElement(n) ? i = n : m ? i = l.createElement(m, { item: n }) : i = String(n), /* @__PURE__ */ t("td", { children: i }, `item-${u}`);
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
`row-${e}`
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function M({
|
|
90
|
+
headers: h = [],
|
|
91
|
+
data: e = [],
|
|
92
|
+
includeRadio: o = !1,
|
|
93
|
+
onSelectChange: s,
|
|
17
94
|
dataContainer: b,
|
|
18
|
-
|
|
19
|
-
sortBy:
|
|
20
|
-
sortOrder:
|
|
21
|
-
onSortChange:
|
|
95
|
+
selectedRow: m = null,
|
|
96
|
+
sortBy: a,
|
|
97
|
+
sortOrder: f = "asc",
|
|
98
|
+
onSortChange: _
|
|
22
99
|
}) {
|
|
23
|
-
const [p,
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
y(t), t !== null && (c == null || c(t));
|
|
31
|
-
}
|
|
100
|
+
const [p, n] = C(m), [u, i] = C(a), [k, w] = C(f), R = l.useCallback((c) => {
|
|
101
|
+
const x = u === c && k === "asc" ? "desc" : "asc";
|
|
102
|
+
i(c), w(x), _ == null || _(c, x);
|
|
103
|
+
}, [_, u, k]), y = l.useCallback(
|
|
104
|
+
(c) => {
|
|
105
|
+
const d = c === p ? null : c;
|
|
106
|
+
n(d), s == null || s(d);
|
|
32
107
|
},
|
|
33
|
-
[
|
|
108
|
+
[s, p]
|
|
34
109
|
);
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
110
|
+
return l.useEffect(() => {
|
|
111
|
+
n(m);
|
|
112
|
+
}, [m]), l.useEffect(() => {
|
|
113
|
+
i(a);
|
|
114
|
+
}, [a]), l.useEffect(() => {
|
|
115
|
+
w(f);
|
|
116
|
+
}, [f]), /* @__PURE__ */ t("div", { className: r.root, children: /* @__PURE__ */ j("table", { children: [
|
|
117
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ j("tr", { children: [
|
|
118
|
+
o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
|
|
119
|
+
h.map((c, d) => /* @__PURE__ */ t(
|
|
120
|
+
V,
|
|
40
121
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: /* @__PURE__ */ i("div", { className: l.headerContent, children: [
|
|
44
|
-
e,
|
|
45
|
-
n && /* @__PURE__ */ o(
|
|
46
|
-
j,
|
|
47
|
-
{
|
|
48
|
-
className: l.sortButton,
|
|
49
|
-
color: "secondary",
|
|
50
|
-
name: "Sort",
|
|
51
|
-
onClick: n ? () => _(e) : void 0
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
] })
|
|
122
|
+
item: c,
|
|
123
|
+
onSortClick: R
|
|
55
124
|
},
|
|
56
|
-
`header-${
|
|
125
|
+
`header-${d}`
|
|
57
126
|
))
|
|
58
127
|
] }) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
128
|
+
/* @__PURE__ */ t("tbody", { children: e.map((c, d) => /* @__PURE__ */ t(
|
|
129
|
+
q,
|
|
61
130
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
size: "small",
|
|
69
|
-
onCheckedChange: (t) => h(t, s),
|
|
70
|
-
"aria-label": `${s}`,
|
|
71
|
-
checked: p === s
|
|
72
|
-
}
|
|
73
|
-
) }),
|
|
74
|
-
e.map((t, C) => {
|
|
75
|
-
let a;
|
|
76
|
-
return f.isValidElement(t) ? a = t : b ? a = f.createElement(b, { item: t }) : a = String(t), /* @__PURE__ */ o("td", { children: a }, `item-${C}`);
|
|
77
|
-
})
|
|
78
|
-
]
|
|
131
|
+
index: d,
|
|
132
|
+
item: c,
|
|
133
|
+
includeRadio: o,
|
|
134
|
+
selectedRow: p,
|
|
135
|
+
onSelectChange: y,
|
|
136
|
+
dataContainer: b
|
|
79
137
|
},
|
|
80
|
-
`row-${
|
|
138
|
+
`row-${d}`
|
|
81
139
|
)) })
|
|
82
140
|
] }) });
|
|
83
141
|
}
|
|
84
142
|
export {
|
|
85
|
-
|
|
143
|
+
M as Table,
|
|
144
|
+
V as TableHeaderItem
|
|
86
145
|
};
|
|
@@ -27,7 +27,13 @@ const i = [
|
|
|
27
27
|
["Cell 7", "Cell 8", "Cell 9", new Date(2023, 2, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "3")],
|
|
28
28
|
["Cell 4", "Cell 5", "Cell 6", new Date(2023, 1, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "2")],
|
|
29
29
|
["Cell 7", "Cell 8", "Cell 9", new Date(2023, 2, 1).toLocaleDateString(), /* @__PURE__ */ e(l, { children: "Badge" }, "3")]
|
|
30
|
-
], n = [
|
|
30
|
+
], n = [
|
|
31
|
+
{ text: "Header 1" },
|
|
32
|
+
{ text: "Header 2" },
|
|
33
|
+
{ text: "Header 3" },
|
|
34
|
+
{ text: "Date" },
|
|
35
|
+
{ text: "Item" }
|
|
36
|
+
];
|
|
31
37
|
function C() {
|
|
32
38
|
return /* @__PURE__ */ t(a, { gap: "large", vertical: !0, children: [
|
|
33
39
|
/* @__PURE__ */ t(a, { gap: "normal", vertical: !0, children: [
|
package/dist/components/ui.d.ts
CHANGED
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
import { TextProps } from './Text/Text.types';
|
|
2
2
|
|
|
3
|
+
export declare enum OffsetEnum {
|
|
4
|
+
none = "none",
|
|
5
|
+
hairthin = "hairthin",
|
|
6
|
+
thin = "thin",
|
|
7
|
+
xxsmall = "xxsmall",
|
|
8
|
+
xsmall = "xsmall",
|
|
9
|
+
small = "small",
|
|
10
|
+
normal = "normal",
|
|
11
|
+
medium = "medium",
|
|
12
|
+
large = "large",
|
|
13
|
+
xlarge = "xlarge",
|
|
14
|
+
safezone = "safezone"
|
|
15
|
+
}
|
|
16
|
+
export type OffesetType = keyof typeof OffsetEnum;
|
|
17
|
+
export declare enum MediaQueryEnum {
|
|
18
|
+
initial = "initial",
|
|
19
|
+
xxsmall = "xxsmall",
|
|
20
|
+
xsmall = "xsmall",
|
|
21
|
+
small = "small",
|
|
22
|
+
medium = "medium",
|
|
23
|
+
large = "large",
|
|
24
|
+
xlarge = "xlarge"
|
|
25
|
+
}
|
|
26
|
+
export type MediaQueryType = keyof typeof MediaQueryEnum;
|
|
27
|
+
export type ResponsiveOffsetType = OffesetType | number | {
|
|
28
|
+
[key in MediaQueryType]?: OffesetType | number;
|
|
29
|
+
};
|
|
30
|
+
export interface MPProps {
|
|
31
|
+
m?: ResponsiveOffsetType;
|
|
32
|
+
mt?: ResponsiveOffsetType;
|
|
33
|
+
mr?: ResponsiveOffsetType;
|
|
34
|
+
mb?: ResponsiveOffsetType;
|
|
35
|
+
ml?: ResponsiveOffsetType;
|
|
36
|
+
p?: ResponsiveOffsetType;
|
|
37
|
+
pt?: ResponsiveOffsetType;
|
|
38
|
+
pr?: ResponsiveOffsetType;
|
|
39
|
+
pb?: ResponsiveOffsetType;
|
|
40
|
+
pl?: ResponsiveOffsetType;
|
|
41
|
+
}
|
|
3
42
|
export declare namespace ui {
|
|
4
43
|
/**
|
|
5
44
|
* Returns CSS value of quant value with applied multiplier
|
|
6
45
|
*/
|
|
7
|
-
function q(multiplier?: number): string;
|
|
8
|
-
function offset(size
|
|
9
|
-
function fontSize(size?: TextProps['size']): string;
|
|
10
|
-
function borderRadius(size?: 'xsmall' | 'small' | 'normal'): string;
|
|
11
|
-
function color(name: string, variantRaw?: string | number, alpha?: number): string;
|
|
12
|
-
namespace cls {
|
|
46
|
+
export function q(multiplier?: number): string;
|
|
47
|
+
export function offset(size: OffesetType): string;
|
|
48
|
+
export function fontSize(size?: TextProps['size']): string;
|
|
49
|
+
export function borderRadius(size?: 'xsmall' | 'small' | 'normal'): string;
|
|
50
|
+
export function color(name: string, variantRaw?: string | number, alpha?: number): string;
|
|
51
|
+
export namespace cls {
|
|
13
52
|
const fullWidth = "util-full-width";
|
|
14
53
|
const fullHeight = "util-full-height";
|
|
15
54
|
const flexGrow = "util-flex-grow";
|
|
@@ -17,12 +56,19 @@ export declare namespace ui {
|
|
|
17
56
|
const userSelectableText = "util-text-selectable";
|
|
18
57
|
const zIndex9000 = "util-z-index-9000";
|
|
19
58
|
}
|
|
20
|
-
const pc: (x: number | string) => string;
|
|
21
|
-
const px: (x: number | string) => string;
|
|
22
|
-
const ch: (x: number | string) => string;
|
|
23
|
-
const em: (x: number | string) => string;
|
|
24
|
-
const rem: (x: number | string) => string;
|
|
25
|
-
const vh: (x: number | string) => string;
|
|
26
|
-
const vw: (x: number | string) => string;
|
|
27
|
-
const url: (u: unknown) => string;
|
|
59
|
+
export const pc: (x: number | string) => string;
|
|
60
|
+
export const px: (x: number | string) => string;
|
|
61
|
+
export const ch: (x: number | string) => string;
|
|
62
|
+
export const em: (x: number | string) => string;
|
|
63
|
+
export const rem: (x: number | string) => string;
|
|
64
|
+
export const vh: (x: number | string) => string;
|
|
65
|
+
export const vw: (x: number | string) => string;
|
|
66
|
+
export const url: (u: unknown) => string;
|
|
67
|
+
export const getOffsetAttrs: (name: string, value: ResponsiveOffsetType) => Record<string, string>;
|
|
68
|
+
export const getOffsetStyles: (name: string, value: ResponsiveOffsetType) => Record<string, string>;
|
|
69
|
+
type CallbackType<T> = (name: string, value: ResponsiveOffsetType) => T;
|
|
70
|
+
export function callAllMPProps<T>(props: Partial<MPProps>, callback: CallbackType<T>): {};
|
|
71
|
+
export const getAllMPStyles: (props: Partial<MPProps>) => React.CSSProperties;
|
|
72
|
+
export const getAllMPAttrs: (props: Partial<MPProps>) => Record<string, string>;
|
|
73
|
+
export {};
|
|
28
74
|
}
|
package/dist/components/ui.js
CHANGED
|
@@ -1,29 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
((
|
|
3
|
-
function
|
|
1
|
+
var z = /* @__PURE__ */ ((t) => (t.none = "none", t.hairthin = "hairthin", t.thin = "thin", t.xxsmall = "xxsmall", t.xsmall = "xsmall", t.small = "small", t.normal = "normal", t.medium = "medium", t.large = "large", t.xlarge = "xlarge", t.safezone = "safezone", t))(z || {}), A = /* @__PURE__ */ ((t) => (t.initial = "initial", t.xxsmall = "xxsmall", t.xsmall = "xsmall", t.small = "small", t.medium = "medium", t.large = "large", t.xlarge = "xlarge", t))(A || {}), d;
|
|
2
|
+
((t) => {
|
|
3
|
+
function i(r = 1) {
|
|
4
4
|
return `calc(var(--quant) * ${r})`;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
function
|
|
6
|
+
t.q = i;
|
|
7
|
+
function s(r) {
|
|
8
8
|
return `var(--offset-${r})`;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
function
|
|
10
|
+
t.offset = s;
|
|
11
|
+
function u(r = "normal") {
|
|
12
12
|
return `var(--font-size-${r})`;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
function
|
|
14
|
+
t.fontSize = u;
|
|
15
|
+
function S(r = "normal") {
|
|
16
16
|
return `var(--border-radius-${r})`;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
return
|
|
18
|
+
t.borderRadius = S;
|
|
19
|
+
function b(r, l, n = 1) {
|
|
20
|
+
let e = l;
|
|
21
|
+
return e === "pure" && (e = ""), typeof e == "number" && (e = `${e}`), `rgba(var(--color-${r}${e ? `-${e}` : ""}), ${n})`;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
t.color = b, ((r) => {
|
|
24
24
|
r.fullWidth = "util-full-width", r.fullHeight = "util-full-height", r.flexGrow = "util-flex-grow", r.flexNoShrink = "util-flex-no-shrink", r.userSelectableText = "util-text-selectable", r.zIndex9000 = "util-z-index-9000";
|
|
25
|
-
})(
|
|
26
|
-
}
|
|
25
|
+
})(t.cls || (t.cls = {})), t.pc = (r) => `${r}%`, t.px = (r) => `${r}px`, t.ch = (r) => `${r}ch`, t.em = (r) => `${r}em`, t.rem = (r) => `${r}rem`, t.vh = (r) => `${r}vh`, t.vw = (r) => `${r}vw`, t.url = (r) => `url(${r})`, t.getOffsetAttrs = (r, l) => typeof l == "string" || typeof l == "number" ? {
|
|
26
|
+
[`data-${r}-initial`]: l.toString()
|
|
27
|
+
} : Object.entries(l).reduce((n, [e, o]) => (n[`data-${r}-${e}`] = o.toString(), n), {}), t.getOffsetStyles = (r, l) => typeof l == "string" ? {
|
|
28
|
+
[`--${r}-initial`]: s(l)
|
|
29
|
+
} : typeof l == "number" ? {
|
|
30
|
+
[`--${r}-initial`]: i(l)
|
|
31
|
+
} : Object.entries(l).reduce((n, [e, o]) => (n[`--${r}-${e}`] = typeof o == "number" ? i(o) : s(o), n), {});
|
|
32
|
+
function x(r, l) {
|
|
33
|
+
const {
|
|
34
|
+
m: n,
|
|
35
|
+
mt: e,
|
|
36
|
+
mr: o,
|
|
37
|
+
mb: f,
|
|
38
|
+
ml: $,
|
|
39
|
+
p: m,
|
|
40
|
+
pt: p,
|
|
41
|
+
pr: g,
|
|
42
|
+
pb: a,
|
|
43
|
+
pl: h
|
|
44
|
+
} = r;
|
|
45
|
+
return {
|
|
46
|
+
...n ? l("m", n) : null,
|
|
47
|
+
...e ? l("mt", e) : null,
|
|
48
|
+
...o ? l("mr", o) : null,
|
|
49
|
+
...f ? l("mb", f) : null,
|
|
50
|
+
...$ ? l("ml", $) : null,
|
|
51
|
+
...m ? l("p", m) : null,
|
|
52
|
+
...p ? l("pt", p) : null,
|
|
53
|
+
...g ? l("pr", g) : null,
|
|
54
|
+
...a ? l("pb", a) : null,
|
|
55
|
+
...h ? l("pl", h) : null
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
t.callAllMPProps = x, t.getAllMPStyles = (r) => x(r, t.getOffsetStyles), t.getAllMPAttrs = (r) => x(r, t.getOffsetAttrs);
|
|
59
|
+
})(d || (d = {}));
|
|
27
60
|
export {
|
|
28
|
-
|
|
61
|
+
A as MediaQueryEnum,
|
|
62
|
+
z as OffsetEnum,
|
|
63
|
+
d as ui
|
|
29
64
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -84,4 +84,5 @@ export type { PopoverProps } from './components/Popover';
|
|
|
84
84
|
export type { AvatarProps, AvatarSize } from './components/Avatar';
|
|
85
85
|
export { OnScreenSensor } from './components/OnScreenSensor';
|
|
86
86
|
export { ui } from './components/ui';
|
|
87
|
+
export type { OffesetType, MediaQueryType } from './components/ui';
|
|
87
88
|
export { Symbols } from './components/Symbols';
|
|
@@ -235,36 +235,25 @@ $cfxui-color-alpha: (
|
|
|
235
235
|
background-attachment: $topLayerAttachement, scroll, fixed, fixed;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
$offsets: (
|
|
239
|
+
'none': 0px,
|
|
240
|
+
'hairthin': 1px,
|
|
241
|
+
'thin': 2px,
|
|
242
|
+
'xxsmall': q(.25),
|
|
243
|
+
'xsmall': q(.5),
|
|
244
|
+
'small': q(1),
|
|
245
|
+
'normal': q(2),
|
|
246
|
+
'medium': q(2.5),
|
|
247
|
+
'large': q(4),
|
|
248
|
+
'xlarge': q(6),
|
|
249
|
+
'safezone': q(8),
|
|
250
|
+
);
|
|
251
|
+
|
|
238
252
|
@mixin offset-classes($prefix: 'offset', $property: 'gap') {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
#{$property}: offset('hairthin');
|
|
244
|
-
}
|
|
245
|
-
&.#{$prefix}-thin {
|
|
246
|
-
#{$property}: offset('thin');
|
|
247
|
-
}
|
|
248
|
-
&.#{$prefix}-xxsmall {
|
|
249
|
-
#{$property}: offset('xxsmall');
|
|
250
|
-
}
|
|
251
|
-
&.#{$prefix}-xsmall {
|
|
252
|
-
#{$property}: offset('xsmall');
|
|
253
|
-
}
|
|
254
|
-
&.#{$prefix}-small {
|
|
255
|
-
#{$property}: offset('small');
|
|
256
|
-
}
|
|
257
|
-
&.#{$prefix}-normal {
|
|
258
|
-
#{$property}: offset('normal');
|
|
259
|
-
}
|
|
260
|
-
&.#{$prefix}-large {
|
|
261
|
-
#{$property}: offset('large');
|
|
262
|
-
}
|
|
263
|
-
&.#{$prefix}-xlarge {
|
|
264
|
-
#{$property}: offset('xlarge');
|
|
265
|
-
}
|
|
266
|
-
&.#{$prefix}-safezone {
|
|
267
|
-
#{$property}: offset('safezone');
|
|
253
|
+
@each $name, $value in $offsets {
|
|
254
|
+
&.#{$prefix}-#{$name} {
|
|
255
|
+
#{$property}: offset('#{$name}');
|
|
256
|
+
}
|
|
268
257
|
}
|
|
269
258
|
}
|
|
270
259
|
|
|
@@ -321,6 +310,7 @@ $zindexMap: (
|
|
|
321
310
|
}
|
|
322
311
|
|
|
323
312
|
$mediaMap: (
|
|
313
|
+
'initial': 0px,
|
|
324
314
|
'xxsmall': 360px,
|
|
325
315
|
'xsmall': 640px,
|
|
326
316
|
'small': 768px,
|
|
@@ -331,7 +321,11 @@ $mediaMap: (
|
|
|
331
321
|
|
|
332
322
|
@mixin media-max($size: 'medium', $fix: 'empty') {
|
|
333
323
|
@if $fix == 'empty' {
|
|
334
|
-
@
|
|
324
|
+
@if $size == 'initial' {
|
|
325
|
+
@content;
|
|
326
|
+
} @else {
|
|
327
|
+
@media (min-width: calc(map.get($mediaMap, $size) - 1px)) { @content; }
|
|
328
|
+
}
|
|
335
329
|
} @else {
|
|
336
330
|
@media (min-width: $fix) { @content; }
|
|
337
331
|
}
|
|
@@ -339,7 +333,11 @@ $mediaMap: (
|
|
|
339
333
|
|
|
340
334
|
@mixin media-min($size: 'medium', $fix: 'empty') {
|
|
341
335
|
@if $fix == 'empty' {
|
|
342
|
-
@
|
|
336
|
+
@if $size == 'initial' {
|
|
337
|
+
@content;
|
|
338
|
+
} @else {
|
|
339
|
+
@media (min-width: map.get($mediaMap, $size)) { @content; }
|
|
340
|
+
}
|
|
343
341
|
} @else {
|
|
344
342
|
@media (min-width: $fix) { @content; }
|
|
345
343
|
}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
@use "sass:map";
|
|
2
2
|
@use "ui";
|
|
3
|
+
@import "ui";
|
|
4
|
+
|
|
5
|
+
$mpMap: (
|
|
6
|
+
m: margin,
|
|
7
|
+
mt: margin-top,
|
|
8
|
+
mr: margin-right,
|
|
9
|
+
mb: margin-bottom,
|
|
10
|
+
ml: margin-left,
|
|
11
|
+
p: padding,
|
|
12
|
+
pt: padding-top,
|
|
13
|
+
pr: padding-right,
|
|
14
|
+
pb: padding-bottom,
|
|
15
|
+
pl: padding-left,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
@mixin mp-tokens() {
|
|
19
|
+
@each $name, $value in $mediaMap {
|
|
20
|
+
@include media-min($name) {
|
|
21
|
+
@each $mpName, $mpProp in $mpMap {
|
|
22
|
+
[data-#{$mpName}-#{$name}] {
|
|
23
|
+
#{$mpProp}: var(--#{$mpName}-#{$name});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
3
29
|
|
|
4
30
|
@mixin border-radius-tokens() {
|
|
5
31
|
@include ui.def('border-radius-none', 0);
|
|
@@ -48,20 +74,6 @@
|
|
|
48
74
|
@include ui.define-color-token('text-a75', ui.color('primary', $alpha: .75));
|
|
49
75
|
}
|
|
50
76
|
|
|
51
|
-
$offsets: (
|
|
52
|
-
'none': 0px,
|
|
53
|
-
'hairthin': 1px,
|
|
54
|
-
'thin': 2px,
|
|
55
|
-
'xxsmall': ui.q(.25),
|
|
56
|
-
'xsmall': ui.q(.5),
|
|
57
|
-
'small': ui.q(1),
|
|
58
|
-
'normal': ui.q(2),
|
|
59
|
-
'medium': ui.q(2.5),
|
|
60
|
-
'large': ui.q(4),
|
|
61
|
-
'xlarge': ui.q(6),
|
|
62
|
-
'safezone': ui.q(8),
|
|
63
|
-
);
|
|
64
|
-
|
|
65
77
|
@mixin offset-tokens() {
|
|
66
78
|
@each $name, $value in $offsets {
|
|
67
79
|
@include ui.def('offset-#{$name}', $value);
|