@lukso/web-components 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +62 -112
  2. package/dist/assets/fonts/Apax-Bold.woff2 +0 -0
  3. package/dist/assets/fonts/Apax-Light.woff2 +0 -0
  4. package/dist/assets/fonts/Apax-Medium.woff2 +0 -0
  5. package/dist/assets/fonts/Apax-Regular.woff2 +0 -0
  6. package/dist/assets/fonts/Inter-Bold.woff2 +0 -0
  7. package/dist/assets/fonts/Inter-ExtraBold.woff2 +0 -0
  8. package/dist/assets/fonts/Inter-Medium.woff2 +0 -0
  9. package/dist/assets/fonts/Inter-Regular.woff2 +0 -0
  10. package/dist/assets/fonts/Inter-SemiBold.woff2 +0 -0
  11. package/dist/assets/fonts/Inter-Thin.woff2 +0 -0
  12. package/dist/assets/fonts/PT-Mono-Bold.woff2 +0 -0
  13. package/dist/assets/fonts/PT-Mono-Regular.woff2 +0 -0
  14. package/dist/assets/fonts/index.cjs +1 -0
  15. package/dist/assets/fonts/index.js +4 -0
  16. package/dist/assets/fonts/index.ts +1 -0
  17. package/dist/directive-619b88dd.cjs +55 -0
  18. package/dist/directive-76d5504a.js +1128 -0
  19. package/dist/index.cjs +1 -0
  20. package/dist/index.js +6 -0
  21. package/dist/lukso-button-4b795065.js +57 -0
  22. package/dist/lukso-button-ab7e2769.cjs +17 -0
  23. package/dist/lukso-button.cjs +1 -0
  24. package/dist/lukso-button.js +2 -0
  25. package/dist/lukso-test.cjs +41 -0
  26. package/dist/lukso-test.js +710 -0
  27. package/dist/sass/color-palette.ts +69 -0
  28. package/dist/sass/component.scss +13 -0
  29. package/dist/sass/fonts.scss +97 -0
  30. package/dist/sass/index.cjs +1 -0
  31. package/dist/sass/index.js +4 -0
  32. package/dist/sass/index.ts +1 -0
  33. package/dist/sass/main.scss +12 -0
  34. package/dist/sass/typography.scss +122 -0
  35. package/dist/sass/variables.scss +5 -0
  36. package/dist/styles/index.cjs +1 -0
  37. package/dist/styles/index.js +4 -0
  38. package/dist/styles/main.css +181 -0
  39. package/dist/styles/main.css.map +1 -0
  40. package/package.json +78 -33
  41. package/src/components/lukso-button/index.ts +1 -0
  42. package/src/components/lukso-button/lukso-button.stories.ts +51 -0
  43. package/src/components/lukso-button/lukso-button.ts +55 -0
  44. package/src/components/lukso-test/index.ts +72 -0
  45. package/src/components/lukso-test/test.component.scss +7 -0
  46. package/src/components/lukso-test/test.stories.ts +31 -0
  47. package/src/docs/buttons.stories.mdx +35 -0
  48. package/src/docs/colors.stories.mdx +72 -0
  49. package/src/docs/typography.stories.mdx +360 -0
  50. package/src/globals.d.ts +1 -0
  51. package/src/index.ts +3 -0
  52. package/src/postcss.config.ts +8 -0
  53. package/src/shared/assets/fonts/Apax-Bold.woff2 +0 -0
  54. package/src/shared/assets/fonts/Apax-Light.woff2 +0 -0
  55. package/src/shared/assets/fonts/Apax-Medium.woff2 +0 -0
  56. package/src/shared/assets/fonts/Apax-Regular.woff2 +0 -0
  57. package/src/shared/assets/fonts/Inter-Bold.woff2 +0 -0
  58. package/src/shared/assets/fonts/Inter-ExtraBold.woff2 +0 -0
  59. package/src/shared/assets/fonts/Inter-Medium.woff2 +0 -0
  60. package/src/shared/assets/fonts/Inter-Regular.woff2 +0 -0
  61. package/src/shared/assets/fonts/Inter-SemiBold.woff2 +0 -0
  62. package/src/shared/assets/fonts/Inter-Thin.woff2 +0 -0
  63. package/src/shared/assets/fonts/PT-Mono-Bold.woff2 +0 -0
  64. package/src/shared/assets/fonts/PT-Mono-Regular.woff2 +0 -0
  65. package/src/shared/assets/fonts/index.ts +1 -0
  66. package/src/shared/directives/custom-class-map.ts +51 -0
  67. package/src/shared/globals.d.ts +5 -0
  68. package/src/shared/styles/color-palette.ts +69 -0
  69. package/src/shared/styles/component.scss +13 -0
  70. package/src/shared/styles/fonts.scss +97 -0
  71. package/src/shared/styles/index.ts +1 -0
  72. package/src/shared/styles/main.scss +12 -0
  73. package/src/shared/styles/typography.scss +122 -0
  74. package/src/shared/styles/variables.scss +5 -0
  75. package/src/shared/tailwind.element.ts +16 -0
  76. package/src/shared/utils/hslColorMap.ts +20 -0
  77. package/src/tailwind.config.ts +60 -0
  78. package/tools/color-palette.cjs +141 -0
  79. package/tools/color-palette.d.ts +50 -0
  80. package/tools/color-palette.d.ts.map +1 -0
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @file Typography
3
+ *
4
+ * This file contains all typography classes used in designs.
5
+ * They should be used instead of individual font attributes.
6
+ *
7
+ * You can use them same as the normal Tailwind classes, e.g.: class="heading-1"
8
+ */
9
+
10
+ @layer base {
11
+ .heading-h1 {
12
+ @apply text-26 not-italic font-600 leading-31 font-inter;
13
+ }
14
+
15
+ .heading-h2 {
16
+ @apply text-21 not-italic font-600 leading-26 font-inter;
17
+ }
18
+
19
+ .heading-h3 {
20
+ @apply text-17 not-italic font-600 leading-22 font-inter;
21
+ }
22
+
23
+ .heading-h4 {
24
+ @apply text-12 not-italic font-700 leading-15 font-inter uppercase tracking-[.02em];
25
+ }
26
+
27
+ .heading-h5 {
28
+ @apply text-14 not-italic font-700 leading-17 font-inter;
29
+ }
30
+
31
+ .heading-h1-apax {
32
+ @apply text-24 not-italic font-500 leading-28 font-apax;
33
+ }
34
+
35
+ .heading-h4-apax {
36
+ @apply text-14 not-italic font-500 leading-20 font-apax;
37
+ }
38
+
39
+ .heading-h5-apax {
40
+ @apply text-8 not-italic font-500 leading-28 font-apax;
41
+ }
42
+
43
+ // Paragraph
44
+
45
+ .paragraph-16-regular {
46
+ @apply text-16 not-italic font-400 leading-24 font-inter;
47
+ }
48
+
49
+ .paragraph-16-semi-bold {
50
+ @apply text-16 not-italic font-600 leading-24 font-inter;
51
+ }
52
+
53
+ .paragraph-14-regular {
54
+ @apply text-14 not-italic font-400 leading-22 font-inter;
55
+ }
56
+
57
+ .paragraph-14-medium {
58
+ @apply text-14 not-italic font-500 leading-22 font-inter;
59
+ }
60
+
61
+ .paragraph-14-semi-bold {
62
+ @apply text-14 not-italic font-600 leading-22 font-inter;
63
+ }
64
+
65
+ .paragraph-12-regular {
66
+ @apply text-12 not-italic font-400 leading-20 font-inter;
67
+ }
68
+
69
+ .paragraph-12-medium {
70
+ @apply text-12 not-italic font-500 leading-20 font-inter;
71
+ }
72
+
73
+ .paragraph-12-semi-bold {
74
+ @apply text-12 not-italic font-600 leading-20 font-inter;
75
+ }
76
+
77
+ // Currency
78
+
79
+ .currency-10-semi-bold {
80
+ @apply text-10 not-italic font-600 leading-12 font-inter;
81
+ }
82
+
83
+ .currency-10-bold-uppercase {
84
+ @apply text-10 not-italic font-700 leading-12 font-inter uppercase;
85
+ }
86
+
87
+ .currency-14-semi-bold {
88
+ @apply text-14 not-italic font-600 leading-17 font-inter;
89
+ }
90
+
91
+ // utility
92
+
93
+ .link {
94
+ @apply text-17 not-italic font-600 leading-22 font-inter;
95
+ }
96
+
97
+ .button-text {
98
+ @apply text-17 not-italic font-600 leading-17 font-inter;
99
+ }
100
+
101
+ .caption {
102
+ @apply text-13 not-italic font-400 leading-20 font-inter;
103
+ }
104
+
105
+ // Monospaced
106
+
107
+ .monospace-16-regular {
108
+ @apply text-16 not-italic font-400 leading-22 font-mono;
109
+ }
110
+
111
+ .monospace-16-bold {
112
+ @apply text-16 not-italic font-700 leading-22 font-mono;
113
+ }
114
+
115
+ .monospace-12-bold {
116
+ @apply text-12 not-italic font-700 leading-14 font-mono;
117
+ }
118
+
119
+ .monospace-10-bold {
120
+ @apply text-10 not-italic font-700 leading-14 font-mono;
121
+ }
122
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file Variables
3
+ *
4
+ * This file contains all CSS variables used in designs.
5
+ */
@@ -0,0 +1,16 @@
1
+ import { LitElement, unsafeCSS } from 'lit'
2
+
3
+ import style from './styles/component.scss?inline'
4
+
5
+ const tailwindElement = unsafeCSS(style)
6
+
7
+ export const TailwindStyledElement = (style: any): typeof LitElement =>
8
+ class extends LitElement {
9
+ static styles = style
10
+ ? [tailwindElement, unsafeCSS(style)]
11
+ : [tailwindElement]
12
+ }
13
+
14
+ export class TailwindElement extends LitElement {
15
+ static styles = [tailwindElement]
16
+ }
@@ -0,0 +1,20 @@
1
+ import tinycolor from 'tinycolor2'
2
+
3
+ /**
4
+ * Generates a color map for a given hue, saturation and lightness values
5
+ *
6
+ * @param {*} h - hue
7
+ * @param {*} s - saturation
8
+ * @param {*} l - lightness as an array
9
+ * @returns object containing lightness as key and hex color as value e.g. { 10: '#000000', 20: '#111111' }
10
+ */
11
+ export const hslColorMap = (h, s, l) => {
12
+ const colors = {}
13
+
14
+ for (let i = 0; i < l.length; i++) {
15
+ const lightness = l[i]
16
+ colors[lightness] = tinycolor({ h, s, l: lightness }).toHexString()
17
+ }
18
+
19
+ return colors
20
+ }
@@ -0,0 +1,60 @@
1
+ import { colorPalette } from './shared/styles/color-palette'
2
+
3
+ export default {
4
+ content: ['**/*.{ts,html,css,scss}'],
5
+ theme: {
6
+ fontFamily: {
7
+ inter: ['Inter', 'sans-serif'],
8
+ apax: ['Apax', 'sans-serif'],
9
+ mono: ['"PT Mono"', 'sans-serif'],
10
+ },
11
+ extend: {
12
+ colors: colorPalette,
13
+ boxShadow: {
14
+ 'button-hover-primary': '0px 20px 16px -16px rgba(0, 0, 0, 0.4)',
15
+ 'button-hover-secondary': '0px 20px 16px -16px rgba(0, 0, 0, 0.12)',
16
+ '1xl': '0px 0px 16px rgba(189, 206, 219, 0.4)',
17
+ '2xl':
18
+ '0px 36px 80px rgba(189, 206, 219, 0.3), 0px 5.01331px 33.4221px rgba(189, 206, 219, 0.0503198), 0px 2.68036px 17.869px rgba(189, 206, 219, 0.0417275), 0px 1.50259px 10.0172px rgba(189, 206, 219, 0.035), 0px 0.798012px 5.32008px rgba(189, 206, 219, 0.0282725), 0px 0.332071px 2.21381px rgba(189, 206, 219, 0.0196802)',
19
+ '3xl':
20
+ '0px 12px 80px rgba(189, 206, 219, 0.3), 0px 73.78px 33.4221px rgba(189, 206, 219, 0.0803), 0px 22.3363px 17.869px rgba(189, 206, 219, 0.0417275), 0px 12.5216px 10.0172px rgba(189, 206, 219, 0.035), 0px 6.6501px 5.32008px rgba(189, 206, 219, 0.0282725), 0px 2.76726px 2.21381px rgba(189, 206, 219, 0.0196802)',
21
+ },
22
+ fontSize: {
23
+ 8: '8px',
24
+ 10: '10px',
25
+ 12: '12px',
26
+ 13: '13px',
27
+ 14: '14px',
28
+ 16: '16px',
29
+ 17: '17px',
30
+ 21: '21px',
31
+ 24: '24px',
32
+ 26: '26px',
33
+ },
34
+ fontWeight: {
35
+ 100: '100',
36
+ 200: '200',
37
+ 300: '300',
38
+ 400: '400',
39
+ 500: '500',
40
+ 600: '600',
41
+ 700: '700',
42
+ 800: '800',
43
+ 900: '900',
44
+ },
45
+ lineHeight: {
46
+ 12: '12px',
47
+ 14: '14px',
48
+ 15: '15px',
49
+ 17: '17px',
50
+ 20: '20px',
51
+ 22: '22px',
52
+ 24: '24px',
53
+ 26: '26px',
54
+ 28: '28px',
55
+ 31: '31px',
56
+ },
57
+ },
58
+ },
59
+ plugins: [],
60
+ }
@@ -0,0 +1,141 @@
1
+ module.exports = (function () {
2
+ var defines = {};
3
+ var entry = [null];
4
+ function define(name, dependencies, factory) {
5
+ defines[name] = { dependencies: dependencies, factory: factory };
6
+ entry[0] = name;
7
+ }
8
+ define("require", ["exports"], function (exports) {
9
+ Object.defineProperty(exports, "__cjsModule", { value: true });
10
+ Object.defineProperty(exports, "default", { value: function (name) { return resolve(name); } });
11
+ });
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ define("utils/hslColorMap", ["require", "exports", "tinycolor2"], function (require, exports, tinycolor2_1) {
16
+ "use strict";
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.hslColorMap = void 0;
19
+ tinycolor2_1 = __importDefault(tinycolor2_1);
20
+ /**
21
+ * Generates a color map for a given hue, saturation and lightness values
22
+ *
23
+ * @param {*} h - hue
24
+ * @param {*} s - saturation
25
+ * @param {*} l - lightness as an array
26
+ * @returns object containing lightness as key and hex color as value e.g. { 10: '#000000', 20: '#111111' }
27
+ */
28
+ var hslColorMap = function (h, s, l) {
29
+ var colors = {};
30
+ for (var i = 0; i < l.length; i++) {
31
+ var lightness = l[i];
32
+ colors[lightness] = (0, tinycolor2_1.default)({ h: h, s: s, l: lightness }).toHexString();
33
+ }
34
+ return colors;
35
+ };
36
+ exports.hslColorMap = hslColorMap;
37
+ });
38
+ define("styles/color-palette", ["require", "exports", "utils/hslColorMap"], function (require, exports, hslColorMap_1) {
39
+ "use strict";
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.neutral3 = exports.neutral2 = exports.neutral1 = exports.colorPalette = void 0;
42
+ /**
43
+ * Color palette based on the structure thats compatible with Tailwind config
44
+ */
45
+ exports.colorPalette = {
46
+ neutral: (0, hslColorMap_1.hslColorMap)(206, 30, [
47
+ 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
48
+ 97, 98, 100,
49
+ ]),
50
+ honey: (0, hslColorMap_1.hslColorMap)(42, 93, [72, 75, 82, 85, 92]),
51
+ coral: (0, hslColorMap_1.hslColorMap)(14, 87, [65, 74, 75, 84, 85, 94]),
52
+ warm: (0, hslColorMap_1.hslColorMap)(25, 100, [77, 87, 97]),
53
+ 'sea-salt': (0, hslColorMap_1.hslColorMap)(180, 17, [57, 67, 88]),
54
+ cloud: (0, hslColorMap_1.hslColorMap)(200, 38, [43, 75, 88]),
55
+ ocean: (0, hslColorMap_1.hslColorMap)(209, 38, [38, 75, 88]),
56
+ sky: (0, hslColorMap_1.hslColorMap)(209, 64, [64, 75, 85]),
57
+ lukso: (0, hslColorMap_1.hslColorMap)(335, 33, [70, 80, 90]),
58
+ yellow: (0, hslColorMap_1.hslColorMap)(36, 100, [55, 65, 75, 85]),
59
+ green: (0, hslColorMap_1.hslColorMap)(135, 57, [45, 54, 75, 85]),
60
+ blue: (0, hslColorMap_1.hslColorMap)(216, 96, [50, 60, 75, 85]),
61
+ red: (0, hslColorMap_1.hslColorMap)(0, 75, [55, 65, 75, 85]),
62
+ purple: (0, hslColorMap_1.hslColorMap)(230, 24, [94, 82, 63, 58, 51, 41, 31, 15]),
63
+ 'gradient-1': {
64
+ start: '#D39B9D',
65
+ end: '#9071D1',
66
+ },
67
+ 'gradient-2': {
68
+ start: '#F8DAD3',
69
+ end: '#CC99AE',
70
+ },
71
+ };
72
+ /**
73
+ * Splits a color map into smaller color maps
74
+ *
75
+ * @param colors - color map to split
76
+ * @param from - index to start from
77
+ * @param to - index to end at
78
+ * @returns a new color map
79
+ */
80
+ var splitColor = function (colors, from, to) {
81
+ return Object.keys(colors)
82
+ .slice(from, to)
83
+ .reduce(function (result, key) {
84
+ result[key] = colors[key];
85
+ return result;
86
+ }, {});
87
+ };
88
+ /**
89
+ * Color map subsets that can be used in the Storybook preview
90
+ */
91
+ exports.neutral1 = splitColor(exports.colorPalette.neutral, 0, 8);
92
+ exports.neutral2 = splitColor(exports.colorPalette.neutral, 8, 16);
93
+ exports.neutral3 = splitColor(exports.colorPalette.neutral, 16, Object.keys(exports.colorPalette.neutral).length);
94
+ });
95
+
96
+ 'marker:resolver';
97
+
98
+ function get_define(name) {
99
+ if (defines[name]) {
100
+ return defines[name];
101
+ }
102
+ else if (defines[name + '/index']) {
103
+ return defines[name + '/index'];
104
+ }
105
+ else {
106
+ var dependencies = ['exports'];
107
+ var factory = function (exports) {
108
+ try {
109
+ Object.defineProperty(exports, "__cjsModule", { value: true });
110
+ Object.defineProperty(exports, "default", { value: require(name) });
111
+ }
112
+ catch (_a) {
113
+ throw Error(['module "', name, '" not found.'].join(''));
114
+ }
115
+ };
116
+ return { dependencies: dependencies, factory: factory };
117
+ }
118
+ }
119
+ var instances = {};
120
+ function resolve(name) {
121
+ if (instances[name]) {
122
+ return instances[name];
123
+ }
124
+ if (name === 'exports') {
125
+ return {};
126
+ }
127
+ var define = get_define(name);
128
+ if (typeof define.factory !== 'function') {
129
+ return define.factory;
130
+ }
131
+ instances[name] = {};
132
+ var dependencies = define.dependencies.map(function (name) { return resolve(name); });
133
+ define.factory.apply(define, dependencies);
134
+ var exports = dependencies[define.dependencies.indexOf('exports')];
135
+ instances[name] = (exports['__cjsModule']) ? exports.default : exports;
136
+ return instances[name];
137
+ }
138
+ if (entry[0] !== null) {
139
+ return resolve(entry[0]);
140
+ }
141
+ })();
@@ -0,0 +1,50 @@
1
+ declare module "utils/hslColorMap" {
2
+ /**
3
+ * Generates a color map for a given hue, saturation and lightness values
4
+ *
5
+ * @param {*} h - hue
6
+ * @param {*} s - saturation
7
+ * @param {*} l - lightness as an array
8
+ * @returns object containing lightness as key and hex color as value e.g. { 10: '#000000', 20: '#111111' }
9
+ */
10
+ export const hslColorMap: (h: any, s: any, l: any) => {};
11
+ }
12
+ declare module "styles/color-palette" {
13
+ type ColorMap = {
14
+ [key: string]: string;
15
+ };
16
+ /**
17
+ * Color palette based on the structure thats compatible with Tailwind config
18
+ */
19
+ export const colorPalette: {
20
+ neutral: {};
21
+ honey: {};
22
+ coral: {};
23
+ warm: {};
24
+ 'sea-salt': {};
25
+ cloud: {};
26
+ ocean: {};
27
+ sky: {};
28
+ lukso: {};
29
+ yellow: {};
30
+ green: {};
31
+ blue: {};
32
+ red: {};
33
+ purple: {};
34
+ 'gradient-1': {
35
+ start: string;
36
+ end: string;
37
+ };
38
+ 'gradient-2': {
39
+ start: string;
40
+ end: string;
41
+ };
42
+ };
43
+ /**
44
+ * Color map subsets that can be used in the Storybook preview
45
+ */
46
+ export const neutral1: ColorMap;
47
+ export const neutral2: ColorMap;
48
+ export const neutral3: ColorMap;
49
+ }
50
+ //# sourceMappingURL=color-palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-palette.d.ts","sourceRoot":"","sources":["../src/shared/utils/hslColorMap.ts","../src/shared/styles/color-palette.ts"],"names":[],"mappings":";IAEA;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,WAAW,gCASvB,CAAA;;;ICjBD,KAAK,QAAQ,GAAG;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;KA8BxB,CAAA;IAoBD;;OAEG;IACH,MAAM,CAAC,MAAM,QAAQ,UAAyC,CAAA;IAC9D,MAAM,CAAC,MAAM,QAAQ,UAA0C,CAAA;IAC/D,MAAM,CAAC,MAAM,QAAQ,UAIpB,CAAA"}