tinkiet 0.9.12 → 0.10.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 (144) hide show
  1. package/accordion/accordion.d.ts +3 -4
  2. package/accordion/index.d.ts +1 -1
  3. package/accordion/index.js +491 -1
  4. package/badge/badge.d.ts +2 -3
  5. package/badge/index.d.ts +1 -1
  6. package/badge/index.js +134 -1
  7. package/box/box.d.ts +3 -3
  8. package/box/focusable-box.d.ts +2 -3
  9. package/box/index.d.ts +1 -1
  10. package/box/index.js +289 -1
  11. package/button/button.d.ts +3 -4
  12. package/button/index.d.ts +1 -1
  13. package/button/index.js +502 -1
  14. package/checkbox/checkbox.d.ts +3 -3
  15. package/checkbox/index.d.ts +1 -1
  16. package/checkbox/index.js +450 -1
  17. package/chip/chip.d.ts +2 -3
  18. package/chip/index.d.ts +1 -1
  19. package/chip/index.js +123 -1
  20. package/dialog/dialog.d.ts +2 -3
  21. package/dialog/index.d.ts +1 -1
  22. package/dialog/index.js +162 -1
  23. package/drawer/drawer.d.ts +2 -3
  24. package/drawer/index.d.ts +1 -1
  25. package/drawer/index.js +272 -1
  26. package/form/form.d.ts +1 -2
  27. package/form/index.d.ts +1 -1
  28. package/form/index.js +149 -1
  29. package/icon/icon.d.ts +3 -4
  30. package/icon/icons.d.ts +1 -2
  31. package/icon/index.d.ts +2 -2
  32. package/icon/index.js +457 -2
  33. package/index.d.ts +52 -26
  34. package/index.js +3682 -52
  35. package/list-item/index.d.ts +1 -1
  36. package/list-item/index.js +414 -1
  37. package/list-item/list-item.d.ts +3 -4
  38. package/loading/index.d.ts +1 -1
  39. package/loading/index.js +389 -1
  40. package/loading/loading.d.ts +3 -4
  41. package/navigation/index.d.ts +2 -2
  42. package/navigation/index.js +201 -2
  43. package/navigation/navigation-bar.d.ts +2 -3
  44. package/navigation/navigation-item.d.ts +2 -3
  45. package/notie/index.d.ts +1 -1
  46. package/notie/index.js +744 -1
  47. package/notie/notie.d.ts +12 -11
  48. package/package.json +8 -5
  49. package/pages/index.d.ts +1 -1
  50. package/pages/index.js +178 -1
  51. package/pages/pages.d.ts +2 -3
  52. package/radio/index.d.ts +1 -1
  53. package/radio/index.js +466 -1
  54. package/radio/radio.d.ts +3 -3
  55. package/select/index.d.ts +1 -1
  56. package/select/index.js +493 -1
  57. package/select/select.d.ts +3 -3
  58. package/slider/index.d.ts +1 -1
  59. package/slider/index.js +274 -1
  60. package/slider/slider.d.ts +2 -3
  61. package/snackbar/index.d.ts +1 -0
  62. package/snackbar/snackbar.d.ts +34 -0
  63. package/switch/index.d.ts +1 -1
  64. package/switch/index.js +462 -1
  65. package/switch/switch.d.ts +3 -3
  66. package/tab-group/index.d.ts +1 -1
  67. package/tab-group/index.js +182 -1
  68. package/tab-group/tab-group.d.ts +2 -3
  69. package/tab-group/tab-item.d.ts +7 -0
  70. package/textarea/index.d.ts +1 -1
  71. package/textarea/index.js +272 -1
  72. package/textarea/textarea.d.ts +2 -3
  73. package/textfield/index.d.ts +1 -1
  74. package/textfield/index.js +278 -1
  75. package/textfield/textfield.d.ts +2 -3
  76. package/theme/index.d.ts +1 -1
  77. package/theme/index.js +240 -1
  78. package/theme/theme.d.ts +2 -3
  79. package/tooltip/index.d.ts +1 -1
  80. package/tooltip/index.js +136 -1
  81. package/tooltip/tooltip.d.ts +2 -3
  82. package/topbar/index.d.ts +1 -1
  83. package/topbar/index.js +358 -1
  84. package/topbar/topbar.d.ts +3 -4
  85. package/umd/tinkiet.min.js +420 -1
  86. package/utils/aria.d.ts +11 -0
  87. package/utils/unique.d.ts +1 -2
  88. package/accordion/accordion.js +0 -94
  89. package/accordion/accordion.scss.js +0 -4
  90. package/badge/badge.js +0 -31
  91. package/badge/badge.scss.js +0 -4
  92. package/box/box.js +0 -186
  93. package/box/box.scss.js +0 -4
  94. package/box/focusable-box.js +0 -30
  95. package/button/button.js +0 -141
  96. package/button/button.scss.js +0 -4
  97. package/checkbox/checkbox.js +0 -89
  98. package/checkbox/checkbox.scss.js +0 -4
  99. package/chip/chip.js +0 -20
  100. package/chip/chip.scss.js +0 -4
  101. package/dialog/dialog.js +0 -59
  102. package/dialog/dialog.scss.js +0 -4
  103. package/drawer/drawer.js +0 -168
  104. package/drawer/drawer.scss.js +0 -4
  105. package/form/form.js +0 -54
  106. package/icon/icon.js +0 -77
  107. package/icon/icon.scss.js +0 -4
  108. package/icon/icons.js +0 -24
  109. package/index.d.ts.map +0 -1
  110. package/list-item/list-item.js +0 -86
  111. package/list-item/list-item.scss.js +0 -4
  112. package/loading/loading.js +0 -61
  113. package/loading/loading.scss.js +0 -4
  114. package/navigation/navigation-bar.js +0 -20
  115. package/navigation/navigation-bar.scss.js +0 -4
  116. package/navigation/navigation-item.js +0 -51
  117. package/navigation/navigation-item.scss.js +0 -4
  118. package/notie/notie.js +0 -201
  119. package/notie/notie.scss.js +0 -4
  120. package/pages/pages.js +0 -75
  121. package/pages/pages.scss.js +0 -4
  122. package/radio/radio.js +0 -105
  123. package/radio/radio.scss.js +0 -4
  124. package/select/select.js +0 -132
  125. package/select/select.scss.js +0 -4
  126. package/slider/slider.js +0 -135
  127. package/slider/slider.scss.js +0 -4
  128. package/switch/switch.js +0 -101
  129. package/switch/switch.scss.js +0 -4
  130. package/tab-group/tab-group.js +0 -79
  131. package/tab-group/tab-group.scss.js +0 -4
  132. package/textarea/textarea.js +0 -133
  133. package/textarea/textarea.scss.js +0 -4
  134. package/textfield/textfield.js +0 -138
  135. package/textfield/textfield.scss.js +0 -4
  136. package/theme/theme.js +0 -137
  137. package/theme/theme.scss.js +0 -4
  138. package/tooltip/tooltip.js +0 -33
  139. package/tooltip/tooltip.scss.js +0 -4
  140. package/topbar/topbar.js +0 -33
  141. package/topbar/topbar.scss.js +0 -4
  142. package/umd/tinkiet.min.d.ts +0 -660
  143. package/umd/tinkiet.min.d.ts.map +0 -1
  144. package/utils/unique.js +0 -12
