@lukso/web-components 1.5.4 → 1.6.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +3 -12
  3. package/dist/components/index.js +828 -814
  4. package/dist/components/index.umd.cjs +156 -155
  5. package/dist/components/lukso-button/index.js +104 -104
  6. package/dist/components/lukso-button/index.umd.cjs +5 -5
  7. package/dist/components/lukso-card/index.d.ts +5 -2
  8. package/dist/components/lukso-card/index.js +221 -204
  9. package/dist/components/lukso-card/index.umd.cjs +26 -25
  10. package/dist/components/lukso-icon/index.js +78 -78
  11. package/dist/components/lukso-icon/index.umd.cjs +224 -224
  12. package/dist/components/lukso-input/index.js +31 -30
  13. package/dist/components/lukso-input/index.umd.cjs +13 -13
  14. package/dist/components/lukso-navbar/index.js +2 -2
  15. package/dist/components/lukso-navbar/index.umd.cjs +2 -2
  16. package/dist/components/lukso-profile/index.js +2 -2
  17. package/dist/components/lukso-profile/index.umd.cjs +2 -2
  18. package/dist/components/lukso-sanitize/index.js +39 -39
  19. package/dist/components/lukso-sanitize/index.umd.cjs +1 -1
  20. package/dist/components/lukso-tag/index.js +1 -1
  21. package/dist/components/lukso-tag/index.umd.cjs +1 -1
  22. package/dist/components/lukso-test/index.js +550 -550
  23. package/dist/components/lukso-test/index.umd.cjs +12 -12
  24. package/dist/components/lukso-username/index.js +19 -19
  25. package/dist/components/lukso-username/index.umd.cjs +1 -1
  26. package/dist/components/lukso-wizard/index.js +28 -28
  27. package/dist/components/lukso-wizard/index.umd.cjs +9 -9
  28. package/dist/index.js +828 -814
  29. package/dist/index.umd.cjs +156 -155
  30. package/dist/sass/typography.scss +23 -3
  31. package/dist/shared/tailwind-element/index.js +21 -21
  32. package/dist/shared/tailwind-element/index.umd.cjs +6 -6
  33. package/dist/shared/tailwind-element.js +21 -21
  34. package/dist/shared/tailwind-element.umd.cjs +6 -6
  35. package/dist/shared/{styles/hslColorMap.d.ts → utils/hsl-color-map.d.ts} +1 -1
  36. package/dist/shared/utils/{sliceAddress.d.ts → slice-address.d.ts} +1 -1
  37. package/dist/styles/main.css +18 -3
  38. package/package.json +4 -10
  39. package/src/components/lukso-card/index.ts +16 -3
  40. package/src/components/lukso-card/lukso-card.stories.ts +56 -4
  41. package/src/components/lukso-card/style.scss +3 -0
  42. package/src/components/lukso-icon/style.scss +1 -1
  43. package/src/components/lukso-input/index.ts +3 -2
  44. package/src/components/lukso-navbar/index.ts +1 -1
  45. package/src/components/lukso-profile/index.ts +1 -1
  46. package/src/components/lukso-username/index.ts +1 -1
  47. package/src/shared/styles/typography.scss +23 -3
  48. package/src/shared/utils/__tests__/{sliceAddress.spec.ts → slice-address.spec.ts} +1 -1
  49. package/src/shared/{styles → utils}/color-palette.ts +1 -1
  50. package/src/shared/utils/copy-assets.ts +35 -0
  51. package/tailwind.config.cjs +3 -0
  52. package/tools/color-palette.cjs +17 -62
  53. package/tools/color-palette.d.ts +2 -5
  54. package/tools/color-palette.d.ts.map +1 -1
  55. package/tools/copy-assets.cjs +139 -0
  56. package/tools/copy-assets.d.ts +10 -0
  57. package/tools/copy-assets.d.ts.map +1 -0
  58. package/dist/copy-assets/index.js +0 -19
  59. package/dist/copy-assets/index.umd.cjs +0 -1
  60. package/dist/sass/color-palette.ts +0 -76
  61. package/dist/shared/utils/copy-assets.d.ts +0 -2
  62. package/src/shared/styles/hslColorMap.ts +0 -20
  63. /package/dist/shared/{styles → utils}/color-palette.d.ts +0 -0
  64. /package/{dist/sass/hslColorMap.ts → src/shared/utils/hsl-color-map.ts} +0 -0
  65. /package/src/shared/utils/{sliceAddress.ts → slice-address.ts} +0 -0
