tinkiet 0.7.6 → 0.8.2

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 (122) hide show
  1. package/accordion/accordion.d.ts +18 -0
  2. package/accordion/accordion.js +94 -0
  3. package/accordion/accordion.scss.js +4 -0
  4. package/accordion/index.d.ts +1 -0
  5. package/accordion/index.js +1 -0
  6. package/badge/badge.d.ts +15 -0
  7. package/badge/badge.js +27 -0
  8. package/badge/badge.scss.js +4 -0
  9. package/badge/index.d.ts +1 -0
  10. package/badge/index.js +1 -0
  11. package/box/box.d.ts +56 -0
  12. package/box/box.js +182 -0
  13. package/box/box.scss.js +4 -0
  14. package/box/focusable-box.d.ts +13 -0
  15. package/box/focusable-box.js +30 -0
  16. package/box/index.d.ts +1 -0
  17. package/box/index.js +1 -0
  18. package/button/button.d.ts +39 -0
  19. package/button/button.js +125 -0
  20. package/button/button.scss.js +4 -0
  21. package/button/index.d.ts +1 -0
  22. package/button/index.js +1 -0
  23. package/checkbox/checkbox.d.ts +21 -0
  24. package/checkbox/checkbox.js +83 -0
  25. package/checkbox/checkbox.scss.js +4 -0
  26. package/checkbox/index.d.ts +1 -0
  27. package/checkbox/index.js +1 -0
  28. package/dialog/dialog.d.ts +18 -0
  29. package/dialog/dialog.js +58 -0
  30. package/dialog/dialog.scss.js +4 -0
  31. package/dialog/index.d.ts +1 -0
  32. package/dialog/index.js +1 -0
  33. package/form/form.d.ts +15 -0
  34. package/form/form.js +57 -0
  35. package/form/index.d.ts +1 -0
  36. package/form/index.js +1 -0
  37. package/icon/icon.d.ts +17 -0
  38. package/icon/icon.js +77 -0
  39. package/icon/icon.scss.js +4 -0
  40. package/icon/icons.d.ts +7 -0
  41. package/icon/icons.js +24 -0
  42. package/icon/index.d.ts +2 -0
  43. package/icon/index.js +2 -0
  44. package/index.d.ts +23 -0
  45. package/index.d.ts.map +1 -0
  46. package/index.js +45 -0
  47. package/list-item/index.d.ts +1 -0
  48. package/list-item/index.js +1 -0
  49. package/list-item/list-item.d.ts +20 -0
  50. package/list-item/list-item.js +72 -0
  51. package/list-item/list-item.scss.js +4 -0
  52. package/loading/index.d.ts +1 -0
  53. package/loading/index.js +1 -0
  54. package/loading/loading.d.ts +14 -0
  55. package/loading/loading.js +61 -0
  56. package/loading/loading.scss.js +4 -0
  57. package/navbar/index.d.ts +1 -0
  58. package/navbar/index.js +1 -0
  59. package/navbar/navbar.d.ts +11 -0
  60. package/navbar/navbar.js +33 -0
  61. package/navbar/navbar.scss.js +4 -0
  62. package/notie/index.d.ts +1 -0
  63. package/notie/index.js +1 -0
  64. package/notie/notie.d.ts +69 -0
  65. package/notie/notie.js +193 -0
  66. package/notie/notie.scss.js +4 -0
  67. package/package.json +4 -9
  68. package/pages/index.d.ts +1 -0
  69. package/pages/index.js +1 -0
  70. package/pages/pages.d.ts +18 -0
  71. package/pages/pages.js +75 -0
  72. package/pages/pages.scss.js +4 -0
  73. package/radio/index.d.ts +1 -0
  74. package/radio/index.js +1 -0
  75. package/radio/radio.d.ts +24 -0
  76. package/radio/radio.js +98 -0
  77. package/radio/radio.scss.js +4 -0
  78. package/select/index.d.ts +1 -0
  79. package/select/index.js +1 -0
  80. package/select/select.d.ts +32 -0
  81. package/select/select.js +132 -0
  82. package/select/select.scss.js +4 -0
  83. package/slider/index.d.ts +1 -0
  84. package/slider/index.js +1 -0
  85. package/slider/slider.d.ts +30 -0
  86. package/slider/slider.js +135 -0
  87. package/slider/slider.scss.js +4 -0
  88. package/switch/index.d.ts +1 -0
  89. package/switch/index.js +1 -0
  90. package/switch/switch.d.ts +24 -0
  91. package/switch/switch.js +99 -0
  92. package/switch/switch.scss.js +4 -0
  93. package/tab-group/index.d.ts +1 -0
  94. package/tab-group/index.js +1 -0
  95. package/tab-group/tab-group.d.ts +21 -0
  96. package/tab-group/tab-group.js +97 -0
  97. package/tab-group/tab-group.scss.js +4 -0
  98. package/tag/index.d.ts +1 -0
  99. package/tag/index.js +1 -0
  100. package/tag/tag.d.ts +11 -0
  101. package/tag/tag.js +20 -0
  102. package/tag/tag.scss.js +4 -0
  103. package/textarea/index.d.ts +1 -0
  104. package/textarea/index.js +1 -0
  105. package/textarea/textarea.d.ts +33 -0
  106. package/textarea/textarea.js +133 -0
  107. package/textarea/textarea.scss.js +4 -0
  108. package/textfield/index.d.ts +1 -0
  109. package/textfield/index.js +1 -0
  110. package/textfield/textfield.d.ts +34 -0
  111. package/textfield/textfield.js +136 -0
  112. package/textfield/textfield.scss.js +4 -0
  113. package/theme/index.d.ts +1 -0
  114. package/theme/index.js +1 -0
  115. package/theme/theme.d.ts +33 -0
  116. package/theme/theme.js +187 -0
  117. package/theme/theme.scss.js +4 -0
  118. package/umd/tinkiet.min.d.ts +3 -30
  119. package/umd/tinkiet.min.d.ts.map +1 -1
  120. package/umd/tinkiet.min.js +1 -1
  121. package/utils/unique.d.ts +7 -0
  122. package/utils/unique.js +12 -0
