@leaflink/stash 44.0.0-beta.1 → 44.0.0-beta.10
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/README.md +107 -39
- package/dist/ActionsDropdown.js +25 -25
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +12 -11
- package/dist/AddressSelect.js.map +1 -1
- package/dist/Alert.js +9 -9
- package/dist/Alert.js.map +1 -1
- package/dist/AppNavigationItem.js +22 -22
- package/dist/AppNavigationItem.js.map +1 -1
- package/dist/AppSidebar.js +11 -11
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +12 -12
- package/dist/Avatar.js +12 -12
- package/dist/Avatar.js.map +1 -1
- package/dist/Backdrop.js +1 -1
- package/dist/Backdrop.js.map +1 -1
- package/dist/Badge.js +12 -12
- package/dist/Badge.js.map +1 -1
- package/dist/Badge.vue.d.ts +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js +17 -0
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-63d31dc0.js.map +1 -0
- package/dist/ButtonGroup.js +28 -28
- package/dist/ButtonGroup.js.map +1 -1
- package/dist/Card.js +3 -3
- package/dist/Card.js.map +1 -1
- package/dist/CardHeader.js +3 -3
- package/dist/CardMedia.js +1 -1
- package/dist/CardMedia.js.map +1 -1
- package/dist/Carousel.js +260 -248
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +58 -46
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox.vue.d.ts +2 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js +9 -0
- package/dist/Checkbox.vue_used_vue_type_style_index_0_lang.module-fa8d9c06.js.map +1 -0
- package/dist/ChevronToggle.js +1 -1
- package/dist/Chip.js +1 -1
- package/dist/Chip.js.map +1 -1
- package/dist/ConfirmationCodeInput.js +21 -21
- package/dist/ConfirmationCodeInput.js.map +1 -1
- package/dist/ContextSwitcher.js +6 -5
- package/dist/ContextSwitcher.js.map +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataView.js +1 -1
- package/dist/DataViewFilters.js +7 -7
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewSortButton.js +47 -38
- package/dist/DataViewSortButton.js.map +1 -1
- package/dist/DataViewToolbar.js +4 -4
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +12 -15
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionListTerm.js +8 -8
- package/dist/DescriptionListTerm.js.map +1 -1
- package/dist/Dialog.js +46 -46
- package/dist/Dialog.js.map +1 -1
- package/dist/Divider.js +9 -9
- package/dist/Divider.js.map +1 -1
- package/dist/Dropdown.js +17 -17
- package/dist/Dropdown.js.map +1 -1
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.js.map +1 -1
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js → Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js} +14 -15
- package/dist/Expand.vue_vue_type_script_setup_true_lang-1751f4a6.js.map +1 -0
- package/dist/Field.js +2 -2
- package/dist/Field.vue.d.ts +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-475832fe.js → Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js} +5 -5
- package/dist/Field.vue_vue_type_script_setup_true_lang-42ba3c5a.js.map +1 -0
- package/dist/FileUpload.js +49 -47
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterChip.js +20 -20
- package/dist/FilterChip.js.map +1 -1
- package/dist/FilterDrawerItem.js +4 -4
- package/dist/FilterDrawerItem.js.map +1 -1
- package/dist/FilterDropdown.js +19 -19
- package/dist/FilterDropdown.js.map +1 -1
- package/dist/FilterSelect.js +27 -27
- package/dist/FilterSelect.js.map +1 -1
- package/dist/Filters.js +51 -50
- package/dist/Filters.js.map +1 -1
- package/dist/HttpError.js +28 -28
- package/dist/HttpError.js.map +1 -1
- package/dist/IconLabel.js +17 -17
- package/dist/IconLabel.js.map +1 -1
- package/dist/IconLabel.vue.d.ts +1 -1
- package/dist/Illustration.js +10 -60
- package/dist/Illustration.js.map +1 -1
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js +56 -0
- package/dist/Illustration.vue_vue_type_script_setup_true_lang-d6a94e17.js.map +1 -0
- package/dist/Image.js +67 -72
- package/dist/Image.js.map +1 -1
- package/dist/InlineEdit.js +3 -3
- package/dist/InlineEdit.js.map +1 -1
- package/dist/Input.js +43 -43
- package/dist/Input.js.map +1 -1
- package/dist/InputOptions.js +34 -33
- package/dist/InputOptions.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/Label.vue.d.ts +13 -2
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js +38 -0
- package/dist/Label.vue_vue_type_script_setup_true_lang-4b02087f.js.map +1 -0
- package/dist/ListItem.js +16 -15
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCell.js +9 -9
- package/dist/ListItemCell.js.map +1 -1
- package/dist/ListView.js +143 -139
- package/dist/ListView.js.map +1 -1
- package/dist/Loading.js +17 -10
- package/dist/Loading.js.map +1 -1
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js +8 -0
- package/dist/Loading.vue_used_vue_type_style_index_0_lang.module-ef5a3bc6.js.map +1 -0
- package/dist/Menu.js +1 -1
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.js +20 -14
- package/dist/MenuItem.js.map +1 -1
- package/dist/Metric.js +4 -4
- package/dist/Metric.js.map +1 -1
- package/dist/Modal.js +21 -21
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +13 -13
- package/dist/Modals.js.map +1 -1
- package/dist/Module.js +2 -2
- package/dist/Module.js.map +1 -1
- package/dist/ModuleContent.js +2 -2
- package/dist/ModuleContent.js.map +1 -1
- package/dist/ModuleFooter.js +11 -11
- package/dist/ModuleFooter.js.map +1 -1
- package/dist/ModuleHeader.js +6 -6
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ObfuscateText.js +30 -32
- package/dist/ObfuscateText.js.map +1 -1
- package/dist/ObfuscateText.vue.d.ts +1 -1
- package/dist/PageContent.js +9 -9
- package/dist/PageContent.js.map +1 -1
- package/dist/PageHeader.js +24 -24
- package/dist/PageHeader.js.map +1 -1
- package/dist/PageNavigation.js +3 -3
- package/dist/PageNavigation.js.map +1 -1
- package/dist/Paginate.js +1 -1
- package/dist/Paginate.js.map +1 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js +11 -0
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-18343da7.js.map +1 -0
- package/dist/QuickAction.js +20 -17
- package/dist/QuickAction.js.map +1 -1
- package/dist/Radio.js +30 -15
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +177 -148
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +118 -91
- package/dist/RadioNew.js.map +1 -1
- package/dist/SearchBar.js +27 -27
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +189 -188
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +22 -21
- package/dist/SelectStatus.js.map +1 -1
- package/dist/Step.js +37 -37
- package/dist/Step.js.map +1 -1
- package/dist/Switch.js +44 -36
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +3 -2
- package/dist/Tab.js.map +1 -1
- package/dist/{Tab.vue_vue_type_script_setup_true_lang-b810bee8.js → Tab.vue_vue_type_script_setup_true_lang-69d1b046.js} +23 -22
- package/dist/Tab.vue_vue_type_script_setup_true_lang-69d1b046.js.map +1 -0
- package/dist/Table.js +23 -22
- package/dist/Table.js.map +1 -1
- package/dist/Table.keys-cf93df19.js +27 -0
- package/dist/{Table.keys-1ebe4ecb.js.map → Table.keys-cf93df19.js.map} +1 -1
- package/dist/TableCell.js +24 -23
- package/dist/TableCell.js.map +1 -1
- package/dist/TableHeaderCell.js +37 -36
- package/dist/TableHeaderCell.js.map +1 -1
- package/dist/TableHeaderRow.js +13 -12
- package/dist/TableHeaderRow.js.map +1 -1
- package/dist/TableRow.js +36 -34
- package/dist/TableRow.js.map +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js → Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js} +26 -26
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-2a131332.js.map +1 -0
- package/dist/Textarea.js +61 -53
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.js +23 -23
- package/dist/Toast.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/constants.d.ts +33 -26
- package/dist/constants.js +56 -41
- package/dist/constants.js.map +1 -1
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/storage.js +3 -2
- package/dist/storage.js.map +1 -1
- package/dist/tailwind-base.d.ts +16 -16
- package/dist/tailwind-base.js +16 -6
- package/dist/tailwind-base.js.map +1 -1
- package/dist/useGoogleMaps.js.map +1 -1
- package/dist/utils/helpers.js +37 -37
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/storage.js +30 -29
- package/dist/utils/storage.js.map +1 -1
- package/package.json +2 -2
- package/styles/_core.scss +1 -1
- package/styles/backwards-compat.css +61 -105
- package/styles/base.css +259 -113
- package/tailwind-base.ts +6 -1
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js +0 -17
- package/dist/Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js +0 -2
- package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +0 -1
- package/dist/Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js.map +0 -1
- package/dist/Field.vue_vue_type_script_setup_true_lang-475832fe.js.map +0 -1
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.js +0 -37
- package/dist/Label.vue_vue_type_script_setup_true_lang-1d29d98a.js.map +0 -1
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js +0 -2
- package/dist/Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js.map +0 -1
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js +0 -11
- package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js.map +0 -1
- package/dist/Tab.vue_vue_type_script_setup_true_lang-b810bee8.js.map +0 -1
- package/dist/Table.keys-1ebe4ecb.js +0 -27
- package/dist/Tabs.vue_used_vue_type_style_index_0_lang.module-4f247ed7.js.map +0 -1
- package/styles/_base.scss +0 -493
- package/styles/elements/_links.scss +0 -32
- package/styles/elements/_lists.scss +0 -31
- package/styles/elements/_misc.scss +0 -16
- package/styles/main.scss +0 -38
package/dist/utils/helpers.js
CHANGED
|
@@ -4,24 +4,24 @@ import g from "lodash-es/isFinite";
|
|
|
4
4
|
import C from "lodash-es/isPlainObject";
|
|
5
5
|
import { INBOUND_LEADS as b, SELLER_STATUSES as y, ORDER as S, LICENSE_COLORS as N } from "../constants.js";
|
|
6
6
|
const L = "BULK", f = ".mount-point-container";
|
|
7
|
-
function k(
|
|
8
|
-
return Object.keys(e).length ?
|
|
7
|
+
function k(t, e) {
|
|
8
|
+
return Object.keys(e).length ? t.filter((r) => {
|
|
9
9
|
for (const c in e) {
|
|
10
10
|
const s = e[c], l = s.filterBy;
|
|
11
|
-
let i = a(
|
|
12
|
-
if (C(i) && (i =
|
|
13
|
-
if (!s.customFilter(l, i,
|
|
11
|
+
let i = a(r, c.split("."));
|
|
12
|
+
if (C(i) && (i = r[c].id), "customFilter" in s) {
|
|
13
|
+
if (!s.customFilter(l, i, r))
|
|
14
14
|
return !1;
|
|
15
15
|
} else if (!Array.isArray(i) && !~l.indexOf(i))
|
|
16
16
|
return !1;
|
|
17
17
|
}
|
|
18
18
|
return !0;
|
|
19
|
-
}) :
|
|
19
|
+
}) : t;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const { sortBy:
|
|
23
|
-
return !
|
|
24
|
-
let o = a(m,
|
|
21
|
+
function w(t, e) {
|
|
22
|
+
const { sortBy: r, sortDesc: c, customSorter: s, locale: l = "en" } = e, i = t.length && typeof t[0] == "object";
|
|
23
|
+
return !r && i ? t : [...t].sort((m, p) => {
|
|
24
|
+
let o = a(m, r) || m, n = a(p, r) || p;
|
|
25
25
|
if (c && ([o, n] = [n, o]), s)
|
|
26
26
|
return s(o, n);
|
|
27
27
|
if ([o, n] = [o, n].map((u) => (u || "").toString().toLocaleLowerCase()), o !== n) {
|
|
@@ -32,58 +32,58 @@ function B(r, e) {
|
|
|
32
32
|
return 0;
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return g(
|
|
35
|
+
function B(t) {
|
|
36
|
+
return g(t) && (t = t.toString()), !t || typeof t != "string" ? "" : t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function D(t) {
|
|
39
|
+
return t.split("").reduce((e, r) => (e = (e << 5) - e + r.charCodeAt(0), e & e), 0);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
41
|
+
function I() {
|
|
42
|
+
const t = document.querySelector(f);
|
|
43
|
+
if (!t) {
|
|
44
44
|
const e = document.createElement("div");
|
|
45
45
|
return e.className = f.slice(1, f.length), document.body.appendChild(e);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return t;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let e =
|
|
49
|
+
function R(t) {
|
|
50
|
+
let e = t;
|
|
51
51
|
return e.substring(0, 2) !== "--" && (e = `--${e}`), getComputedStyle(document.documentElement).getPropertyValue(e);
|
|
52
52
|
}
|
|
53
|
-
function O(
|
|
54
|
-
const e =
|
|
53
|
+
function O(t = "") {
|
|
54
|
+
const e = t.toUpperCase();
|
|
55
55
|
return e === L ? e : e.slice(0, 3);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
let
|
|
57
|
+
function _(t, e) {
|
|
58
|
+
let r;
|
|
59
59
|
try {
|
|
60
|
-
switch (
|
|
60
|
+
switch (t) {
|
|
61
61
|
case "license":
|
|
62
|
-
e = O(e),
|
|
62
|
+
e = O(e), r = N[e];
|
|
63
63
|
break;
|
|
64
64
|
case "order":
|
|
65
|
-
|
|
65
|
+
r = "tw-bg-" + S[e.toUpperCase()].color;
|
|
66
66
|
break;
|
|
67
67
|
case "certified-seller":
|
|
68
|
-
|
|
68
|
+
r = y[d(e)].color;
|
|
69
69
|
break;
|
|
70
70
|
case "inbound-leads":
|
|
71
|
-
|
|
71
|
+
r = b[e.toUpperCase()].color;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return r || "tw-bg-ice-500";
|
|
75
75
|
} catch {
|
|
76
|
-
return "
|
|
76
|
+
return "tw-bg-ice-500";
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
export {
|
|
80
80
|
k as filterItems,
|
|
81
81
|
O as formatLicenseTypeText,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
_ as generateColorClass,
|
|
83
|
+
R as getCssVar,
|
|
84
|
+
I as getMountPoint,
|
|
85
|
+
D as hashCode,
|
|
86
|
+
B as normalizeText,
|
|
87
|
+
w as sortItems
|
|
88
88
|
};
|
|
89
89
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = '
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import camelCase from 'lodash-es/camelCase';\nimport get from 'lodash-es/get';\nimport isFinite from 'lodash-es/isFinite';\nimport isPlainObject from 'lodash-es/isPlainObject';\n\nimport { INBOUND_LEADS, LICENSE_COLORS, ORDER, SELLER_STATUSES } from '../constants';\n\nconst BULK = 'BULK';\nconst MOUNT_POINT_CLASS = '.mount-point-container';\n\n/**\n * Filters the list of `items` based on options selected in the `filters` object\n * @param {array} items A list of items to filter\n * @param {IFilter} options an options object for the filtering configuration\n */\nexport function filterItems(items, filters) {\n if (!Object.keys(filters).length) {\n return items;\n }\n\n return items.filter((item) => {\n for (const key in filters) {\n // eg. `brand`, `category`, `status`...\n const filter = filters[key]; // IFilter;\n const filterValues = filter.filterBy; // eg. ['1906', 'LuvBuds'], ['vape', 'pen', 'flower']\n let itemValue = get(item, key.split('.')); // eg `LuvBuds`, 'vape'\n\n // TODO take care of this upstream. ie write custom filter function if itemValue is an object\n // ie. if (typeof itemValue !== 'string' || typeof itemValue !== 'number' )\n if (isPlainObject(itemValue)) {\n itemValue = item[key].id;\n }\n\n if ('customFilter' in filter) {\n // custom function should return `false` when the filter logic does not match\n if (!filter.customFilter(filterValues, itemValue, item)) {\n return false;\n }\n } else {\n if (!Array.isArray(itemValue) && !~filterValues.indexOf(itemValue)) {\n return false;\n }\n }\n }\n\n return true;\n });\n}\n\n/**\n * Sorts an array of items\n * @param {Array} items the list of things to sort\n * @param {ISort} options an options object for the sorting configuration\n * sortBy: the object key to sort on\n * sortDesc: whether to sort descending or not\n * customSorter: a custom sorting function\n *\n * https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/util/helpers.ts#L381\n */\nexport function sortItems(items, options) {\n const { sortBy, sortDesc, customSorter, locale = 'en' } = options;\n const isObject = items.length && typeof items[0] === 'object';\n\n if (!sortBy && isObject) {\n return items;\n }\n\n return [...items].sort((a, b) => {\n let sortA = get(a, sortBy) || a;\n let sortB = get(b, sortBy) || b;\n\n if (sortDesc) {\n [sortA, sortB] = [sortB, sortA];\n }\n\n if (customSorter) {\n return customSorter(sortA, sortB);\n }\n\n [sortA, sortB] = [sortA, sortB].map((s) => (s || '').toString().toLocaleLowerCase());\n\n if (sortA !== sortB) {\n const sortResult =\n !isNaN(sortA) && !isNaN(sortB) ? Number(sortA) - Number(sortB) : sortA.localeCompare(sortB, locale);\n\n if (sortResult) {\n return sortResult;\n }\n }\n\n return 0;\n });\n}\n\n/**\n * Removes all accents/diacritics and converts to lower case\n * @param {string} text to normalize\n */\nexport function normalizeText(text) {\n if (isFinite(text)) {\n text = text.toString();\n }\n\n if (!text || typeof text !== 'string') {\n return '';\n }\n\n /**\n * NFD splits the canonical form and the regex removed only accent characters\n * see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize for more detail.\n */\n return text\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n}\n\n/**\n * Generates a hash code from a string\n * @param {string} s The string to generate a hash from\n * @see https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript/52171480\n */\nexport function hashCode(s) {\n return s.split('').reduce((a, b) => {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0);\n}\n\n/**\n * Returns the mount point for elements that will reattach themselves, or creates one if not available\n */\nexport function getMountPoint() {\n const el = document.querySelector(MOUNT_POINT_CLASS);\n\n if (!el) {\n const div = document.createElement('div');\n\n div.className = MOUNT_POINT_CLASS.slice(1, MOUNT_POINT_CLASS.length);\n return document.body.appendChild(div);\n }\n\n return el;\n}\n\n/**\n * Retrieves the value of a css variable\n *\n * @param {string} name name of the css var, with or without `--`\n * @return {string} value of the css var\n */\nexport function getCssVar(name) {\n let variable = name;\n\n if (variable.substring(0, 2) !== '--') {\n variable = `--${variable}`;\n }\n\n return getComputedStyle(document.documentElement).getPropertyValue(variable);\n}\n\n/**\n * Format the license type text to display\n * @param {string} licenseType the first three characters of the licenseType\n */\nexport function formatLicenseTypeText(licenseType = '') {\n const type = licenseType.toUpperCase();\n\n return type === BULK ? type : type.slice(0, 3);\n}\n\nexport function generateColorClass(type, value) {\n let color;\n\n try {\n switch (type) {\n case 'license':\n value = formatLicenseTypeText(value);\n color = LICENSE_COLORS[value];\n break;\n case 'order':\n color = 'tw-bg-' + ORDER[value.toUpperCase()].color;\n break;\n case 'certified-seller':\n color = SELLER_STATUSES[camelCase(value)].color;\n break;\n case 'inbound-leads':\n color = INBOUND_LEADS[value.toUpperCase()].color;\n break;\n }\n\n return color || 'tw-bg-ice-500';\n } catch (e) {\n return 'tw-bg-ice-500';\n }\n}\n"],"names":["BULK","MOUNT_POINT_CLASS","filterItems","items","filters","item","key","filter","filterValues","itemValue","get","isPlainObject","sortItems","options","sortBy","sortDesc","customSorter","locale","isObject","a","b","sortA","sortB","s","sortResult","normalizeText","text","isFinite","hashCode","getMountPoint","el","div","getCssVar","name","variable","formatLicenseTypeText","licenseType","type","generateColorClass","value","color","LICENSE_COLORS","ORDER","SELLER_STATUSES","camelCase","INBOUND_LEADS"],"mappings":"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"}
|
package/dist/utils/storage.js
CHANGED
|
@@ -1,66 +1,67 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "@leaflink/snitch";
|
|
2
|
+
import { hashCode as i } from "./helpers.js";
|
|
2
3
|
import "lodash-es/camelCase";
|
|
3
4
|
import "lodash-es/get";
|
|
4
5
|
import "lodash-es/isFinite";
|
|
5
6
|
import "lodash-es/isPlainObject";
|
|
6
7
|
import "../constants.js";
|
|
7
8
|
const n = "ll";
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
9
|
+
function m(t, o, a = {}) {
|
|
10
|
+
const e = a.global ? "" : `-${location.pathname}`, r = `${n}-${t}${e}`, s = JSON.stringify(o);
|
|
10
11
|
try {
|
|
11
|
-
localStorage.setItem(r,
|
|
12
|
+
localStorage.setItem(r, s);
|
|
12
13
|
} catch (c) {
|
|
13
|
-
c && c.name === "QuotaExceededError" ?
|
|
14
|
+
c && c.name === "QuotaExceededError" ? l.log(`Your localStorage is full. Failed to save item for key: ${r}`) : l.log(`Failed to save value to localStorage for key: ${r}`);
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
17
|
+
function g(t, o = {}) {
|
|
18
|
+
const a = o.global ? "" : `-${location.pathname}`, e = localStorage.getItem(`${n}-${t}${a}`);
|
|
18
19
|
if (e === null || e === "undefined")
|
|
19
20
|
return null;
|
|
20
21
|
try {
|
|
21
22
|
return JSON.parse(e);
|
|
22
23
|
} catch (r) {
|
|
23
|
-
return
|
|
24
|
+
return l.error(r.message, { error: r }), null;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
27
|
+
function u(t, o = {}) {
|
|
28
|
+
const a = o.global ? "" : `-${location.pathname}`, e = `${n}-${t}${a}`;
|
|
28
29
|
if (localStorage.getItem(e) !== null)
|
|
29
30
|
try {
|
|
30
31
|
localStorage.removeItem(e);
|
|
31
|
-
} catch (
|
|
32
|
-
|
|
32
|
+
} catch (s) {
|
|
33
|
+
l.error(s.message, { error: s });
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
36
|
+
function y(t, o) {
|
|
37
|
+
const a = JSON.parse(localStorage.getItem(t) || "{}");
|
|
37
38
|
try {
|
|
38
|
-
return (
|
|
39
|
+
return (a[o] || {})[i(location.pathname)];
|
|
39
40
|
} catch (e) {
|
|
40
|
-
|
|
41
|
+
l.error(e.message, { error: e });
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function v(t, o) {
|
|
45
46
|
const e = { ...JSON.parse(localStorage.getItem(t) || "{}") };
|
|
46
|
-
e[o] && delete e[o][
|
|
47
|
+
e[o] && delete e[o][i(location.pathname)];
|
|
47
48
|
try {
|
|
48
49
|
localStorage.setItem(t, JSON.stringify(e));
|
|
49
50
|
} catch (r) {
|
|
50
|
-
r && r.name === "QuotaExceededError" ?
|
|
51
|
+
r && r.name === "QuotaExceededError" ? l.log("Your localStorage is full. Failed to set item.") : l.log("Failed to set item to localStorage.");
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
const
|
|
54
|
-
setItem:
|
|
55
|
-
getItem:
|
|
56
|
-
removeItem:
|
|
54
|
+
const P = {
|
|
55
|
+
setItem: m,
|
|
56
|
+
getItem: g,
|
|
57
|
+
removeItem: u
|
|
57
58
|
};
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
g as getPersistentItem,
|
|
61
|
+
y as getPersistentItem__deprecated,
|
|
62
|
+
P as persistentStorage,
|
|
63
|
+
u as removePersistentItem,
|
|
64
|
+
v as removePersistentItem__deprecated,
|
|
65
|
+
m as setPersistentItem
|
|
65
66
|
};
|
|
66
67
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error: any) {\n if (error && error.name === 'QuotaExceededError') {\n
|
|
1
|
+
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":["import logger from '@leaflink/snitch';\n\nimport { hashCode } from './helpers';\n\nconst PREFIX = 'll';\n\n/**\n * Persist an item to localStorage, unique to each url pathname unless [options.global] is set to true\n *\n * If global is set to false (the default):\n * name: 'foo'\n * data: { a: 'a' }\n *\n * localStorage key: 'll-foo-/c/the-leaf-shop/customers/'\n * localStorage value: { a: 'a' }\n *\n * If global is set to true:\n * name: 'bar'\n * data: { b: 'b' }\n *\n * localStorage key: 'll-bar'\n * localStorage value: { b: 'b' }\n *\n * @param {string} name - the storage key name, often a component name\n * @param {object} data - the data to persist\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function setPersistentItem(name, data, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const storageValue = JSON.stringify(data);\n\n try {\n localStorage.setItem(storageKey, storageValue);\n } catch (error: any) {\n if (error && error.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to save item for key: ${storageKey}`);\n } else {\n logger.log(`Failed to save value to localStorage for key: ${storageKey}`);\n }\n }\n}\n\n/**\n * Retrieve an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n * @returns {any | undefined}\n */\nexport function getPersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const item = localStorage.getItem(`${PREFIX}-${name}${scope}`);\n\n // localStorage.getItem always returns a string or null. When it's a string,\n // it usually contains an object or a boolean. If the value is 'false', we\n // need to ensure we return false instead of null.\n if (item === null || item === 'undefined') {\n return null;\n }\n\n try {\n return JSON.parse(item);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n\n return null;\n }\n}\n\n/**\n * Remove an item from localStorage, previously saved by `setPersistentItem`.\n * @param {string} name The storage key name, often a component name\n * @param {object} [options] - an optional options object\n * @param {boolean} [options.global] - does not add url to the key when true\n */\nexport function removePersistentItem(name, options: { global?: boolean } = {}) {\n const scope = options.global ? '' : `-${location.pathname}`;\n const storageKey = `${PREFIX}-${name}${scope}`;\n const item = localStorage.getItem(storageKey);\n\n if (item === null) {\n return;\n }\n\n try {\n localStorage.removeItem(storageKey);\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n }\n}\n\n/**\n ***************** DEPRECATED *****************\n */\nexport function getPersistentItem__deprecated(itemKey: string, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n\n try {\n return (item[name] || {})[hashCode(location.pathname)];\n } catch (err) {\n logger.error((err as Error).message, { error: err });\n\n return undefined;\n }\n}\n\nexport function removePersistentItem__deprecated(itemKey, name) {\n const item = JSON.parse(localStorage.getItem(itemKey) || '{}');\n const itemValue = { ...item };\n\n if (itemValue[name]) {\n delete itemValue[name][hashCode(location.pathname)];\n }\n\n try {\n localStorage.setItem(itemKey, JSON.stringify(itemValue));\n } catch (error: any) {\n if (error && error.name === 'QuotaExceededError') {\n logger.log(`Your localStorage is full. Failed to set item.`);\n } else {\n logger.log(`Failed to set item to localStorage.`);\n }\n }\n}\n// END DEPRECATED\n\nexport const persistentStorage = {\n setItem: setPersistentItem,\n getItem: getPersistentItem,\n removeItem: removePersistentItem,\n};\n"],"names":["PREFIX","setPersistentItem","name","data","options","scope","storageKey","storageValue","error","logger","getPersistentItem","item","err","removePersistentItem","getPersistentItem__deprecated","itemKey","hashCode","removePersistentItem__deprecated","itemValue","persistentStorage"],"mappings":";;;;;;;AAIA,MAAMA,IAAS;AAwBR,SAASC,EAAkBC,GAAMC,GAAMC,IAAgC,CAAA,GAAI;AAChF,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDE,IAAa,GAAGN,CAAM,IAAIE,CAAI,GAAGG,CAAK,IACtCE,IAAe,KAAK,UAAUJ,CAAI;AAEpC,MAAA;AACW,iBAAA,QAAQG,GAAYC,CAAY;AAAA,WACtCC,GAAY;AACf,IAAAA,KAASA,EAAM,SAAS,uBACnBC,EAAA,IAAI,2DAA2DH,CAAU,EAAE,IAE3EG,EAAA,IAAI,iDAAiDH,CAAU,EAAE;AAAA,EAE5E;AACF;AASO,SAASI,EAAkBR,GAAME,IAAgC,IAAI;AAC1E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDO,IAAO,aAAa,QAAQ,GAAGX,CAAM,IAAIE,CAAI,GAAGG,CAAK,EAAE;AAKzD,MAAAM,MAAS,QAAQA,MAAS;AACrB,WAAA;AAGL,MAAA;AACK,WAAA,KAAK,MAAMA,CAAI;AAAA,WACfC,GAAK;AACZ,WAAAH,EAAO,MAAOG,EAAc,SAAS,EAAE,OAAOA,GAAK,GAE5C;AAAA,EACT;AACF;AAQO,SAASC,EAAqBX,GAAME,IAAgC,IAAI;AAC7E,QAAMC,IAAQD,EAAQ,SAAS,KAAK,IAAI,SAAS,QAAQ,IACnDE,IAAa,GAAGN,CAAM,IAAIE,CAAI,GAAGG,CAAK;AAG5C,MAFa,aAAa,QAAQC,CAAU,MAE/B;AAIT,QAAA;AACF,mBAAa,WAAWA,CAAU;AAAA,aAC3BM,GAAK;AACZ,MAAAH,EAAO,MAAOG,EAAc,SAAS,EAAE,OAAOA,GAAK;AAAA,IACrD;AACF;AAKgB,SAAAE,EAA8BC,GAAiBb,GAAM;AACnE,QAAMS,IAAO,KAAK,MAAM,aAAa,QAAQI,CAAO,KAAK,IAAI;AAEzD,MAAA;AACM,YAAAJ,EAAKT,CAAI,KAAK,CAAA,GAAIc,EAAS,SAAS,QAAQ,CAAC;AAAA,WAC9CJ,GAAK;AACZ,IAAAH,EAAO,MAAOG,EAAc,SAAS,EAAE,OAAOA,GAAK;AAE5C;AAAA,EACT;AACF;AAEgB,SAAAK,EAAiCF,GAASb,GAAM;AAExD,QAAAgB,IAAY,EAAE,GADP,KAAK,MAAM,aAAa,QAAQH,CAAO,KAAK,IAAI;AAGzD,EAAAG,EAAUhB,CAAI,KAChB,OAAOgB,EAAUhB,CAAI,EAAEc,EAAS,SAAS,QAAQ,CAAC;AAGhD,MAAA;AACF,iBAAa,QAAQD,GAAS,KAAK,UAAUG,CAAS,CAAC;AAAA,WAChDV,GAAY;AACf,IAAAA,KAASA,EAAM,SAAS,uBAC1BC,EAAO,IAAI,gDAAgD,IAE3DA,EAAO,IAAI,qCAAqC;AAAA,EAEpD;AACF;AAGO,MAAMU,IAAoB;AAAA,EAC/B,SAASlB;AAAA,EACT,SAASS;AAAA,EACT,YAAYG;AACd;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaflink/stash",
|
|
3
|
-
"version": "44.0.0-beta.
|
|
3
|
+
"version": "44.0.0-beta.10",
|
|
4
4
|
"description": "LeafLink's design system.",
|
|
5
5
|
"homepage": "https://stash.leaflink.com",
|
|
6
6
|
"main": "./dist/index.ts",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"autoprefixer": "^9.7.4",
|
|
139
139
|
"babel-core": "^7.0.0-bridge.0",
|
|
140
140
|
"eslint": "^8.41.0",
|
|
141
|
-
"eslint-config-leaflink": "^1.
|
|
141
|
+
"eslint-config-leaflink": "^3.1.0",
|
|
142
142
|
"jsdom": "^22.1.0",
|
|
143
143
|
"postcss": "^8.4.35",
|
|
144
144
|
"postcss-html": "^1.5.0",
|
package/styles/_core.scss
CHANGED
|
@@ -826,7 +826,7 @@ $inputs: (
|
|
|
826
826
|
|
|
827
827
|
@mixin input-disabled {
|
|
828
828
|
background-color: var(--color-ice-200) !important;
|
|
829
|
-
border-color: var(--color-ice) !important;
|
|
829
|
+
border-color: var(--color-ice-500) !important;
|
|
830
830
|
color: var(--color-ice-700) !important;
|
|
831
831
|
pointer-events: none;
|
|
832
832
|
|
|
@@ -4,14 +4,7 @@
|
|
|
4
4
|
* ✅ Contents of `styles/components/*`
|
|
5
5
|
* ✅ Contents of `styles/overrides/*`
|
|
6
6
|
* ✅ Contents of `styles/elements/*`
|
|
7
|
-
* ✅ Contents of `styles/utility
|
|
8
|
-
* ✅ Contents of `styles/utility/_misc`
|
|
9
|
-
*
|
|
10
|
-
* Once all downstream apps have introduced to Tailwind and import this file, the above can be deleted.
|
|
11
|
-
*
|
|
12
|
-
* Todo:
|
|
13
|
-
*
|
|
14
|
-
* ⬜️ Remaining contents of `styles/utility/*`
|
|
7
|
+
* ✅ Contents of `styles/utility/*`
|
|
15
8
|
*/
|
|
16
9
|
|
|
17
10
|
:root {
|
|
@@ -44,114 +37,19 @@
|
|
|
44
37
|
--screen-md-max: 960px;
|
|
45
38
|
--screen-lg-max: 1320px;
|
|
46
39
|
/* Stash colors */
|
|
40
|
+
|
|
47
41
|
--color-purple: #1E164B;
|
|
48
|
-
--color-purple-900: #06040F;
|
|
49
|
-
--color-purple-800: #0C091E;
|
|
50
|
-
--color-purple-700: #120D2D;
|
|
51
|
-
--color-purple-600: #18123C;
|
|
52
|
-
--color-purple-500: #1E164B;
|
|
53
|
-
--color-purple-400: #4B456F;
|
|
54
|
-
--color-purple-300: #787393;
|
|
55
|
-
--color-purple-200: #A5A2B7;
|
|
56
|
-
--color-purple-100: #D2D0DB;
|
|
57
42
|
--color-royal: #303AB2;
|
|
58
|
-
--color-royal-900: #0A0C24;
|
|
59
|
-
--color-royal-800: #131747;
|
|
60
|
-
--color-royal-700: #1D236B;
|
|
61
|
-
--color-royal-600: #262E8E;
|
|
62
|
-
--color-royal-500: #303AB2;
|
|
63
|
-
--color-royal-400: #5961C1;
|
|
64
|
-
--color-royal-300: #8389D1;
|
|
65
|
-
--color-royal-200: #ACB0E0;
|
|
66
|
-
--color-royal-100: #D6D8F0;
|
|
67
43
|
--color-blue: #0072F0;
|
|
68
|
-
--color-blue-900: #001730;
|
|
69
|
-
--color-blue-800: #002E60;
|
|
70
|
-
--color-blue-700: #004490;
|
|
71
|
-
--color-blue-600: #005BC0;
|
|
72
|
-
--color-blue-500: #0072F0;
|
|
73
|
-
--color-blue-400: #338EF3;
|
|
74
|
-
--color-blue-300: #66AAF6;
|
|
75
|
-
--color-blue-200: #99C7F9;
|
|
76
|
-
--color-blue-100: #CCE3FC;
|
|
77
44
|
--color-teal: #01BBC8;
|
|
78
|
-
--color-teal-900: #002528;
|
|
79
|
-
--color-teal-800: #004B50;
|
|
80
|
-
--color-teal-700: #017078;
|
|
81
|
-
--color-teal-600: #0196A0;
|
|
82
|
-
--color-teal-500: #01BBC8;
|
|
83
|
-
--color-teal-400: #34C9D3;
|
|
84
|
-
--color-teal-300: #67D6DE;
|
|
85
|
-
--color-teal-200: #99E4E9;
|
|
86
|
-
--color-teal-100: #CCF1F4;
|
|
87
45
|
--color-green: #1DAE61;
|
|
88
|
-
--color-green-900: #062313;
|
|
89
|
-
--color-green-800: #0C4627;
|
|
90
|
-
--color-green-700: #11683A;
|
|
91
|
-
--color-green-600: #178B4E;
|
|
92
|
-
--color-green-500: #1DAE61;
|
|
93
|
-
--color-green-400: #4ABE81;
|
|
94
|
-
--color-green-300: #77CEA0;
|
|
95
|
-
--color-green-200: #A5DFC0;
|
|
96
|
-
--color-green-100: #D2EFDF;
|
|
97
46
|
--color-seafoam: #3CDBC0;
|
|
98
|
-
--color-seafoam-900: #0C2C26;
|
|
99
|
-
--color-seafoam-800: #18584D;
|
|
100
|
-
--color-seafoam-700: #248373;
|
|
101
|
-
--color-seafoam-600: #30AF9A;
|
|
102
|
-
--color-seafoam-500: #3CDBC0;
|
|
103
|
-
--color-seafoam-400: #63E2CD;
|
|
104
|
-
--color-seafoam-300: #8AE9D9;
|
|
105
|
-
--color-seafoam-200: #B1F1E6;
|
|
106
|
-
--color-seafoam-100: #D8F8F2;
|
|
107
47
|
--color-yellow: #FFD400;
|
|
108
|
-
--color-yellow-900: #332A00;
|
|
109
|
-
--color-yellow-800: #665500;
|
|
110
|
-
--color-yellow-700: #997F00;
|
|
111
|
-
--color-yellow-600: #CCAA00;
|
|
112
|
-
--color-yellow-500: #FFD400;
|
|
113
|
-
--color-yellow-400: #FFDD33;
|
|
114
|
-
--color-yellow-300: #FFE566;
|
|
115
|
-
--color-yellow-200: #FFEE99;
|
|
116
|
-
--color-yellow-100: #FFF6CC;
|
|
117
48
|
--color-orange: #FF9425;
|
|
118
|
-
--color-orange-900: #331E07;
|
|
119
|
-
--color-orange-800: #663B0F;
|
|
120
|
-
--color-orange-700: #995916;
|
|
121
|
-
--color-orange-600: #CC761E;
|
|
122
|
-
--color-orange-500: #FF9425;
|
|
123
|
-
--color-orange-400: #FFA951;
|
|
124
|
-
--color-orange-300: #FFBF7C;
|
|
125
|
-
--color-orange-200: #FFD4A8;
|
|
126
|
-
--color-orange-100: #FFEAD3;
|
|
127
49
|
--color-red: #E4002B;
|
|
128
|
-
--color-red-900: #2E0009;
|
|
129
|
-
--color-red-800: #5B0011;
|
|
130
|
-
--color-red-700: #89001A;
|
|
131
|
-
--color-red-600: #B60022;
|
|
132
|
-
--color-red-500: #E4002B;
|
|
133
|
-
--color-red-400: #E93355;
|
|
134
|
-
--color-red-300: #EF6680;
|
|
135
|
-
--color-red-200: #F499AA;
|
|
136
|
-
--color-red-100: #FACCD5;
|
|
137
50
|
--color-ice: #C5C9D4;
|
|
138
|
-
--color-ice-900: #27282A;
|
|
139
|
-
--color-ice-800: #4F5055;
|
|
140
|
-
--color-ice-700: #76797F;
|
|
141
|
-
--color-ice-600: #9EA1AA;
|
|
142
|
-
--color-ice-500: #C5C9D4;
|
|
143
|
-
--color-ice-400: #D1D4DD;
|
|
144
|
-
--color-ice-300: #DCDFE5;
|
|
145
|
-
--color-ice-200: #E8E9EE;
|
|
146
|
-
--color-ice-100: #F3F4F6;
|
|
147
51
|
--color-white: #ffffff;
|
|
148
52
|
--color-black: #000000;
|
|
149
|
-
--color-blue-hover: rgba(0,114,240,0.74902);
|
|
150
|
-
--color-red-hover: rgba(228,0,43,0.74902);
|
|
151
|
-
--color-ice-700-hover: rgba(118,121,127,0.11765);
|
|
152
|
-
--color-white-hover: rgba(255,255,255,0.11765);
|
|
153
|
-
--button-secondary-blue-hover: rgba(0,114,240,0.11765);
|
|
154
|
-
--button-secondary-red-hover: rgba(228,0,43,0.11765);
|
|
155
53
|
/*
|
|
156
54
|
For use in style blocks when a utility wasn't possible to use.
|
|
157
55
|
Todo (tailwind): migrate to @apply .class-name
|
|
@@ -4485,7 +4383,6 @@
|
|
|
4485
4383
|
|
|
4486
4384
|
*/
|
|
4487
4385
|
.form__errors {
|
|
4488
|
-
border: 1px solid #C5C9D4 #E4002B;
|
|
4489
4386
|
border: 1px solid #C5C9D4 var(--color-red-500);
|
|
4490
4387
|
color: #E4002B;
|
|
4491
4388
|
color: var(--color-red-500);
|
|
@@ -5032,3 +4929,62 @@ textarea {
|
|
|
5032
4929
|
height: 16px;
|
|
5033
4930
|
width: 16px;
|
|
5034
4931
|
}
|
|
4932
|
+
.text-small {
|
|
4933
|
+
font-size: 0.875rem;
|
|
4934
|
+
line-height: calc(20/14);
|
|
4935
|
+
}
|
|
4936
|
+
|
|
4937
|
+
|
|
4938
|
+
.heading-1 {
|
|
4939
|
+
--tw-text-opacity: 1;
|
|
4940
|
+
font-size: 1.5rem;
|
|
4941
|
+
line-height: calc(32/24);
|
|
4942
|
+
font-weight: 500;
|
|
4943
|
+
color: rgba(39, 40, 42, 1);
|
|
4944
|
+
color: rgba(39, 40, 42, var(--tw-text-opacity));
|
|
4945
|
+
margin: 0.67em 0;
|
|
4946
|
+
}
|
|
4947
|
+
.heading-2 {
|
|
4948
|
+
--tw-text-opacity: 1;
|
|
4949
|
+
font-size: 1.25rem;
|
|
4950
|
+
line-height: calc(28/20);
|
|
4951
|
+
font-weight: 500;
|
|
4952
|
+
color: rgba(39, 40, 42, 1);
|
|
4953
|
+
color: rgba(39, 40, 42, var(--tw-text-opacity));
|
|
4954
|
+
}
|
|
4955
|
+
.heading-3 {
|
|
4956
|
+
--tw-text-opacity: 1;
|
|
4957
|
+
color: rgba(39, 40, 42, 1);
|
|
4958
|
+
color: rgba(39, 40, 42, var(--tw-text-opacity));
|
|
4959
|
+
font-size: 1rem;
|
|
4960
|
+
line-height: calc(24/16);
|
|
4961
|
+
font-weight: 500;
|
|
4962
|
+
}
|
|
4963
|
+
.heading-4 {
|
|
4964
|
+
--tw-text-opacity: 1;
|
|
4965
|
+
color: rgba(39, 40, 42, 1);
|
|
4966
|
+
color: rgba(39, 40, 42, var(--tw-text-opacity));
|
|
4967
|
+
font-size: 0.875rem;
|
|
4968
|
+
line-height: calc(20/14);
|
|
4969
|
+
font-weight: 500;
|
|
4970
|
+
}
|
|
4971
|
+
.flex { display: flex; }
|
|
4972
|
+
.flex-wrap { flex-wrap: wrap; }
|
|
4973
|
+
.flex-initial { flex: 0 1 auto; }
|
|
4974
|
+
.flex-1 { flex: 1 1 0%; }
|
|
4975
|
+
.flex-auto { flex: 1 1 auto; }
|
|
4976
|
+
.flex-none { flex: none; }
|
|
4977
|
+
.flex-col { flex-direction: column; }
|
|
4978
|
+
.align-center { justify-content: center; }
|
|
4979
|
+
.align-right { justify-content: flex-end; }
|
|
4980
|
+
.align-spaced { justify-content: space-around; }
|
|
4981
|
+
.align-justify { justify-content: space-between; }
|
|
4982
|
+
.align-top { align-items: flex-start; }
|
|
4983
|
+
.align-bottom { align-items: flex-end; }
|
|
4984
|
+
.align-middle { align-items: center; }
|
|
4985
|
+
.align-self-start { align-self: flex-start; }
|
|
4986
|
+
.align-self-end { align-self: flex-end; }
|
|
4987
|
+
.align-self-center { align-self: center; }
|
|
4988
|
+
.align-self-baseline { align-self: baseline; }
|
|
4989
|
+
.align-self-auto { align-self: auto; }
|
|
4990
|
+
.align-self-stretch { align-self: stretch; }
|