@sk-web-gui/core 3.10.0 → 3.11.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/cjs/aria-plugin.js +101 -1
- package/dist/cjs/aria-plugin.js.map +1 -1
- package/dist/cjs/base.js +60 -1
- package/dist/cjs/base.js.map +1 -1
- package/dist/cjs/colors.js +724 -1
- package/dist/cjs/colors.js.map +1 -1
- package/dist/cjs/components/accordion.js +211 -1
- package/dist/cjs/components/accordion.js.map +1 -1
- package/dist/cjs/components/ai/ai-corner-module.js +344 -1
- package/dist/cjs/components/ai/ai-corner-module.js.map +1 -1
- package/dist/cjs/components/ai/ai-feed.js +74 -1
- package/dist/cjs/components/ai/ai-feed.js.map +1 -1
- package/dist/cjs/components/ai/ai-service-module.js +225 -1
- package/dist/cjs/components/ai/ai-service-module.js.map +1 -1
- package/dist/cjs/components/ai/assistant-presentation.js +65 -1
- package/dist/cjs/components/ai/assistant-presentation.js.map +1 -1
- package/dist/cjs/components/ai/assistant-switch.js +58 -1
- package/dist/cjs/components/ai/assistant-switch.js.map +1 -1
- package/dist/cjs/components/ai/bubble.js +127 -1
- package/dist/cjs/components/ai/bubble.js.map +1 -1
- package/dist/cjs/components/ai/feedback.js +40 -1
- package/dist/cjs/components/ai/feedback.js.map +1 -1
- package/dist/cjs/components/ai/input-section.js +34 -1
- package/dist/cjs/components/ai/input-section.js.map +1 -1
- package/dist/cjs/components/ai/markdown-rendered.js +33 -1
- package/dist/cjs/components/ai/markdown-rendered.js.map +1 -1
- package/dist/cjs/components/ai/new-session-button.js +29 -1
- package/dist/cjs/components/ai/new-session-button.js.map +1 -1
- package/dist/cjs/components/ai/typing-bubble.js +31 -1
- package/dist/cjs/components/ai/typing-bubble.js.map +1 -1
- package/dist/cjs/components/ai/typing-sequence.js +91 -1
- package/dist/cjs/components/ai/typing-sequence.js.map +1 -1
- package/dist/cjs/components/avatar.js +104 -1
- package/dist/cjs/components/avatar.js.map +1 -1
- package/dist/cjs/components/badge.js +93 -1
- package/dist/cjs/components/badge.js.map +1 -1
- package/dist/cjs/components/breadcrumb.js +49 -1
- package/dist/cjs/components/breadcrumb.js.map +1 -1
- package/dist/cjs/components/button-group.js +38 -1
- package/dist/cjs/components/button-group.js.map +1 -1
- package/dist/cjs/components/button.js +306 -1
- package/dist/cjs/components/button.js.map +1 -1
- package/dist/cjs/components/callout.js +96 -1
- package/dist/cjs/components/callout.js.map +1 -1
- package/dist/cjs/components/card.js +282 -1
- package/dist/cjs/components/card.js.map +1 -1
- package/dist/cjs/components/checkbox.js +141 -1
- package/dist/cjs/components/checkbox.js.map +1 -1
- package/dist/cjs/components/chip.js +50 -1
- package/dist/cjs/components/chip.js.map +1 -1
- package/dist/cjs/components/code.js +22 -1
- package/dist/cjs/components/code.js.map +1 -1
- package/dist/cjs/components/combobox.js +102 -1
- package/dist/cjs/components/combobox.js.map +1 -1
- package/dist/cjs/components/cookie-consent.js +54 -1
- package/dist/cjs/components/cookie-consent.js.map +1 -1
- package/dist/cjs/components/dialog.js +82 -1
- package/dist/cjs/components/dialog.js.map +1 -1
- package/dist/cjs/components/divider.js +63 -1
- package/dist/cjs/components/divider.js.map +1 -1
- package/dist/cjs/components/dot.js +115 -1
- package/dist/cjs/components/dot.js.map +1 -1
- package/dist/cjs/components/file-upload.js +230 -1
- package/dist/cjs/components/file-upload.js.map +1 -1
- package/dist/cjs/components/filter.js +27 -1
- package/dist/cjs/components/filter.js.map +1 -1
- package/dist/cjs/components/footer.js +44 -1
- package/dist/cjs/components/footer.js.map +1 -1
- package/dist/cjs/components/forms.js +37 -1
- package/dist/cjs/components/forms.js.map +1 -1
- package/dist/cjs/components/header.js +41 -1
- package/dist/cjs/components/header.js.map +1 -1
- package/dist/cjs/components/icon.js +117 -1
- package/dist/cjs/components/icon.js.map +1 -1
- package/dist/cjs/components/input.js +302 -1
- package/dist/cjs/components/input.js.map +1 -1
- package/dist/cjs/components/kbd.js +20 -1
- package/dist/cjs/components/kbd.js.map +1 -1
- package/dist/cjs/components/label.js +96 -1
- package/dist/cjs/components/label.js.map +1 -1
- package/dist/cjs/components/link.js +62 -1
- package/dist/cjs/components/link.js.map +1 -1
- package/dist/cjs/components/list.js +66 -1
- package/dist/cjs/components/list.js.map +1 -1
- package/dist/cjs/components/logo.js +61 -1
- package/dist/cjs/components/logo.js.map +1 -1
- package/dist/cjs/components/menu-vertical.js +256 -1
- package/dist/cjs/components/menu-vertical.js.map +1 -1
- package/dist/cjs/components/menubar.js +104 -1
- package/dist/cjs/components/menubar.js.map +1 -1
- package/dist/cjs/components/modal.js +61 -1
- package/dist/cjs/components/modal.js.map +1 -1
- package/dist/cjs/components/pagination.js +114 -1
- package/dist/cjs/components/pagination.js.map +1 -1
- package/dist/cjs/components/popup-menu.js +153 -1
- package/dist/cjs/components/popup-menu.js.map +1 -1
- package/dist/cjs/components/progress-bar.js +82 -1
- package/dist/cjs/components/progress-bar.js.map +1 -1
- package/dist/cjs/components/progress-stepper.js +83 -1
- package/dist/cjs/components/progress-stepper.js.map +1 -1
- package/dist/cjs/components/radio.js +143 -1
- package/dist/cjs/components/radio.js.map +1 -1
- package/dist/cjs/components/search-field.js +48 -1
- package/dist/cjs/components/search-field.js.map +1 -1
- package/dist/cjs/components/select.js +267 -1
- package/dist/cjs/components/select.js.map +1 -1
- package/dist/cjs/components/snackbar.js +43 -1
- package/dist/cjs/components/snackbar.js.map +1 -1
- package/dist/cjs/components/spinner.js +82 -1
- package/dist/cjs/components/spinner.js.map +1 -1
- package/dist/cjs/components/switch.js +93 -1
- package/dist/cjs/components/switch.js.map +1 -1
- package/dist/cjs/components/table.js +308 -1
- package/dist/cjs/components/table.js.map +1 -1
- package/dist/cjs/components/tabs.js +128 -1
- package/dist/cjs/components/tabs.js.map +1 -1
- package/dist/cjs/components/tooltip.js +71 -1
- package/dist/cjs/components/tooltip.js.map +1 -1
- package/dist/cjs/components/user-menu.js +27 -1
- package/dist/cjs/components/user-menu.js.map +1 -1
- package/dist/cjs/components.js +415 -1
- package/dist/cjs/components.js.map +1 -1
- package/dist/cjs/data-plugin.js +67 -1
- package/dist/cjs/data-plugin.js.map +1 -1
- package/dist/cjs/fonts.js +19 -1
- package/dist/cjs/fonts.js.map +1 -1
- package/dist/cjs/index.js +38 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/plugin.js +144 -1
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/cjs/preset.js +164 -1
- package/dist/cjs/preset.js.map +1 -1
- package/dist/cjs/theme.js +209 -1
- package/dist/cjs/theme.js.map +1 -1
- package/dist/cjs/units.js +415 -1
- package/dist/cjs/units.js.map +1 -1
- package/dist/cjs/with-opacity.js +19 -1
- package/dist/cjs/with-opacity.js.map +1 -1
- package/dist/esm/aria-plugin.js +86 -1
- package/dist/esm/aria-plugin.js.map +1 -1
- package/dist/esm/base.js +51 -1
- package/dist/esm/base.js.map +1 -1
- package/dist/esm/colors.js +715 -1
- package/dist/esm/colors.js.map +1 -1
- package/dist/esm/components/accordion.js +201 -1
- package/dist/esm/components/accordion.js.map +1 -1
- package/dist/esm/components/ai/ai-corner-module.js +334 -1
- package/dist/esm/components/ai/ai-corner-module.js.map +1 -1
- package/dist/esm/components/ai/ai-feed.js +64 -1
- package/dist/esm/components/ai/ai-feed.js.map +1 -1
- package/dist/esm/components/ai/ai-service-module.js +215 -1
- package/dist/esm/components/ai/ai-service-module.js.map +1 -1
- package/dist/esm/components/ai/assistant-presentation.js +55 -1
- package/dist/esm/components/ai/assistant-presentation.js.map +1 -1
- package/dist/esm/components/ai/assistant-switch.js +48 -1
- package/dist/esm/components/ai/assistant-switch.js.map +1 -1
- package/dist/esm/components/ai/bubble.js +117 -1
- package/dist/esm/components/ai/bubble.js.map +1 -1
- package/dist/esm/components/ai/feedback.js +30 -1
- package/dist/esm/components/ai/feedback.js.map +1 -1
- package/dist/esm/components/ai/input-section.js +24 -1
- package/dist/esm/components/ai/input-section.js.map +1 -1
- package/dist/esm/components/ai/markdown-rendered.js +23 -1
- package/dist/esm/components/ai/markdown-rendered.js.map +1 -1
- package/dist/esm/components/ai/new-session-button.js +19 -1
- package/dist/esm/components/ai/new-session-button.js.map +1 -1
- package/dist/esm/components/ai/typing-bubble.js +21 -1
- package/dist/esm/components/ai/typing-bubble.js.map +1 -1
- package/dist/esm/components/ai/typing-sequence.js +81 -1
- package/dist/esm/components/ai/typing-sequence.js.map +1 -1
- package/dist/esm/components/avatar.js +94 -1
- package/dist/esm/components/avatar.js.map +1 -1
- package/dist/esm/components/badge.js +83 -1
- package/dist/esm/components/badge.js.map +1 -1
- package/dist/esm/components/breadcrumb.js +39 -1
- package/dist/esm/components/breadcrumb.js.map +1 -1
- package/dist/esm/components/button-group.js +28 -1
- package/dist/esm/components/button-group.js.map +1 -1
- package/dist/esm/components/button.js +296 -1
- package/dist/esm/components/button.js.map +1 -1
- package/dist/esm/components/callout.js +86 -1
- package/dist/esm/components/callout.js.map +1 -1
- package/dist/esm/components/card.js +272 -1
- package/dist/esm/components/card.js.map +1 -1
- package/dist/esm/components/checkbox.js +131 -1
- package/dist/esm/components/checkbox.js.map +1 -1
- package/dist/esm/components/chip.js +40 -1
- package/dist/esm/components/chip.js.map +1 -1
- package/dist/esm/components/code.js +12 -1
- package/dist/esm/components/code.js.map +1 -1
- package/dist/esm/components/combobox.js +92 -1
- package/dist/esm/components/combobox.js.map +1 -1
- package/dist/esm/components/cookie-consent.js +44 -1
- package/dist/esm/components/cookie-consent.js.map +1 -1
- package/dist/esm/components/dialog.js +72 -1
- package/dist/esm/components/dialog.js.map +1 -1
- package/dist/esm/components/divider.js +53 -1
- package/dist/esm/components/divider.js.map +1 -1
- package/dist/esm/components/dot.js +105 -1
- package/dist/esm/components/dot.js.map +1 -1
- package/dist/esm/components/file-upload.js +220 -1
- package/dist/esm/components/file-upload.js.map +1 -1
- package/dist/esm/components/filter.js +17 -1
- package/dist/esm/components/filter.js.map +1 -1
- package/dist/esm/components/footer.js +34 -1
- package/dist/esm/components/footer.js.map +1 -1
- package/dist/esm/components/forms.js +27 -1
- package/dist/esm/components/forms.js.map +1 -1
- package/dist/esm/components/header.js +31 -1
- package/dist/esm/components/header.js.map +1 -1
- package/dist/esm/components/icon.js +107 -1
- package/dist/esm/components/icon.js.map +1 -1
- package/dist/esm/components/input.js +292 -1
- package/dist/esm/components/input.js.map +1 -1
- package/dist/esm/components/kbd.js +10 -1
- package/dist/esm/components/kbd.js.map +1 -1
- package/dist/esm/components/label.js +86 -1
- package/dist/esm/components/label.js.map +1 -1
- package/dist/esm/components/link.js +52 -1
- package/dist/esm/components/link.js.map +1 -1
- package/dist/esm/components/list.js +56 -1
- package/dist/esm/components/list.js.map +1 -1
- package/dist/esm/components/logo.js +51 -1
- package/dist/esm/components/logo.js.map +1 -1
- package/dist/esm/components/menu-vertical.js +241 -1
- package/dist/esm/components/menu-vertical.js.map +1 -1
- package/dist/esm/components/menubar.js +94 -1
- package/dist/esm/components/menubar.js.map +1 -1
- package/dist/esm/components/modal.js +51 -1
- package/dist/esm/components/modal.js.map +1 -1
- package/dist/esm/components/pagination.js +104 -1
- package/dist/esm/components/pagination.js.map +1 -1
- package/dist/esm/components/popup-menu.js +143 -1
- package/dist/esm/components/popup-menu.js.map +1 -1
- package/dist/esm/components/progress-bar.js +72 -1
- package/dist/esm/components/progress-bar.js.map +1 -1
- package/dist/esm/components/progress-stepper.js +73 -1
- package/dist/esm/components/progress-stepper.js.map +1 -1
- package/dist/esm/components/radio.js +133 -1
- package/dist/esm/components/radio.js.map +1 -1
- package/dist/esm/components/search-field.js +38 -1
- package/dist/esm/components/search-field.js.map +1 -1
- package/dist/esm/components/select.js +257 -1
- package/dist/esm/components/select.js.map +1 -1
- package/dist/esm/components/snackbar.js +33 -1
- package/dist/esm/components/snackbar.js.map +1 -1
- package/dist/esm/components/spinner.js +72 -1
- package/dist/esm/components/spinner.js.map +1 -1
- package/dist/esm/components/switch.js +83 -1
- package/dist/esm/components/switch.js.map +1 -1
- package/dist/esm/components/table.js +298 -1
- package/dist/esm/components/table.js.map +1 -1
- package/dist/esm/components/tabs.js +118 -1
- package/dist/esm/components/tabs.js.map +1 -1
- package/dist/esm/components/tooltip.js +61 -1
- package/dist/esm/components/tooltip.js.map +1 -1
- package/dist/esm/components/user-menu.js +17 -1
- package/dist/esm/components/user-menu.js.map +1 -1
- package/dist/esm/components.js +407 -1
- package/dist/esm/components.js.map +1 -1
- package/dist/esm/data-plugin.js +52 -1
- package/dist/esm/data-plugin.js.map +1 -1
- package/dist/esm/fonts.js +9 -1
- package/dist/esm/fonts.js.map +1 -1
- package/dist/esm/index.js +7 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugin.js +121 -1
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/preset.js +109 -1
- package/dist/esm/preset.js.map +1 -1
- package/dist/esm/theme.js +195 -1
- package/dist/esm/theme.js.map +1 -1
- package/dist/esm/units.js +406 -1
- package/dist/esm/units.js.map +1 -1
- package/dist/esm/with-opacity.js +9 -1
- package/dist/esm/with-opacity.js.map +1 -1
- package/dist/types/components/checkbox.d.ts +19 -3
- package/dist/types/components/input.d.ts +12 -0
- package/dist/types/components/radio.d.ts +8 -0
- package/dist/types/components/select.d.ts +7 -0
- package/package.json +10 -8
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import preset from './preset';\nimport plugin from './plugin';\nimport { AriaAttributes } from './aria-plugin';\nimport { DataAttributes } from './data-plugin';\n\nexport { preset, plugin, DataAttributes, AriaAttributes };\nexport default plugin;\n"],"names":["AriaAttributes","DataAttributes","plugin","preset"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import preset from './preset';\nimport plugin from './plugin';\nimport { AriaAttributes } from './aria-plugin';\nimport { DataAttributes } from './data-plugin';\n\nexport { preset, plugin, DataAttributes, AriaAttributes };\nexport default plugin;\n"],"names":["AriaAttributes","DataAttributes","plugin","preset"],"mappings":";;;;;;;;;;;IAKyCA,cAAc;eAAdA,0BAAc;;IAA9BC,cAAc;eAAdA,0BAAc;;IACvC,OAAsB;eAAtB;;IADiBC,MAAM;eAANA,eAAM;;IAAdC,MAAM;eAANA,eAAM;;;6DALI;6DACA;0BACY;0BACA;;;;;;IAG/B,WAAeD,eAAM"}
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -1,2 +1,145 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
default: function() {
|
|
13
|
+
return _default;
|
|
14
|
+
},
|
|
15
|
+
pluginDefaults: function() {
|
|
16
|
+
return pluginDefaults;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _plugin = /*#__PURE__*/ _interop_require_default(require("tailwindcss/plugin"));
|
|
20
|
+
var _base = require("./base");
|
|
21
|
+
var _theme = require("./theme");
|
|
22
|
+
var _components = require("./components");
|
|
23
|
+
function _array_like_to_array(arr, len) {
|
|
24
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
25
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
26
|
+
return arr2;
|
|
27
|
+
}
|
|
28
|
+
function _array_without_holes(arr) {
|
|
29
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
30
|
+
}
|
|
31
|
+
function _define_property(obj, key, value) {
|
|
32
|
+
if (key in obj) {
|
|
33
|
+
Object.defineProperty(obj, key, {
|
|
34
|
+
value: value,
|
|
35
|
+
enumerable: true,
|
|
36
|
+
configurable: true,
|
|
37
|
+
writable: true
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
obj[key] = value;
|
|
41
|
+
}
|
|
42
|
+
return obj;
|
|
43
|
+
}
|
|
44
|
+
function _interop_require_default(obj) {
|
|
45
|
+
return obj && obj.__esModule ? obj : {
|
|
46
|
+
default: obj
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function _iterable_to_array(iter) {
|
|
50
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
51
|
+
}
|
|
52
|
+
function _non_iterable_spread() {
|
|
53
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
54
|
+
}
|
|
55
|
+
function _object_spread(target) {
|
|
56
|
+
for(var i = 1; i < arguments.length; i++){
|
|
57
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
58
|
+
var ownKeys = Object.keys(source);
|
|
59
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
60
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
61
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
ownKeys.forEach(function(key) {
|
|
65
|
+
_define_property(target, key, source[key]);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return target;
|
|
69
|
+
}
|
|
70
|
+
function _to_consumable_array(arr) {
|
|
71
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
72
|
+
}
|
|
73
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
74
|
+
if (!o) return;
|
|
75
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
76
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
77
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
78
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
79
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
80
|
+
}
|
|
81
|
+
var pluginDefaults = {
|
|
82
|
+
cssBase: true,
|
|
83
|
+
colors: []
|
|
84
|
+
};
|
|
85
|
+
var defaultColors = [
|
|
86
|
+
'warning',
|
|
87
|
+
'error',
|
|
88
|
+
'success',
|
|
89
|
+
'info',
|
|
90
|
+
'vattjom',
|
|
91
|
+
'juniskar',
|
|
92
|
+
'bjornstigen',
|
|
93
|
+
'gronsta'
|
|
94
|
+
];
|
|
95
|
+
var getComponentWithDependencies = function(compName) {
|
|
96
|
+
var compWithDeps = _components.components.find(function(comp) {
|
|
97
|
+
return comp.comp.name === compName;
|
|
98
|
+
});
|
|
99
|
+
if (!compWithDeps) return [];
|
|
100
|
+
var comps = [
|
|
101
|
+
compWithDeps.comp
|
|
102
|
+
];
|
|
103
|
+
if (compWithDeps === null || compWithDeps === void 0 ? void 0 : compWithDeps.deps) {
|
|
104
|
+
for(var index = 0; index < (compWithDeps === null || compWithDeps === void 0 ? void 0 : compWithDeps.deps.length); index++){
|
|
105
|
+
comps = _to_consumable_array(getComponentWithDependencies(compWithDeps.deps[index].name)).concat(_to_consumable_array(comps));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return comps;
|
|
109
|
+
};
|
|
110
|
+
var plugin = _plugin.default.withOptions(function(_options) {
|
|
111
|
+
var options = _object_spread({}, pluginDefaults, _options);
|
|
112
|
+
var pickedComponents = _components.components.reduce(function(comps, compWithDeps) {
|
|
113
|
+
if ((options === null || options === void 0 ? void 0 : options.components) && !options.components.includes(compWithDeps.comp.name)) {
|
|
114
|
+
return comps;
|
|
115
|
+
}
|
|
116
|
+
var deps = [];
|
|
117
|
+
if (compWithDeps === null || compWithDeps === void 0 ? void 0 : compWithDeps.deps) {
|
|
118
|
+
for(var index = 0; index < compWithDeps.deps.length; index++){
|
|
119
|
+
deps = _to_consumable_array(getComponentWithDependencies(compWithDeps.deps[index].name)).concat(_to_consumable_array(deps));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return _to_consumable_array(comps).concat(_to_consumable_array(deps), [
|
|
123
|
+
compWithDeps.comp
|
|
124
|
+
]);
|
|
125
|
+
}, []).filter(function(val, index, arr) {
|
|
126
|
+
return arr.indexOf(val) === index;
|
|
127
|
+
});
|
|
128
|
+
return function(param) {
|
|
129
|
+
var addComponents = param.addComponents, addBase = param.addBase, theme = param.theme;
|
|
130
|
+
var optionColors = _to_consumable_array(defaultColors).concat(_to_consumable_array(options.colors || []));
|
|
131
|
+
if (options.cssBase) {
|
|
132
|
+
addBase(_base.base);
|
|
133
|
+
}
|
|
134
|
+
addComponents(pickedComponents.map(function(component) {
|
|
135
|
+
return component(optionColors, theme);
|
|
136
|
+
}));
|
|
137
|
+
};
|
|
138
|
+
}, function() {
|
|
139
|
+
return {
|
|
140
|
+
theme: _theme.theme
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
var _default = plugin;
|
|
144
|
+
|
|
2
145
|
//# sourceMappingURL=plugin.js.map
|
package/dist/cjs/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugin.ts"],"sourcesContent":["import TailwindPlugin from 'tailwindcss/plugin';\nimport { base } from './base';\nimport { theme } from './theme';\nimport { Component, components } from './components';\nimport { PluginAPI } from 'tailwindcss/types/config';\n\nexport interface PluginOptions {\n colors?: string[];\n cssBase?: boolean;\n components?: string[];\n}\n\nexport const pluginDefaults = { cssBase: true, colors: [] };\n\nconst defaultColors = ['warning', 'error', 'success', 'info', 'vattjom', 'juniskar', 'bjornstigen', 'gronsta'];\n\nconst getComponentWithDependencies = (compName: string): Component[] => {\n const compWithDeps = components.find((comp) => comp.comp.name === compName);\n if (!compWithDeps) return [];\n\n let comps: Component[] = [compWithDeps.comp];\n if (compWithDeps?.deps) {\n for (let index = 0; index < compWithDeps?.deps.length; index++) {\n comps = [...getComponentWithDependencies(compWithDeps.deps[index].name), ...comps];\n }\n }\n\n return comps;\n};\n\nconst plugin = TailwindPlugin.withOptions<PluginOptions>(\n function (_options) {\n const options = { ...pluginDefaults, ..._options };\n\n const pickedComponents = components\n .reduce((comps: Component[], compWithDeps) => {\n if (options?.components && !options.components.includes(compWithDeps.comp.name)) {\n return comps;\n }\n\n let deps: Component[] = [];\n if (compWithDeps?.deps) {\n for (let index = 0; index < compWithDeps.deps.length; index++) {\n deps = [...getComponentWithDependencies(compWithDeps.deps[index].name), ...deps];\n }\n }\n\n return [...comps, ...deps, compWithDeps.comp];\n }, [])\n .filter((val, index, arr) => arr.indexOf(val) === index);\n\n return function ({ addComponents, addBase, theme }: PluginAPI) {\n const optionColors = [...defaultColors, ...(options.colors || [])];\n\n if (options.cssBase) {\n addBase(base);\n }\n\n addComponents(pickedComponents.map((component) => component(optionColors, theme)));\n };\n },\n function () {\n return {\n theme: theme,\n };\n }\n);\n\nexport default plugin;\n"],"names":["pluginDefaults","cssBase","colors","defaultColors","getComponentWithDependencies","compName","compWithDeps","components","find","comp","name","comps","deps","index","length","plugin","TailwindPlugin","withOptions","_options","options","pickedComponents","reduce","includes","filter","val","arr","indexOf","addComponents","addBase","theme","optionColors","base","map","component"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/plugin.ts"],"sourcesContent":["import TailwindPlugin from 'tailwindcss/plugin';\nimport { base } from './base';\nimport { theme } from './theme';\nimport { Component, components } from './components';\nimport { PluginAPI } from 'tailwindcss/types/config';\n\nexport interface PluginOptions {\n colors?: string[];\n cssBase?: boolean;\n components?: string[];\n}\n\nexport const pluginDefaults = { cssBase: true, colors: [] };\n\nconst defaultColors = ['warning', 'error', 'success', 'info', 'vattjom', 'juniskar', 'bjornstigen', 'gronsta'];\n\nconst getComponentWithDependencies = (compName: string): Component[] => {\n const compWithDeps = components.find((comp) => comp.comp.name === compName);\n if (!compWithDeps) return [];\n\n let comps: Component[] = [compWithDeps.comp];\n if (compWithDeps?.deps) {\n for (let index = 0; index < compWithDeps?.deps.length; index++) {\n comps = [...getComponentWithDependencies(compWithDeps.deps[index].name), ...comps];\n }\n }\n\n return comps;\n};\n\nconst plugin = TailwindPlugin.withOptions<PluginOptions>(\n function (_options) {\n const options = { ...pluginDefaults, ..._options };\n\n const pickedComponents = components\n .reduce((comps: Component[], compWithDeps) => {\n if (options?.components && !options.components.includes(compWithDeps.comp.name)) {\n return comps;\n }\n\n let deps: Component[] = [];\n if (compWithDeps?.deps) {\n for (let index = 0; index < compWithDeps.deps.length; index++) {\n deps = [...getComponentWithDependencies(compWithDeps.deps[index].name), ...deps];\n }\n }\n\n return [...comps, ...deps, compWithDeps.comp];\n }, [])\n .filter((val, index, arr) => arr.indexOf(val) === index);\n\n return function ({ addComponents, addBase, theme }: PluginAPI) {\n const optionColors = [...defaultColors, ...(options.colors || [])];\n\n if (options.cssBase) {\n addBase(base);\n }\n\n addComponents(pickedComponents.map((component) => component(optionColors, theme)));\n };\n },\n function () {\n return {\n theme: theme,\n };\n }\n);\n\nexport default plugin;\n"],"names":["pluginDefaults","cssBase","colors","defaultColors","getComponentWithDependencies","compName","compWithDeps","components","find","comp","name","comps","deps","index","length","plugin","TailwindPlugin","withOptions","_options","options","pickedComponents","reduce","includes","filter","val","arr","indexOf","addComponents","addBase","theme","optionColors","base","map","component"],"mappings":";;;;;;;;;;;IAoEA,OAAsB;eAAtB;;IAxDaA,cAAc;eAAdA;;;6DAZc;oBACN;qBACC;0BACgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAS/B,IAAMA,iBAAiB;IAAEC,SAAS;IAAMC,QAAQ,EAAE;AAAC;AAE1D,IAAMC,gBAAgB;IAAC;IAAW;IAAS;IAAW;IAAQ;IAAW;IAAY;IAAe;CAAU;AAE9G,IAAMC,+BAA+B,SAACC;IACpC,IAAMC,eAAeC,sBAAU,CAACC,IAAI,CAAC,SAACC;eAASA,KAAKA,IAAI,CAACC,IAAI,KAAKL;;IAClE,IAAI,CAACC,cAAc,OAAO,EAAE;IAE5B,IAAIK,QAAqB;QAACL,aAAaG,IAAI;KAAC;IAC5C,IAAIH,yBAAAA,mCAAAA,aAAcM,IAAI,EAAE;QACtB,IAAK,IAAIC,QAAQ,GAAGA,SAAQP,yBAAAA,mCAAAA,aAAcM,IAAI,CAACE,MAAM,GAAED,QAAS;YAC9DF,QAAQ,AAAC,qBAAGP,6BAA6BE,aAAaM,IAAI,CAACC,MAAM,CAACH,IAAI,UAAG,qBAAGC;QAC9E;IACF;IAEA,OAAOA;AACT;AAEA,IAAMI,SAASC,eAAc,CAACC,WAAW,CACvC,SAAUC,QAAQ;IAChB,IAAMC,UAAU,mBAAKnB,gBAAmBkB;IAExC,IAAME,mBAAmBb,sBAAU,CAChCc,MAAM,CAAC,SAACV,OAAoBL;QAC3B,IAAIa,CAAAA,oBAAAA,8BAAAA,QAASZ,UAAU,KAAI,CAACY,QAAQZ,UAAU,CAACe,QAAQ,CAAChB,aAAaG,IAAI,CAACC,IAAI,GAAG;YAC/E,OAAOC;QACT;QAEA,IAAIC,OAAoB,EAAE;QAC1B,IAAIN,yBAAAA,mCAAAA,aAAcM,IAAI,EAAE;YACtB,IAAK,IAAIC,QAAQ,GAAGA,QAAQP,aAAaM,IAAI,CAACE,MAAM,EAAED,QAAS;gBAC7DD,OAAO,AAAC,qBAAGR,6BAA6BE,aAAaM,IAAI,CAACC,MAAM,CAACH,IAAI,UAAG,qBAAGE;YAC7E;QACF;QAEA,OAAO,AAAC,qBAAGD,cAAO,qBAAGC,OAAd;YAAoBN,aAAaG,IAAI;SAAC;IAC/C,GAAG,EAAE,EACJc,MAAM,CAAC,SAACC,KAAKX,OAAOY;eAAQA,IAAIC,OAAO,CAACF,SAASX;;IAEpD,OAAO,SAAU,KAA4C;YAA1Cc,gBAAF,MAAEA,eAAeC,UAAjB,MAAiBA,SAASC,QAA1B,MAA0BA;QACzC,IAAMC,eAAe,AAAC,qBAAG3B,sBAAe,qBAAIgB,QAAQjB,MAAM,IAAI,EAAE;QAEhE,IAAIiB,QAAQlB,OAAO,EAAE;YACnB2B,QAAQG,UAAI;QACd;QAEAJ,cAAcP,iBAAiBY,GAAG,CAAC,SAACC;mBAAcA,UAAUH,cAAcD;;IAC5E;AACF,GACA;IACE,OAAO;QACLA,OAAOA,YAAK;IACd;AACF;IAGF,WAAed"}
|
package/dist/cjs/preset.js
CHANGED
|
@@ -1,2 +1,165 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "default", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _forms = /*#__PURE__*/ _interop_require_default(require("@tailwindcss/forms"));
|
|
12
|
+
var _containerqueries = /*#__PURE__*/ _interop_require_default(require("@tailwindcss/container-queries"));
|
|
13
|
+
var _plugin = /*#__PURE__*/ _interop_require_wildcard(require("./plugin"));
|
|
14
|
+
var _dataplugin = require("./data-plugin");
|
|
15
|
+
var _ariaplugin = require("./aria-plugin");
|
|
16
|
+
function _array_like_to_array(arr, len) {
|
|
17
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
18
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
19
|
+
return arr2;
|
|
20
|
+
}
|
|
21
|
+
function _array_without_holes(arr) {
|
|
22
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
23
|
+
}
|
|
24
|
+
function _define_property(obj, key, value) {
|
|
25
|
+
if (key in obj) {
|
|
26
|
+
Object.defineProperty(obj, key, {
|
|
27
|
+
value: value,
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
obj[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return obj;
|
|
36
|
+
}
|
|
37
|
+
function _interop_require_default(obj) {
|
|
38
|
+
return obj && obj.__esModule ? obj : {
|
|
39
|
+
default: obj
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
43
|
+
if (typeof WeakMap !== "function") return null;
|
|
44
|
+
var cacheBabelInterop = new WeakMap();
|
|
45
|
+
var cacheNodeInterop = new WeakMap();
|
|
46
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
47
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
48
|
+
})(nodeInterop);
|
|
49
|
+
}
|
|
50
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
51
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
52
|
+
return obj;
|
|
53
|
+
}
|
|
54
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
55
|
+
return {
|
|
56
|
+
default: obj
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
60
|
+
if (cache && cache.has(obj)) {
|
|
61
|
+
return cache.get(obj);
|
|
62
|
+
}
|
|
63
|
+
var newObj = {
|
|
64
|
+
__proto__: null
|
|
65
|
+
};
|
|
66
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
67
|
+
for(var key in obj){
|
|
68
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
69
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
70
|
+
if (desc && (desc.get || desc.set)) {
|
|
71
|
+
Object.defineProperty(newObj, key, desc);
|
|
72
|
+
} else {
|
|
73
|
+
newObj[key] = obj[key];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
newObj.default = obj;
|
|
78
|
+
if (cache) {
|
|
79
|
+
cache.set(obj, newObj);
|
|
80
|
+
}
|
|
81
|
+
return newObj;
|
|
82
|
+
}
|
|
83
|
+
function _iterable_to_array(iter) {
|
|
84
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
85
|
+
}
|
|
86
|
+
function _non_iterable_spread() {
|
|
87
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
88
|
+
}
|
|
89
|
+
function _object_spread(target) {
|
|
90
|
+
for(var i = 1; i < arguments.length; i++){
|
|
91
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
92
|
+
var ownKeys = Object.keys(source);
|
|
93
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
94
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
95
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
ownKeys.forEach(function(key) {
|
|
99
|
+
_define_property(target, key, source[key]);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return target;
|
|
103
|
+
}
|
|
104
|
+
function ownKeys(object, enumerableOnly) {
|
|
105
|
+
var keys = Object.keys(object);
|
|
106
|
+
if (Object.getOwnPropertySymbols) {
|
|
107
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
108
|
+
if (enumerableOnly) {
|
|
109
|
+
symbols = symbols.filter(function(sym) {
|
|
110
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
keys.push.apply(keys, symbols);
|
|
114
|
+
}
|
|
115
|
+
return keys;
|
|
116
|
+
}
|
|
117
|
+
function _object_spread_props(target, source) {
|
|
118
|
+
source = source != null ? source : {};
|
|
119
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
120
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
121
|
+
} else {
|
|
122
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
123
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return target;
|
|
127
|
+
}
|
|
128
|
+
function _to_consumable_array(arr) {
|
|
129
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
130
|
+
}
|
|
131
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
132
|
+
if (!o) return;
|
|
133
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
134
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
135
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
136
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
137
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
138
|
+
}
|
|
139
|
+
var preset = function preset(_options) {
|
|
140
|
+
var defaults = {
|
|
141
|
+
tailwindForms: true,
|
|
142
|
+
tailwindContainers: true,
|
|
143
|
+
dataAttributes: true,
|
|
144
|
+
ariaAttributes: true
|
|
145
|
+
};
|
|
146
|
+
var options = _object_spread_props(_object_spread({}, defaults, _options), {
|
|
147
|
+
plugin: _object_spread({}, _plugin.pluginDefaults, (_options === null || _options === void 0 ? void 0 : _options.plugin) || {})
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
plugins: _to_consumable_array(options.tailwindForms ? [
|
|
151
|
+
(0, _forms.default)()
|
|
152
|
+
] : []).concat(_to_consumable_array(options.tailwindContainers ? [
|
|
153
|
+
_containerqueries.default
|
|
154
|
+
] : []), _to_consumable_array(options.dataAttributes ? [
|
|
155
|
+
_dataplugin.DataAttributes
|
|
156
|
+
] : []), _to_consumable_array(options.ariaAttributes ? [
|
|
157
|
+
_ariaplugin.AriaAttributes
|
|
158
|
+
] : []), [
|
|
159
|
+
(0, _plugin.default)(options === null || options === void 0 ? void 0 : options.plugin)
|
|
160
|
+
])
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
var _default = preset;
|
|
164
|
+
|
|
2
165
|
//# sourceMappingURL=preset.js.map
|
package/dist/cjs/preset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/preset.ts"],"sourcesContent":["import tailwindForms from '@tailwindcss/forms';\r\nimport tailwindContainerQueries from '@tailwindcss/container-queries';\r\nimport plugin from './plugin';\r\nimport { type PluginOptions, pluginDefaults } from './plugin';\r\nimport { DataAttributes } from './data-plugin';\r\nimport { AriaAttributes } from './aria-plugin';\r\n\r\ninterface PresetOptions {\r\n tailwindForms?: boolean;\r\n tailwindContainers?: boolean;\r\n dataAttributes?: boolean;\r\n ariaAttributes?: boolean;\r\n plugin?: PluginOptions;\r\n}\r\n\r\nconst preset = function (_options?: PresetOptions) {\r\n const defaults: PresetOptions = {\r\n tailwindForms: true,\r\n tailwindContainers: true,\r\n dataAttributes: true,\r\n ariaAttributes: true,\r\n };\r\n\r\n const options = {\r\n ...defaults,\r\n ..._options,\r\n plugin: { ...pluginDefaults, ...(_options?.plugin || {}) },\r\n };\r\n\r\n return {\r\n plugins: [\r\n ...(options.tailwindForms ? [tailwindForms()] : []),\r\n ...(options.tailwindContainers ? [tailwindContainerQueries] : []),\r\n ...(options.dataAttributes ? [DataAttributes] : []),\r\n ...(options.ariaAttributes ? [AriaAttributes] : []),\r\n plugin(options?.plugin),\r\n ],\r\n };\r\n};\r\nexport default preset;\r\n"],"names":["preset","_options","defaults","tailwindForms","tailwindContainers","dataAttributes","ariaAttributes","options","plugin","pluginDefaults","plugins","tailwindContainerQueries","DataAttributes","AriaAttributes"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/preset.ts"],"sourcesContent":["import tailwindForms from '@tailwindcss/forms';\r\nimport tailwindContainerQueries from '@tailwindcss/container-queries';\r\nimport plugin from './plugin';\r\nimport { type PluginOptions, pluginDefaults } from './plugin';\r\nimport { DataAttributes } from './data-plugin';\r\nimport { AriaAttributes } from './aria-plugin';\r\n\r\ninterface PresetOptions {\r\n tailwindForms?: boolean;\r\n tailwindContainers?: boolean;\r\n dataAttributes?: boolean;\r\n ariaAttributes?: boolean;\r\n plugin?: PluginOptions;\r\n}\r\n\r\nconst preset = function (_options?: PresetOptions) {\r\n const defaults: PresetOptions = {\r\n tailwindForms: true,\r\n tailwindContainers: true,\r\n dataAttributes: true,\r\n ariaAttributes: true,\r\n };\r\n\r\n const options = {\r\n ...defaults,\r\n ..._options,\r\n plugin: { ...pluginDefaults, ...(_options?.plugin || {}) },\r\n };\r\n\r\n return {\r\n plugins: [\r\n ...(options.tailwindForms ? [tailwindForms()] : []),\r\n ...(options.tailwindContainers ? [tailwindContainerQueries] : []),\r\n ...(options.dataAttributes ? [DataAttributes] : []),\r\n ...(options.ariaAttributes ? [AriaAttributes] : []),\r\n plugin(options?.plugin),\r\n ],\r\n };\r\n};\r\nexport default preset;\r\n"],"names":["preset","_options","defaults","tailwindForms","tailwindContainers","dataAttributes","ariaAttributes","options","plugin","pluginDefaults","plugins","tailwindContainerQueries","DataAttributes","AriaAttributes"],"mappings":";;;;+BAuCA;;;eAAA;;;4DAvC0B;uEACW;8DAClB;0BAEY;0BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU/B,IAAMA,SAAS,gBAAUC,QAAwB;IAC/C,IAAMC,WAA0B;QAC9BC,eAAe;QACfC,oBAAoB;QACpBC,gBAAgB;QAChBC,gBAAgB;IAClB;IAEA,IAAMC,UAAU,wCACXL,UACAD;QACHO,QAAQ,mBAAKC,sBAAc,EAAMR,CAAAA,qBAAAA,+BAAAA,SAAUO,MAAM,KAAI,CAAC;;IAGxD,OAAO;QACLE,SAAS,AACP,qBAAIH,QAAQJ,aAAa,GAAG;YAACA,IAAAA,cAAa;SAAG,GAAG,EAAE,SAClD,qBAAII,QAAQH,kBAAkB,GAAG;YAACO,yBAAwB;SAAC,GAAG,EAAE,GAChE,qBAAIJ,QAAQF,cAAc,GAAG;YAACO,0BAAc;SAAC,GAAG,EAAE,GAClD,qBAAIL,QAAQD,cAAc,GAAG;YAACO,0BAAc;SAAC,GAAG,EAAE,GAJ3C;YAKPL,IAAAA,eAAM,EAACD,oBAAAA,8BAAAA,QAASC,MAAM;SACvB;IACH;AACF;IACA,WAAeR"}
|
package/dist/cjs/theme.js
CHANGED
|
@@ -1,2 +1,210 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "theme", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return theme;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _withopacity = /*#__PURE__*/ _interop_require_default(require("./with-opacity"));
|
|
12
|
+
var _colors = require("./colors");
|
|
13
|
+
var _units = require("./units");
|
|
14
|
+
var _theme = require("@sk-web-gui/theme");
|
|
15
|
+
var _fonts = require("./fonts");
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
17
|
+
if (key in obj) {
|
|
18
|
+
Object.defineProperty(obj, key, {
|
|
19
|
+
value: value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
obj[key] = value;
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
function _interop_require_default(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function _object_spread(target) {
|
|
35
|
+
for(var i = 1; i < arguments.length; i++){
|
|
36
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
37
|
+
var ownKeys = Object.keys(source);
|
|
38
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
39
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
40
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
ownKeys.forEach(function(key) {
|
|
44
|
+
_define_property(target, key, source[key]);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return target;
|
|
48
|
+
}
|
|
49
|
+
function ownKeys(object, enumerableOnly) {
|
|
50
|
+
var keys = Object.keys(object);
|
|
51
|
+
if (Object.getOwnPropertySymbols) {
|
|
52
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
53
|
+
if (enumerableOnly) {
|
|
54
|
+
symbols = symbols.filter(function(sym) {
|
|
55
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
keys.push.apply(keys, symbols);
|
|
59
|
+
}
|
|
60
|
+
return keys;
|
|
61
|
+
}
|
|
62
|
+
function _object_spread_props(target, source) {
|
|
63
|
+
source = source != null ? source : {};
|
|
64
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
65
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
66
|
+
} else {
|
|
67
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
68
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
|
+
var theme = {
|
|
74
|
+
extend: {
|
|
75
|
+
containers: Object.keys(_theme.screens).reduce(function(containers, screenKey, index) {
|
|
76
|
+
return _object_spread_props(_object_spread({}, containers), _define_property({}, "screen-".concat(screenKey), Object.values(_theme.screens)[index]));
|
|
77
|
+
}, {}),
|
|
78
|
+
fontSize: _object_spread_props(_object_spread({}, _units.units.fontSizes), {
|
|
79
|
+
tiny: 'var(--sk-spacing-10)',
|
|
80
|
+
xs: 'var(--sk-spacing-12)',
|
|
81
|
+
xl: _units.units.fontSizes['h4'],
|
|
82
|
+
'2xl': _units.units.fontSizes['h3'],
|
|
83
|
+
'3xl': _units.units.fontSizes['h2'],
|
|
84
|
+
'4xl': _units.units.fontSizes['h1'],
|
|
85
|
+
'5xl': _units.units.fontSizes['h3']
|
|
86
|
+
}),
|
|
87
|
+
fontFamily: _object_spread({}, _fonts.fonts),
|
|
88
|
+
screens: _theme.screens,
|
|
89
|
+
borderRadius: _object_spread_props(_object_spread({}, _units.units.radius), {
|
|
90
|
+
base: 'var(--sk-spacing-0)'
|
|
91
|
+
}),
|
|
92
|
+
backgroundPosition: _object_spread({}, Object.keys(_units.units.spacing).reduce(function(positions, spaceKey) {
|
|
93
|
+
var _obj;
|
|
94
|
+
return _object_spread_props(_object_spread({}, positions), (_obj = {}, _define_property(_obj, "top-".concat(spaceKey), "center top ".concat(_units.units.spacing[spaceKey])), _define_property(_obj, "right-".concat(spaceKey), "center right ".concat(_units.units.spacing[spaceKey])), _define_property(_obj, "bottom-".concat(spaceKey), "center bottom ".concat(_units.units.spacing[spaceKey])), _define_property(_obj, "left-".concat(spaceKey), "center left ".concat(_units.units.spacing[spaceKey])), _obj));
|
|
95
|
+
}, {})),
|
|
96
|
+
boxShadow: {
|
|
97
|
+
'50': "\n 0 0 3px 0 rgba(10, 12, 15, 0.08),\n 0 1px 8px 0 rgba(10, 12, 15, 0.13)\n ",
|
|
98
|
+
'100': "\n 0 6px 16px 0 rgba(13,13,14, 0.07),\n 0 1.81px 12px 0 rgba(13,13,14, 0.15),\n 0 0.75px 2px 0 rgba(13,13,14, 0.085),\n 0 0.27px 0.72px 0 rgba(13,13,14, 0.0583)\n ",
|
|
99
|
+
'200': "\n 0 0 2px 0 rgba(13,13,14, 0.15),\n 0 15px 27px 0 rgba(13,13,14, 0.1),\n 0 4.52px 8.14px 0 rgba(13,13,14, 0.06),\n 0 1.88px 3.38px 0 rgba(13,13,14, 0.03),\n 0 0.68px 1.22px 0 rgba(13,13,14, 0.02)\n ",
|
|
100
|
+
insetring: "0 0 0 0.25rem ".concat(_colors.colors.ring, " inset")
|
|
101
|
+
},
|
|
102
|
+
ringColor: _object_spread({
|
|
103
|
+
DEFAULT: _colors.colors.ring
|
|
104
|
+
}, _colors.colors),
|
|
105
|
+
ringOffsetWidth: _object_spread({
|
|
106
|
+
DEFAULT: 'var(--sk-spacing-2)'
|
|
107
|
+
}, _units.units.spacing),
|
|
108
|
+
ringWidth: {
|
|
109
|
+
DEFAULT: 'var(--sk-spacing-3)',
|
|
110
|
+
0: '0px'
|
|
111
|
+
},
|
|
112
|
+
ringOpacity: {
|
|
113
|
+
DEFAULT: '1'
|
|
114
|
+
},
|
|
115
|
+
colors: _object_spread_props(_object_spread({}, _colors.colors), {
|
|
116
|
+
current: 'currentColor',
|
|
117
|
+
gray: _object_spread({
|
|
118
|
+
DEFAULT: _colors.colors.primitives.gray[600],
|
|
119
|
+
stroke: _colors.colors.divider,
|
|
120
|
+
middle: _colors.colors.primitives.gray[600],
|
|
121
|
+
light: _colors.colors.primitives.gray[300],
|
|
122
|
+
lighter: _colors.colors.primitives.gray[200]
|
|
123
|
+
}, _colors.colors.primitives.gray),
|
|
124
|
+
hover: _colors.colors.primitives.gray[600],
|
|
125
|
+
background: _object_spread_props(_object_spread({}, _colors.colors.background), {
|
|
126
|
+
one: _colors.colors.background[100],
|
|
127
|
+
two: _colors.colors.background[200]
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
cursor: {
|
|
131
|
+
base: 'var(--tw-cursor)'
|
|
132
|
+
},
|
|
133
|
+
spacing: _object_spread_props(_object_spread({}, _units.units.spacing, Object.keys(_units.units.spacing).reduce(function(smallerSpacings, spacingkey) {
|
|
134
|
+
var _obj;
|
|
135
|
+
return _object_spread_props(_object_spread({}, smallerSpacings), (_obj = {}, _define_property(_obj, "".concat(spacingkey, "-1"), "calc(".concat(_units.units.spacing[spacingkey], " - var(--sk-spacing-1))")), _define_property(_obj, "".concat(spacingkey, "-2"), "calc(".concat(_units.units.spacing[spacingkey], " - var(--sk-spacing-2))")), _define_property(_obj, "".concat(spacingkey, "+1"), "calc(".concat(_units.units.spacing[spacingkey], " + var(--sk-spacing-1))")), _define_property(_obj, "".concat(spacingkey, "+2"), "calc(".concat(_units.units.spacing[spacingkey], " + var(--sk-spacing-2))")), _obj));
|
|
136
|
+
}, {})), {
|
|
137
|
+
xs: _units.units.spacing[4],
|
|
138
|
+
sm: _units.units.spacing[8],
|
|
139
|
+
md: _units.units.spacing[16],
|
|
140
|
+
lg: _units.units.spacing[24],
|
|
141
|
+
xl: _units.units.spacing[48]
|
|
142
|
+
}),
|
|
143
|
+
maxWidth: {
|
|
144
|
+
content: _theme.screens['desktop-max']
|
|
145
|
+
},
|
|
146
|
+
lineHeight: _object_spread_props(_object_spread({}, _units.units.lineHeights, _units.units.spacing), {
|
|
147
|
+
xs: 'var(-sk-spacing-16)',
|
|
148
|
+
xl: _units.units.lineHeights['h4'],
|
|
149
|
+
'2xl': _units.units.lineHeights['h3'],
|
|
150
|
+
'3xl': _units.units.lineHeights['h2'],
|
|
151
|
+
'4xl': _units.units.lineHeights['h1'],
|
|
152
|
+
'5xl': _units.units.lineHeights['display-3']
|
|
153
|
+
}),
|
|
154
|
+
opacity: {
|
|
155
|
+
'15': '0.15'
|
|
156
|
+
},
|
|
157
|
+
borderWidth: _object_spread({
|
|
158
|
+
DEFAULT: 'var(--sk-spacing-2)'
|
|
159
|
+
}, _units.units.spacing),
|
|
160
|
+
backgroundColor: {
|
|
161
|
+
base: (0, _withopacity.default)('--sk-colors-primary-surface'),
|
|
162
|
+
fill: (0, _withopacity.default)('--sk-colors-bg-fill')
|
|
163
|
+
},
|
|
164
|
+
textColor: {
|
|
165
|
+
foreground: (0, _withopacity.default)('--sk-colors-primary-DEFAULT'),
|
|
166
|
+
muted: (0, _withopacity.default)('--sk-colors-xt-muted')
|
|
167
|
+
},
|
|
168
|
+
zIndex: {
|
|
169
|
+
hide: '-1',
|
|
170
|
+
none: '0',
|
|
171
|
+
base: '1',
|
|
172
|
+
docked: '10',
|
|
173
|
+
dropdown: '1000',
|
|
174
|
+
sticky: '1100',
|
|
175
|
+
banner: '1200',
|
|
176
|
+
overlay: '1300',
|
|
177
|
+
modal: '1400',
|
|
178
|
+
popover: '1500',
|
|
179
|
+
skipLink: '1600',
|
|
180
|
+
toast: '1700',
|
|
181
|
+
tooltip: '1800'
|
|
182
|
+
},
|
|
183
|
+
keyframes: {
|
|
184
|
+
'reset-overflow': {
|
|
185
|
+
'from, to': {
|
|
186
|
+
overflow: 'hidden'
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
typingbounce: {
|
|
190
|
+
'0%': {
|
|
191
|
+
transform: 'translateY(0)'
|
|
192
|
+
},
|
|
193
|
+
'10%': {
|
|
194
|
+
transform: 'translateY(-0.8rem)'
|
|
195
|
+
},
|
|
196
|
+
'20%, 100%': {
|
|
197
|
+
transform: 'translateY(0rem)'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
animation: {
|
|
202
|
+
'reset-overflow': 'reset-overflow 180ms backwards',
|
|
203
|
+
'typing-bounce-1': 'typingbounce 1.5s ease-in-out 600ms infinite',
|
|
204
|
+
'typing-bounce-2': 'typingbounce 1.5s ease-in-out 800ms infinite',
|
|
205
|
+
'typing-bounce-3': 'typingbounce 1.5s ease-in-out 1s infinite'
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
2
210
|
//# sourceMappingURL=theme.js.map
|