@paperless/core 0.0.3-alpha.3 → 0.1.0-alpha.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 (145) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +14 -10
  3. package/dist/assets/icons/arrow.svg +1 -1
  4. package/dist/assets/icons/attachment.svg +1 -1
  5. package/dist/assets/icons/bread.svg +1 -1
  6. package/dist/assets/icons/calendar.svg +1 -1
  7. package/dist/assets/icons/car.svg +1 -1
  8. package/dist/assets/icons/checkmark.svg +1 -1
  9. package/dist/assets/icons/chevron.svg +1 -1
  10. package/dist/assets/icons/clock.svg +1 -1
  11. package/dist/assets/icons/cogs.svg +1 -1
  12. package/dist/assets/icons/comment.svg +1 -1
  13. package/dist/assets/icons/document.svg +1 -1
  14. package/dist/assets/icons/download.svg +1 -1
  15. package/dist/assets/icons/envelope.svg +1 -1
  16. package/dist/assets/icons/explanation.svg +1 -1
  17. package/dist/assets/icons/eye.svg +1 -1
  18. package/dist/assets/icons/filter.svg +1 -1
  19. package/dist/assets/icons/grid.svg +1 -1
  20. package/dist/assets/icons/headset.svg +1 -1
  21. package/dist/assets/icons/list.svg +1 -1
  22. package/dist/assets/icons/location.svg +1 -1
  23. package/dist/assets/icons/megaphone.svg +1 -1
  24. package/dist/assets/icons/minus.svg +1 -1
  25. package/dist/assets/icons/negative.svg +1 -1
  26. package/dist/assets/icons/pagination.svg +1 -1
  27. package/dist/assets/icons/payment.svg +1 -1
  28. package/dist/assets/icons/pencil.svg +1 -1
  29. package/dist/assets/icons/person.svg +1 -1
  30. package/dist/assets/icons/plus.svg +1 -1
  31. package/dist/assets/icons/question.svg +1 -1
  32. package/dist/assets/icons/receipt.svg +1 -1
  33. package/dist/assets/icons/report.svg +1 -1
  34. package/dist/assets/icons/search.svg +1 -1
  35. package/dist/assets/icons/settings.svg +1 -1
  36. package/dist/assets/icons/sick.svg +1 -1
  37. package/dist/assets/icons/tachometer.svg +1 -1
  38. package/dist/assets/icons/tool.svg +1 -1
  39. package/dist/assets/icons/trash.svg +1 -1
  40. package/dist/assets/icons/turn.svg +1 -1
  41. package/dist/assets/icons/upload.svg +1 -1
  42. package/dist/assets/icons/warning.svg +1 -1
  43. package/dist/build/p-3318b73b.entry.js +1 -0
  44. package/dist/build/p-6f9229a6.js +2 -0
  45. package/dist/build/p-711630fb.entry.js +1 -0
  46. package/dist/build/p-98d636b6.entry.js +1 -0
  47. package/dist/build/p-c3d80205.entry.js +1 -0
  48. package/dist/build/paperless.css +22 -12
  49. package/dist/build/paperless.esm.js +1 -1
  50. package/dist/cjs/{index-e3e940d8.js → index-6758a39e.js} +155 -7
  51. package/dist/cjs/loader.cjs.js +2 -2
  52. package/dist/cjs/p-button.cjs.entry.js +4 -4
  53. package/dist/cjs/p-icon.cjs.entry.js +802 -0
  54. package/dist/cjs/p-illustration.cjs.entry.js +1426 -0
  55. package/dist/cjs/p-tooltip.cjs.entry.js +1873 -0
  56. package/dist/cjs/paperless.cjs.js +2 -2
  57. package/dist/collection/assets/icons/arrow.svg +1 -1
  58. package/dist/collection/assets/icons/attachment.svg +1 -1
  59. package/dist/collection/assets/icons/bread.svg +1 -1
  60. package/dist/collection/assets/icons/calendar.svg +1 -1
  61. package/dist/collection/assets/icons/car.svg +1 -1
  62. package/dist/collection/assets/icons/checkmark.svg +1 -1
  63. package/dist/collection/assets/icons/chevron.svg +1 -1
  64. package/dist/collection/assets/icons/clock.svg +1 -1
  65. package/dist/collection/assets/icons/cogs.svg +1 -1
  66. package/dist/collection/assets/icons/comment.svg +1 -1
  67. package/dist/collection/assets/icons/document.svg +1 -1
  68. package/dist/collection/assets/icons/download.svg +1 -1
  69. package/dist/collection/assets/icons/envelope.svg +1 -1
  70. package/dist/collection/assets/icons/explanation.svg +1 -1
  71. package/dist/collection/assets/icons/eye.svg +1 -1
  72. package/dist/collection/assets/icons/filter.svg +1 -1
  73. package/dist/collection/assets/icons/grid.svg +1 -1
  74. package/dist/collection/assets/icons/headset.svg +1 -1
  75. package/dist/collection/assets/icons/list.svg +1 -1
  76. package/dist/collection/assets/icons/location.svg +1 -1
  77. package/dist/collection/assets/icons/megaphone.svg +1 -1
  78. package/dist/collection/assets/icons/minus.svg +1 -1
  79. package/dist/collection/assets/icons/negative.svg +1 -1
  80. package/dist/collection/assets/icons/pagination.svg +1 -1
  81. package/dist/collection/assets/icons/payment.svg +1 -1
  82. package/dist/collection/assets/icons/pencil.svg +1 -1
  83. package/dist/collection/assets/icons/person.svg +1 -1
  84. package/dist/collection/assets/icons/plus.svg +1 -1
  85. package/dist/collection/assets/icons/question.svg +1 -1
  86. package/dist/collection/assets/icons/receipt.svg +1 -1
  87. package/dist/collection/assets/icons/report.svg +1 -1
  88. package/dist/collection/assets/icons/search.svg +1 -1
  89. package/dist/collection/assets/icons/settings.svg +1 -1
  90. package/dist/collection/assets/icons/sick.svg +1 -1
  91. package/dist/collection/assets/icons/tachometer.svg +1 -1
  92. package/dist/collection/assets/icons/tool.svg +1 -1
  93. package/dist/collection/assets/icons/trash.svg +1 -1
  94. package/dist/collection/assets/icons/turn.svg +1 -1
  95. package/dist/collection/assets/icons/upload.svg +1 -1
  96. package/dist/collection/assets/icons/warning.svg +1 -1
  97. package/dist/collection/collection-manifest.json +4 -1
  98. package/dist/collection/components/button/button.component.js +6 -5
  99. package/dist/collection/components/icon/icon.component.js +108 -0
  100. package/dist/collection/components/illustration/illustration.component.js +39 -0
  101. package/dist/collection/components/tooltip/tooltip.component.css +34 -0
  102. package/dist/collection/components/tooltip/tooltip.component.js +174 -0
  103. package/dist/collection/tailwind/border-radius.js +1 -0
  104. package/dist/collection/tailwind/grid.js +6 -0
  105. package/dist/collection/tailwind.config.js +10 -0
  106. package/dist/collection/utils/icons.js +82 -0
  107. package/dist/collection/utils/illustrations.js +18 -0
  108. package/dist/components/index.d.ts +3 -0
  109. package/dist/components/index.js +3 -0
  110. package/dist/components/p-button.js +4 -4
  111. package/dist/components/p-icon.d.ts +11 -0
  112. package/dist/components/p-icon.js +820 -0
  113. package/dist/components/p-illustration.d.ts +11 -0
  114. package/dist/components/p-illustration.js +1441 -0
  115. package/dist/components/p-tooltip.d.ts +11 -0
  116. package/dist/components/p-tooltip.js +1891 -0
  117. package/dist/esm/{index-100a5ae6.js → index-e4d80e41.js} +154 -8
  118. package/dist/esm/loader.js +2 -2
  119. package/dist/esm/p-button.entry.js +4 -4
  120. package/dist/esm/p-icon.entry.js +798 -0
  121. package/dist/esm/p-illustration.entry.js +1422 -0
  122. package/dist/esm/p-tooltip.entry.js +1869 -0
  123. package/dist/esm/paperless.js +2 -2
  124. package/dist/index.html +1 -1
  125. package/dist/paperless/p-3318b73b.entry.js +1 -0
  126. package/dist/paperless/p-6f9229a6.js +2 -0
  127. package/dist/paperless/p-711630fb.entry.js +1 -0
  128. package/dist/paperless/p-98d636b6.entry.js +1 -0
  129. package/dist/paperless/p-c3d80205.entry.js +1 -0
  130. package/dist/paperless/paperless.css +23382 -13
  131. package/dist/paperless/paperless.esm.js +1 -1
  132. package/dist/sw.js +100 -21
  133. package/dist/tailwind.config.js +10 -0
  134. package/dist/types/components/button/button.component.d.ts +1 -1
  135. package/dist/types/components/icon/icon.component.d.ts +22 -0
  136. package/dist/types/components/illustration/illustration.component.d.ts +9 -0
  137. package/dist/types/components/tooltip/tooltip.component.d.ts +28 -0
  138. package/dist/types/components.d.ts +108 -2
  139. package/dist/types/utils/icons.d.ts +43 -0
  140. package/dist/types/utils/illustrations.d.ts +11 -0
  141. package/package.json +6 -2
  142. package/dist/build/p-54459ae1.js +0 -2
  143. package/dist/build/p-c66e9743.entry.js +0 -1
  144. package/dist/paperless/p-54459ae1.js +0 -2
  145. package/dist/paperless/p-c66e9743.entry.js +0 -1