package/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import './accordion/index.js';
2
+ import './badge/index.js';
3
+ import './box/index.js';
4
+ import './button/index.js';
5
+ import './checkbox/index.js';
6
+ import './dialog/index.js';
7
+ import './form/index.js';
8
+ import './icon/index.js';
9
+ import './list-item/index.js';
10
+ import './loading/index.js';
11
+ import './navbar/index.js';
12
+ import './notie/index.js';
13
+ import './pages/index.js';
14
+ import './radio/index.js';
15
+ import './select/index.js';
16
+ import './slider/index.js';
17
+ import './switch/index.js';
18
+ import './tab-group/index.js';
19
+ import './tag/index.js';
20
+ import './textarea/index.js';
21
+ import './textfield/index.js';
22
+ import './theme/index.js';
23
+ export { TkAccordion } from './accordion/accordion.js';
24
+ export { TkBadge } from './badge/badge.js';
25
+ export { TkBox } from './box/box.js';
26
+ export { TkButton } from './button/button.js';
27
+ export { TkCheckbox } from './checkbox/checkbox.js';
28
+ export { TkDialog } from './dialog/dialog.js';
29
+ export { TkForm } from './form/form.js';
30
+ export { TkIcon } from './icon/icon.js';
31
+ export { TkIcons } from './icon/icons.js';
32
+ export { TkListItem } from './list-item/list-item.js';
33
+ export { TkLoading } from './loading/loading.js';
34
+ export { TkNavbar } from './navbar/navbar.js';
35
+ export { TkNotie } from './notie/notie.js';
36
+ export { TkPages } from './pages/pages.js';
37
+ export { TkRadio } from './radio/radio.js';
38
+ export { TkSelect } from './select/select.js';
39
+ export { TkSlider } from './slider/slider.js';
40
+ export { TkSwitch } from './switch/switch.js';
41
+ export { TkTabGroup } from './tab-group/tab-group.js';
42
+ export { TkTag } from './tag/tag.js';
43
+ export { TkTextarea } from './textarea/textarea.js';
44
+ export { TkTextfield } from './textfield/textfield.js';
45
+ export { TkTheme } from './theme/theme.js';
@@ -0,0 +1 @@
1
+ export * from "./list-item";
@@ -0,0 +1 @@
1
+ export { TkListItem } from './list-item.js';
@@ -0,0 +1,20 @@
1
+ import { LitElement } from "lit";
2
+ declare class TkListItem extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ href: string;
5
+ target: string;
6
+ ariaLabel: string;
7
+ protected $ahref: HTMLAnchorElement;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ constructor();
10
+ firstUpdated(): void;
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ protected handleClick(e: Event): void;
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ "tk-list-item": TkListItem;
18
+ }
19
+ }
20
+ export { TkListItem };
@@ -0,0 +1,72 @@
1
+ import { __decorate } from 'tslib';
2
+ import { LitElement, html, css, unsafeCSS } from 'lit';
3
+ import { property, query, customElement } from 'lit/decorators.js';
4
+ import css_248z from './list-item.scss.js';
5
+
6
+ let TkListItem = class TkListItem extends LitElement {
7
+ render() {
8
+ return html `
9
+ <slot name="before" @click=${this.handleClick}></slot>
10
+ <div id="content">
11
+ <slot></slot>
12
+ </div>
13
+ <slot name="after" @click=${this.handleClick}></slot>
14
+ ${this.href
15
+ ? html `
16
+ <a tabindex="-1" id="ahref" href="${this.href}" rel="noreferrer" aria-label=${this.ariaLabel}></a>
17
+ `
18
+ : ""}
19
+ `;
20
+ }
21
+ constructor() {
22
+ super();
23
+ this.href = "";
24
+ this.target = "";
25
+ }
26
+ firstUpdated() {
27
+ if (!this.ariaLabel && this.innerText)
28
+ this.ariaLabel = this.innerText;
29
+ }
30
+ connectedCallback() {
31
+ super.connectedCallback();
32
+ this.addEventListener("click", this.handleClick.bind(this));
33
+ }
34
+ disconnectedCallback() {
35
+ this.removeEventListener("click", this.handleClick);
36
+ super.disconnectedCallback();
37
+ }
38
+ handleClick(e) {
39
+ const target = e.target;
40
+ // In case click cames from a slotted element with href attribute we stop propagation
41
+ if ((target.tagName == "BUTTON" || target.tagName == "TK-BUTTON") && target.hasAttribute("href")) {
42
+ // e.preventDefault();
43
+ //e.stopPropagation();
44
+ }
45
+ ;
46
+ if (this.href && e.isTrusted) {
47
+ e.stopPropagation();
48
+ e.preventDefault();
49
+ this.$ahref.click();
50
+ }
51
+ }
52
+ };
53
+ TkListItem.styles = css `
54
+ ${unsafeCSS(css_248z)}
55
+ `;
56
+ __decorate([
57
+ property({ attribute: true })
58
+ ], TkListItem.prototype, "href", void 0);
59
+ __decorate([
60
+ property({ attribute: true })
61
+ ], TkListItem.prototype, "target", void 0);
62
+ __decorate([
63
+ property({ attribute: "aria-label" })
64
+ ], TkListItem.prototype, "ariaLabel", void 0);
65
+ __decorate([
66
+ query("#ahref")
67
+ ], TkListItem.prototype, "$ahref", void 0);
68
+ TkListItem = __decorate([
69
+ customElement("tk-list-item")
70
+ ], TkListItem);
71
+
72
+ export { TkListItem };
@@ -0,0 +1,4 @@
1
+ var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--text:var(--list-item-color,var(--foreground,#454545));--color:var(--list-item-bg,var(--background,#f7f7f7));align-items:center;background:var(--color);border-radius:var(--list-item-border-radius,var(--border-radius-large,.5rem));color:var(--text);display:flex;outline:none;overflow:hidden;padding:var(--spacing-m,1rem) var(--spacing-m,1rem);position:relative;text-align:left;transition:var(--list-item-transition,background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));will-change:background,color}:host([active]:focus),:host([active]:hover){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}:host([disabled]){--text:var(--shade-dark,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*0.85)));--color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));opacity:.4;pointer-events:none}:host([active]){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1}";
2
+ var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--text:var(--list-item-color,var(--foreground,#454545));--color:var(--list-item-bg,var(--background,#f7f7f7));align-items:center;background:var(--color);border-radius:var(--list-item-border-radius,var(--border-radius-large,.5rem));color:var(--text);display:flex;outline:none;overflow:hidden;padding:var(--spacing-m,1rem) var(--spacing-m,1rem);position:relative;text-align:left;transition:var(--list-item-transition,background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease))}:host([clickable]),:host([href]){user-select:none}:host([clickable]:not([active]):not([disabled])),:host([href]:not([active]):not([disabled])){cursor:pointer}:host(:focus),:host(:hover){--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)));will-change:background,color}:host([active]:focus),:host([active]:hover){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}:host([disabled]){--text:var(--shade-dark,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*0.85)));--color:var(--shade,hsl(var(--shade-h,0),var(--shade-s,0%),var(--shade-l,66.6667%)));opacity:.4;pointer-events:none}:host([active]){--text:var(--primary-darker,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),calc(var(--primary-l, 59.4118%)*0.7)));--color:var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3)))}::slotted([slot=after]),::slotted([slot=before]){flex-shrink:0}::slotted([slot=before]){align-self:var(--list-item-left-align-self,center);margin:0 var(--spacing-m,1rem) 0 0}::slotted([slot=after]){align-self:var(--list-item-left-align-self,center);margin:0 0 0 var(--spacing-m,1rem)}#content{display:flex;flex-direction:column;flex-grow:1}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1 @@
1
+ export * from "./loading";
@@ -0,0 +1 @@
1
+ export { TkLoading } from './loading.js';
@@ -0,0 +1,14 @@
1
+ import { TkBox } from "../box/index";
2
+ declare class TkLoading extends TkBox {
3
+ static get styles(): import("lit").CSSResult[];
4
+ circle: boolean;
5
+ indeterminate: boolean;
6
+ percent: number;
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ "tk-loading": TkLoading;
12
+ }
13
+ }
14
+ export { TkLoading };
@@ -0,0 +1,61 @@
1
+ import { __decorate } from 'tslib';
2
+ import { css, unsafeCSS, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import '../box/index.js';
6
+ import css_248z from './loading.scss.js';
7
+ import { TkBox } from '../box/box.js';
8
+
9
+ let TkLoading = class TkLoading extends TkBox {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.circle = false;
13
+ this.indeterminate = false;
14
+ this.percent = 0;
15
+ }
16
+ static get styles() {
17
+ return [
18
+ ...TkBox.styles,
19
+ css `
20
+ ${unsafeCSS(css_248z)}
21
+ `
22
+ ];
23
+ }
24
+ render() {
25
+ return html `
26
+ ${this.circle
27
+ ? html `
28
+ <svg class="circle" viewBox="0 0 100 100">
29
+ <circle
30
+ class=${classMap({ indeterminate: this.indeterminate, path: true })}
31
+ fill="none"
32
+ stroke-width="1em"
33
+ stroke-linecap="butt"
34
+ cx="50"
35
+ cy="50"
36
+ r="40"
37
+ ></circle>
38
+ </svg>
39
+ `
40
+ : html `
41
+ <div class="line">
42
+ <div class=${classMap({ progress: true, indeterminate: this.indeterminate })} style="${`width:${this.percent}%;`}"></div>
43
+ </div>
44
+ `}
45
+ `;
46
+ }
47
+ };
48
+ __decorate([
49
+ property({ attribute: true, type: Boolean })
50
+ ], TkLoading.prototype, "circle", void 0);
51
+ __decorate([
52
+ property({ attribute: true, type: Boolean })
53
+ ], TkLoading.prototype, "indeterminate", void 0);
54
+ __decorate([
55
+ property({ attribute: true, type: Number })
56
+ ], TkLoading.prototype, "percent", void 0);
57
+ TkLoading = __decorate([
58
+ customElement("tk-loading")
59
+ ], TkLoading);
60
+
61
+ export { TkLoading };
@@ -0,0 +1,4 @@
1
+ var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:currentColor;--background-color:var(--tk-loading-background-color,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([accent]){--color:var(--accent)}:host([error]){--color:var(--error)}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:2em;width:2em}.circle,.circle .path{transform-origin:center}.circle .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.line{background-color:var(--background-color);height:.4em;overflow:hidden;position:relative}.line .progress{height:100%}.line .indeterminate,.line .progress{background-color:var(--color)}.line .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.line .indeterminate:after,.line .indeterminate:before{background-color:inherit;bottom:0;content:\"\";left:0;position:absolute;top:0;will-change:left,right}.line .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}";
2
+ var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:currentColor;--background-color:var(--tk-loading-background-color,var(--shade-lighter,hsl(var(--shade-h,0),var(--shade-s,0%),calc(var(--shade-l, 66.6667%)*1.3))))}:host([accent]){--color:var(--accent)}:host([error]){--color:var(--error)}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:2em;width:2em}.circle,.circle .path{transform-origin:center}.circle .path{stroke-dasharray:265;stroke-dashoffset:0;stroke:var(--color);animation:dash 3s ease-in-out infinite}@keyframes rotator{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes dash{0%{stroke-dashoffset:265}50%{stroke-dashoffset:65;transform:rotate(90deg)}to{stroke-dashoffset:265;transform:rotate(1turn)}}.line{background-color:var(--background-color);height:.4em;overflow:hidden;position:relative}.line .progress{height:100%}.line .indeterminate,.line .progress{background-color:var(--color)}.line .indeterminate:before{animation:indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite}.line .indeterminate:after,.line .indeterminate:before{background-color:inherit;bottom:0;content:\"\";left:0;position:absolute;top:0;will-change:left,right}.line .indeterminate:after{animation:indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;animation-delay:1.15s}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1 @@
1
+ export * from "./navbar";
@@ -0,0 +1 @@
1
+ export { TkNavbar } from './navbar.js';
@@ -0,0 +1,11 @@
1
+ import { TkBox } from "../box/index";
2
+ declare class TkNavbar extends TkBox {
3
+ static get styles(): import("lit").CSSResult[];
4
+ render(): import("lit-html").TemplateResult<1>;
5
+ }
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ "tk-navbar": TkNavbar;
9
+ }
10
+ }
11
+ export { TkNavbar };
@@ -0,0 +1,33 @@
1
+ import { __decorate } from 'tslib';
2
+ import { css, unsafeCSS, html } from 'lit';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import '../box/index.js';
5
+ import css_248z from './navbar.scss.js';
6
+ import { TkBox } from '../box/box.js';
7
+
8
+ let TkNavbar = class TkNavbar extends TkBox {
9
+ static get styles() {
10
+ return [
11
+ ...TkBox.styles,
12
+ css `
13
+ ${unsafeCSS(css_248z)}
14
+ `
15
+ ];
16
+ }
17
+ render() {
18
+ return html `
19
+ <div id="left">
20
+ <slot name="left"></slot>
21
+ <slot name="title"></slot>
22
+ </div>
23
+ <div id="right">
24
+ <slot name="right"></slot>
25
+ </div>
26
+ `;
27
+ }
28
+ };
29
+ TkNavbar = __decorate([
30
+ customElement("tk-navbar")
31
+ ], TkNavbar);
32
+
33
+ export { TkNavbar };
@@ -0,0 +1,4 @@
1
+ var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background:var(--color);color:var(--text);flex-direction:row;justify-content:space-between}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([fixed]){left:0;position:fixed;right:0;top:0;z-index:var(--navbar-z-index,100)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}";
2
+ var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));--text:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));align-items:center;background:var(--color);color:var(--text);flex-direction:row;justify-content:space-between}:host([inverted]){--color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));--text:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)))}:host([fixed]){left:0;position:fixed;right:0;top:0;z-index:var(--navbar-z-index,100)}#left,#right,#title,::slotted([slot=left]),::slotted([slot=right]),::slotted([slot=title]){align-items:center;display:flex;height:100%}#title,::slotted([slot=title]){font-weight:var(--nav-title-font-weight,var(--font-weight-regular,500));margin:var(--nav-title-margin,0 0 0 var(--spacing-l,1.25rem))}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1 @@
1
+ export * from "./notie";
package/notie/index.js ADDED
@@ -0,0 +1 @@
1
+ export { TkNotie } from './notie.js';
@@ -0,0 +1,69 @@
1
+ import { TemplateResult } from "lit";
2
+ import { TkBox } from "../box/index";
3
+ interface NotieOptions {
4
+ background?: string;
5
+ level?: NotieLevel;
6
+ color?: string;
7
+ text?: string;
8
+ delay?: number;
9
+ zIndex?: number;
10
+ template?: TemplateResult;
11
+ container?: HTMLElement;
12
+ position?: "bottom" | "top";
13
+ }
14
+ interface NotieForceOptions extends NotieOptions {
15
+ buttonText?: string;
16
+ }
17
+ interface NotieConfirmOptions extends NotieOptions {
18
+ confirmText?: string;
19
+ cancelText?: string;
20
+ }
21
+ interface NotieInputOptions extends NotieConfirmOptions {
22
+ password?: boolean;
23
+ }
24
+ declare enum NotieType {
25
+ show = "show",
26
+ force = "force",
27
+ confirm = "confirm",
28
+ input = "input"
29
+ }
30
+ declare enum NotieLevel {
31
+ success = "success",
32
+ warning = "warning",
33
+ error = "error",
34
+ info = "info",
35
+ neutral = "neutral"
36
+ }
37
+ declare class TkNotie extends TkBox {
38
+ static get styles(): import("lit").CSSResult[];
39
+ persistent: boolean;
40
+ open: boolean;
41
+ position: NotieOptions["position"];
42
+ type: NotieType;
43
+ level: NotieLevel;
44
+ delay: number;
45
+ animationDelay: number;
46
+ text: string;
47
+ buttonText: string;
48
+ confirmText: string;
49
+ cancelText: string;
50
+ template: TemplateResult;
51
+ private $input;
52
+ private $container;
53
+ private resolve;
54
+ render(): TemplateResult<1>;
55
+ show(): Promise<string | boolean | null>;
56
+ hide(value: boolean | string | null): void;
57
+ constructor(text?: string);
58
+ static show(options: NotieOptions): Promise<boolean | string | null>;
59
+ static force(options: NotieForceOptions): Promise<boolean | string | null>;
60
+ static confirm(options: NotieConfirmOptions): Promise<boolean | string | null>;
61
+ static input(options: NotieInputOptions): Promise<boolean | string | null>;
62
+ private static getNotie;
63
+ }
64
+ declare global {
65
+ interface HTMLElementTagNameMap {
66
+ "tk-notie": TkNotie;
67
+ }
68
+ }
69
+ export { TkNotie };
package/notie/notie.js ADDED
@@ -0,0 +1,193 @@
1
+ import { __decorate } from 'tslib';
2
+ import { css, unsafeCSS, html } from 'lit';
3
+ import { state, property, query, customElement } from 'lit/decorators.js';
4
+ import '../box/index.js';
5
+ import '../textfield/index.js';
6
+ import css_248z from './notie.scss.js';
7
+ import { TkBox } from '../box/box.js';
8
+
9
+ var TkNotie_1;
10
+ var NotieType;
11
+ (function (NotieType) {
12
+ NotieType["show"] = "show";
13
+ NotieType["force"] = "force";
14
+ NotieType["confirm"] = "confirm";
15
+ NotieType["input"] = "input";
16
+ })(NotieType || (NotieType = {}));
17
+ var NotieLevel;
18
+ (function (NotieLevel) {
19
+ NotieLevel["success"] = "success";
20
+ NotieLevel["warning"] = "warning";
21
+ NotieLevel["error"] = "error";
22
+ NotieLevel["info"] = "info";
23
+ NotieLevel["neutral"] = "neutral";
24
+ })(NotieLevel || (NotieLevel = {}));
25
+ let TkNotie = TkNotie_1 = class TkNotie extends TkBox {
26
+ static get styles() {
27
+ return [
28
+ ...TkBox.styles,
29
+ css `
30
+ ${unsafeCSS(css_248z)}
31
+ `
32
+ ];
33
+ }
34
+ render() {
35
+ return html `
36
+ <div class="overlay" @click=${() => this.hide(false)}></div>
37
+ <tk-box class="container ${this.level}">
38
+ ${this.text
39
+ ? html `
40
+ <tk-box class="text" @click="${() => (this.type == NotieType.show ? this.hide(true) : null)}">${this.text}</tk-box>
41
+ `
42
+ : ""}
43
+ ${this.template
44
+ ? html `
45
+ <tk-box class="template" @click="${() => (this.type == NotieType.show ? this.hide(true) : null)}">${this.template}</tk-box>
46
+ `
47
+ : ""}
48
+ ${this.type == NotieType.force
49
+ ? html `
50
+ <tk-box @click="${() => this.hide(true)}" class="button force">${this.buttonText}</tk-box>
51
+ `
52
+ : ""}
53
+ ${this.type == NotieType.input
54
+ ? html `
55
+ <tk-textfield class="input" ></tk-textfield>
56
+ `
57
+ : ""}
58
+ ${this.type == NotieType.confirm || this.type == NotieType.input
59
+ ? html `
60
+ <tk-box direction="row">
61
+ <tk-box justify="center" align-items="center" flex="grow" @click="${() => this.hide(true)}" class="button confirm">
62
+ ${this.confirmText}
63
+ </tk-box>
64
+ <tk-box justify="center" align-items="center" flex="grow" @click="${() => this.hide(false)}" class="button confirm cancel">
65
+ ${this.cancelText}
66
+ </tk-box>
67
+ </tk-box>
68
+ `
69
+ : ""}
70
+ </tk-box>
71
+ `;
72
+ }
73
+ show() {
74
+ return new Promise(resolve => {
75
+ this.resolve = resolve;
76
+ this.style.setProperty("display", "flex");
77
+ setTimeout(() => (this.open = true));
78
+ this.dispatchEvent(new Event("didShow"));
79
+ if (this.$input)
80
+ setTimeout(() => this.$input.focus());
81
+ if (this.type == NotieType.show)
82
+ setTimeout(() => this.hide(false), this.delay);
83
+ });
84
+ }
85
+ hide(value) {
86
+ if (value && this.type === NotieType.input)
87
+ value = this.$input.value;
88
+ if (!value && this.type === NotieType.input)
89
+ value = null;
90
+ this.$input ? (this.$input.value = "") : null;
91
+ this.$container.addEventListener("transitionend", () => {
92
+ this.dispatchEvent(new Event("didHide"));
93
+ this.resolve(value);
94
+ if (!this.persistent)
95
+ this.remove();
96
+ }, { once: true });
97
+ this.open = false;
98
+ }
99
+ constructor(text = "") {
100
+ super();
101
+ this.persistent = true;
102
+ this.open = false;
103
+ this.position = "bottom";
104
+ this.type = NotieType.show;
105
+ this.level = NotieLevel.info;
106
+ this.delay = 3000;
107
+ this.animationDelay = 300;
108
+ this.buttonText = "OK";
109
+ this.confirmText = "OK";
110
+ this.cancelText = "CANCEL";
111
+ this.text = text;
112
+ }
113
+ static show(options) {
114
+ const notie = this.getNotie(options, NotieType.show);
115
+ return notie.show();
116
+ }
117
+ static force(options) {
118
+ const notie = this.getNotie(options, NotieType.force);
119
+ options.buttonText ? (notie.buttonText = options.buttonText) : null;
120
+ return notie.show();
121
+ }
122
+ static confirm(options) {
123
+ const notie = this.getNotie(options, NotieType.confirm);
124
+ options.confirmText ? (notie.confirmText = options.confirmText) : null;
125
+ options.cancelText ? (notie.cancelText = options.cancelText) : null;
126
+ return notie.show();
127
+ }
128
+ static input(options) {
129
+ const notie = this.getNotie(options, NotieType.input);
130
+ options.password ? (notie.$input.type = "password") : null;
131
+ options.confirmText ? (notie.confirmText = options.confirmText) : null;
132
+ options.cancelText ? (notie.cancelText = options.cancelText) : null;
133
+ return notie.show();
134
+ }
135
+ static getNotie(options, type) {
136
+ var _a, _b;
137
+ const notie = new TkNotie_1(options.text);
138
+ notie.persistent = false;
139
+ notie.type = type;
140
+ notie.delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 999999999;
141
+ options.template ? (notie.template = options.template) : null;
142
+ options.position ? (notie.position = options.position) : null;
143
+ options.background && notie.$container ? notie.$container.setAttribute("background-color", options.background) : null;
144
+ options.color && notie.$container ? notie.$container.setAttribute("color", options.color) : null;
145
+ options.container ? (_b = options.container.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(notie) : window.document.body.appendChild(notie);
146
+ options.zIndex ? notie.style.setProperty("z-index", options.zIndex.toString()) : null;
147
+ return notie;
148
+ }
149
+ };
150
+ __decorate([
151
+ state()
152
+ ], TkNotie.prototype, "persistent", void 0);
153
+ __decorate([
154
+ property({ type: Boolean, reflect: true })
155
+ ], TkNotie.prototype, "open", void 0);
156
+ __decorate([
157
+ property({ reflect: true })
158
+ ], TkNotie.prototype, "position", void 0);
159
+ __decorate([
160
+ property({ type: String })
161
+ ], TkNotie.prototype, "type", void 0);
162
+ __decorate([
163
+ property({ type: String })
164
+ ], TkNotie.prototype, "level", void 0);
165
+ __decorate([
166
+ property({ type: Number })
167
+ ], TkNotie.prototype, "delay", void 0);
168
+ __decorate([
169
+ property()
170
+ ], TkNotie.prototype, "text", void 0);
171
+ __decorate([
172
+ property()
173
+ ], TkNotie.prototype, "buttonText", void 0);
174
+ __decorate([
175
+ property()
176
+ ], TkNotie.prototype, "confirmText", void 0);
177
+ __decorate([
178
+ property()
179
+ ], TkNotie.prototype, "cancelText", void 0);
180
+ __decorate([
181
+ property({ type: Object })
182
+ ], TkNotie.prototype, "template", void 0);
183
+ __decorate([
184
+ query("tk-textfield")
185
+ ], TkNotie.prototype, "$input", void 0);
186
+ __decorate([
187
+ query(".container")
188
+ ], TkNotie.prototype, "$container", void 0);
189
+ TkNotie = TkNotie_1 = __decorate([
190
+ customElement("tk-notie")
191
+ ], TkNotie);
192
+
193
+ export { TkNotie };
@@ -0,0 +1,4 @@
1
+ var css_248z = ":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}";
2
+ var stylesheet=":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .container{background-color:var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%)));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%)));height:fit-content;left:0;position:fixed;right:0;text-align:center;transform:translateY(100%);transition:all .15s ease-in;z-index:calc(var(--notie-z-index, 400) + 1)}:host .container.info{background-color:#4d82d6}:host .container.error{background-color:#e1715b}:host .container.warning{background-color:#d6a14d}:host .container.success{background-color:#57bf57}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background);color:var(--foreground);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.forcer{background-color:#57bf57;color:#fff}:host .button.cancel{background-color:var(--error,#e1715b);color:var(--on-error,#fff)}@media screen and (max-width:900px){:host{font-size:1.4rem}}@media screen and (max-width:750px){:host{font-size:1.2rem}}@media screen and (max-width:400px){:host{font-size:1rem}}:host([position=top]) .container{bottom:inherit;position:fixed;top:0;transform:translateY(-100%)}:host([open]) .container{transform:translateY(0)}";
3
+
4
+ export { css_248z as default, stylesheet };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinkiet",
3
- "version": "0.7.6",
3
+ "version": "0.8.2",
4
4
  "description": "Pragmatic UI Web Components",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -19,18 +19,13 @@
19
19
  "component",
20
20
  "element"
21
21
  ],
