@salla.sa/twilight-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/cjs/index-6ea83d19.js +1619 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/salla-alert_3.cjs.entry.js +171 -0
- package/dist/cjs/salla-modal.cjs.entry.js +52 -0
- package/dist/cjs/twilight-components.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +15 -0
- package/dist/collection/components/alert/alert.css +112 -0
- package/dist/collection/components/alert/alert.js +194 -0
- package/dist/collection/components/generate-summary.js +35 -0
- package/dist/collection/components/modal/modal.css +158 -0
- package/dist/collection/components/modal/modal.js +180 -0
- package/dist/collection/components/salla-login/salla-login.css +104 -0
- package/dist/collection/components/salla-login/salla-login.js +113 -0
- package/dist/collection/components/search-modal/search-modal.css +0 -0
- package/dist/collection/components/search-modal/search-modal.js +126 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/interfaces/colors.js +1 -0
- package/dist/collection/interfaces/index.js +2 -0
- package/dist/collection/interfaces/ratio.js +1 -0
- package/dist/collection/plugins/tailwind-theme/index.js +35 -0
- package/dist/collection/plugins/tailwind-theme/scripts/generator.js +51 -0
- package/dist/collection/utils/utils.js +16 -0
- package/dist/esm/index-3c2b0663.js +1591 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/salla-alert_3.entry.js +165 -0
- package/dist/esm/salla-modal.entry.js +48 -0
- package/dist/esm/twilight-components.js +17 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/twilight-components/index.esm.js +0 -0
- package/dist/twilight-components/p-58168e3c.entry.js +1 -0
- package/dist/twilight-components/p-a2a8cae2.entry.js +1 -0
- package/dist/twilight-components/p-e1773073.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -0
- package/dist/types/components/alert/alert.d.ts +38 -0
- package/dist/types/components/modal/modal.d.ts +28 -0
- package/dist/types/components/salla-login/salla-login.d.ts +14 -0
- package/dist/types/components/search-modal/search-modal.d.ts +22 -0
- package/dist/types/components.d.ts +188 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interfaces/colors.d.ts +1 -0
- package/dist/types/interfaces/index.d.ts +2 -0
- package/dist/types/interfaces/ratio.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1563 -0
- package/dist/types/utils/utils.d.ts +6 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +13 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +66 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const plugin = require('tailwindcss/plugin');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = plugin.withOptions(() => {
|
|
6
|
+
return function({addUtilities}) {
|
|
7
|
+
addUtilities({
|
|
8
|
+
// TODO :: find if there are used and defined them here if its.
|
|
9
|
+
'.anime-item': {},
|
|
10
|
+
'.text-md': {},
|
|
11
|
+
'.items-top': {},
|
|
12
|
+
'.error': {},
|
|
13
|
+
|
|
14
|
+
// wrapper class
|
|
15
|
+
// todo :: rename it with the statnder
|
|
16
|
+
'.results__item': {},
|
|
17
|
+
|
|
18
|
+
'.search-box': {},
|
|
19
|
+
'.spinner-loader-wrap': {}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// todo :: move it to global
|
|
23
|
+
addUtilities({
|
|
24
|
+
'.spinner-loader': {
|
|
25
|
+
'border-right-color': 'var(--main-color) !important',
|
|
26
|
+
'&.reverse': {
|
|
27
|
+
'border-right-color': '#9f7171 !important',
|
|
28
|
+
'background-color': '#f98181'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
addUtilities(JSON.parse(fs.readFileSync(path.resolve(__dirname, 'utilities.json'), 'UTF-8')));
|
|
34
|
+
};
|
|
35
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var fs = require('fs');
|
|
2
|
+
var path = require('path');
|
|
3
|
+
var _ = require('lodash');
|
|
4
|
+
var components = {};
|
|
5
|
+
fs.readdirSync(path.resolve(__dirname, './../'), {withFileTypes: true}).filter(dirent => dirent.isDirectory()).forEach(directory => {
|
|
6
|
+
try {
|
|
7
|
+
components[directory.name] = JSON.parse(fs.readFileSync(path.resolve(__dirname + '/../' + directory.name, 'utilities.json'), 'UTF-8'));
|
|
8
|
+
} catch (e) {
|
|
9
|
+
// ignore
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var utilities = {};
|
|
14
|
+
|
|
15
|
+
for (const [keyComponent, value] of Object.entries(components)) {
|
|
16
|
+
console.log('> Processing ' + keyComponent + ' ...');
|
|
17
|
+
_.forEach(value, function(value, keyUtility) {
|
|
18
|
+
keyUtility = '.s-' + keyComponent + '-' + keyUtility;
|
|
19
|
+
utilities[keyUtility] = {[`@apply ${value}`]: {}};
|
|
20
|
+
});
|
|
21
|
+
console.log('✓ Processed ' + keyComponent + '');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// write the utilities for the plugin
|
|
25
|
+
console.log('> Write utilities ...');
|
|
26
|
+
fs.writeFileSync(
|
|
27
|
+
path.resolve(__dirname, './../utilities.json'),
|
|
28
|
+
JSON.stringify(utilities),
|
|
29
|
+
function(err) {
|
|
30
|
+
if (err) {
|
|
31
|
+
return console.log(err);
|
|
32
|
+
}
|
|
33
|
+
console.log('The file was saved!');
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// write the save list css
|
|
39
|
+
console.log('> Write safe-list-css ...');
|
|
40
|
+
fs.writeFileSync(
|
|
41
|
+
path.resolve(__dirname, './../safe-list-css.txt'),
|
|
42
|
+
Object.keys(utilities).map((name) => name.replace('.','')).join('\n'),
|
|
43
|
+
function(err) {
|
|
44
|
+
if (err) {
|
|
45
|
+
return console.log(err);
|
|
46
|
+
}
|
|
47
|
+
console.log('The file was saved!');
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
console.log('✓ Done ...');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function format(first, middle, last) {
|
|
2
|
+
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
3
|
+
}
|
|
4
|
+
export const toInteger = (value, defaultValue = NaN) => {
|
|
5
|
+
const integer = parseInt(value, 10);
|
|
6
|
+
return isNaN(integer) ? defaultValue : integer;
|
|
7
|
+
};
|
|
8
|
+
export const validateInput = event => {
|
|
9
|
+
const isValid = true;
|
|
10
|
+
const errors = [];
|
|
11
|
+
// check if email or url matched
|
|
12
|
+
if (event.target.validity.typeMismatch) {
|
|
13
|
+
errors.push('mismatched');
|
|
14
|
+
}
|
|
15
|
+
return { isValid, errors };
|
|
16
|
+
};
|