@operato/input 8.0.0-alpha.41 → 8.0.0-alpha.45

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.44...v8.0.0-alpha.45) (2024-10-23)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * add switch into input module ([3eb9c84](https://github.com/hatiolab/operato/commit/3eb9c84e3de2e8b36522e230e785948171df2aba))
12
+
13
+
14
+
6
15
  ## [8.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.40...v8.0.0-alpha.41) (2024-10-21)
7
16
 
8
17
 
@@ -5,6 +5,7 @@ export * from './ox-form-field.js';
5
5
  export * from './ox-buttons-radio.js';
6
6
  export * from './ox-checkbox.js';
7
7
  export * from './ox-select.js';
8
+ export * from './ox-input-switch.js';
8
9
  export * from './ox-input-angle.js';
9
10
  export * from './ox-input-3dish.js';
10
11
  export * from './ox-input-3axis.js';
package/dist/src/index.js CHANGED
@@ -5,6 +5,7 @@ export * from './ox-form-field.js';
5
5
  export * from './ox-buttons-radio.js';
6
6
  export * from './ox-checkbox.js';
7
7
  export * from './ox-select.js';
8
+ export * from './ox-input-switch.js';
8
9
  export * from './ox-input-angle.js';
9
10
  export * from './ox-input-3dish.js';
10
11
  export * from './ox-input-3axis.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kCAAkC,CAAA;AAChD,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nexport * from './ox-form-field.js'\nexport * from './ox-buttons-radio.js'\nexport * from './ox-checkbox.js'\nexport * from './ox-select.js'\nexport * from './ox-input-angle.js'\nexport * from './ox-input-3dish.js'\nexport * from './ox-input-3axis.js'\nexport * from './ox-input-stack.js'\nexport * from './ox-input-barcode.js'\nexport * from './ox-input-code.js'\nexport * from './ox-input-color.js'\nexport * from './ox-input-multiple-colors.js'\nexport * from './ox-input-color-stops.js'\nexport * from './ox-input-color-gradient.js'\nexport * from './ox-input-file.js'\nexport * from './ox-input-image.js'\nexport * from './ox-input-value-ranges.js'\nexport * from './ox-input-value-map.js'\nexport * from './ox-input-table.js'\nexport * from './ox-input-scene-component-id.js'\nexport * from './ox-input-crontab.js'\nexport * from './ox-input-partition-keys.js'\nexport * from './ox-input-duration.js'\nexport * from './ox-input-quantifier.js'\nexport * from './ox-input-select-buttons.js'\nexport * from './ox-input-textarea.js'\nexport * from './ox-input-direction.js'\nexport * from './ox-input-table-column-config.js'\nexport * from './ox-input-search.js'\nexport * from './ox-input-signature.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kCAAkC,CAAA;AAChD,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nexport * from './ox-form-field.js'\nexport * from './ox-buttons-radio.js'\nexport * from './ox-checkbox.js'\nexport * from './ox-select.js'\nexport * from './ox-input-switch.js'\nexport * from './ox-input-angle.js'\nexport * from './ox-input-3dish.js'\nexport * from './ox-input-3axis.js'\nexport * from './ox-input-stack.js'\nexport * from './ox-input-barcode.js'\nexport * from './ox-input-code.js'\nexport * from './ox-input-color.js'\nexport * from './ox-input-multiple-colors.js'\nexport * from './ox-input-color-stops.js'\nexport * from './ox-input-color-gradient.js'\nexport * from './ox-input-file.js'\nexport * from './ox-input-image.js'\nexport * from './ox-input-value-ranges.js'\nexport * from './ox-input-value-map.js'\nexport * from './ox-input-table.js'\nexport * from './ox-input-scene-component-id.js'\nexport * from './ox-input-crontab.js'\nexport * from './ox-input-partition-keys.js'\nexport * from './ox-input-duration.js'\nexport * from './ox-input-quantifier.js'\nexport * from './ox-input-select-buttons.js'\nexport * from './ox-input-textarea.js'\nexport * from './ox-input-direction.js'\nexport * from './ox-input-table-column-config.js'\nexport * from './ox-input-search.js'\nexport * from './ox-input-signature.js'\n"]}
@@ -0,0 +1,9 @@
1
+ import { OxFormField } from './ox-form-field';
2
+ export declare class OxInputSwitch extends OxFormField {
3
+ static styles: import("lit").CSSResult;
4
+ round: boolean;
5
+ value: boolean;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ firstUpdated(): void;
8
+ protected appendFormData({ formData }: FormDataEvent): void;
9
+ }
@@ -0,0 +1,121 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { OxFormField } from './ox-form-field';
5
+ let OxInputSwitch = class OxInputSwitch extends OxFormField {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.round = false;
9
+ this.value = false;
10
+ }
11
+ static { this.styles = css `
12
+ :host {
13
+ --ox-simple-switch-fullwidth: 2em;
14
+ --ox-simple-switch-fullheight: 1em;
15
+ --ox-simple-switch-thumbnail-size: 1em;
16
+ }
17
+
18
+ label {
19
+ position: relative;
20
+ display: inline-block;
21
+ width: 100%;
22
+ height: 100%;
23
+ }
24
+
25
+ label input {
26
+ opacity: 0;
27
+ width: 0;
28
+ height: 0;
29
+ }
30
+
31
+ span {
32
+ position: absolute;
33
+ cursor: pointer;
34
+ width: var(--ox-simple-switch-fullwidth);
35
+ height: var(--ox-simple-switch-fullheight);
36
+ top: calc(0 - var(--ox-simple-switch-thumbnail-size));
37
+ left: 0;
38
+ background-color: var(--ox-simple-switch-off-color, #ccc);
39
+ -webkit-transition: 0.4s;
40
+ transition: 0.4s;
41
+ }
42
+
43
+ span:before {
44
+ position: absolute;
45
+ content: '';
46
+ height: calc(var(--ox-simple-switch-thumbnail-size) - 8px);
47
+ width: calc(var(--ox-simple-switch-thumbnail-size) - 8px);
48
+ left: 4px;
49
+ top: 4px;
50
+ background-color: var(--ox-simple-switch-thumbnail-color, white);
51
+ -webkit-transition: 0.4s;
52
+ transition: 0.4s;
53
+ }
54
+
55
+ input:checked + span {
56
+ background-color: var(--ox-simple-switch-on-color, #2196f3);
57
+ }
58
+
59
+ input + span:before {
60
+ -webkit-transform: translateY(
61
+ calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2)
62
+ );
63
+ -ms-transform: translateY(
64
+ calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2)
65
+ );
66
+ transform: translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));
67
+ }
68
+
69
+ input:checked + span:before {
70
+ -webkit-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))
71
+ translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));
72
+ -ms-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))
73
+ translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));
74
+ transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))
75
+ translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));
76
+ }
77
+
78
+ /* Rounded sliders */
79
+ span[round] {
80
+ border-radius: calc(var(--ox-simple-switch-thumbnail-size) / 2);
81
+ }
82
+
83
+ span[round]:before {
84
+ border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);
85
+ }
86
+ `; }
87
+ render() {
88
+ return html `
89
+ <label>
90
+ <input type="checkbox" .checked=${this.value} />
91
+ <span ?round=${this.round}></span>
92
+ </label>
93
+ `;
94
+ }
95
+ firstUpdated() {
96
+ this.renderRoot.addEventListener('change', (e) => {
97
+ e.preventDefault();
98
+ e.stopPropagation();
99
+ this.value = e.target?.checked;
100
+ this.dispatchEvent(new CustomEvent('change', {
101
+ bubbles: true,
102
+ composed: true,
103
+ detail: this.value
104
+ }));
105
+ });
106
+ }
107
+ appendFormData({ formData }) {
108
+ this.name && formData.append(this.name, this.value ? 'true' : 'false');
109
+ }
110
+ };
111
+ __decorate([
112
+ property({ type: Boolean })
113
+ ], OxInputSwitch.prototype, "round", void 0);
114
+ __decorate([
115
+ property({ type: Boolean })
116
+ ], OxInputSwitch.prototype, "value", void 0);
117
+ OxInputSwitch = __decorate([
118
+ customElement('ox-input-switch')
119
+ ], OxInputSwitch);
120
+ export { OxInputSwitch };
121
+ //# sourceMappingURL=ox-input-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-input-switch.js","sourceRoot":"","sources":["../../src/ox-input-switch.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGtC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAW;IAAvC;;QA8EwB,UAAK,GAAY,KAAK,CAAA;QACtB,UAAK,GAAY,KAAK,CAAA;IA8BrD,CAAC;aA5GQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2ElB,AA3EY,CA2EZ;IAKD,MAAM;QACJ,OAAO,IAAI,CAAA;;0CAE2B,IAAI,CAAC,KAAK;uBAC7B,IAAI,CAAC,KAAK;;KAE5B,CAAA;IACH,CAAC;IAED,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAQ,EAAE,EAAE;YACtD,CAAC,CAAC,cAAc,EAAE,CAAA;YAClB,CAAC,CAAC,eAAe,EAAE,CAAA;YAEnB,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA2B,EAAE,OAAO,CAAA;YACpD,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,IAAI,CAAC,KAAK;aACnB,CAAC,CACH,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAES,cAAc,CAAC,EAAE,QAAQ,EAAiB;QAClD,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IACxE,CAAC;;AA9B4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAuB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAuB;AA/ExC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA6GzB","sourcesContent":["import { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from './ox-form-field'\n\n@customElement('ox-input-switch')\nexport class OxInputSwitch extends OxFormField {\n static styles = css`\n :host {\n --ox-simple-switch-fullwidth: 2em;\n --ox-simple-switch-fullheight: 1em;\n --ox-simple-switch-thumbnail-size: 1em;\n }\n\n label {\n position: relative;\n display: inline-block;\n width: 100%;\n height: 100%;\n }\n\n label input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n span {\n position: absolute;\n cursor: pointer;\n width: var(--ox-simple-switch-fullwidth);\n height: var(--ox-simple-switch-fullheight);\n top: calc(0 - var(--ox-simple-switch-thumbnail-size));\n left: 0;\n background-color: var(--ox-simple-switch-off-color, #ccc);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n span:before {\n position: absolute;\n content: '';\n height: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n width: calc(var(--ox-simple-switch-thumbnail-size) - 8px);\n left: 4px;\n top: 4px;\n background-color: var(--ox-simple-switch-thumbnail-color, white);\n -webkit-transition: 0.4s;\n transition: 0.4s;\n }\n\n input:checked + span {\n background-color: var(--ox-simple-switch-on-color, #2196f3);\n }\n\n input + span:before {\n -webkit-transform: translateY(\n calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2)\n );\n -ms-transform: translateY(\n calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2)\n );\n transform: translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));\n }\n\n input:checked + span:before {\n -webkit-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));\n -ms-transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));\n transform: translateX(calc(var(--ox-simple-switch-fullwidth) - var(--ox-simple-switch-thumbnail-size)))\n translateY(calc((var(--ox-simple-switch-fullheight) - var(--ox-simple-switch-thumbnail-size)) / 2));\n }\n\n /* Rounded sliders */\n span[round] {\n border-radius: calc(var(--ox-simple-switch-thumbnail-size) / 2);\n }\n\n span[round]:before {\n border-radius: calc((var(--ox-simple-switch-thumbnail-size) - 8px) / 2);\n }\n `\n\n @property({ type: Boolean }) round: boolean = false\n @property({ type: Boolean }) value: boolean = false\n\n render() {\n return html`\n <label>\n <input type=\"checkbox\" .checked=${this.value} />\n <span ?round=${this.round}></span>\n </label>\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', (e: Event) => {\n e.preventDefault()\n e.stopPropagation()\n\n this.value = (e.target as HTMLInputElement)?.checked\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n })\n }\n\n protected appendFormData({ formData }: FormDataEvent): void {\n this.name && formData.append(this.name, this.value ? 'true' : 'false')\n }\n}\n"]}
@@ -0,0 +1,38 @@
1
+ import '@material/web/all.js';
2
+ import '../src/ox-input-switch.js';
3
+ import { TemplateResult } from 'lit';
4
+ declare const _default: {
5
+ title: string;
6
+ component: string;
7
+ argTypes: {
8
+ label: {
9
+ control: string;
10
+ };
11
+ name: {
12
+ control: string;
13
+ };
14
+ round: {
15
+ control: string;
16
+ };
17
+ value: {
18
+ control: string;
19
+ };
20
+ disabled: {
21
+ control: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
26
+ interface Story<T> {
27
+ (args: T): TemplateResult;
28
+ args?: Partial<T>;
29
+ argTypes?: Record<string, unknown>;
30
+ }
31
+ interface ArgTypes {
32
+ label?: string;
33
+ name?: string;
34
+ round?: boolean;
35
+ value?: boolean;
36
+ disabled?: boolean;
37
+ }
38
+ export declare const Regular: Story<ArgTypes>;
@@ -0,0 +1,68 @@
1
+ import '@material/web/all.js';
2
+ import '../src/ox-input-switch.js';
3
+ import { html } from 'lit';
4
+ import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles';
5
+ export default {
6
+ title: 'ox-input-switch',
7
+ component: 'ox-input-switch',
8
+ argTypes: {
9
+ label: { control: 'text' },
10
+ name: { control: 'text' },
11
+ round: { control: 'boolean' },
12
+ value: { control: 'boolean' },
13
+ disabled: { control: 'boolean' }
14
+ }
15
+ };
16
+ const Template = ({ label = 'Checkbox', name = 'hello', round = false, value = false, disabled }) => html `
17
+ <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
18
+
19
+ <link href="/themes/light.css" rel="stylesheet" />
20
+ <link href="/themes/dark.css" rel="stylesheet" />
21
+ <link href="/themes/spacing.css" rel="stylesheet" />
22
+
23
+ <link
24
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
25
+ rel="stylesheet"
26
+ />
27
+ <link
28
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
29
+ rel="stylesheet"
30
+ />
31
+ <link
32
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
33
+ rel="stylesheet"
34
+ />
35
+
36
+ <style>
37
+ ${MDTypeScaleStyles.cssText}
38
+ </style>
39
+
40
+ <style>
41
+ .container {
42
+ height: 500px;
43
+ text-align: center;
44
+ padding: 20px;
45
+ background-color: var(--md-sys-color-primary-container);
46
+ color: var(--md-sys-color-on-primary-container);
47
+ padding: 20px;
48
+ }
49
+
50
+ ox-input-switch {
51
+ --ox-simple-switch-fullwidth: 120px;
52
+ --ox-simple-switch-fullheight: 40px;
53
+ --ox-simple-switch-thumbnail-size: 60px;
54
+ }
55
+ </style>
56
+
57
+ <div class="container md-typescale-body-large-prominent">
58
+ <ox-input-switch name=${name} .value=${value} .round=${round} ?disabled=${disabled}> </ox-input-switch>
59
+ </div>
60
+ `;
61
+ export const Regular = Template.bind({});
62
+ Regular.args = {
63
+ label: 'label',
64
+ name: 'label',
65
+ round: false,
66
+ value: false
67
+ };
68
+ //# sourceMappingURL=ox-input-switch.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-input-switch.stories.js","sourceRoot":"","sources":["../../stories/ox-input-switch.stories.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,2BAA2B,CAAA;AAElC,OAAO,EAAkB,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAE1F,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,iBAAiB;IAC5B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAC7B,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAC7B,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KACjC;CACF,CAAA;AAgBD,MAAM,QAAQ,GAAoB,CAAC,EACjC,KAAK,GAAG,UAAU,EAClB,IAAI,GAAG,OAAO,EACd,KAAK,GAAG,KAAK,EACb,KAAK,GAAG,KAAK,EACb,QAAQ,EACC,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBd,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;4BAqBH,IAAI,WAAW,KAAK,WAAW,KAAK,cAAc,QAAQ;;CAErF,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;CACb,CAAA","sourcesContent":["import '@material/web/all.js'\nimport '../src/ox-input-switch.js'\n\nimport { TemplateResult, html } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\n\nexport default {\n title: 'ox-input-switch',\n component: 'ox-input-switch',\n argTypes: {\n label: { control: 'text' },\n name: { control: 'text' },\n round: { control: 'boolean' },\n value: { control: 'boolean' },\n disabled: { control: 'boolean' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n label?: string\n name?: string\n round?: boolean\n value?: boolean\n disabled?: boolean\n}\n\nconst Template: Story<ArgTypes> = ({\n label = 'Checkbox',\n name = 'hello',\n round = false,\n value = false,\n disabled\n}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n .container {\n height: 500px;\n text-align: center;\n padding: 20px;\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n padding: 20px;\n }\n\n ox-input-switch {\n --ox-simple-switch-fullwidth: 120px;\n --ox-simple-switch-fullheight: 40px;\n --ox-simple-switch-thumbnail-size: 60px;\n }\n </style>\n\n <div class=\"container md-typescale-body-large-prominent\">\n <ox-input-switch name=${name} .value=${value} .round=${round} ?disabled=${disabled}> </ox-input-switch>\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n label: 'label',\n name: 'label',\n round: false,\n value: false\n}\n"]}