inputs-wc 0.1.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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/alt-input.cjs.entry.js +35 -0
  3. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  4. package/dist/cjs/index-d27e04ed.js +1326 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/inputs-wc.cjs.js +25 -0
  7. package/dist/cjs/loader.cjs.js +15 -0
  8. package/dist/cjs/numeric-input.cjs.entry.js +41 -0
  9. package/dist/cjs/sample-form.cjs.entry.js +64 -0
  10. package/dist/cjs/tw-555edb3e.js +11966 -0
  11. package/dist/collection/collection-manifest.json +14 -0
  12. package/dist/collection/components/alt-input/alt-input.css +0 -0
  13. package/dist/collection/components/alt-input/alt-input.js +118 -0
  14. package/dist/collection/components/numeric-input/numeric-input.css +0 -0
  15. package/dist/collection/components/numeric-input/numeric-input.js +144 -0
  16. package/dist/collection/components/sample-form/button.js +8 -0
  17. package/dist/collection/components/sample-form/check.js +11 -0
  18. package/dist/collection/components/sample-form/radio.js +11 -0
  19. package/dist/collection/components/sample-form/sample-form.js +34 -0
  20. package/dist/collection/index.js +1 -0
  21. package/dist/collection/props.css +100 -0
  22. package/dist/collection/styles/shadow.css +480 -0
  23. package/dist/collection/tokens.css +379 -0
  24. package/dist/collection/utils/index.js +4 -0
  25. package/dist/collection/utils/store.js +58 -0
  26. package/dist/collection/utils/tw-version.js +4 -0
  27. package/dist/collection/utils/tw.js +5 -0
  28. package/dist/collection/utils/types.js +1 -0
  29. package/dist/components/alt-input.d.ts +11 -0
  30. package/dist/components/alt-input.js +53 -0
  31. package/dist/components/index.d.ts +33 -0
  32. package/dist/components/index.js +1 -0
  33. package/dist/components/numeric-input.d.ts +11 -0
  34. package/dist/components/numeric-input.js +60 -0
  35. package/dist/components/sample-form.d.ts +11 -0
  36. package/dist/components/sample-form.js +78 -0
  37. package/dist/components/tw.js +11962 -0
  38. package/dist/esm/alt-input.entry.js +31 -0
  39. package/dist/esm/app-globals-0f993ce5.js +3 -0
  40. package/dist/esm/index-1c8d0134.js +1298 -0
  41. package/dist/esm/index.js +1 -0
  42. package/dist/esm/inputs-wc.js +20 -0
  43. package/dist/esm/loader.js +11 -0
  44. package/dist/esm/numeric-input.entry.js +37 -0
  45. package/dist/esm/sample-form.entry.js +60 -0
  46. package/dist/esm/tw-88a8de4e.js +11962 -0
  47. package/dist/index.cjs.js +1 -0
  48. package/dist/index.js +1 -0
  49. package/dist/inputs-wc/index.esm.js +0 -0
  50. package/dist/inputs-wc/inputs-wc.esm.js +1 -0
  51. package/dist/inputs-wc/p-1c4a76f0.js +1 -0
  52. package/dist/inputs-wc/p-352bc40d.entry.js +1 -0
  53. package/dist/inputs-wc/p-92a60dc3.js +2 -0
  54. package/dist/inputs-wc/p-b6a348f1.entry.js +1 -0
  55. package/dist/inputs-wc/p-c3a8f125.entry.js +1 -0
  56. package/dist/inputs-wc/p-e1255160.js +1 -0
  57. package/dist/inputs-wc/props.css +100 -0
  58. package/dist/inputs-wc/tokens.css +379 -0
  59. package/dist/loader/cdn.js +1 -0
  60. package/dist/loader/index.cjs.js +1 -0
  61. package/dist/loader/index.d.ts +24 -0
  62. package/dist/loader/index.es2017.js +1 -0
  63. package/dist/loader/index.js +2 -0
  64. package/dist/loader/package.json +11 -0
  65. package/dist/types/components/alt-input/alt-input.d.ts +9 -0
  66. package/dist/types/components/numeric-input/numeric-input.d.ts +11 -0
  67. package/dist/types/components/sample-form/button.d.ts +9 -0
  68. package/dist/types/components/sample-form/check.d.ts +5 -0
  69. package/dist/types/components/sample-form/radio.d.ts +5 -0
  70. package/dist/types/components/sample-form/sample-form.d.ts +4 -0
  71. package/dist/types/components.d.ts +81 -0
  72. package/dist/types/index.d.ts +1 -0
  73. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  74. package/dist/types/utils/index.d.ts +4 -0
  75. package/dist/types/utils/store.d.ts +6 -0
  76. package/dist/types/utils/tw-version.d.ts +3 -0
  77. package/dist/types/utils/tw.d.ts +3 -0
  78. package/dist/types/utils/types.d.ts +26 -0
  79. package/loader/cdn.js +1 -0
  80. package/loader/index.cjs.js +1 -0
  81. package/loader/index.d.ts +24 -0
  82. package/loader/index.es2017.js +1 -0
  83. package/loader/index.js +2 -0
  84. package/loader/package.json +11 -0
  85. package/package.json +48 -0
  86. package/readme.md +75 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "entries": [
3
+ "components/alt-input/alt-input.js",
4
+ "components/numeric-input/numeric-input.js",
5
+ "components/sample-form/sample-form.js"
6
+ ],
7
+ "compiler": {
8
+ "name": "@stencil/core",
9
+ "version": "4.26.0",
10
+ "typescriptVersion": "5.5.4"
11
+ },
12
+ "collections": [],
13
+ "bundles": []
14
+ }
@@ -0,0 +1,118 @@
1
+ import { h } from "@stencil/core";
2
+ import { actions, tw } from "../../utils";
3
+ export class AltInput {
4
+ constructor() {
5
+ this.min = 0;
6
+ this.max = undefined;
7
+ this.xId = '';
8
+ this.value = 0;
9
+ this.isInvalid = (num) => {
10
+ const { min, max } = this;
11
+ return num < min || (max !== undefined && num > max);
12
+ };
13
+ this.handleInput = event => {
14
+ event.preventDefault();
15
+ const target = event.target;
16
+ const num = target.value != '' ? target.value : 0;
17
+ actions.update(this.xId, num);
18
+ };
19
+ }
20
+ render() {
21
+ return (h("input", { key: '4f722d7778500c3f5038667e0b977dd04389c185', class: tw('text-right', this.isInvalid(this.value) ? 'text-clrs-red' : 'text-clrs-navy'), type: "number", onInput: this.handleInput, value: this.value }));
22
+ }
23
+ static get is() { return "alt-input"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["alt-input.css"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["alt-input.css"]
32
+ };
33
+ }
34
+ static get properties() {
35
+ return {
36
+ "min": {
37
+ "type": "number",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "number",
41
+ "resolved": "number",
42
+ "references": {}
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": ""
49
+ },
50
+ "getter": false,
51
+ "setter": false,
52
+ "attribute": "min",
53
+ "reflect": false,
54
+ "defaultValue": "0"
55
+ },
56
+ "max": {
57
+ "type": "number",
58
+ "mutable": false,
59
+ "complexType": {
60
+ "original": "number",
61
+ "resolved": "number",
62
+ "references": {}
63
+ },
64
+ "required": false,
65
+ "optional": false,
66
+ "docs": {
67
+ "tags": [],
68
+ "text": ""
69
+ },
70
+ "getter": false,
71
+ "setter": false,
72
+ "attribute": "max",
73
+ "reflect": false,
74
+ "defaultValue": "undefined"
75
+ },
76
+ "xId": {
77
+ "type": "string",
78
+ "mutable": false,
79
+ "complexType": {
80
+ "original": "string",
81
+ "resolved": "string",
82
+ "references": {}
83
+ },
84
+ "required": false,
85
+ "optional": false,
86
+ "docs": {
87
+ "tags": [],
88
+ "text": ""
89
+ },
90
+ "getter": false,
91
+ "setter": false,
92
+ "attribute": "x-id",
93
+ "reflect": false,
94
+ "defaultValue": "''"
95
+ },
96
+ "value": {
97
+ "type": "number",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "number",
101
+ "resolved": "number",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": false,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "getter": false,
111
+ "setter": false,
112
+ "attribute": "x-value",
113
+ "reflect": false,
114
+ "defaultValue": "0"
115
+ }
116
+ };
117
+ }
118
+ }
@@ -0,0 +1,144 @@
1
+ import { h } from "@stencil/core";
2
+ import { actions, tw } from "../../utils";
3
+ export class NumericInput {
4
+ constructor() {
5
+ this.min = 0;
6
+ this.max = undefined;
7
+ this.xId = '';
8
+ this.xPrefix = '';
9
+ this.value = 0;
10
+ this.labelFor = (num) => {
11
+ return num > 0 ? this.xPrefix.concat(num.toLocaleString()) : '';
12
+ };
13
+ this.isInvalid = (num) => {
14
+ const { min, max } = this;
15
+ return num < min || (max !== undefined && num > max);
16
+ };
17
+ this.handleInput = event => {
18
+ event.preventDefault();
19
+ const target = event.target;
20
+ const text = target.value;
21
+ const stripped = text.replace(/[^0-9]/g, '');
22
+ const num = stripped !== '' ? parseInt(stripped) : 0;
23
+ actions.update(this.xId, num);
24
+ };
25
+ }
26
+ render() {
27
+ return (h("input", { key: '7bc740cc171519ea2928f1b63054bd8566605248', class: tw('text-right', this.isInvalid(this.value) ? 'text-clrs-red' : 'text-clrs-navy'), type: "text", onInput: this.handleInput, value: this.labelFor(this.value) }));
28
+ }
29
+ static get is() { return "numeric-input"; }
30
+ static get originalStyleUrls() {
31
+ return {
32
+ "$": ["numeric-input.css"]
33
+ };
34
+ }
35
+ static get styleUrls() {
36
+ return {
37
+ "$": ["numeric-input.css"]
38
+ };
39
+ }
40
+ static get properties() {
41
+ return {
42
+ "min": {
43
+ "type": "number",
44
+ "mutable": false,
45
+ "complexType": {
46
+ "original": "number",
47
+ "resolved": "number",
48
+ "references": {}
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": ""
55
+ },
56
+ "getter": false,
57
+ "setter": false,
58
+ "attribute": "min",
59
+ "reflect": false,
60
+ "defaultValue": "0"
61
+ },
62
+ "max": {
63
+ "type": "number",
64
+ "mutable": false,
65
+ "complexType": {
66
+ "original": "number",
67
+ "resolved": "number",
68
+ "references": {}
69
+ },
70
+ "required": false,
71
+ "optional": false,
72
+ "docs": {
73
+ "tags": [],
74
+ "text": ""
75
+ },
76
+ "getter": false,
77
+ "setter": false,
78
+ "attribute": "max",
79
+ "reflect": false,
80
+ "defaultValue": "undefined"
81
+ },
82
+ "xId": {
83
+ "type": "string",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "string",
87
+ "resolved": "string",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": ""
95
+ },
96
+ "getter": false,
97
+ "setter": false,
98
+ "attribute": "x-id",
99
+ "reflect": false,
100
+ "defaultValue": "''"
101
+ },
102
+ "xPrefix": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": ""
115
+ },
116
+ "getter": false,
117
+ "setter": false,
118
+ "attribute": "x-prefix",
119
+ "reflect": false,
120
+ "defaultValue": "''"
121
+ },
122
+ "value": {
123
+ "type": "number",
124
+ "mutable": false,
125
+ "complexType": {
126
+ "original": "number",
127
+ "resolved": "number",
128
+ "references": {}
129
+ },
130
+ "required": false,
131
+ "optional": false,
132
+ "docs": {
133
+ "tags": [],
134
+ "text": ""
135
+ },
136
+ "getter": false,
137
+ "setter": false,
138
+ "attribute": "x-value",
139
+ "reflect": false,
140
+ "defaultValue": "0"
141
+ }
142
+ };
143
+ }
144
+ }
@@ -0,0 +1,8 @@
1
+ import { h } from "@stencil/core";
2
+ import { tw } from "../../utils";
3
+ const Button = props => {
4
+ const { label, callback } = props;
5
+ return (h("button", { class: tw('mr-2 rounded-md border border-solid border-clrs-slate4 font-bold', 'bg-clrs-blue px-2 py-1 text-clrs-white', 'hover:bg-clrs-red'), onClick: callback }, label));
6
+ };
7
+ export { Button };
8
+ export default Button;
@@ -0,0 +1,11 @@
1
+ import { h } from "@stencil/core";
2
+ const Check = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'check';
6
+ const selected = props.selected || false;
7
+ const size = props.size || 24;
8
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" }, h("title", null, label), ' ', h("g", { fill: hex }, selected ? (h("path", { d: "M10 17L5 12L6.41 10.58L10 14.17L17.59 6.58L19 8M19 3H5C3.89 3 3 3.89 3 5V19A2 2 0 0 0 5 21H19A2 2 0 0 0 21 19V5C21 3.89 20.1 3 19 3Z" })) : (h("path", { d: "M19 3H5C3.89 3 3 3.89 3 5V19A2 2 0 0 0 5 21H19A2 2 0 0 0 21 19V5C21 3.89 20.1 3 19 3M19 5V19H5V5H19Z" }))), h("path", { d: "M0 0h24v24H0z", fill: "none" })));
9
+ };
10
+ export { Check };
11
+ export default Check;
@@ -0,0 +1,11 @@
1
+ import { h } from "@stencil/core";
2
+ const Radio = props => {
3
+ const hex = props.hex || 'currentColor';
4
+ const klass = props.class;
5
+ const label = props.label || 'radio';
6
+ const selected = props.selected || false;
7
+ const size = props.size || 24;
8
+ return (h("svg", { class: klass, width: size, height: size, viewBox: "0 0 24 24", role: "img", "aria-label": "title" }, h("title", null, label), ' ', h("g", { fill: hex }, selected ? (h("path", { d: "M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" })) : (h("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }))), h("path", { d: "M0 0h24v24H0z", fill: "none" })));
9
+ };
10
+ export { Radio };
11
+ export default Radio;
@@ -0,0 +1,34 @@
1
+ import { h } from "@stencil/core";
2
+ import { actions, state } from "../../utils";
3
+ import { Button } from "./button";
4
+ import { Check } from "./check";
5
+ import { Radio } from "./radio";
6
+ export class SampleForm {
7
+ refresh() {
8
+ actions.refresh();
9
+ }
10
+ render() {
11
+ const { items, itemSets, pick } = state;
12
+ const TAG = state.tag;
13
+ const radios = itemSets.map((_item, indx) => {
14
+ return (h("span", { onClick: () => actions.pick(indx) }, h(Radio, { selected: indx == pick })));
15
+ });
16
+ const inputs = items.map(({ key, value }) => {
17
+ // NOTE: we're not using the key attribute, and it works...
18
+ return h(TAG, { "x-id": key, "x-value": value, max: 20 });
19
+ });
20
+ return (h("div", { class: "flex flex-col gap-2 text-clrs-navy" }, h("div", { class: "flex" }, h(Button, { label: "Refresh", callback: this.refresh }), h("span", { onClick: () => actions.toggle() }, h(Check, { selected: TAG === 'numeric-input', label: TAG })), ...radios), ...inputs));
21
+ }
22
+ static get is() { return "sample-form"; }
23
+ static get encapsulation() { return "shadow"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["sample-form.css"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["sample-form.css"]
32
+ };
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,100 @@
1
+ @property --tw-border-style {
2
+ syntax: '*';
3
+ inherits: false;
4
+ initial-value: solid;
5
+ }
6
+ @property --tw-font-weight {
7
+ syntax: '*';
8
+ inherits: false;
9
+ }
10
+ @property --tw-shadow {
11
+ syntax: '*';
12
+ inherits: false;
13
+ initial-value: 0 0 #0000;
14
+ }
15
+ @property --tw-shadow-color {
16
+ syntax: '*';
17
+ inherits: false;
18
+ }
19
+ @property --tw-inset-shadow {
20
+ syntax: '*';
21
+ inherits: false;
22
+ initial-value: 0 0 #0000;
23
+ }
24
+ @property --tw-inset-shadow-color {
25
+ syntax: '*';
26
+ inherits: false;
27
+ }
28
+ @property --tw-ring-color {
29
+ syntax: '*';
30
+ inherits: false;
31
+ }
32
+ @property --tw-ring-shadow {
33
+ syntax: '*';
34
+ inherits: false;
35
+ initial-value: 0 0 #0000;
36
+ }
37
+ @property --tw-inset-ring-color {
38
+ syntax: '*';
39
+ inherits: false;
40
+ }
41
+ @property --tw-inset-ring-shadow {
42
+ syntax: '*';
43
+ inherits: false;
44
+ initial-value: 0 0 #0000;
45
+ }
46
+ @property --tw-ring-inset {
47
+ syntax: '*';
48
+ inherits: false;
49
+ }
50
+ @property --tw-ring-offset-width {
51
+ syntax: '<length>';
52
+ inherits: false;
53
+ initial-value: 0px;
54
+ }
55
+ @property --tw-ring-offset-color {
56
+ syntax: '*';
57
+ inherits: false;
58
+ initial-value: #fff;
59
+ }
60
+ @property --tw-ring-offset-shadow {
61
+ syntax: '*';
62
+ inherits: false;
63
+ initial-value: 0 0 #0000;
64
+ }
65
+ @property --tw-blur {
66
+ syntax: '*';
67
+ inherits: false;
68
+ }
69
+ @property --tw-brightness {
70
+ syntax: '*';
71
+ inherits: false;
72
+ }
73
+ @property --tw-contrast {
74
+ syntax: '*';
75
+ inherits: false;
76
+ }
77
+ @property --tw-grayscale {
78
+ syntax: '*';
79
+ inherits: false;
80
+ }
81
+ @property --tw-hue-rotate {
82
+ syntax: '*';
83
+ inherits: false;
84
+ }
85
+ @property --tw-invert {
86
+ syntax: '*';
87
+ inherits: false;
88
+ }
89
+ @property --tw-opacity {
90
+ syntax: '*';
91
+ inherits: false;
92
+ }
93
+ @property --tw-saturate {
94
+ syntax: '*';
95
+ inherits: false;
96
+ }
97
+ @property --tw-sepia {
98
+ syntax: '*';
99
+ inherits: false;
100
+ }