proto-daisy-ui 0.0.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/dealers-a8306eb8.js +15 -0
  4. package/dist/cjs/index-b1631310.js +1219 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/cjs/proto-button-d349703f.js +9 -0
  8. package/dist/cjs/proto-daisy-ui.cjs.entry.js +25 -0
  9. package/dist/cjs/proto-daisy-ui.cjs.js +19 -0
  10. package/dist/cjs/proto-demo.cjs.entry.js +20 -0
  11. package/dist/cjs/proto-hero.cjs.entry.js +21 -0
  12. package/dist/cjs/proto-home.cjs.entry.js +24 -0
  13. package/dist/cjs/proto-list.cjs.entry.js +58 -0
  14. package/dist/cjs/proto-shell.cjs.entry.js +120 -0
  15. package/dist/cjs/store-74bb495b.js +332 -0
  16. package/dist/collection/collection-manifest.json +17 -0
  17. package/dist/collection/components/functional/index.js +1 -0
  18. package/dist/collection/components/functional/proto-button.js +6 -0
  19. package/dist/collection/components/proto-daisy-ui/proto-daisy-ui.css +2023 -0
  20. package/dist/collection/components/proto-daisy-ui/proto-daisy-ui.js +20 -0
  21. package/dist/collection/components/proto-demo/proto-demo.css +0 -0
  22. package/dist/collection/components/proto-demo/proto-demo.js +14 -0
  23. package/dist/collection/components/proto-hero/proto-hero.css +3 -0
  24. package/dist/collection/components/proto-hero/proto-hero.js +43 -0
  25. package/dist/collection/components/proto-home/proto-home.css +0 -0
  26. package/dist/collection/components/proto-home/proto-home.js +26 -0
  27. package/dist/collection/components/proto-list/proto-list.css +0 -0
  28. package/dist/collection/components/proto-list/proto-list.js +64 -0
  29. package/dist/collection/components/proto-shell/proto-footer.js +20 -0
  30. package/dist/collection/components/proto-shell/proto-header.js +81 -0
  31. package/dist/collection/components/proto-shell/proto-shell.css +3 -0
  32. package/dist/collection/components/proto-shell/proto-shell.js +47 -0
  33. package/dist/collection/index.js +1 -0
  34. package/dist/collection/utils/bag.js +23 -0
  35. package/dist/collection/utils/dealers.js +13 -0
  36. package/dist/collection/utils/index.js +5 -0
  37. package/dist/collection/utils/store.js +115 -0
  38. package/dist/collection/utils/tw-version.js +4 -0
  39. package/dist/collection/utils/types.js +1 -0
  40. package/dist/components/dealers.js +13 -0
  41. package/dist/components/index.d.ts +27 -0
  42. package/dist/components/index.js +7 -0
  43. package/dist/components/proto-button.js +7 -0
  44. package/dist/components/proto-daisy-ui.d.ts +11 -0
  45. package/dist/components/proto-daisy-ui.js +39 -0
  46. package/dist/components/proto-demo.d.ts +11 -0
  47. package/dist/components/proto-demo.js +33 -0
  48. package/dist/components/proto-hero.d.ts +11 -0
  49. package/dist/components/proto-hero.js +36 -0
  50. package/dist/components/proto-home.d.ts +11 -0
  51. package/dist/components/proto-home.js +37 -0
  52. package/dist/components/proto-list.d.ts +11 -0
  53. package/dist/components/proto-list.js +71 -0
  54. package/dist/components/proto-shell.d.ts +11 -0
  55. package/dist/components/proto-shell.js +135 -0
  56. package/dist/components/store.js +329 -0
  57. package/dist/esm/dealers-752f9914.js +13 -0
  58. package/dist/esm/index-832d1e38.js +1192 -0
  59. package/dist/esm/index.js +1 -0
  60. package/dist/esm/loader.js +17 -0
  61. package/dist/esm/polyfills/core-js.js +11 -0
  62. package/dist/esm/polyfills/css-shim.js +1 -0
  63. package/dist/esm/polyfills/dom.js +79 -0
  64. package/dist/esm/polyfills/es5-html-element.js +1 -0
  65. package/dist/esm/polyfills/index.js +34 -0
  66. package/dist/esm/polyfills/system.js +6 -0
  67. package/dist/esm/proto-button-c929a8fb.js +7 -0
  68. package/dist/esm/proto-daisy-ui.entry.js +21 -0
  69. package/dist/esm/proto-daisy-ui.js +17 -0
  70. package/dist/esm/proto-demo.entry.js +16 -0
  71. package/dist/esm/proto-hero.entry.js +17 -0
  72. package/dist/esm/proto-home.entry.js +20 -0
  73. package/dist/esm/proto-list.entry.js +54 -0
  74. package/dist/esm/proto-shell.entry.js +116 -0
  75. package/dist/esm/store-6cbf6338.js +329 -0
  76. package/dist/index.cjs.js +1 -0
  77. package/dist/index.js +1 -0
  78. package/dist/proto-daisy-ui/index.esm.js +0 -0
  79. package/dist/proto-daisy-ui/p-0cbc124a.js +1 -0
  80. package/dist/proto-daisy-ui/p-4c1c4093.entry.js +1 -0
  81. package/dist/proto-daisy-ui/p-78473e80.js +1 -0
  82. package/dist/proto-daisy-ui/p-82c6ae5e.entry.js +1 -0
  83. package/dist/proto-daisy-ui/p-98b063cb.js +1 -0
  84. package/dist/proto-daisy-ui/p-bba460f2.entry.js +1 -0
  85. package/dist/proto-daisy-ui/p-d7d5a047.entry.js +1 -0
  86. package/dist/proto-daisy-ui/p-e274e36c.entry.js +1 -0
  87. package/dist/proto-daisy-ui/p-eeb6284e.entry.js +1 -0
  88. package/dist/proto-daisy-ui/p-f445bcf9.js +2 -0
  89. package/dist/proto-daisy-ui/proto-daisy-ui.esm.js +1 -0
  90. package/dist/types/components/functional/index.d.ts +1 -0
  91. package/dist/types/components/functional/proto-button.d.ts +4 -0
  92. package/dist/types/components/proto-daisy-ui/proto-daisy-ui.d.ts +4 -0
  93. package/dist/types/components/proto-demo/proto-demo.d.ts +3 -0
  94. package/dist/types/components/proto-hero/proto-hero.d.ts +4 -0
  95. package/dist/types/components/proto-home/proto-home.d.ts +3 -0
  96. package/dist/types/components/proto-list/proto-list.d.ts +3 -0
  97. package/dist/types/components/proto-shell/proto-footer.d.ts +4 -0
  98. package/dist/types/components/proto-shell/proto-header.d.ts +4 -0
  99. package/dist/types/components/proto-shell/proto-shell.d.ts +4 -0
  100. package/dist/types/components.d.ts +106 -0
  101. package/dist/types/index.d.ts +1 -0
  102. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  103. package/dist/types/utils/bag.d.ts +10 -0
  104. package/dist/types/utils/dealers.d.ts +6 -0
  105. package/dist/types/utils/index.d.ts +5 -0
  106. package/dist/types/utils/store.d.ts +12 -0
  107. package/dist/types/utils/tw-version.d.ts +3 -0
  108. package/dist/types/utils/types.d.ts +8 -0
  109. package/loader/cdn.js +3 -0
  110. package/loader/index.cjs.js +3 -0
  111. package/loader/index.d.ts +12 -0
  112. package/loader/index.es2017.js +3 -0
  113. package/loader/index.js +4 -0
  114. package/loader/package.json +10 -0
  115. package/package.json +53 -0