22
- "scripts": {
23
- "clean": "rimraf ./dist",
24
- "blib": "rollup -c rollup.config.mjs",
25
- "build": "rimraf ./dist && rollup -c rollup.config.mjs"
26
- },
27
22
  "author": "Cyrille Colin <cyrille.colin@educ.cloud>",
28
23
  "license": "MIT",
29
24
  "homepage": "https://tinkiet.educ.cloud",
30
25
  "dependencies": {
31
- "contactjs": "^2.1.3",
32
- "lit": "^2.2.7",
33
- "tslib": "^2.4.0"
26
+ "contactjs": "^2.1.5",
27
+ "lit": "^2.6.1",
28
+ "tslib": "^2.5.0"
34
29
  },
35
30
  "contributors": [
36
31
  {
@@ -0,0 +1 @@
1
+ export * from "./pages";
package/pages/index.js ADDED
@@ -0,0 +1 @@
1
+ export { TkPages } from './pages.js';
@@ -0,0 +1,18 @@
1
+ import { LitElement } from "lit";
2
+ declare class TkPages extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ private _page;
5
+ set page(val: string);
6
+ get page(): string;
7
+ selected: string;
8
+ handleScroll: boolean;
9
+ private scrollHistory;
10
+ render(): import("lit-html").TemplateResult<1>;
11
+ updated(props: any): void;
12
+ }
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ "tk-pages": TkPages;
16
+ }
17
+ }
18
+ export { TkPages };