@@ -0,0 +1,174 @@
1
+ import { createPopper } from '@popperjs/core';
2
+ import { Component, Element, h, Host, Listen, Prop } from '@stencil/core';
3
+ export class Tooltip {
4
+ constructor() {
5
+ /**
6
+ * The content of the tooltip
7
+ */
8
+ this.content = null;
9
+ /**
10
+ * The content of the tooltip
11
+ */
12
+ this.placement = 'top';
13
+ /**
14
+ * Wether to force show the tooltip
15
+ */
16
+ this.forceShow = false;
17
+ this._loaded = false;
18
+ }
19
+ componentShouldUpdate() {
20
+ this._setOptions();
21
+ if (this.forceShow) {
22
+ this._show();
23
+ }
24
+ }
25
+ render() {
26
+ return (h(Host, null,
27
+ h("slot", null),
28
+ h("div", { class: "tooltip", role: "tooltip", ref: el => this._load(el) },
29
+ this.content,
30
+ h("div", { class: "arrow", "data-popper-arrow": true }))));
31
+ }
32
+ _show() {
33
+ if (!this._loaded) {
34
+ return;
35
+ }
36
+ // Make the tooltip visible
37
+ this._tooltip.setAttribute('data-show', '');
38
+ // Enable the event listeners
39
+ this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: true }] })));
40
+ // Update its position
41
+ this._popper.update();
42
+ }
43
+ _hide() {
44
+ if (!this._loaded && !this.forceShow) {
45
+ return;
46
+ }
47
+ // Hide the tooltip
48
+ this._tooltip.removeAttribute('data-show');
49
+ // Disable the event listeners
50
+ this._popper.setOptions(options => (Object.assign(Object.assign({}, options), { modifiers: [...options.modifiers, { name: 'eventListeners', enabled: false }] })));
51
+ }
52
+ _load(tooltip) {
53
+ this._tooltip = tooltip;
54
+ if (tooltip) {
55
+ this._popper = createPopper(this._el, tooltip);
56
+ this._setOptions();
57
+ this._loaded = true;
58
+ if (this.forceShow) {
59
+ this._show();
60
+ }
61
+ }
62
+ }
63
+ _setOptions() {
64
+ if (!this._popper) {
65
+ return;
66
+ }
67
+ this._popper.setOptions({
68
+ placement: this.placement,
69
+ modifiers: [
70
+ {
71
+ name: 'offset',
72
+ options: {
73
+ offset: [0, 8],
74
+ },
75
+ },
76
+ ],
77
+ });
78
+ }
79
+ static get is() { return "p-tooltip"; }
80
+ static get encapsulation() { return "shadow"; }
81
+ static get originalStyleUrls() { return {
82
+ "$": ["tooltip.component.scss"]
83
+ }; }
84
+ static get styleUrls() { return {
85
+ "$": ["tooltip.component.css"]
86
+ }; }
87
+ static get properties() { return {
88
+ "content": {
89
+ "type": "any",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "any",
93
+ "resolved": "any",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": false,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": "The content of the tooltip"
101
+ },
102
+ "attribute": "content",
103
+ "reflect": false,
104
+ "defaultValue": "null"
105
+ },
106
+ "placement": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "Placement",
111
+ "resolved": "\"auto\" | \"auto-end\" | \"auto-start\" | \"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
112
+ "references": {
113
+ "Placement": {
114
+ "location": "import",
115
+ "path": "@popperjs/core"
116
+ }
117
+ }
118
+ },
119
+ "required": false,
120
+ "optional": false,
121
+ "docs": {
122
+ "tags": [],
123
+ "text": "The content of the tooltip"
124
+ },
125
+ "attribute": "placement",
126
+ "reflect": false,
127
+ "defaultValue": "'top'"
128
+ },
129
+ "forceShow": {
130
+ "type": "boolean",
131
+ "mutable": false,
132
+ "complexType": {
133
+ "original": "boolean",
134
+ "resolved": "boolean",
135
+ "references": {}
136
+ },
137
+ "required": false,
138
+ "optional": false,
139
+ "docs": {
140
+ "tags": [],
141
+ "text": "Wether to force show the tooltip"
142
+ },
143
+ "attribute": "force-show",
144
+ "reflect": false,
145
+ "defaultValue": "false"
146
+ }
147
+ }; }
148
+ static get elementRef() { return "_el"; }
149
+ static get listeners() { return [{
150
+ "name": "mouseenter",
151
+ "method": "_show",
152
+ "target": undefined,
153
+ "capture": false,
154
+ "passive": true
155
+ }, {
156
+ "name": "focus",
157
+ "method": "_show",
158
+ "target": undefined,
159
+ "capture": false,
160
+ "passive": false
161
+ }, {
162
+ "name": "mouseleave",
163
+ "method": "_hide",
164
+ "target": undefined,
165
+ "capture": false,
166
+ "passive": true
167
+ }, {
168
+ "name": "blur",
169
+ "method": "_hide",
170
+ "target": undefined,
171
+ "capture": false,
172
+ "passive": false
173
+ }]; }
174
+ }
@@ -1,6 +1,7 @@
1
1
  module.exports = {
2
2
  large: '0.375rem',
3
3
  DEFAULT: '0.25rem',
4
+ medium: '0.25rem',
4
5
  small: '0.125rem',
5
6
  none: 0,
6
7
  round: '100%',
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ 13: 'repeat(13, minmax(0, 1fr))',
3
+ 14: 'repeat(14, minmax(0, 1fr))',
4
+ 15: 'repeat(15, minmax(0, 1fr))',
5
+ 16: 'repeat(16, minmax(0, 1fr))',
6
+ };
@@ -1,13 +1,23 @@
1
1
  const colors = require('./tailwind/colors');