@@ -0,0 +1,17 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-832d1e38.js';
2
+
3
+ /*
4
+ Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ const patchBrowser = () => {
7
+ const importMeta = import.meta.url;
8
+ const opts = {};
9
+ if (importMeta !== '') {
10
+ opts.resourcesUrl = new URL('.', importMeta).href;
11
+ }
12
+ return promiseResolve(opts);
13
+ };
14
+
15
+ patchBrowser().then(options => {
16
+ return bootstrapLazy([["proto-daisy-ui",[[1,"proto-daisy-ui"]]],["proto-demo",[[0,"proto-demo"]]],["proto-hero",[[0,"proto-hero",{"theme":[1]}]]],["proto-home",[[0,"proto-home"]]],["proto-list",[[0,"proto-list"]]],["proto-shell",[[0,"proto-shell",{"theme":[1]}]]]], options);
17
+ });
@@ -0,0 +1,16 @@
1
+ import { r as registerInstance, h } from './index-832d1e38.js';
2
+ import { P as ProtoButton } from './proto-button-c929a8fb.js';
3
+
4
+ const protoDemoCss = "";
5
+
6
+ const ProtoDemo = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ }
10
+ render() {
11
+ return h(ProtoButton, null, "Foobar");
12
+ }
13
+ };
14
+ ProtoDemo.style = protoDemoCss;
15
+
16
+ export { ProtoDemo as proto_demo };
@@ -0,0 +1,17 @@
1
+ import { r as registerInstance, h } from './index-832d1e38.js';
2
+ import { a as actions } from './store-6cbf6338.js';
3
+
4
+ const protoHeroCss = "proto-hero{}";
5
+
6
+ const ProtoHero = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.theme = 'light';
10
+ }
11
+ render() {
12
+ return (h("div", { class: "flex min-h-screen flex-col bg-clrs-slate font-sans", "data-theme": this.theme }, h("div", { class: "hero min-h-screen bg-base-200" }, h("div", { class: "hero-content text-center" }, h("div", { class: "max-w-md" }, h("h1", { class: "text-5xl font-bold" }, "Hello there"), h("p", { class: "py-6" }, "Provident cupiditate voluptatem et in. Quaerat fugiat ut assumenda excepturi exercitationem quasi. In deleniti eaque aut repudiandae et a id nisi."), h("button", { class: "btn btn-primary", onClick: () => actions.updateApp('proto-home') }, "Get Started"))))));
13
+ }
14
+ };
15
+ ProtoHero.style = protoHeroCss;
16
+
17
+ export { ProtoHero as proto_hero };
@@ -0,0 +1,20 @@
1
+ import { r as registerInstance, h } from './index-832d1e38.js';
2
+ import { P as ProtoButton } from './proto-button-c929a8fb.js';
3
+ import { d as dealers } from './dealers-752f9914.js';
4
+ import { s as state } from './store-6cbf6338.js';
5
+
6
+ const protoHomeCss = "";
7
+
8
+ const ProtoHome = class {
9
+ constructor(hostRef) {
10
+ registerInstance(this, hostRef);
11
+ }
12
+ render() {
13
+ const { pick } = state;
14
+ const dealer = dealers[pick];
15
+ return (h("div", { class: "mr-8 flex flex-col flex-nowrap items-start gap-2" }, h("div", { class: "alert alert-info shadow-lg" }, h("div", null, h("svg", { fill: "none", viewBox: "0 0 24 24", class: "h-6 w-6 flex-shrink-0 stroke-current" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" })), h("span", null, "Welcome... [ ", dealer.name, " ]"))), h(ProtoButton, null, "Home")));
16
+ }
17
+ };
18
+ ProtoHome.style = protoHomeCss;
19
+
20
+ export { ProtoHome as proto_home };
@@ -0,0 +1,54 @@
1
+ import { r as registerInstance, h } from './index-832d1e38.js';
2
+
3
+ const protoListCss = "";
4
+
5
+ const keys = [
6
+ {
7
+ label: 'Name',
8
+ prop: 'name',
9
+ },
10
+ {
11
+ label: 'Job',
12
+ prop: 'job',
13
+ },
14
+ {
15
+ label: 'Favorite Color',
16
+ prop: 'color',
17
+ },
18
+ ];
19
+ const data = [
20
+ {
21
+ name: 'Cy Ganderton',
22
+ job: 'Quality Control Specialist',
23
+ color: 'Blue',
24
+ },
25
+ {
26
+ name: 'Hart Hagerty',
27
+ job: 'Desktop Support Technician',
28
+ color: 'Purple',
29
+ },
30
+ {
31
+ name: 'Brice Swyre',
32
+ job: 'Tax Accountant',
33
+ color: 'Red',
34
+ },
35
+ ];
36
+ const ProtoList = class {
37
+ constructor(hostRef) {
38
+ registerInstance(this, hostRef);
39
+ }
40
+ render() {
41
+ return (h("div", { class: "overflow-x-auto" }, h("table", { class: "table-compact table w-full" }, h("thead", null, h("tr", null, h("th", null), keys.map(({ label }) => {
42
+ return h("th", null, label);
43
+ }))), h("tbody", null, data.map((obj, indx) => {
44
+ return (h("tr", { class: "hover" }, h("th", null, indx + 1), keys.map(({ prop }) => {
45
+ return h("td", null, obj[prop]);
46
+ })));
47
+ })), h("tfoot", null, h("tr", null, h("th", null), keys.map(({ label }) => {
48
+ return h("th", null, label);
49
+ }))))));
50
+ }
51
+ };
52
+ ProtoList.style = protoListCss;
53
+
54
+ export { ProtoList as proto_list };
@@ -0,0 +1,116 @@
1
+ import { h, r as registerInstance } from './index-832d1e38.js';
2
+ import { d as dealers } from './dealers-752f9914.js';
3
+ import { a as actions, s as state } from './store-6cbf6338.js';
4
+
5
+ const clickHandler = (mfe = undefined) => {
6
+ return _event => {
7
+ console.log('-- mfe:', mfe);
8
+ actions.updateApp(mfe);
9
+ document.activeElement.blur();
10
+ };
11
+ };
12
+ const clickPick = (indx) => {
13
+ return _event => {
14
+ console.log('-- pick:', indx);
15
+ actions.updatePick(indx);
16
+ document.activeElement.blur();
17
+ };
18
+ };
19
+ const clickTheme = (theme) => {
20
+ return _event => {
21
+ console.log('-- theme:', theme);
22
+ actions.updateTheme(theme);
23
+ document.activeElement.blur();
24
+ };
25
+ };
26
+ const ProtoHeader = (_props, _children) => {
27
+ const { pick, themes } = state;
28
+ const dealer = dealers[pick];
29
+ return (h("div", { class: "navbar m-1 w-auto rounded-md bg-base-100" },
30
+ h("div", { class: "flex-none" },
31
+ h("div", { class: "dropdown" },
32
+ h("button", { class: "btn btn-ghost btn-square drawer-button" },
33
+ h("svg", { fill: "none", viewBox: "0 0 24 24", class: "inline-block h-5 w-5 stroke-current" },
34
+ h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M4 6h16M4 12h16M4 18h16" }))),
35
+ h("ul", { class: "dropdown-content menu mt-1 rounded-md bg-accent p-2 text-accent-content" },
36
+ h("li", null,
37
+ h("button", { class: "btn-ghost", onClick: clickHandler('proto-home') },
38
+ h("svg", { class: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
39
+ h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" })))),
40
+ h("li", null,
41
+ h("button", { class: "btn-ghost", onClick: clickHandler('proto-demo') },
42
+ h("svg", { class: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
43
+ h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" })))),
44
+ h("li", null,
45
+ h("button", { class: "btn-ghost", onClick: clickHandler('proto-list') },
46
+ h("svg", { class: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor" },
47
+ h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }))))))),
48
+ h("div", { class: "flex-1" },
49
+ h("a", { class: "btn btn-ghost text-xl normal-case" }, "daisyUI")),
50
+ h("div", { class: "flex-none" },
51
+ h("div", { class: "dropdown dropdown-end" },
52
+ h("button", { class: "btn btn-ghost normal-case" }, dealer.name),
53
+ h("ul", { tabindex: "0", class: "dropdown-content menu menu-compact mt-1 w-52 rounded-md bg-secondary p-2 text-secondary-content shadow " }, dealers.map((obj, indx) => {
54
+ const active = indx === pick ? 'active' : undefined;
55
+ return (h("li", null,
56
+ h("a", { class: active, onClick: clickPick(indx) }, obj.name)));
57
+ })))),
58
+ h("div", { class: "divider divider-horizontal flex-none" }),
59
+ h("div", { class: "flex-none" },
60
+ h("div", { class: "dropdown dropdown-end" },
61
+ h("button", { class: "btn btn-ghost normal-case" }, state.theme),
62
+ h("ul", { tabindex: "0", class: "dropdown-content menu menu-compact mt-1 w-52 rounded-md bg-secondary p-2 text-secondary-content shadow " }, themes.map(theme => {
63
+ const active = theme === state.theme ? 'active' : undefined;
64
+ return (h("li", null,
65
+ h("a", { class: active, onClick: clickTheme(theme) }, theme)));
66
+ })))),
67
+ h("div", { class: "flex-none" },
68
+ h("div", { class: "dropdown dropdown-end" },
69
+ h("button", { class: "btn btn-ghost btn-square" },
70
+ h("svg", { fill: "none", viewBox: "0 0 24 24", class: "inline-block h-5 w-5 stroke-current" },
71
+ h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" }))),
72
+ h("ul", { tabindex: "0", class: "dropdown-content menu menu-compact mt-1 w-52 rounded-md bg-secondary p-2 text-secondary-content shadow " },
73
+ h("li", null,
74
+ h("a", { class: "justify-between" },
75
+ "Profile",
76
+ h("span", { class: "badge" }, "New"))),
77
+ h("li", null,
78
+ h("a", null, "Settings...")),
79
+ h("li", null,
80
+ h("a", { onClick: clickHandler() }, "Logout")))))));
81
+ };
82
+
83
+ const ProtoFooter = (_props, _children) => {
84
+ return (h("footer", { class: "footer w-auto items-center bg-neutral p-4 text-neutral-content" },
85
+ h("div", { class: "grid-flow-col items-center" },
86
+ h("svg", { width: "36", height: "36", viewBox: "0 0 24 24", "fill-rule": "evenodd", "clip-rule": "evenodd", class: "fill-current" },
87
+ h("path", { d: "M22.672 15.226l-2.432.811.841 2.515c.33 1.019-.209 2.127-1.23 2.456-1.15.325-2.148-.321-2.463-1.226l-.84-2.518-5.013 1.677.84 2.517c.391 1.203-.434 2.542-1.831 2.542-.88 0-1.601-.564-1.86-1.314l-.842-2.516-2.431.809c-1.135.328-2.145-.317-2.463-1.229-.329-1.018.211-2.127 1.231-2.456l2.432-.809-1.621-4.823-2.432.808c-1.355.384-2.558-.59-2.558-1.839 0-.817.509-1.582 1.327-1.846l2.433-.809-.842-2.515c-.33-1.02.211-2.129 1.232-2.458 1.02-.329 2.13.209 2.461 1.229l.842 2.515 5.011-1.677-.839-2.517c-.403-1.238.484-2.553 1.843-2.553.819 0 1.585.509 1.85 1.326l.841 2.517 2.431-.81c1.02-.33 2.131.211 2.461 1.229.332 1.018-.21 2.126-1.23 2.456l-2.433.809 1.622 4.823 2.433-.809c1.242-.401 2.557.484 2.557 1.838 0 .819-.51 1.583-1.328 1.847m-8.992-6.428l-5.01 1.675 1.619 4.828 5.011-1.674-1.62-4.829z" })),
88
+ h("p", null, "Copyright \u00A9 2022 - All right reserved")),
89
+ h("div", { class: "grid-flow-col gap-4 md:place-self-center md:justify-self-end" },
90
+ h("a", null,
91
+ h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", class: "fill-current" },
92
+ h("path", { d: "M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z" }))),
93
+ h("a", null,
94
+ h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", class: "fill-current" },
95
+ h("path", { d: "M19.615 3.184c-3.604-.246-11.631-.245-15.23 0-3.897.266-4.356 2.62-4.385 8.816.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0 3.897-.266 4.356-2.62 4.385-8.816-.029-6.185-.484-8.549-4.385-8.816zm-10.615 12.816v-8l8 3.993-8 4.007z" }))),
96
+ h("a", null,
97
+ h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", class: "fill-current" },
98
+ h("path", { d: "M9 8h-3v4h3v12h5v-12h3.642l.358-4h-4v-1.667c0-.955.192-1.333 1.115-1.333h2.885v-5h-3.808c-3.596 0-5.192 1.583-5.192 4.615v3.385z" }))))));
99
+ };
100
+
101
+ const protoShellCss = "proto-shell{}";
102
+
103
+ const ProtoShell = class {
104
+ constructor(hostRef) {
105
+ registerInstance(this, hostRef);
106
+ this.theme = 'light';
107
+ }
108
+ render() {
109
+ const TAG = state.mfe;
110
+ console.log('-- render:', TAG);
111
+ return (h("div", { class: "flex min-h-screen flex-col font-sans", "data-theme": this.theme }, h(ProtoHeader, null), h("div", { class: "flex-auto p-4 pt-0" }, h("div", { class: "divider mt-0" }), h("div", null, h(TAG, null))), h(ProtoFooter, null)));
112
+ }
113
+ };
114
+ ProtoShell.style = protoShellCss;
115
+
116
+ export { ProtoShell as proto_shell };
@@ -0,0 +1,329 @@
1
+ import { g as getRenderingRef, f as forceUpdate } from './index-832d1e38.js';
2
+
3
+ const KEY = 'proto-daisy-ui';
4
+ const LOGIN = 'login';
5
+ const MFE = 'mfe';
6
+ const PICK = 'pick';
7
+ const THEME = 'theme';
8
+ // Examples:
9
+ // get(MFE)
10
+ // get(PICK)
11
+ //
12
+ const bag = {
13
+ get: (tag) => {
14
+ const key = tag ? `${KEY}-${tag}` : KEY;
15
+ const json = localStorage.getItem(key);
16
+ return json ? JSON.parse(json) : undefined;
17
+ },
18
+ store: (tag, value) => {
19
+ const key = tag ? `${KEY}-${tag}` : KEY;
20
+ const json = JSON.stringify(value === undefined ? null : value);
21
+ localStorage.setItem(key, json);
22
+ },
23
+ };
24
+
25
+ const appendToMap = (map, propName, value) => {
26
+ const items = map.get(propName);
27
+ if (!items) {
28
+ map.set(propName, [value]);
29
+ }
30
+ else if (!items.includes(value)) {
31
+ items.push(value);
32
+ }
33
+ };
34
+ const debounce = (fn, ms) => {
35
+ let timeoutId;
36
+ return (...args) => {
37
+ if (timeoutId) {
38
+ clearTimeout(timeoutId);
39
+ }
40
+ timeoutId = setTimeout(() => {
41
+ timeoutId = 0;
42
+ fn(...args);
43
+ }, ms);
44
+ };
45
+ };
46
+
47
+ /**
48
+ * Check if a possible element isConnected.
49
+ * The property might not be there, so we check for it.
50
+ *
51
+ * We want it to return true if isConnected is not a property,
52
+ * otherwise we would remove these elements and would not update.
53
+ *
54
+ * Better leak in Edge than to be useless.
55
+ */
56
+ const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
57
+ const cleanupElements = debounce((map) => {
58
+ for (let key of map.keys()) {
59
+ map.set(key, map.get(key).filter(isConnected));
60
+ }
61
+ }, 2000);
62
+ const stencilSubscription = () => {
63
+ if (typeof getRenderingRef !== 'function') {
64
+ // If we are not in a stencil project, we do nothing.
65
+ // This function is not really exported by @stencil/core.
66
+ return {};
67
+ }
68
+ const elmsToUpdate = new Map();
69
+ return {
70
+ dispose: () => elmsToUpdate.clear(),
71
+ get: (propName) => {
72
+ const elm = getRenderingRef();
73
+ if (elm) {
74
+ appendToMap(elmsToUpdate, propName, elm);
75
+ }
76
+ },
77
+ set: (propName) => {
78
+ const elements = elmsToUpdate.get(propName);
79
+ if (elements) {
80
+ elmsToUpdate.set(propName, elements.filter(forceUpdate));
81
+ }
82
+ cleanupElements(elmsToUpdate);
83
+ },
84
+ reset: () => {
85
+ elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
86
+ cleanupElements(elmsToUpdate);
87
+ },
88
+ };
89
+ };
90
+
91
+ const unwrap = (val) => (typeof val === 'function' ? val() : val);
92
+ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
93
+ const unwrappedState = unwrap(defaultState);
94
+ let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
95
+ const handlers = {
96
+ dispose: [],
97
+ get: [],
98
+ set: [],
99
+ reset: [],
100
+ };
101
+ const reset = () => {
102
+ var _a;
103
+ // When resetting the state, the default state may be a function - unwrap it to invoke it.
104
+ // otherwise, the state won't be properly reset
105
+ states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
106
+ handlers.reset.forEach((cb) => cb());
107
+ };
108
+ const dispose = () => {
109
+ // Call first dispose as resetting the state would
110
+ // cause less updates ;)
111
+ handlers.dispose.forEach((cb) => cb());
112
+ reset();
113
+ };
114
+ const get = (propName) => {
115
+ handlers.get.forEach((cb) => cb(propName));
116
+ return states.get(propName);
117
+ };
118
+ const set = (propName, value) => {
119
+ const oldValue = states.get(propName);
120
+ if (shouldUpdate(value, oldValue, propName)) {
121
+ states.set(propName, value);
122
+ handlers.set.forEach((cb) => cb(propName, value, oldValue));
123
+ }
124
+ };
125
+ const state = (typeof Proxy === 'undefined'
126
+ ? {}
127
+ : new Proxy(unwrappedState, {
128
+ get(_, propName) {
129
+ return get(propName);
130
+ },
131
+ ownKeys(_) {
132
+ return Array.from(states.keys());
133
+ },
134
+ getOwnPropertyDescriptor() {
135
+ return {
136
+ enumerable: true,
137
+ configurable: true,
138
+ };
139
+ },
140
+ has(_, propName) {
141
+ return states.has(propName);
142
+ },
143
+ set(_, propName, value) {
144
+ set(propName, value);
145
+ return true;
146
+ },
147
+ }));
148
+ const on = (eventName, callback) => {
149
+ handlers[eventName].push(callback);
150
+ return () => {
151
+ removeFromArray(handlers[eventName], callback);
152
+ };
153
+ };
154
+ const onChange = (propName, cb) => {
155
+ const unSet = on('set', (key, newValue) => {
156
+ if (key === propName) {
157
+ cb(newValue);
158
+ }
159
+ });
160
+ // We need to unwrap the defaultState because it might be a function.
161
+ // Otherwise we might not be sending the right reset value.
162
+ const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
163
+ return () => {
164
+ unSet();
165
+ unReset();
166
+ };
167
+ };
168
+ const use = (...subscriptions) => {
169
+ const unsubs = subscriptions.reduce((unsubs, subscription) => {
170
+ if (subscription.set) {
171
+ unsubs.push(on('set', subscription.set));
172
+ }
173
+ if (subscription.get) {
174
+ unsubs.push(on('get', subscription.get));
175
+ }
176
+ if (subscription.reset) {
177
+ unsubs.push(on('reset', subscription.reset));
178
+ }
179
+ if (subscription.dispose) {
180
+ unsubs.push(on('dispose', subscription.dispose));
181
+ }
182
+ return unsubs;
183
+ }, []);
184
+ return () => unsubs.forEach((unsub) => unsub());
185
+ };
186
+ const forceUpdate = (key) => {
187
+ const oldValue = states.get(key);
188
+ handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
189
+ };
190
+ return {
191
+ state,
192
+ get,
193
+ set,
194
+ on,
195
+ onChange,
196
+ use,
197
+ dispose,
198
+ reset,
199
+ forceUpdate,
200
+ };
201
+ };
202
+ const removeFromArray = (array, item) => {
203
+ const index = array.indexOf(item);
204
+ if (index >= 0) {
205
+ array[index] = array[array.length - 1];
206
+ array.length--;
207
+ }
208
+ };
209
+
210
+ const createStore = (defaultState, shouldUpdate) => {
211
+ const map = createObservableMap(defaultState, shouldUpdate);
212
+ map.use(stencilSubscription());
213
+ return map;
214
+ };
215
+
216
+ function mitt(n){return {all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e]);},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]));},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e);}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e);});}}}
217
+
218
+ const themes = [
219
+ 'light',
220
+ 'dark',
221
+ 'aqua',
222
+ 'business',
223
+ 'corporate',
224
+ 'fantasy',
225
+ 'night',
226
+ 'winter',
227
+ 'wireframe',
228
+ ];
229
+ // --------------------------------------------------------[ mutable store ]
230
+ const storeDef = {
231
+ login: true,
232
+ mfe: 'proto-home',
233
+ pick: 0,
234
+ theme: 'dark',
235
+ themes,
236
+ };
237
+ const { state } = createStore(storeDef);
238
+ const emitter = mitt();
239
+ // --------------------------------------------------------[ utility ]
240
+ const clearStore = (login = false) => {
241
+ state.login = login;
242
+ state.pick = 0;
243
+ state.mfe = 'proto-home';
244
+ state.theme = 'dark';
245
+ state.themes = themes;
246
+ };
247
+ // --------------------------------------------------------[ processing ]
248
+ const processApp = (next) => {
249
+ state.mfe = next;
250
+ if (next) {
251
+ bag.store(LOGIN, false);
252
+ state.login = false;
253
+ emitter.emit('app', { mfe: next });
254
+ }
255
+ else {
256
+ bag.store(LOGIN, true);
257
+ state.login = true;
258
+ }
259
+ };
260
+ const processLogin = (next) => {
261
+ state.login = next;
262
+ if (next) {
263
+ emitter.emit('login', { login: next });
264
+ }
265
+ };
266
+ const processPick = (next) => {
267
+ state.pick = next;
268
+ if (next) {
269
+ emitter.emit('pick', { pick: next });
270
+ }
271
+ };
272
+ const processTheme = (next) => {
273
+ state.theme = next;
274
+ console.log(next);
275
+ if (next) {
276
+ emitter.emit('theme', { theme: next });
277
+ }
278
+ };
279
+ // --------------------------------------------------------[ actions ]
280
+ const initApp = () => {
281
+ clearStore();
282
+ // this retrieves the last data we stored in the bag...
283
+ const login = bag.get(LOGIN);
284
+ const data = bag.get(MFE);
285
+ const pick = bag.get(PICK);
286
+ const theme = bag.get(THEME);
287
+ console.log('-- data:', data);
288
+ if (theme) {
289
+ processTheme(theme);
290
+ if (login !== undefined) {
291
+ processLogin(login);
292
+ }
293
+ if (login === false && data) {
294
+ console.log('-- app:', data);
295
+ processApp(data);
296
+ }
297
+ if (pick) {
298
+ processPick(pick);
299
+ }
300
+ }
301
+ else {
302
+ refresh();
303
+ }
304
+ };
305
+ const refresh = () => {
306
+ clearStore(true);
307
+ bag.store(PICK, 0);
308
+ };
309
+ const updateApp = (mfe) => {
310
+ bag.store(MFE, mfe);
311
+ processApp(mfe);
312
+ };
313
+ const updatePick = (pick) => {
314
+ bag.store(PICK, pick);
315
+ processPick(pick);
316
+ };
317
+ const updateTheme = (theme) => {
318
+ bag.store(THEME, theme);
319
+ processTheme(theme);
320
+ };
321
+ const actions = {
322
+ initApp,
323
+ refresh,
324
+ updateApp,
325
+ updatePick,
326
+ updateTheme,
327
+ };
328
+
329
+ export { actions as a, state as s };
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
File without changes
@@ -0,0 +1 @@
1
+ const e=[{id:"brookhaven",name:"Brookhaven"},{id:"buckhead",name:"Buckhead"},{id:"dawsonville",name:"Dawsonville"},{id:"decatur",name:"Decatur"},{id:"kennesaw",name:"Kennesaw"},{id:"marietta",name:"Marietta"},{id:"peachtree",name:"Peachtree"},{id:"perimeter",name:"Perimeter"},{id:"stoneMountain",name:"Stone Mountain"}];export{e as d}
@@ -0,0 +1 @@
1
+ import{r as l,h as o}from"./p-f445bcf9.js";const t=[{label:"Name",prop:"name"},{label:"Job",prop:"job"},{label:"Favorite Color",prop:"color"}],r=[{name:"Cy Ganderton",job:"Quality Control Specialist",color:"Blue"},{name:"Hart Hagerty",job:"Desktop Support Technician",color:"Purple"},{name:"Brice Swyre",job:"Tax Accountant",color:"Red"}],a=class{constructor(o){l(this,o)}render(){return o("div",{class:"overflow-x-auto"},o("table",{class:"table-compact table w-full"},o("thead",null,o("tr",null,o("th",null),t.map((({label:l})=>o("th",null,l))))),o("tbody",null,r.map(((l,r)=>o("tr",{class:"hover"},o("th",null,r+1),t.map((({prop:t})=>o("td",null,l[t]))))))),o("tfoot",null,o("tr",null,o("th",null),t.map((({label:l})=>o("th",null,l)))))))}};a.style="";export{a as proto_list}
@@ -0,0 +1 @@
1
+ import{g as e,f as t}from"./p-f445bcf9.js";const o="proto-daisy-ui",n=e=>{const t=localStorage.getItem(e?`${o}-${e}`:o);return t?JSON.parse(t):void 0},s=(e,t)=>{const n=e?`${o}-${e}`:o,s=JSON.stringify(void 0===t?null:t);localStorage.setItem(n,s)},r=e=>!("isConnected"in e)||e.isConnected,i=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(r))})(...t)}),2e3)}})(),a=e=>"function"==typeof e?e():e,c=["light","dark","aqua","business","corporate","fantasy","night","winter","wireframe"],p={login:!0,mfe:"proto-home",pick:0,theme:"dark",themes:c},{state:u}=(()=>{const o=((e,t=((e,t)=>e!==t))=>{const o=a(e);let n=new Map(Object.entries(null!=o?o:{}));const s={dispose:[],get:[],set:[],reset:[]},r=()=>{var t;n=new Map(Object.entries(null!==(t=a(e))&&void 0!==t?t:{})),s.reset.forEach((e=>e()))},i=e=>(s.get.forEach((t=>t(e))),n.get(e)),c=(e,o)=>{const r=n.get(e);t(o,r,e)&&(n.set(e,o),s.set.forEach((t=>t(e,o,r))))},p="undefined"==typeof Proxy?{}:new Proxy(o,{get:(e,t)=>i(t),ownKeys:()=>Array.from(n.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>n.has(t),set:(e,t,o)=>(c(t,o),!0)}),u=(e,t)=>(s[e].push(t),()=>{((e,t)=>{const o=e.indexOf(t);o>=0&&(e[o]=e[e.length-1],e.length--)})(s[e],t)});return{state:p,get:i,set:c,on:u,onChange:(t,o)=>{const n=u("set",((e,n)=>{e===t&&o(n)})),s=u("reset",(()=>o(a(e)[t])));return()=>{n(),s()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(u("set",t.set)),t.get&&e.push(u("get",t.get)),t.reset&&e.push(u("reset",t.reset)),t.dispose&&e.push(u("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{s.dispose.forEach((e=>e())),r()},reset:r,forceUpdate:e=>{const t=n.get(e);s.set.forEach((o=>o(e,t,t)))}}})(p,void 0);return o.use((()=>{if("function"!=typeof e)return{};const o=new Map;return{dispose:()=>o.clear(),get:t=>{const n=e();n&&((e,t,o)=>{const n=e.get(t);n?n.includes(o)||n.push(o):e.set(t,[o])})(o,t,n)},set:e=>{const n=o.get(e);n&&o.set(e,n.filter(t)),i(o)},reset:()=>{o.forEach((e=>e.forEach(t))),i(o)}}})()),o})(),l=(f=f||new Map,function(e,t){var o=f.get(e);o&&o.slice().map((function(e){e(t)})),(o=f.get("*"))&&o.slice().map((function(o){o(e,t)}))});var f;const d=(e=!1)=>{u.login=e,u.pick=0,u.mfe="proto-home",u.theme="dark",u.themes=c},g=e=>{u.mfe=e,e?(s("login",!1),u.login=!1,l("app",{mfe:e})):(s("login",!0),u.login=!0)},m=e=>{u.pick=e,e&&l("pick",{pick:e})},h=e=>{u.theme=e,console.log(e),e&&l("theme",{theme:e})},k=()=>{d(!0),s("pick",0)},y={initApp:()=>{d();const e=n("login"),t=n("mfe"),o=n("pick"),s=n("theme");var r;console.log("-- data:",t),s?(h(s),void 0!==e&&(u.login=r=e,r&&l("login",{login:r})),!1===e&&t&&(console.log("-- app:",t),g(t)),o&&m(o)):k()},refresh:k,updateApp:e=>{s("mfe",e),g(e)},updatePick:e=>{s("pick",e),m(e)},updateTheme:e=>{s("theme",e),h(e)}};export{y as a,u as s}
@@ -0,0 +1 @@
1
+ import{r as t,h as e}from"./p-f445bcf9.js";import{a as s}from"./p-78473e80.js";const a=class{constructor(e){t(this,e),this.theme="light"}render(){return e("div",{class:"flex min-h-screen flex-col bg-clrs-slate font-sans","data-theme":this.theme},e("div",{class:"hero min-h-screen bg-base-200"},e("div",{class:"hero-content text-center"},e("div",{class:"max-w-md"},e("h1",{class:"text-5xl font-bold"},"Hello there"),e("p",{class:"py-6"},"Provident cupiditate voluptatem et in. Quaerat fugiat ut assumenda excepturi exercitationem quasi. In deleniti eaque aut repudiandae et a id nisi."),e("button",{class:"btn btn-primary",onClick:()=>s.updateApp("proto-home")},"Get Started")))))}};a.style="proto-hero{}";export{a as proto_hero}
@@ -0,0 +1 @@
1
+ import{h as t}from"./p-f445bcf9.js";const o=(o,r)=>t("button",{class:"btn btn-primary"},r);export{o as P}
@@ -0,0 +1 @@
1
+ import{r,h as o}from"./p-f445bcf9.js";import{P as s}from"./p-98b063cb.js";const t=class{constructor(o){r(this,o)}render(){return o(s,null,"Foobar")}};t.style="";export{t as proto_demo}
@@ -0,0 +1 @@
1
+ import{r as s,h as o}from"./p-f445bcf9.js";import{P as r}from"./p-98b063cb.js";import{d as e}from"./p-0cbc124a.js";import{s as t}from"./p-78473e80.js";const l=class{constructor(o){s(this,o)}render(){const{pick:s}=t,l=e[s];return o("div",{class:"mr-8 flex flex-col flex-nowrap items-start gap-2"},o("div",{class:"alert alert-info shadow-lg"},o("div",null,o("svg",{fill:"none",viewBox:"0 0 24 24",class:"h-6 w-6 flex-shrink-0 stroke-current"},o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})),o("span",null,"Welcome... [ ",l.name," ]"))),o(r,null,"Home"))}};l.style="";export{l as proto_home}