@@ -1,61 +0,0 @@
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 };
@@ -1,4 +0,0 @@
1
- var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:hsl(var(--primary));--background-color:var(--tk-loading-background-color,hsl(var(--surface-dim)))}:host([secondary]){--color:hsl(var(--secondary))}:host([error]){--color:hsl(var(--error))}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:56px;width:56px}.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)}}:host([small]) .circle{height:20px;width:20px}:host([small]) .line{height:2px}:host([large]) .circle{height:96px;width:96px}:host([large]) .line{height:14px}.line{background-color:var(--background-color);height:6px;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:hsl(var(--primary));--background-color:var(--tk-loading-background-color,hsl(var(--surface-dim)))}:host([secondary]){--color:hsl(var(--secondary))}:host([error]){--color:hsl(var(--error))}.circle{animation:rotator 3s linear infinite;display:inline-flex;height:56px;width:56px}.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)}}:host([small]) .circle{height:20px;width:20px}:host([small]) .line{height:2px}:host([large]) .circle{height:96px;width:96px}:host([large]) .line{height:14px}.line{background-color:var(--background-color);height:6px;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 };
@@ -1,20 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import { LitElement, html, css, unsafeCSS } from 'lit';
3
- import { customElement } from 'lit/decorators.js';
4
- import css_248z from './navigation-bar.scss.js';
5
-
6
- let TkNavigationBar = class TkNavigationBar extends LitElement {
7
- render() {
8
- return html `
9
- <slot></slot>
10
- `;
11
- }
12
- };
13
- TkNavigationBar.styles = css `
14
- ${unsafeCSS(css_248z)}
15
- `;
16
- TkNavigationBar = __decorate([
17
- customElement("tk-navigation-bar")
18
- ], TkNavigationBar);
19
-
20
- export { TkNavigationBar };
@@ -1,4 +0,0 @@
1
- var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host slot{display:flex;justify-content:space-between}";
2
- var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host slot{display:flex;justify-content:space-between}";
3
-
4
- export { css_248z as default, stylesheet };
@@ -1,51 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import { LitElement, html, css, unsafeCSS } from 'lit';
3
- import { property, customElement } from 'lit/decorators.js';
4
- import css_248z from './navigation-item.scss.js';
5
-
6
- let TkNavigationItem = class TkNavigationItem extends LitElement {
7
- constructor() {
8
- super(...arguments);
9
- this.label = "";
10
- this.iconPath = "";
11
- this.activeIconPath = "";
12
- this.active = false;
13
- }
14
- render() {
15
- return html `
16
- <tk-box align-items="center">
17
- <tk-box ripple overflow="hidden" tabindex="0" class="indicator">
18
- <tk-icon path=${this.active && this.activeIconPath ? this.activeIconPath : this.iconPath}></tk-icon>
19
- <span class="badge">
20
- <slot name="badge"></slot>
21
- </span>
22
- </tk-box>
23
- ${this.label
24
- ? html `
25
- <span class="label">${this.label}</span>
26
- `
27
- : ""}
28
- </tk-box>
29
- `;
30
- }
31
- };
32
- TkNavigationItem.styles = css `
33
- ${unsafeCSS(css_248z)}
34
- `;
35
- __decorate([
36
- property()
37
- ], TkNavigationItem.prototype, "label", void 0);
38
- __decorate([
39
- property()
40
- ], TkNavigationItem.prototype, "iconPath", void 0);
41
- __decorate([
42
- property()
43
- ], TkNavigationItem.prototype, "activeIconPath", void 0);
44
- __decorate([
45
- property({ type: Boolean })
46
- ], TkNavigationItem.prototype, "active", void 0);
47
- TkNavigationItem = __decorate([
48
- customElement("tk-navigation-item")
49
- ], TkNavigationItem);
50
-
51
- export { TkNavigationItem };
@@ -1,4 +0,0 @@
1
- var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{cursor:pointer}:host .indicator{align-items:center;border-radius:16px;display:flex;height:32px;justify-content:center;margin-bottom:4px;outline:none;position:relative;width:64px}:host .indicator tk-icon{height:24px;width:24px}:host .indicator .badge{display:flex;left:35px;position:absolute;top:4px}:host .label{font-size:12px;font-weight:500;line-height:16px;margin-top:4px}:host([active]){color:hsl(var(--on-secondary-container))}:host([active]) .indicator{background-color:hsl(var(--secondary-container))}:host(:hover){color:hsl(var(--on-surface-variant))}:host(:hover) .indicator{background-color:hsla(var(--on-surface-variant),.08)}:host(:focus){color:hsl(var(--on-surface-variant))}:host(:focus) .indicator{background-color:hsla(var(--on-surface-variant),.12)}:host([active]:hover){color:hsl(var(--on-surface))}:host([active]:hover) .indicator{background-color:hsla(var(--on-surface),.08)}:host([active]:focus){color:hsl(var(--on-surface))}:host([active]:focus) .indicator{background-color:hsl(var(--on-surface),.12)}";
2
- var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{cursor:pointer}:host .indicator{align-items:center;border-radius:16px;display:flex;height:32px;justify-content:center;margin-bottom:4px;outline:none;position:relative;width:64px}:host .indicator tk-icon{height:24px;width:24px}:host .indicator .badge{display:flex;left:35px;position:absolute;top:4px}:host .label{font-size:12px;font-weight:500;line-height:16px;margin-top:4px}:host([active]){color:hsl(var(--on-secondary-container))}:host([active]) .indicator{background-color:hsl(var(--secondary-container))}:host(:hover){color:hsl(var(--on-surface-variant))}:host(:hover) .indicator{background-color:hsla(var(--on-surface-variant),.08)}:host(:focus){color:hsl(var(--on-surface-variant))}:host(:focus) .indicator{background-color:hsla(var(--on-surface-variant),.12)}:host([active]:hover){color:hsl(var(--on-surface))}:host([active]:hover) .indicator{background-color:hsla(var(--on-surface),.08)}:host([active]:focus){color:hsl(var(--on-surface))}:host([active]:focus) .indicator{background-color:hsl(var(--on-surface),.12)}";
3
-
4
- export { css_248z as default, stylesheet };
package/notie/notie.js DELETED
@@ -1,201 +0,0 @@
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.type == NotieType.force ? null : 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 type=${this.inputType} 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("did-show"));
79
- setTimeout(() => {
80
- if (this.$input)
81
- this.$input.focus();
82
- }, 100);
83
- if (this.type == NotieType.show)
84
- setTimeout(() => this.hide(false), this.delay);
85
- });
86
- }
87
- hide(value) {
88
- if (value && this.type === NotieType.input)
89
- value = this.$input.value;
90
- if (!value && this.type === NotieType.input)
91
- value = null;
92
- this.$input ? (this.$input.value = "") : null;
93
- this.$container.addEventListener("transitionend", () => {
94
- this.dispatchEvent(new Event("did-hide"));
95
- this.resolve(value);
96
- if (!this.persistent)
97
- this.remove();
98
- }, { once: true });
99
- this.open = false;
100
- }
101
- constructor(text = "") {
102
- super();
103
- this.persistent = true;
104
- this.open = false;
105
- this.position = "bottom";
106
- this.type = NotieType.show;
107
- this.level = NotieLevel.info;
108
- this.delay = 3000;
109
- this.animationDelay = 300;
110
- this.inputType = "text";
111
- this.buttonText = "OK";
112
- this.confirmText = "OK";
113
- this.cancelText = "CANCEL";
114
- this.text = text;
115
- }
116
- static show(options) {
117
- const notie = this.getNotie(options, NotieType.show);
118
- return notie.show();
119
- }
120
- static force(options) {
121
- const notie = this.getNotie(options, NotieType.force);
122
- options.buttonText ? (notie.buttonText = options.buttonText) : null;
123
- return notie.show();
124
- }
125
- static confirm(options) {
126
- const notie = this.getNotie(options, NotieType.confirm);
127
- options.confirmText ? (notie.confirmText = options.confirmText) : null;
128
- options.cancelText ? (notie.cancelText = options.cancelText) : null;
129
- return notie.show();
130
- }
131
- static input(options) {
132
- const notie = this.getNotie(options, NotieType.input);
133
- options.inputType ? (notie.inputType = options.inputType) : null;
134
- options.password ? (notie.inputType = "password") : null;
135
- options.confirmText ? (notie.confirmText = options.confirmText) : null;
136
- options.cancelText ? (notie.cancelText = options.cancelText) : null;
137
- return notie.show();
138
- }
139
- static getNotie(options, type) {
140
- var _a, _b;
141
- const notie = new TkNotie_1(options.text);
142
- notie.persistent = false;
143
- notie.type = type;
144
- notie.delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 999999999;
145
- options.level ? (notie.level = options.level) : null;
146
- options.template ? (notie.template = options.template) : null;
147
- options.position ? (notie.position = options.position) : null;
148
- options.background && notie.$container ? notie.$container.setAttribute("background-color", options.background) : null;
149
- options.color && notie.$container ? notie.$container.setAttribute("color", options.color) : null;
150
- options.container ? (_b = options.container.shadowRoot) === null || _b === void 0 ? void 0 : _b.appendChild(notie) : window.document.body.appendChild(notie);
151
- options.zIndex ? notie.style.setProperty("z-index", options.zIndex.toString()) : null;
152
- return notie;
153
- }
154
- };
155
- __decorate([
156
- state()
157
- ], TkNotie.prototype, "persistent", void 0);
158
- __decorate([
159
- property({ type: Boolean, reflect: true })
160
- ], TkNotie.prototype, "open", void 0);
161
- __decorate([
162
- property({ reflect: true })
163
- ], TkNotie.prototype, "position", void 0);
164
- __decorate([
165
- state()
166
- ], TkNotie.prototype, "type", void 0);
167
- __decorate([
168
- property({ type: String })
169
- ], TkNotie.prototype, "level", void 0);
170
- __decorate([
171
- property({ type: Number })
172
- ], TkNotie.prototype, "delay", void 0);
173
- __decorate([
174
- property()
175
- ], TkNotie.prototype, "text", void 0);
176
- __decorate([
177
- property()
178
- ], TkNotie.prototype, "inputType", void 0);
179
- __decorate([
180
- property()
181
- ], TkNotie.prototype, "buttonText", void 0);
182
- __decorate([
183
- property()
184
- ], TkNotie.prototype, "confirmText", void 0);
185
- __decorate([
186
- property()
187
- ], TkNotie.prototype, "cancelText", void 0);
188
- __decorate([
189
- property({ type: Object })
190
- ], TkNotie.prototype, "template", void 0);
191
- __decorate([
192
- query("tk-textfield")
193
- ], TkNotie.prototype, "$input", void 0);
194
- __decorate([
195
- query(".container")
196
- ], TkNotie.prototype, "$container", void 0);
197
- TkNotie = TkNotie_1 = __decorate([
198
- customElement("tk-notie")
199
- ], TkNotie);
200
-
201
- export { NotieLevel, TkNotie };
@@ -1,4 +0,0 @@
1
- var css_248z = ":host{bottom:0;display:none;font-size:1.6rem;left:0;margin:0;position:fixed;right:0;top:0;z-index:var(--notie-z-index,400)}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0}:host .container{background-color:hsl(var(--primary));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:hsl(var(--on-primary));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;color:#fff}:host .container.error{background-color:#e1715b;color:#fff}:host .container.warning{background-color:#d6a14d;color:#fff}:host .container.success{background-color:#57bf57;color:#fff}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background,#fff);color:var(--foreground,#000);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.force{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}}: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;z-index:var(--notie-z-index,400)}:host .overlay{background-color:rgba(0,0,0,.502);bottom:0;left:0;position:fixed;right:0;top:0}:host .container{background-color:hsl(var(--primary));bottom:0;box-shadow:10px 10px 10px 10px var(--shadow);color:hsl(var(--on-primary));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;color:#fff}:host .container.error{background-color:#e1715b;color:#fff}:host .container.warning{background-color:#d6a14d;color:#fff}:host .container.success{background-color:#57bf57;color:#fff}:host .text{padding:.5em}:host .input{--input-font-size:$font-size-widescreen;background-color:var(--background,#fff);color:var(--foreground,#000);text-align:center}:host .button{cursor:pointer;padding:.5em}:host .button.confirm,:host .button.force{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}}: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/pages/pages.js DELETED
@@ -1,75 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import { LitElement, html, css, unsafeCSS } from 'lit';
3
- import { property, customElement } from 'lit/decorators.js';
4
- import css_248z from './pages.scss.js';
5
-
6
- let TkPages = class TkPages extends LitElement {
7
- constructor() {
8
- super(...arguments);
9
- this._page = "";
10
- this.selected = "";
11
- this.handleScroll = false;
12
- this.scrollHistory = {};
13
- }
14
- set page(val) {
15
- let oldVal = this._page;
16
- this._page = val;
17
- if (oldVal && this.handleScroll) {
18
- const el = this.querySelector(`[page=${oldVal}]`);
19
- if (el) {
20
- const scrollElement = document.scrollingElement || document.documentElement;
21
- this.scrollHistory[oldVal] = scrollElement.scrollTop;
22
- }
23
- }
24
- this.requestUpdate("page", oldVal);
25
- }
26
- get page() {
27
- return this._page;
28
- }
29
- render() {
30
- return html `
31
- <slot></slot>
32
- `;
33
- }
34
- updated(props) {
35
- if (props.has("page")) {
36
- this.querySelectorAll(":scope > *").forEach(el => {
37
- var _a;
38
- const elPageAttribute = (_a = el.getAttribute("page")) !== null && _a !== void 0 ? _a : "default";
39
- const scrollElement = document.scrollingElement || document.documentElement;
40
- if (elPageAttribute == this.page) {
41
- el.removeAttribute("hidden");
42
- if (this.selected != "") {
43
- el.setAttribute(this.selected, "");
44
- }
45
- if (this.handleScroll && !el.hasAttribute("no-scroll")) {
46
- scrollElement.scrollTop = this.scrollHistory[elPageAttribute] ? this.scrollHistory[elPageAttribute] : 0;
47
- }
48
- }
49
- else {
50
- el.setAttribute("hidden", "");
51
- if (this.selected != "") {
52
- el.removeAttribute(this.selected);
53
- }
54
- }
55
- });
56
- }
57
- }
58
- };
59
- TkPages.styles = css `
60
- ${unsafeCSS(css_248z)}
61
- `;
62
- __decorate([
63
- property({ attribute: "page", type: String })
64
- ], TkPages.prototype, "page", null);
65
- __decorate([
66
- property({ attribute: true, type: String })
67
- ], TkPages.prototype, "selected", void 0);
68
- __decorate([
69
- property({ attribute: "handle-scroll", type: Boolean })
70
- ], TkPages.prototype, "handleScroll", void 0);
71
- TkPages = __decorate([
72
- customElement("tk-pages")
73
- ], TkPages);
74
-
75
- export { TkPages };
@@ -1,4 +0,0 @@
1
- var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}";
2
- var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}";
3
-
4
- export { css_248z as default, stylesheet };
package/radio/radio.js DELETED
@@ -1,105 +0,0 @@
1
- import { __decorate } from 'tslib';
2
- import { LitElement, html, css, unsafeCSS } from 'lit';
3
- import { property, query, customElement } from 'lit/decorators.js';
4
- import { ifDefined } from 'lit/directives/if-defined.js';
5
- import '../box/index.js';
6
- import { uniqueID } from '../utils/unique.js';
7
- import css_248z from './radio.scss.js';
8
-
9
- let TkRadio = class TkRadio extends LitElement {
10
- constructor() {
11
- super(...arguments);
12
- this._id = uniqueID();
13
- this.checked = false;
14
- this.required = false;
15
- this.disabled = false;
16
- this.readonly = false;
17
- }
18
- render() {
19
- return html `
20
- <tk-box direction="row" align-items="center">
21
- <tk-box ripple tabindex="${this.disabled ? -1 : 0}" class="state">
22
- <div class="radio">
23
- <div id="dot"></div>
24
- </div>
25
- </tk-box>
26
- <span class="label"><slot></slot></span>
27
- </tk-box>
28
- <input
29
- id=${this._id}
30
- hidden
31
- type="radio"
32
- style="position: absolute;left: 0;z-index: -1;"
33
- ?checked="${this.checked}"
34
- .checked=${this.checked}
35
- ?required="${this.required}"
36
- ?disabled="${this.disabled}"
37
- ?readonly="${this.readonly}"
38
- value="${ifDefined(this.value)}"
39
- name="${ifDefined(this.name)}"
40
- tabindex="-1"
41
- />
42
- `;
43
- }
44
- connectedCallback() {
45
- super.connectedCallback();
46
- this.addEventListener("click", this.handleClick.bind(this));
47
- this.addEventListener("keydown", this.onKeyDown.bind(this));
48
- }
49
- disconnectedCallback() {
50
- super.disconnectedCallback();
51
- this.removeEventListener("click", this.handleClick);
52
- this.removeEventListener("keydown", this.onKeyDown);
53
- }
54
- firstUpdated() {
55
- this.appendChild(this.$input);
56
- }
57
- onKeyDown(e) {
58
- if (this.disabled)
59
- return;
60
- if (e.code === "Space" || e.code === "Enter") {
61
- e.preventDefault();
62
- e.stopPropagation();
63
- this.click();
64
- }
65
- }
66
- handleClick() {
67
- if (this.disabled)
68
- return;
69
- this.checked = !this.checked;
70
- if (this.checked && this.name)
71
- this.getRootNode()
72
- .querySelectorAll(`tk-radio[name="${this.name}"]`)
73
- .forEach(el => (el != this ? (el.checked = false) : null));
74
- setTimeout(() => this.dispatchEvent(new Event("change", { bubbles: true, composed: true })));
75
- }
76
- };
77
- TkRadio.styles = css `
78
- ${unsafeCSS(css_248z)}
79
- `;
80
- __decorate([
81
- property({ attribute: true, type: String })
82
- ], TkRadio.prototype, "name", void 0);
83
- __decorate([
84
- property({ attribute: true, type: Boolean, reflect: true })
85
- ], TkRadio.prototype, "checked", void 0);
86
- __decorate([
87
- property({ type: Boolean })
88
- ], TkRadio.prototype, "required", void 0);
89
- __decorate([
90
- property({ type: Boolean })
91
- ], TkRadio.prototype, "disabled", void 0);
92
- __decorate([
93
- property({ type: Boolean })
94
- ], TkRadio.prototype, "readonly", void 0);
95
- __decorate([
96
- property({ type: String, reflect: true })
97
- ], TkRadio.prototype, "value", void 0);
98
- __decorate([
99
- query("input")
100
- ], TkRadio.prototype, "$input", void 0);
101
- TkRadio = __decorate([
102
- customElement("tk-radio")
103
- ], TkRadio);
104
-
105
- export { TkRadio };
@@ -1,4 +0,0 @@
1
- var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{cursor:pointer;display:inline-flex}:host .state{align-items:center;border-radius:100%;display:inline-flex;height:40px;justify-content:center;outline:none;overflow:hidden;width:40px}:host .radio{align-items:center;border:2px solid hsl(var(--on-surface-variant));border-radius:100%;display:inline-flex;height:20px;justify-content:center;position:relative;transition:var(--radio-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:20px}:host #dot{background:hsl(var(--primary));border-radius:100%;height:10px;transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:10px}:host .label{user-select:none}:host([checked]) .radio{border-color:hsl(var(--primary))}:host([checked]) #dot{transform:scale(1)}:host(:focus) .state,:host(:hover) .state{background:hsla(var(--on-surface),.3)}:host([checked]:focus) .state,:host([checked]:hover) .state{background:hsla(var(--primary),.3)}:host([disabled]){opacity:.5;pointer-events:none}:host([disabled]) .radio{border:2px solid hsl(var(--on-surface-variant))}:host([disabled]) #dot{background:hsl(var(--on-surface-variant))}:host([disabled]) .label{opacity:.6}";
2
- var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{cursor:pointer;display:inline-flex}:host .state{align-items:center;border-radius:100%;display:inline-flex;height:40px;justify-content:center;outline:none;overflow:hidden;width:40px}:host .radio{align-items:center;border:2px solid hsl(var(--on-surface-variant));border-radius:100%;display:inline-flex;height:20px;justify-content:center;position:relative;transition:var(--radio-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));-webkit-user-select:none;user-select:none;width:20px}:host #dot{background:hsl(var(--primary));border-radius:100%;height:10px;transform:scale(0);transition:var(--radio-dot-transition,transform var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));width:10px}:host .label{user-select:none}:host([checked]) .radio{border-color:hsl(var(--primary))}:host([checked]) #dot{transform:scale(1)}:host(:focus) .state,:host(:hover) .state{background:hsla(var(--on-surface),.3)}:host([checked]:focus) .state,:host([checked]:hover) .state{background:hsla(var(--primary),.3)}:host([disabled]){opacity:.5;pointer-events:none}:host([disabled]) .radio{border:2px solid hsl(var(--on-surface-variant))}:host([disabled]) #dot{background:hsl(var(--on-surface-variant))}:host([disabled]) .label{opacity:.6}";
3
-
4
- export { css_248z as default, stylesheet };