@transcodes/ui-components 0.3.0 → 0.3.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 (55) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +124 -79
  3. package/dist/controllers/animation.controller.js +32 -0
  4. package/dist/controllers/base.controller.js +8 -0
  5. package/dist/controllers/form-validation.controller.js +49 -0
  6. package/dist/controllers/history.controller.js +26 -0
  7. package/dist/controllers/index.d.ts +11 -0
  8. package/dist/controllers/index.js +18 -0
  9. package/dist/controllers/loading.controller.js +27 -0
  10. package/dist/controllers/match-media.controller.js +20 -0
  11. package/dist/controllers/message-bus.controller.js +45 -0
  12. package/dist/controllers/storage.controller.js +40 -0
  13. package/dist/index.d.ts +0 -696
  14. package/dist/index.js +80 -0
  15. package/dist/primitives/index.d.ts +21 -0
  16. package/dist/primitives/index.js +42 -0
  17. package/dist/primitives/tc-box.js +38 -0
  18. package/dist/primitives/tc-button.js +167 -0
  19. package/dist/primitives/tc-callout.js +86 -0
  20. package/dist/primitives/tc-card.js +76 -0
  21. package/dist/primitives/tc-chip.js +79 -0
  22. package/dist/primitives/tc-container.js +62 -0
  23. package/dist/primitives/tc-divider.js +76 -0
  24. package/dist/primitives/tc-error-message.js +74 -0
  25. package/dist/primitives/tc-form-header.js +120 -0
  26. package/dist/primitives/tc-icon.js +95 -0
  27. package/dist/primitives/tc-input-with-chip.js +242 -0
  28. package/dist/primitives/tc-input.js +262 -0
  29. package/dist/primitives/tc-item-button.js +168 -0
  30. package/dist/primitives/tc-item.js +93 -0
  31. package/dist/primitives/tc-otp-input.js +230 -0
  32. package/dist/primitives/tc-section.js +48 -0
  33. package/dist/primitives/tc-spinner.js +87 -0
  34. package/dist/primitives/tc-symbol.js +56 -0
  35. package/dist/primitives/tc-text.js +145 -0
  36. package/dist/primitives/tc-toast.js +189 -0
  37. package/dist/screens/index.d.ts +4 -0
  38. package/dist/screens/index.js +8 -0
  39. package/dist/screens/tc-error-screen.js +119 -0
  40. package/dist/screens/tc-loading-screen.js +77 -0
  41. package/dist/screens/tc-success-screen.js +192 -0
  42. package/dist/styles/shared.js +7 -0
  43. package/dist/widgets/index.d.ts +9 -0
  44. package/dist/widgets/index.js +18 -0
  45. package/dist/widgets/tc-authenticator-card.js +213 -0
  46. package/dist/widgets/tc-floating-button.js +132 -0
  47. package/dist/widgets/tc-iframe-modal.js +263 -0
  48. package/dist/widgets/tc-installation-banner.js +234 -0
  49. package/dist/widgets/tc-ios-installation-guide.js +240 -0
  50. package/dist/widgets/tc-notification-modal.js +230 -0
  51. package/dist/widgets/tc-offline-modal.js +202 -0
  52. package/dist/widgets/tc-page-decoration.js +126 -0
  53. package/package.json +25 -7
  54. package/dist/ui-components.css +0 -1
  55. package/dist/ui-components.js +0 -4981
@@ -0,0 +1,40 @@
1
+ import { BaseController as a } from "./base.controller.js";
2
+ class i extends a {
3
+ constructor(t, s, o = localStorage) {
4
+ super(t), this._value = null, this.handleStorageChange = (e) => {
5
+ e.key === this.key && e.storageArea === this.storage && (this.load(), this.host.requestUpdate());
6
+ }, this.key = s, this.storage = o, this.load();
7
+ }
8
+ get value() {
9
+ return this._value;
10
+ }
11
+ set(t) {
12
+ this._value = t;
13
+ try {
14
+ this.storage.setItem(this.key, JSON.stringify(t));
15
+ } catch {
16
+ console.warn(`Failed to save to storage: ${this.key}`);
17
+ }
18
+ this.host.requestUpdate();
19
+ }
20
+ remove() {
21
+ this._value = null, this.storage.removeItem(this.key), this.host.requestUpdate();
22
+ }
23
+ load() {
24
+ try {
25
+ const t = this.storage.getItem(this.key);
26
+ t !== null && (this._value = JSON.parse(t));
27
+ } catch {
28
+ this._value = null;
29
+ }
30
+ }
31
+ hostConnected() {
32
+ window.addEventListener("storage", this.handleStorageChange);
33
+ }
34
+ hostDisconnected() {
35
+ window.removeEventListener("storage", this.handleStorageChange);
36
+ }
37
+ }
38
+ export {
39
+ i as StorageController
40
+ };