2
2
  const shadows = require('./tailwind/shadows');
3
3
  const borderRadius = require('./tailwind/border-radius');
4
+ const grid = require('./tailwind/grid');
4
5
 
5
6
  module.exports = {
7
+ important: true,
8
+ safelist: [
9
+ {
10
+ pattern: /./,
11
+ },
12
+ ],
6
13
  theme: {
7
14
  colors,
8
15
  boxShadow: shadows,
9
16
  dropShadow: shadows,
10
17
  borderRadius,
18
+ extends: {
19
+ grid,
20
+ },
11
21
  },
12
22
  variants: {},
13
23
  plugins: [require('@tailwindcss/aspect-ratio')],
@@ -0,0 +1,82 @@
1
+ import arrow from '../assets/icons/arrow.svg';
2
+ import attachment from '../assets/icons/attachment.svg';
3
+ import bread from '../assets/icons/bread.svg';
4
+ import calendar from '../assets/icons/calendar.svg';
5
+ import car from '../assets/icons/car.svg';
6
+ import checkmark from '../assets/icons/checkmark.svg';
7
+ import chevron from '../assets/icons/chevron.svg';
8
+ import clock from '../assets/icons/clock.svg';
9
+ import cogs from '../assets/icons/cogs.svg';
10
+ import comment from '../assets/icons/comment.svg';
11
+ import document from '../assets/icons/document.svg';
12
+ import download from '../assets/icons/download.svg';
13
+ import envelope from '../assets/icons/envelope.svg';
14
+ import explanation from '../assets/icons/explanation.svg';
15
+ import eye from '../assets/icons/eye.svg';
16
+ import filter from '../assets/icons/filter.svg';
17
+ import grid from '../assets/icons/grid.svg';
18
+ import headset from '../assets/icons/headset.svg';
19
+ import list from '../assets/icons/list.svg';
20
+ import location from '../assets/icons/location.svg';
21
+ import megaphone from '../assets/icons/megaphone.svg';
22
+ import minus from '../assets/icons/minus.svg';
23
+ import negative from '../assets/icons/negative.svg';
24
+ import pagination from '../assets/icons/pagination.svg';
25
+ import payment from '../assets/icons/payment.svg';
26
+ import pencil from '../assets/icons/pencil.svg';
27
+ import person from '../assets/icons/person.svg';
28
+ import plus from '../assets/icons/plus.svg';
29
+ import question from '../assets/icons/question.svg';
30
+ import receipt from '../assets/icons/receipt.svg';
31
+ import report from '../assets/icons/report.svg';
32
+ import search from '../assets/icons/search.svg';
33
+ import settings from '../assets/icons/settings.svg';
34
+ import sick from '../assets/icons/sick.svg';
35
+ import tachometer from '../assets/icons/tachometer.svg';
36
+ import tool from '../assets/icons/tool.svg';
37
+ import trash from '../assets/icons/trash.svg';
38
+ import turn from '../assets/icons/turn.svg';
39
+ import upload from '../assets/icons/upload.svg';
40
+ import warning from '../assets/icons/warning.svg';
41
+ export default {
42
+ arrow,
43
+ attachment,
44
+ bread,
45
+ calendar,
46
+ car,
47
+ checkmark,
48
+ chevron,
49
+ clock,
50
+ cogs,
51
+ comment,
52
+ document,
53
+ download,
54
+ envelope,
55
+ explanation,
56
+ eye,
57
+ filter,
58
+ grid,
59
+ headset,
60
+ list,
61
+ location,
62
+ megaphone,
63
+ minus,
64
+ negative,
65
+ pagination,
66
+ payment,
67
+ pencil,
68
+ person,
69
+ plus,
70
+ question,
71
+ receipt,
72
+ report,
73
+ search,
74
+ settings,
75
+ sick,
76
+ tachometer,
77
+ tool,
78
+ trash,
79
+ turn,
80
+ upload,
81
+ warning,
82
+ };
@@ -0,0 +1,18 @@
1
+ import emptyState from '../assets/illustrations/default-empty-state.svg';
2
+ import departments from '../assets/illustrations/departments.svg';
3
+ import expenses from '../assets/illustrations/expenses.svg';
4
+ import functions from '../assets/illustrations/functions.svg';
5
+ import questions from '../assets/illustrations/questions.svg';
6
+ import sickLeave from '../assets/illustrations/sick-leave.svg';
7
+ import timeOff from '../assets/illustrations/time-off.svg';
8
+ import upgradeToHr from '../assets/illustrations/upgrade-to-hr.svg';
9
+ export default {
10
+ 'empty-state': emptyState,
11
+ departments,
12
+ expenses,
13
+ functions,
14
+ questions,
15
+ 'sick-leave': sickLeave,
16
+ 'time-off': timeOff,
17
+ 'upgrade-to-hr': upgradeToHr,
18
+ };
@@ -1,5 +1,8 @@
1
1
  /* paperless custom elements */
2
2
  export { Button as PButton } from '../types/components/p-button/p-button';
3
+ export { Icon as PIcon } from '../types/components/p-icon/p-icon';
4
+ export { Icon as PIllustration } from '../types/components/p-illustration/p-illustration';
5
+ export { Tooltip as PTooltip } from '../types/components/p-tooltip/p-tooltip';
3
6
 
4
7
  /**
5
8
  * Used to manually set the base path where assets can be found.
@@ -1,2 +1,5 @@
1
1
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { PButton, defineCustomElement as defineCustomElementPButton } from './p-button.js';
3
+ export { PIcon, defineCustomElement as defineCustomElementPIcon } from './p-icon.js';
4
+ export { PIllustration, defineCustomElement as defineCustomElementPIllustration } from './p-illustration.js';
5
+ export { PTooltip, defineCustomElement as defineCustomElementPTooltip } from './p-tooltip.js';