@@ -1,3 +1,3 @@
1
1
  :host {
2
- display: inline-flex;
2
+ @apply inline-flex;
3
3
  }
@@ -47,11 +47,11 @@ export class LuksoInput extends TailwindElement {
47
47
  private hasHocus = false
48
48
 
49
49
  private defaultInputStyles = `bg-neutral-100 text-neutral-20 paragraph-16-regular px-4 py-3
50
- border border-solid border-neutral-90 h-[48px] placeholder:text-neutral-70
50
+ border border-solid h-[48px] placeholder:text-neutral-70
51
51
  outline-none transition transition-all duration-250 appearance-none`
52
52
 
53
53
  private defaultUnitStyles = `paragraph-12-regular text-neutral-60 flex px-3.5 items-center relative
54
- border border-solid border-neutral-90 h-[48px] transition transition-all duration-250
54
+ border border-solid h-[48px] transition transition-all duration-250
55
55
  rounded-r-xl border-l-0 before:bg-neutral-90 before:absolute before:top-[calc(50%-12px)] before:left-0
56
56
  before:w-[1px] before:h-[24px] whitespace-nowrap`
57
57
 
@@ -70,6 +70,7 @@ export class LuksoInput extends TailwindElement {
70
70
  [this.defaultInputStyles]: true,
71
71
  ['border-red-85 text-red-65 focus:border-red-65']: this.error !== '',
72
72
  ['border-neutral-35']: this.hasHocus,
73
+ ['border-neutral-90']: !this.hasHocus,
73
74
  ['rounded-l-xl border-r-0']: this.unit !== '',
74
75
  ['rounded-xl']: this.unit === '',
75
76
  ['w-full']: this.isFullWidth,
@@ -43,7 +43,7 @@ export class LuksoNavbar extends TailwindElement {
43
43
  class="flex items-center px-10 h-full cursor-pointer"
44
44
  @click=${this._onBrandClick}
45
45
  >
46
- <img src="assets/images/lukso-logo.svg" class="mr-4" />
46
+ <img src="/assets/images/lukso-logo.svg" class="mr-4" />
47
47
  <div
48
48
  class="text-purple-51 heading-h4-apax whitespace-pre-line flex leading-none"
49
49
  >
@@ -53,7 +53,7 @@ export class LuksoProfile extends TailwindElement {
53
53
  return this.sizes[this.size].identiconSize
54
54
  }
55
55
 
56
- private defaultProfileUrl = 'assets/images/profile-default.png'
56
+ private defaultProfileUrl = '/assets/images/profile-default.png'
57
57
 
58
58
  private identicon() {
59
59
  return this.hasIdenticon && this.profileAddress && this.identiconSize()
@@ -2,7 +2,7 @@ import { html } from 'lit'
2
2
  import { customElement, property } from 'lit/decorators.js'
3
3
  import { styleMap } from 'lit-html/directives/style-map.js'
4
4
 
5
- import { sliceAddress } from '@/shared/utils/sliceAddress'
5
+ import { sliceAddress } from '@/shared/utils/slice-address'
6
6
  import { TailwindElement } from '@/shared/tailwind-element'
7
7
  import { customClassMap } from '@/shared/directives'
8
8
 
@@ -28,15 +28,35 @@
28
28
  @apply text-14 not-italic font-700 leading-17 font-inter;
29
29
  }
30
30
 
31
- .heading-h1-apax {
31
+ .heading-h1-medium-apax {
32
+ @apply text-44 not-italic font-500 leading-40 font-apax;
33
+ }
34
+
35
+ .heading-h1-regular-apax {
36
+ @apply text-44 not-italic font-400 leading-40 font-apax;
37
+ }
38
+
39
+ .heading-h2-medium-apax {
32
40
  @apply text-24 not-italic font-500 leading-28 font-apax;
33
41
  }
34
42
 
35
- .heading-h4-apax {
43
+ .heading-h3-medium-apax {
44
+ @apply text-16 not-italic font-500 leading-19 font-apax;
45
+ }
46
+
47
+ .heading-h4-medium-apax {
48
+ @apply text-14 not-italic font-500 leading-20 font-apax;
49
+ }
50
+
51
+ .heading-h4-medium-uppercase-apax {
36
52
  @apply text-14 not-italic font-500 leading-20 font-apax uppercase tracking-[.08em];
37
53
  }
38
54
 
39
- .heading-h5-apax {
55
+ .heading-h5-medium-apax {
56
+ @apply text-8 not-italic font-500 leading-10 font-apax;
57
+ }
58
+
59
+ .heading-h5-medium-uppercase-apax {
40
60
  @apply text-8 not-italic font-500 leading-10 font-apax uppercase tracking-[.08em];
41
61
  }
42
62
 
@@ -1,4 +1,4 @@
1
- import { sliceAddress } from '../sliceAddress'
1
+ import { sliceAddress } from '../slice-address'
2
2
 
3
3
  test('sliceAddress', () => {
4
4
  expect(sliceAddress()).toEqual('')
@@ -1,6 +1,6 @@
1
1
  import tinycolor from 'tinycolor2'
2
2
 
3
- import { hslColorMap } from './hslColorMap'
3
+ import { hslColorMap } from './hsl-color-map'
4
4
 
5
5
  type ColorMap = {
6
6
  [key: string]: string
@@ -1,6 +1,25 @@
1
1
  import fs from 'fs'
2
2
  import path from 'path'
3
3
 
4
+ /**
5
+ * List of allowed file extensions
6
+ */
7
+ const fileExtensionWhitelist = [
8
+ '.woff2',
9
+ '.svg',
10
+ '.img',
11
+ '.jpg',
12
+ '.jpeg',
13
+ '.png',
14
+ ]
15
+
16
+ /**
17
+ * Copy file from source to destination
18
+ *
19
+ * @param source - Source path
20
+ * @param target - Destination path
21
+ * @returns
22
+ */
4
23
  function copyFileSync(source, target) {
5
24
  let targetFile = target
6
25
 
@@ -11,9 +30,19 @@ function copyFileSync(source, target) {
11
30
  }
12
31
  }
13
32
 
33
+ if (!fileExtensionWhitelist.includes(path.extname(source))) {
34
+ return
35
+ }
36
+
14
37
  fs.writeFileSync(targetFile, fs.readFileSync(source))
15
38
  }
16
39
 
40
+ /**
41
+ * Recursively copy directory from source to destination
42
+ *
43
+ * @param source - source directory
44
+ * @param target - destination directory
45
+ */
17
46
  function copyFolderRecursiveSync(source, target) {
18
47
  let files = []
19
48
 
@@ -37,6 +66,12 @@ function copyFolderRecursiveSync(source, target) {
37
66
  }
38
67
  }
39
68
 
69
+ /**
70
+ * Copy asset directory from source to destination
71
+ *
72
+ * @param assetDir - destination directory
73
+ * @param assets - source directory
74
+ */
40
75
  export const copyAssets = (assetDir: string, assets: any) => {
41
76
  if (!fs.existsSync(assetDir)) {
42
77
  fs.mkdirSync(assetDir, { recursive: true })
@@ -135,6 +135,7 @@ module.exports = {
135
135
  21: '21px',
136
136
  24: '24px',
137
137
  26: '26px',
138
+ 44: '44px',
138
139
  },
139
140
  fontWeight: {
140
141
  100: '100',
@@ -153,12 +154,14 @@ module.exports = {
153
154
  14: '14px',
154
155
  15: '15px',
155
156
  17: '17px',
157
+ 19: '19px',
156
158
  20: '20px',
157
159
  22: '22px',
158
160
  24: '24px',
159
161
  26: '26px',
160
162
  28: '28px',
161
163
  31: '31px',
164
+ 40: '40px',
162
165
  },
163
166
  transitionDuration: {
164
167
  25: '25ms',
@@ -12,52 +12,7 @@ module.exports = (function () {
12
12
  var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
- define("utils/copy-assets", ["require", "exports", "fs", "path"], function (require, exports, fs_1, path_1) {
16
- "use strict";
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.copyAssets = void 0;
19
- fs_1 = __importDefault(fs_1);
20
- path_1 = __importDefault(path_1);
21
- function copyFileSync(source, target) {
22
- var targetFile = target;
23
- // If target is a directory, a new file with the same name will be created
24
- if (fs_1.default.existsSync(target)) {
25
- if (fs_1.default.lstatSync(target).isDirectory()) {
26
- targetFile = path_1.default.join(target, path_1.default.basename(source));
27
- }
28
- }
29
- fs_1.default.writeFileSync(targetFile, fs_1.default.readFileSync(source));
30
- }
31
- function copyFolderRecursiveSync(source, target) {
32
- var files = [];
33
- // Check if folder needs to be created or integrated
34
- var targetFolder = path_1.default.join(target, path_1.default.basename(source));
35
- if (!fs_1.default.existsSync(targetFolder)) {
36
- fs_1.default.mkdirSync(targetFolder);
37
- }
38
- // Copy
39
- if (fs_1.default.lstatSync(source).isDirectory()) {
40
- files = fs_1.default.readdirSync(source);
41
- files.forEach(function (file) {
42
- var curSource = path_1.default.join(source, file);
43
- if (fs_1.default.lstatSync(curSource).isDirectory()) {
44
- copyFolderRecursiveSync(curSource, targetFolder);
45
- }
46
- else {
47
- copyFileSync(curSource, targetFolder);
48
- }
49
- });
50
- }
51
- }
52
- var copyAssets = function (assetDir, assets) {
53
- if (!fs_1.default.existsSync(assetDir)) {
54
- fs_1.default.mkdirSync(assetDir, { recursive: true });
55
- }
56
- copyFolderRecursiveSync(assets, assetDir);
57
- };
58
- exports.copyAssets = copyAssets;
59
- });
60
- define("styles/hslColorMap", ["require", "exports", "tinycolor2"], function (require, exports, tinycolor2_1) {
15
+ define("hsl-color-map", ["require", "exports", "tinycolor2"], function (require, exports, tinycolor2_1) {
61
16
  "use strict";
62
17
  Object.defineProperty(exports, "__esModule", { value: true });
63
18
  exports.hslColorMap = void 0;
@@ -80,7 +35,7 @@ module.exports = (function () {
80
35
  };
81
36
  exports.hslColorMap = hslColorMap;
82
37
  });
83
- define("styles/color-palette", ["require", "exports", "tinycolor2", "styles/hslColorMap"], function (require, exports, tinycolor2_2, hslColorMap_1) {
38
+ define("color-palette", ["require", "exports", "tinycolor2", "hsl-color-map"], function (require, exports, tinycolor2_2, hsl_color_map_1) {
84
39
  "use strict";
85
40
  Object.defineProperty(exports, "__esModule", { value: true });
86
41
  exports.neutral3 = exports.neutral2 = exports.neutral1 = exports.colorPalette = void 0;
@@ -89,24 +44,24 @@ module.exports = (function () {
89
44
  * Color palette based on the structure thats compatible with Tailwind config
90
45
  */
91
46
  exports.colorPalette = {
92
- neutral: (0, hslColorMap_1.hslColorMap)(206, 30, [
47
+ neutral: (0, hsl_color_map_1.hslColorMap)(206, 30, [
93
48
  10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
94
49
  97, 98, 100,
95
50
  ]),
96
- honey: (0, hslColorMap_1.hslColorMap)(42, 93, [72, 75, 82, 85, 92]),
97
- coral: (0, hslColorMap_1.hslColorMap)(14, 87, [65, 74, 75, 84, 85, 94]),
98
- warm: (0, hslColorMap_1.hslColorMap)(25, 100, [77, 87, 97]),
99
- 'sea-salt': (0, hslColorMap_1.hslColorMap)(180, 17, [57, 67, 88]),
100
- cloud: (0, hslColorMap_1.hslColorMap)(200, 38, [43, 75, 88]),
101
- ocean: (0, hslColorMap_1.hslColorMap)(209, 38, [38, 75, 88]),
102
- sky: (0, hslColorMap_1.hslColorMap)(209, 64, [64, 75, 85]),
103
- lukso: (0, hslColorMap_1.hslColorMap)(335, 33, [70, 80, 90]),
104
- yellow: (0, hslColorMap_1.hslColorMap)(36, 100, [55, 65, 75, 85]),
105
- green: (0, hslColorMap_1.hslColorMap)(135, 57, [45, 54, 75, 85]),
106
- blue: (0, hslColorMap_1.hslColorMap)(216, 96, [50, 60, 75, 85]),
107
- red: (0, hslColorMap_1.hslColorMap)(0, 75, [55, 65, 75, 85]),
108
- purple: (0, hslColorMap_1.hslColorMap)(230, 24, [94, 82, 63, 58, 51, 41, 31, 15]),
109
- pink: (0, hslColorMap_1.hslColorMap)(11, 73, [97, 96, 95, 94, 93, 92, 91, 90]),
51
+ honey: (0, hsl_color_map_1.hslColorMap)(42, 93, [72, 75, 82, 85, 92]),
52
+ coral: (0, hsl_color_map_1.hslColorMap)(14, 87, [65, 74, 75, 84, 85, 94]),
53
+ warm: (0, hsl_color_map_1.hslColorMap)(25, 100, [77, 87, 97]),
54
+ 'sea-salt': (0, hsl_color_map_1.hslColorMap)(180, 17, [57, 67, 88]),
55
+ cloud: (0, hsl_color_map_1.hslColorMap)(200, 38, [43, 75, 88]),
56
+ ocean: (0, hsl_color_map_1.hslColorMap)(209, 38, [38, 75, 88]),
57
+ sky: (0, hsl_color_map_1.hslColorMap)(209, 64, [64, 75, 85]),
58
+ lukso: (0, hsl_color_map_1.hslColorMap)(335, 33, [70, 80, 90]),
59
+ yellow: (0, hsl_color_map_1.hslColorMap)(36, 100, [55, 65, 75, 85]),
60
+ green: (0, hsl_color_map_1.hslColorMap)(135, 57, [45, 54, 75, 85]),
61
+ blue: (0, hsl_color_map_1.hslColorMap)(216, 96, [50, 60, 75, 85]),
62
+ red: (0, hsl_color_map_1.hslColorMap)(0, 75, [55, 65, 75, 85]),
63
+ purple: (0, hsl_color_map_1.hslColorMap)(230, 24, [94, 82, 63, 58, 51, 41, 31, 15]),
64
+ pink: (0, hsl_color_map_1.hslColorMap)(11, 73, [97, 96, 95, 94, 93, 92, 91, 90]),
110
65
  'gradient-1': {
111
66
  start: '#D39B9D',
112
67
  end: '#9071D1',
@@ -1,7 +1,4 @@
1
- declare module "utils/copy-assets" {
2
- export const copyAssets: (assetDir: string, assets: any) => void;
3
- }
4
- declare module "styles/hslColorMap" {
1
+ declare module "hsl-color-map" {
5
2
  /**
6
3
  * Generates a color map for a given hue, saturation and lightness values
7
4
  *
@@ -12,7 +9,7 @@ declare module "styles/hslColorMap" {
12
9
  */
13
10
  export const hslColorMap: (h: any, s: any, l: any) => {};
14
11
  }
15
- declare module "styles/color-palette" {
12
+ declare module "color-palette" {
16
13
  type ColorMap = {
17
14
  [key: string]: string;
18
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"color-palette.d.ts","sourceRoot":"","sources":["../src/shared/utils/copy-assets.ts","../src/shared/styles/hslColorMap.ts","../src/shared/styles/color-palette.ts"],"names":[],"mappings":";IAuCA,MAAM,CAAC,MAAM,UAAU,aAAc,MAAM,UAAU,GAAG,SAKvD,CAAA;;;IC1CD;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,WAAW,gCASvB,CAAA;;;ICfD,KAAK,QAAQ,GAAG;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCxB,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"}
1
+ {"version":3,"file":"color-palette.d.ts","sourceRoot":"","sources":["../src/shared/utils/hsl-color-map.ts","../src/shared/utils/color-palette.ts"],"names":[],"mappings":";IAEA;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,WAAW,gCASvB,CAAA;;;ICfD,KAAK,QAAQ,GAAG;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmCxB,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"}
@@ -0,0 +1,139 @@
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("copy-assets", ["require", "exports", "fs", "path"], function (require, exports, fs_1, path_1) {
16
+ "use strict";
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.copyAssets = void 0;
19
+ fs_1 = __importDefault(fs_1);
20
+ path_1 = __importDefault(path_1);
21
+ /**
22
+ * List of allowed file extensions
23
+ */
24
+ var fileExtensionWhitelist = [
25
+ '.woff2',
26
+ '.svg',
27
+ '.img',
28
+ '.jpg',
29
+ '.jpeg',
30
+ '.png',
31
+ ];
32
+ /**
33
+ * Copy file from source to destination
34
+ *
35
+ * @param source - Source path
36
+ * @param target - Destination path
37
+ * @returns
38
+ */
39
+ function copyFileSync(source, target) {
40
+ var targetFile = target;
41
+ // If target is a directory, a new file with the same name will be created
42
+ if (fs_1.default.existsSync(target)) {
43
+ if (fs_1.default.lstatSync(target).isDirectory()) {
44
+ targetFile = path_1.default.join(target, path_1.default.basename(source));
45
+ }
46
+ }
47
+ if (!fileExtensionWhitelist.includes(path_1.default.extname(source))) {
48
+ return;
49
+ }
50
+ fs_1.default.writeFileSync(targetFile, fs_1.default.readFileSync(source));
51
+ }
52
+ /**
53
+ * Recursively copy directory from source to destination
54
+ *
55
+ * @param source - source directory
56
+ * @param target - destination directory
57
+ */
58
+ function copyFolderRecursiveSync(source, target) {
59
+ var files = [];
60
+ // Check if folder needs to be created or integrated
61
+ var targetFolder = path_1.default.join(target, path_1.default.basename(source));
62
+ if (!fs_1.default.existsSync(targetFolder)) {
63
+ fs_1.default.mkdirSync(targetFolder);
64
+ }
65
+ // Copy
66
+ if (fs_1.default.lstatSync(source).isDirectory()) {
67
+ files = fs_1.default.readdirSync(source);
68
+ files.forEach(function (file) {
69
+ var curSource = path_1.default.join(source, file);
70
+ if (fs_1.default.lstatSync(curSource).isDirectory()) {
71
+ copyFolderRecursiveSync(curSource, targetFolder);
72
+ }
73
+ else {
74
+ copyFileSync(curSource, targetFolder);
75
+ }
76
+ });
77
+ }
78
+ }
79
+ /**
80
+ * Copy asset directory from source to destination
81
+ *
82
+ * @param assetDir - destination directory
83
+ * @param assets - source directory
84
+ */
85
+ var copyAssets = function (assetDir, assets) {
86
+ if (!fs_1.default.existsSync(assetDir)) {
87
+ fs_1.default.mkdirSync(assetDir, { recursive: true });
88
+ }
89
+ copyFolderRecursiveSync(assets, assetDir);
90
+ };
91
+ exports.copyAssets = copyAssets;
92
+ });
93
+
94
+ 'marker:resolver';
95
+
96
+ function get_define(name) {
97
+ if (defines[name]) {
98
+ return defines[name];
99
+ }
100
+ else if (defines[name + '/index']) {
101
+ return defines[name + '/index'];
102
+ }
103
+ else {
104
+ var dependencies = ['exports'];
105
+ var factory = function (exports) {
106
+ try {
107
+ Object.defineProperty(exports, "__cjsModule", { value: true });
108
+ Object.defineProperty(exports, "default", { value: require(name) });
109
+ }
110
+ catch (_a) {
111
+ throw Error(['module "', name, '" not found.'].join(''));
112
+ }
113
+ };
114
+ return { dependencies: dependencies, factory: factory };
115
+ }
116
+ }
117
+ var instances = {};
118
+ function resolve(name) {
119
+ if (instances[name]) {
120
+ return instances[name];
121
+ }
122
+ if (name === 'exports') {
123
+ return {};
124
+ }
125
+ var define = get_define(name);
126
+ if (typeof define.factory !== 'function') {
127
+ return define.factory;
128
+ }
129
+ instances[name] = {};
130
+ var dependencies = define.dependencies.map(function (name) { return resolve(name); });
131
+ define.factory.apply(define, dependencies);
132
+ var exports = dependencies[define.dependencies.indexOf('exports')];
133
+ instances[name] = (exports['__cjsModule']) ? exports.default : exports;
134
+ return instances[name];
135
+ }
136
+ if (entry[0] !== null) {
137
+ return resolve(entry[0]);
138
+ }
139
+ })();
@@ -0,0 +1,10 @@
1
+ declare module "copy-assets" {
2
+ /**
3
+ * Copy asset directory from source to destination
4
+ *
5
+ * @param assetDir - destination directory
6
+ * @param assets - source directory
7
+ */
8
+ export const copyAssets: (assetDir: string, assets: any) => void;
9
+ }
10
+ //# sourceMappingURL=copy-assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-assets.d.ts","sourceRoot":"","sources":["../src/shared/utils/copy-assets.ts"],"names":[],"mappings":";IAoEA;;;;;OAKG;IACH,MAAM,CAAC,MAAM,UAAU,aAAc,MAAM,UAAU,GAAG,SAKvD,CAAA"}
@@ -1,19 +0,0 @@
1
- const i = {};
2
- function r(n, c) {
3
- let e = c;
4
- i.existsSync(c) && i.lstatSync(c).isDirectory() && (e = i.join(c, i.basename(n))), i.writeFileSync(e, i.readFileSync(n));
5
- }
6
- function s(n, c) {
7
- let e = [];
8
- const t = i.join(c, i.basename(n));
9
- i.existsSync(t) || i.mkdirSync(t), i.lstatSync(n).isDirectory() && (e = i.readdirSync(n), e.forEach(function(o) {
10
- const y = i.join(n, o);
11
- i.lstatSync(y).isDirectory() ? s(y, t) : r(y, t);
12
- }));
13
- }
14
- const S = (n, c) => {
15
- i.existsSync(n) || i.mkdirSync(n, { recursive: !0 }), s(c, n);
16
- };
17
- export {
18
- S as copyAssets
19
- };
@@ -1 +0,0 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.web_component_copy_assets={}))})(this,function(t){"use strict";const e={};function f(n,i){let c=i;e.existsSync(i)&&e.lstatSync(i).isDirectory()&&(c=e.join(i,e.basename(n))),e.writeFileSync(c,e.readFileSync(n))}function y(n,i){let c=[];const o=e.join(i,e.basename(n));e.existsSync(o)||e.mkdirSync(o),e.lstatSync(n).isDirectory()&&(c=e.readdirSync(n),c.forEach(function(l){const s=e.join(n,l);e.lstatSync(s).isDirectory()?y(s,o):f(s,o)}))}const d=(n,i)=>{e.existsSync(n)||e.mkdirSync(n,{recursive:!0}),y(i,n)};t.copyAssets=d,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
@@ -1,76 +0,0 @@
1
- import tinycolor from 'tinycolor2'
2
-
3
- import { hslColorMap } from './hslColorMap'
4
-
5
- type ColorMap = {
6
- [key: string]: string
7
- }
8
-
9
- /**
10
- * Color palette based on the structure thats compatible with Tailwind config
11
- */
12
- export const colorPalette = {
13
- neutral: hslColorMap(
14
- 206,
15
- 30,
16
- [
17
- 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95,
18
- 97, 98, 100,
19
- ]
20
- ),
21
- honey: hslColorMap(42, 93, [72, 75, 82, 85, 92]),
22
- coral: hslColorMap(14, 87, [65, 74, 75, 84, 85, 94]),
23
- warm: hslColorMap(25, 100, [77, 87, 97]),
24
- 'sea-salt': hslColorMap(180, 17, [57, 67, 88]),
25
- cloud: hslColorMap(200, 38, [43, 75, 88]),
26
- ocean: hslColorMap(209, 38, [38, 75, 88]),
27
- sky: hslColorMap(209, 64, [64, 75, 85]),
28
- lukso: hslColorMap(335, 33, [70, 80, 90]),
29
- yellow: hslColorMap(36, 100, [55, 65, 75, 85]),
30
- green: hslColorMap(135, 57, [45, 54, 75, 85]),
31
- blue: hslColorMap(216, 96, [50, 60, 75, 85]),
32
- red: hslColorMap(0, 75, [55, 65, 75, 85]),
33
- purple: hslColorMap(230, 24, [94, 82, 63, 58, 51, 41, 31, 15]),
34
- pink: hslColorMap(11, 73, [97, 96, 95, 94, 93, 92, 91, 90]),
35
- 'gradient-1': {
36
- start: '#D39B9D',
37
- end: '#9071D1',
38
- },
39
- 'gradient-2': {
40
- start: '#F8DAD3',
41
- end: '#CC99AE',
42
- },
43
- 'gradient-3': {
44
- start: tinycolor({ h: 230, s: 20, l: 28 }).toHexString(),
45
- end: tinycolor({ h: 230, s: 24, l: 51 }).toHexString(),
46
- },
47
- }
48
-
49
- /**
50
- * Splits a color map into smaller color maps
51
- *
52
- * @param colors - color map to split
53
- * @param from - index to start from
54
- * @param to - index to end at
55
- * @returns a new color map
56
- */
57
- const splitColor = (colors: ColorMap, from: number, to: number): ColorMap => {
58
- return Object.keys(colors)
59
- .slice(from, to)
60
- .reduce((result, key) => {
61
- result[key] = colors[key]
62
-
63
- return result
64
- }, {})
65
- }
66
-
67
- /**
68
- * Color map subsets that can be used in the Storybook preview
69
- */
70
- export const neutral1 = splitColor(colorPalette.neutral, 0, 8)
71
- export const neutral2 = splitColor(colorPalette.neutral, 8, 16)
72
- export const neutral3 = splitColor(
73
- colorPalette.neutral,
74
- 16,
75
- Object.keys(colorPalette.neutral).length
76
- )
@@ -1,2 +0,0 @@
1
- export declare const copyAssets: (assetDir: string, assets: any) => void;
2
- //# sourceMappingURL=copy-assets.d.ts.map
@@ -1,20 +0,0 @@
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
- }