tinkiet 0.7.6 → 0.7.8

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 (125) hide show
  1. package/accordion/accordion.d.ts +18 -0
  2. package/accordion/accordion.js +94 -0
  3. package/accordion/accordion.scss.js +4 -0
  4. package/accordion/index.d.ts +1 -0
  5. package/accordion/index.js +1 -0
  6. package/badge/badge.d.ts +15 -0
  7. package/badge/badge.js +27 -0
  8. package/badge/badge.scss.js +4 -0
  9. package/badge/index.d.ts +1 -0
  10. package/badge/index.js +1 -0
  11. package/box/box.d.ts +56 -0
  12. package/box/box.js +182 -0
  13. package/box/box.scss.js +4 -0
  14. package/box/focusable-box.d.ts +13 -0
  15. package/box/focusable-box.js +30 -0
  16. package/box/index.d.ts +1 -0
  17. package/box/index.js +1 -0
  18. package/button/button.d.ts +39 -0
  19. package/button/button.js +125 -0
  20. package/button/button.scss.js +4 -0
  21. package/button/index.d.ts +1 -0
  22. package/button/index.js +1 -0
  23. package/checkbox/checkbox.d.ts +21 -0
  24. package/checkbox/checkbox.js +83 -0
  25. package/checkbox/checkbox.scss.js +4 -0
  26. package/checkbox/index.d.ts +1 -0
  27. package/checkbox/index.js +1 -0
  28. package/dialog/dialog.d.ts +18 -0
  29. package/dialog/dialog.js +58 -0
  30. package/dialog/dialog.scss.js +4 -0
  31. package/dialog/index.d.ts +1 -0
  32. package/dialog/index.js +1 -0
  33. package/drawer/drawer.d.ts +29 -0
  34. package/drawer/drawer.js +152 -0
  35. package/drawer/drawer.scss.js +4 -0
  36. package/drawer/index.d.ts +1 -0
  37. package/drawer/index.js +1 -0
  38. package/form/form.d.ts +15 -0
  39. package/form/form.js +57 -0
  40. package/form/index.d.ts +1 -0
  41. package/form/index.js +1 -0
  42. package/icon/icon.d.ts +17 -0
  43. package/icon/icon.js +75 -0
  44. package/icon/icon.scss.js +4 -0
  45. package/icon/icons.d.ts +7 -0
  46. package/icon/icons.js +24 -0
  47. package/icon/index.d.ts +2 -0
  48. package/icon/index.js +2 -0
  49. package/index.d.ts +24 -0
  50. package/index.d.ts.map +1 -0
  51. package/index.js +47 -0
  52. package/list-item/index.d.ts +1 -0
  53. package/list-item/index.js +1 -0
  54. package/list-item/list-item.d.ts +20 -0
  55. package/list-item/list-item.js +72 -0
  56. package/list-item/list-item.scss.js +4 -0
  57. package/loading/index.d.ts +1 -0
  58. package/loading/index.js +1 -0
  59. package/loading/loading.d.ts +14 -0
  60. package/loading/loading.js +61 -0
  61. package/loading/loading.scss.js +4 -0
  62. package/navbar/index.d.ts +1 -0
  63. package/navbar/index.js +1 -0
  64. package/navbar/navbar.d.ts +11 -0
  65. package/navbar/navbar.js +33 -0
  66. package/navbar/navbar.scss.js +4 -0
  67. package/notie/index.d.ts +1 -0
  68. package/notie/index.js +1 -0
  69. package/notie/notie.d.ts +69 -0
  70. package/notie/notie.js +193 -0
  71. package/notie/notie.scss.js +4 -0
  72. package/package.json +1 -1
  73. package/pages/index.d.ts +1 -0
  74. package/pages/index.js +1 -0
  75. package/pages/pages.d.ts +18 -0
  76. package/pages/pages.js +75 -0
  77. package/pages/pages.scss.js +4 -0
  78. package/radio/index.d.ts +1 -0
  79. package/radio/index.js +1 -0
  80. package/radio/radio.d.ts +24 -0
  81. package/radio/radio.js +98 -0
  82. package/radio/radio.scss.js +4 -0
  83. package/select/index.d.ts +1 -0
  84. package/select/index.js +1 -0
  85. package/select/select.d.ts +32 -0
  86. package/select/select.js +132 -0
  87. package/select/select.scss.js +4 -0
  88. package/slider/index.d.ts +1 -0
  89. package/slider/index.js +1 -0
  90. package/slider/slider.d.ts +30 -0
  91. package/slider/slider.js +135 -0
  92. package/slider/slider.scss.js +4 -0
  93. package/switch/index.d.ts +1 -0
  94. package/switch/index.js +1 -0
  95. package/switch/switch.d.ts +24 -0
  96. package/switch/switch.js +99 -0
  97. package/switch/switch.scss.js +4 -0
  98. package/tab-group/index.d.ts +1 -0
  99. package/tab-group/index.js +1 -0
  100. package/tab-group/tab-group.d.ts +21 -0
  101. package/tab-group/tab-group.js +97 -0
  102. package/tab-group/tab-group.scss.js +4 -0
  103. package/tag/index.d.ts +1 -0
  104. package/tag/index.js +1 -0
  105. package/tag/tag.d.ts +11 -0
  106. package/tag/tag.js +20 -0
  107. package/tag/tag.scss.js +4 -0
  108. package/textarea/index.d.ts +1 -0
  109. package/textarea/index.js +1 -0
  110. package/textarea/textarea.d.ts +33 -0
  111. package/textarea/textarea.js +133 -0
  112. package/textarea/textarea.scss.js +4 -0
  113. package/textfield/index.d.ts +1 -0
  114. package/textfield/index.js +1 -0
  115. package/textfield/textfield.d.ts +34 -0
  116. package/textfield/textfield.js +136 -0
  117. package/textfield/textfield.scss.js +4 -0
  118. package/theme/index.d.ts +1 -0
  119. package/theme/index.js +1 -0
  120. package/theme/theme.d.ts +33 -0
  121. package/theme/theme.js +187 -0
  122. package/theme/theme.scss.js +4 -0
  123. package/umd/tinkiet.min.d.ts.map +1 -1
  124. package/utils/unique.d.ts +7 -0
  125. package/utils/unique.js +12 -0
@@ -0,0 +1,18 @@
1
+ import { TkFocusableBox } from "../box/focusable-box";
2
+ declare class TkAccordion extends TkFocusableBox {
3
+ static get styles(): import("lit").CSSResult[];
4
+ name: string;
5
+ checked: boolean;
6
+ rippleHeader: boolean;
7
+ protected $input: HTMLInputElement;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ firstUpdated(): void;
10
+ protected onKeyDown(e: KeyboardEvent): void;
11
+ protected handleClick(): void;
12
+ }
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ "tk-accordion": TkAccordion;
16
+ }
17
+ }
18
+ export { TkAccordion };
@@ -0,0 +1,94 @@
1
+ import { __decorate } from 'tslib';
2
+ import { css, unsafeCSS, html } 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 { TkFocusableBox } from '../box/focusable-box.js';
7
+ import css_248z from './accordion.scss.js';
8
+ import { TkBox } from '../box/box.js';
9
+
10
+ let TkAccordion = class TkAccordion extends TkFocusableBox {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.checked = false;
14
+ this.rippleHeader = false;
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
+ <tk-box margin="small">
27
+ <tk-box
28
+ @click=${this.handleClick.bind(this)}
29
+ ?ripple=${this.rippleHeader}
30
+ class="header"
31
+ direction="row"
32
+ align-items="center"
33
+ >
34
+ <tk-box class="before">
35
+ <slot name="before"></slot>
36
+ </tk-box>
37
+ <tk-box class="header-content">
38
+ <h3 class="title"><slot name="title"></slot></h3>
39
+ <h5><slot name="description"></slot></h5>
40
+ </tk-box>
41
+ </tk-box>
42
+ <tk-box class="content">
43
+ <slot></slot>
44
+ </tk-box>
45
+ </tk-box>
46
+ <input
47
+ id=${this.id}
48
+ slot="none"
49
+ style="display: none;"
50
+ type="radio"
51
+ ?checked="${this.checked}"
52
+ ?disabled="${this.disabled}"
53
+ name="${ifDefined(this.name)}"
54
+ aria-hidden="true"
55
+ tabindex="-1"
56
+ />
57
+ `;
58
+ }
59
+ firstUpdated() {
60
+ this.appendChild(this.$input);
61
+ }
62
+ onKeyDown(e) {
63
+ if (e.code === "Space" || e.code === "Enter") {
64
+ e.preventDefault();
65
+ e.stopPropagation();
66
+ this.click();
67
+ }
68
+ }
69
+ handleClick() {
70
+ this.checked = !this.checked;
71
+ if (this.checked && this.name)
72
+ this.getRootNode()
73
+ .querySelectorAll(`tk-accordion[name="${this.name}"]`)
74
+ .forEach(el => (el != this ? (el.checked = false) : null));
75
+ this.dispatchEvent(new Event("change"));
76
+ }
77
+ };
78
+ __decorate([
79
+ property({ attribute: true, type: String })
80
+ ], TkAccordion.prototype, "name", void 0);
81
+ __decorate([
82
+ property({ attribute: true, type: Boolean, reflect: true })
83
+ ], TkAccordion.prototype, "checked", void 0);
84
+ __decorate([
85
+ property({ attribute: "ripple-header", type: Boolean })
86
+ ], TkAccordion.prototype, "rippleHeader", void 0);
87
+ __decorate([
88
+ query("input")
89
+ ], TkAccordion.prototype, "$input", void 0);
90
+ TkAccordion = __decorate([
91
+ customElement("tk-accordion")
92
+ ], TkAccordion);
93
+
94
+ export { TkAccordion };
@@ -0,0 +1,4 @@
1
+ var css_248z = "@charset \"UTF-8\";*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host .header{border:1px solid var(--shade-lighter);border-radius:10px;color:var(--primary);cursor:pointer;padding:.6em}:host .header>*{margin:0 10px}:host .header:after{content:\"▼\";display:inline-block;font-size:12px;transition:transform .3s}:host .header .before{width:fit-content}:host .header .header-content{flex:1}:host .content{height:0;margin:0 auto;opacity:0;transition:all .2s;visibility:hidden;width:95%}:host h3,:host h5{margin:0}:host([checked]) .header{background-color:var(--primary);color:var(--on-primary)}:host([checked]) .header:after{transform:rotate(180deg)}:host([checked]) .content{height:auto;opacity:1;transition:all .3s,opacity .7s;visibility:visible}:host([pill]) .header{border-radius:9999px}";
2
+ var stylesheet="@charset \"UTF-8\";*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host .header{border:1px solid var(--shade-lighter);border-radius:10px;color:var(--primary);cursor:pointer;padding:.6em}:host .header>*{margin:0 10px}:host .header:after{content:\"▼\";display:inline-block;font-size:12px;transition:transform .3s}:host .header .before{width:fit-content}:host .header .header-content{flex:1}:host .content{height:0;margin:0 auto;opacity:0;transition:all .2s;visibility:hidden;width:95%}:host h3,:host h5{margin:0}:host([checked]) .header{background-color:var(--primary);color:var(--on-primary)}:host([checked]) .header:after{transform:rotate(180deg)}:host([checked]) .content{height:auto;opacity:1;transition:all .3s,opacity .7s;visibility:visible}:host([pill]) .header{border-radius:9999px}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1 @@
1
+ export * from "./accordion";
@@ -0,0 +1 @@
1
+ export { TkAccordion } from './accordion.js';
@@ -0,0 +1,15 @@
1
+ import { TkBox } from "../box/index";
2
+ /**
3
+ * A badge WebComponent
4
+ * @cssprop --tk-badge-color - Color of widget default to --primary
5
+ * @cssprop --tk-badge-text-color - Text color of widget to --on-primary
6
+ */
7
+ declare class TkBadge extends TkBox {
8
+ static get styles(): import("lit").CSSResult[];
9
+ }
10
+ declare global {
11
+ interface HTMLElementTagNameMap {
12
+ "tk-badge": TkBadge;
13
+ }
14
+ }
15
+ export { TkBadge };
package/badge/badge.js ADDED
@@ -0,0 +1,27 @@
1
+ import { __decorate } from 'tslib';
2
+ import { css, unsafeCSS } from 'lit';
3
+ import { customElement } from 'lit/decorators.js';
4
+ import '../box/index.js';
5
+ import css_248z from './badge.scss.js';
6
+ import { TkBox } from '../box/box.js';
7
+
8
+ /**
9
+ * A badge WebComponent
10
+ * @cssprop --tk-badge-color - Color of widget default to --primary
11
+ * @cssprop --tk-badge-text-color - Text color of widget to --on-primary
12
+ */
13
+ let TkBadge = class TkBadge extends TkBox {
14
+ static get styles() {
15
+ return [
16
+ ...TkBox.styles,
17
+ css `
18
+ ${unsafeCSS(css_248z)}
19
+ `
20
+ ];
21
+ }
22
+ };
23
+ TkBadge = __decorate([
24
+ customElement("tk-badge")
25
+ ], TkBadge);
26
+
27
+ export { TkBadge };
@@ -0,0 +1,4 @@
1
+ var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-badge-color,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--text:var(--tk-badge-text-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));align-items:center;background-color:var(--color);border-radius:9999px;color:var(--text);cursor:inherit;display:inline-flex;height:1.375em;justify-content:center;padding:0 .5em;user-select:none;white-space:nowrap}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--text:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}";
2
+ var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{--color:var(--tk-badge-color,var(--primary,hsl(var(--primary-h,258.987),var(--primary-s,38.1643%),var(--primary-l,59.4118%))));--text:var(--tk-badge-text-color,var(--on-primary,hsl(var(--on-primary-h,0),var(--on-primary-s,0%),var(--on-primary-l,100%))));align-items:center;background-color:var(--color);border-radius:9999px;color:var(--text);cursor:inherit;display:inline-flex;height:1.375em;justify-content:center;padding:0 .5em;user-select:none;white-space:nowrap}:host([accent]){--color:var(--accent,hsl(var(--accent-h,8.76404),var(--accent-s,64.0288%),var(--accent-l,72.7451%)));--text:var(--on-accent,hsl(var(--on-accent-h,0),var(--on-accent-s,0%),var(--on-accent-l,100%)))}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1 @@
1
+ export * from "./badge";
package/badge/index.js ADDED
@@ -0,0 +1 @@
1
+ export { TkBadge } from './badge.js';
package/box/box.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import { LitElement } from "lit";
2
+ declare const colors: readonly ["primary-lighter", "primary-light", "primary", "primary-dark", "primary-darker", "on-primary-lighter", "on-primary-light", "on-primary", "on-primary-dark", "on-primary-darker", "accent-lighter", "accent-light", "accent", "accent-dark", "accent-darker", "on-accent-lighter", "on-accent-light", "on-accent", "on-accent-dark", "on-accent-darker", "error-lighter", "error-light", "error", "error-dark", "error-darker", "on-error-lighter", "on-error-light", "on-error", "on-error-dark", "on-error-darker", "shade-lighter", "shade-light", "shade", "shade-dark", "shade-darker", "on-shade-lighter", "on-shade-light", "on-shade", "on-shade-dark", "on-shade-darker"];
3
+ type Color = typeof colors;
4
+ /**
5
+ * A container that lays out its contents in one direction
6
+ *
7
+ * @attr {"none" | "small" | "medium" | "large" | "xlarge" | "circle" | "pill" } radius - border radius
8
+ * @attr {"around" | "between" | "center" | "end" | "start" | "stretch"} align-content - How to align the contents when there is extra space in the cross axis.
9
+ * @attr [align-content="stretch"]
10
+ * @attr {"baseline" | "center" | "end" | "start" | "stretch"} align-items - How to align the contents along the cross axis.
11
+ * @attr {"center" | "end" | "start" | "stretch"} align-self - How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
12
+ * @attr {"row" | "column"} direction - The orientation to layout the child components in.
13
+ * @attr [direction="column"]
14
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} elevation - Elevated height above the underlying context, indicated via a drop shadow.
15
+ * @attr {"horizontal" | "vertical" | "true" | "false"} fill - Whether the width and/or height should fill the container.
16
+ * @attr {"grow" | "shrink" | "true" | "false"} flex - flex-grow and/or flex-shrink
17
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} gap - The amount of spacing between child elements. This should not be used in conjunction with 'wrap' as the gap elements will not wrap gracefully. If a child is a Fragment, Box will not add a gap between the children of the Fragment.
18
+ * @attr {"around" | "between" | "center" | "end" | "evenly" | "start" | "stretch"} justify - How to align the contents along the main axis.
19
+ * @attr [justify="stretch"]
20
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} margin - The amount of margin around the component. An object can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
21
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} padding - The amount of padding around the box contents. An object can be specified to distinguish horizontal padding, vertical padding, and padding on a particular side of the box.
22
+ * @attr {"center" | "justify" | "left" | "right"} text - Text align
23
+ * @attr {"xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"} width - A fixed width.
24
+ * @attr {"xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"} height - A fixed height.
25
+ * @attr {"auto" | "hidden" | "scroll" | "visible"} overflow - box overflow.
26
+ * @attr { "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "lighter" | "bold" | "bolder"} weight - Font weight.
27
+ * @attr {"true" | "false" | "reverse"} wrap - Whether children can wrap if they can't all fit.
28
+ * @attr [wrap="false"]
29
+ */
30
+ declare class TkBox extends LitElement {
31
+ static get styles(): import("lit").CSSResult[];
32
+ /**
33
+ * Activate ripple
34
+ */
35
+ ripple: boolean;
36
+ /**
37
+ * Set background color.
38
+ */
39
+ background: Color | string;
40
+ /**
41
+ * Set color.
42
+ */
43
+ color: Color | "foreground" | "background" | string;
44
+ render(): import("lit-html").TemplateResult<1>;
45
+ connectedCallback(): void;
46
+ disconnectedCallback(): void;
47
+ updated(props: any): void;
48
+ private showRipple;
49
+ private hideRipple;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ "tk-box": TkBox;
54
+ }
55
+ }
56
+ export { TkBox };
package/box/box.js ADDED
@@ -0,0 +1,182 @@
1
+ import { __decorate } from 'tslib';
2
+ import { LitElement, css, unsafeCSS, html } from 'lit';
3
+ import { property, customElement } from 'lit/decorators.js';
4
+ import css_248z from './box.scss.js';
5
+
6
+ const colors = [
7
+ "primary-lighter",
8
+ "primary-light",
9
+ "primary",
10
+ "primary-dark",
11
+ "primary-darker",
12
+ "on-primary-lighter",
13
+ "on-primary-light",
14
+ "on-primary",
15
+ "on-primary-dark",
16
+ "on-primary-darker",
17
+ "accent-lighter",
18
+ "accent-light",
19
+ "accent",
20
+ "accent-dark",
21
+ "accent-darker",
22
+ "on-accent-lighter",
23
+ "on-accent-light",
24
+ "on-accent",
25
+ "on-accent-dark",
26
+ "on-accent-darker",
27
+ "error-lighter",
28
+ "error-light",
29
+ "error",
30
+ "error-dark",
31
+ "error-darker",
32
+ "on-error-lighter",
33
+ "on-error-light",
34
+ "on-error",
35
+ "on-error-dark",
36
+ "on-error-darker",
37
+ "shade-lighter",
38
+ "shade-light",
39
+ "shade",
40
+ "shade-dark",
41
+ "shade-darker",
42
+ "on-shade-lighter",
43
+ "on-shade-light",
44
+ "on-shade",
45
+ "on-shade-dark",
46
+ "on-shade-darker"
47
+ ];
48
+ /**
49
+ * A container that lays out its contents in one direction
50
+ *
51
+ * @attr {"none" | "small" | "medium" | "large" | "xlarge" | "circle" | "pill" } radius - border radius
52
+ * @attr {"around" | "between" | "center" | "end" | "start" | "stretch"} align-content - How to align the contents when there is extra space in the cross axis.
53
+ * @attr [align-content="stretch"]
54
+ * @attr {"baseline" | "center" | "end" | "start" | "stretch"} align-items - How to align the contents along the cross axis.
55
+ * @attr {"center" | "end" | "start" | "stretch"} align-self - How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
56
+ * @attr {"row" | "column"} direction - The orientation to layout the child components in.
57
+ * @attr [direction="column"]
58
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} elevation - Elevated height above the underlying context, indicated via a drop shadow.
59
+ * @attr {"horizontal" | "vertical" | "true" | "false"} fill - Whether the width and/or height should fill the container.
60
+ * @attr {"grow" | "shrink" | "true" | "false"} flex - flex-grow and/or flex-shrink
61
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} gap - The amount of spacing between child elements. This should not be used in conjunction with 'wrap' as the gap elements will not wrap gracefully. If a child is a Fragment, Box will not add a gap between the children of the Fragment.
62
+ * @attr {"around" | "between" | "center" | "end" | "evenly" | "start" | "stretch"} justify - How to align the contents along the main axis.
63
+ * @attr [justify="stretch"]
64
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} margin - The amount of margin around the component. An object can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
65
+ * @attr {"xsmall" | "small" | "medium" | "large" | "xlarge"} padding - The amount of padding around the box contents. An object can be specified to distinguish horizontal padding, vertical padding, and padding on a particular side of the box.
66
+ * @attr {"center" | "justify" | "left" | "right"} text - Text align
67
+ * @attr {"xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"} width - A fixed width.
68
+ * @attr {"xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge"} height - A fixed height.
69
+ * @attr {"auto" | "hidden" | "scroll" | "visible"} overflow - box overflow.
70
+ * @attr { "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "lighter" | "bold" | "bolder"} weight - Font weight.
71
+ * @attr {"true" | "false" | "reverse"} wrap - Whether children can wrap if they can't all fit.
72
+ * @attr [wrap="false"]
73
+ */
74
+ let TkBox = class TkBox extends LitElement {
75
+ constructor() {
76
+ super(...arguments);
77
+ /**
78
+ * Activate ripple
79
+ */
80
+ this.ripple = false;
81
+ }
82
+ static get styles() {
83
+ return [
84
+ css `
85
+ ${unsafeCSS(css_248z)}
86
+ `
87
+ ];
88
+ }
89
+ render() {
90
+ return html `
91
+ <slot></slot>
92
+ `;
93
+ }
94
+ connectedCallback() {
95
+ if (this.ripple) {
96
+ this.addEventListener("mousedown", this.showRipple.bind(this), { passive: true });
97
+ this.addEventListener("mouseup", this.hideRipple.bind(this), { passive: true });
98
+ }
99
+ super.connectedCallback();
100
+ }
101
+ disconnectedCallback() {
102
+ this.removeEventListener("mousedown", this.showRipple);
103
+ this.addEventListener("mouseup", this.hideRipple);
104
+ super.disconnectedCallback();
105
+ }
106
+ updated(props) {
107
+ if (props.has("background") && ![...colors, "background", "foreground"].includes(this.background))
108
+ this.style.setProperty("background-color", this.background.toString());
109
+ if (props.has("color") && ![...colors, "background", "foreground"].includes(this.color))
110
+ this.style.setProperty("color", this.color.toString());
111
+ super.updated(props);
112
+ }
113
+ showRipple(event) {
114
+ const x = event.clientX;
115
+ const y = event.clientY;
116
+ const { offsetWidth, offsetHeight } = this;
117
+ const container = document.createElement("span");
118
+ container.classList.add("ripple", "open");
119
+ const element = document.createElement("span");
120
+ container.appendChild(element);
121
+ this.shadowRoot.appendChild(container);
122
+ const rect = this.getBoundingClientRect();
123
+ const diameter = Math.max(offsetWidth, offsetWidth) * 2;
124
+ element.style.width = element.style.height = diameter + "px";
125
+ element.style.left = x - rect.left - diameter / 2 + "px";
126
+ element.style.top = y - rect.top - diameter / 2 + "px";
127
+ const inAnimation = element.animate({
128
+ transform: [`scale(0)`, `scale(1)`]
129
+ }, {
130
+ easing: "ease-out",
131
+ fill: "both",
132
+ duration: 500
133
+ });
134
+ inAnimation.onfinish = () => {
135
+ container.classList.remove("open");
136
+ const outAnimation = element.animate({
137
+ opacity: ["0.5", "0"]
138
+ }, {
139
+ easing: "ease-in",
140
+ fill: "both",
141
+ duration: 300
142
+ });
143
+ outAnimation.onfinish = () => {
144
+ requestAnimationFrame(() => {
145
+ container.remove();
146
+ });
147
+ };
148
+ };
149
+ }
150
+ hideRipple(event) {
151
+ var _a;
152
+ (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(".ripple:not([open])").forEach(container => {
153
+ const element = container.querySelector("span");
154
+ const outAnimation = element.animate({
155
+ opacity: ["0.5", "0"]
156
+ }, {
157
+ easing: "ease-out",
158
+ fill: "both",
159
+ duration: 300
160
+ });
161
+ outAnimation.onfinish = () => {
162
+ requestAnimationFrame(() => {
163
+ container.remove();
164
+ });
165
+ };
166
+ });
167
+ }
168
+ };
169
+ __decorate([
170
+ property({ type: Boolean })
171
+ ], TkBox.prototype, "ripple", void 0);
172
+ __decorate([
173
+ property()
174
+ ], TkBox.prototype, "background", void 0);
175
+ __decorate([
176
+ property()
177
+ ], TkBox.prototype, "color", void 0);
178
+ TkBox = __decorate([
179
+ customElement("tk-box")
180
+ ], TkBox);
181
+
182
+ export { TkBox };
@@ -0,0 +1,4 @@
1
+ var css_248z = "*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease)}:host([hidden]){display:none}.ripple{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.ripple span{background-color:currentColor;border-radius:50%;opacity:.5;position:absolute}:host([align-content=start]){align-content:flex-start}:host([align-content=end]){align-content:flex-end}:host([align-content=stretch]){align-content:stretch}:host([align-content=center]){align-content:center}:host([align-content=around]){align-content:space-around}:host([align-content=between]){align-content:space-between}:host([align-items=start]){align-items:flex-start}:host([align-items=end]){align-items:flex-end}:host([align-items=stretch]){align-items:stretch}:host([align-items=center]){align-items:center}:host([align-items=baseline]){align-items:baseline}:host([align-self=start]){align-self:flex-start}:host([align-self=end]){align-self:flex-end}:host([align-self=stretch]){align-self:stretch}:host([align-self=center]){align-self:center}:host([background=primary-lighter]){background-color:var(--primary-lighter)}:host([color=primary-lighter]){color:var(--primary-lighter)}:host([background=primary-light]){background-color:var(--primary-light)}:host([color=primary-light]){color:var(--primary-light)}:host([background=primary]){background-color:var(--primary)}:host([color=primary]){color:var(--primary)}:host([background=primary-dark]){background-color:var(--primary-dark)}:host([color=primary-dark]){color:var(--primary-dark)}:host([background=primary-darker]){background-color:var(--primary-darker)}:host([color=primary-darker]){color:var(--primary-darker)}:host([background=on-primary-lighter]){background-color:var(--on-primary-lighter)}:host([color=on-primary-lighter]){color:var(--on-primary-lighter)}:host([background=on-primary-light]){background-color:var(--on-primary-light)}:host([color=on-primary-light]){color:var(--on-primary-light)}:host([background=on-primary]){background-color:var(--on-primary)}:host([color=on-primary]){color:var(--on-primary)}:host([background=on-primary-dark]){background-color:var(--on-primary-dark)}:host([color=on-primary-dark]){color:var(--on-primary-dark)}:host([background=on-primary-darker]){background-color:var(--on-primary-darker)}:host([color=on-primary-darker]){color:var(--on-primary-darker)}:host([background=accent-lighter]){background-color:var(--accent-lighter)}:host([color=accent-lighter]){color:var(--accent-lighter)}:host([background=accent-light]){background-color:var(--accent-light)}:host([color=accent-light]){color:var(--accent-light)}:host([background=accent]){background-color:var(--accent)}:host([color=accent]){color:var(--accent)}:host([background=accent-dark]){background-color:var(--accent-dark)}:host([color=accent-dark]){color:var(--accent-dark)}:host([background=accent-darker]){background-color:var(--accent-darker)}:host([color=accent-darker]){color:var(--accent-darker)}:host([background=on-accent-lighter]){background-color:var(--on-accent-lighter)}:host([color=on-accent-lighter]){color:var(--on-accent-lighter)}:host([background=on-accent-light]){background-color:var(--on-accent-light)}:host([color=on-accent-light]){color:var(--on-accent-light)}:host([background=on-accent]){background-color:var(--on-accent)}:host([color=on-accent]){color:var(--on-accent)}:host([background=on-accent-dark]){background-color:var(--on-accent-dark)}:host([color=on-accent-dark]){color:var(--on-accent-dark)}:host([background=on-accent-darker]){background-color:var(--on-accent-darker)}:host([color=on-accent-darker]){color:var(--on-accent-darker)}:host([background=error-lighter]){background-color:var(--error-lighter)}:host([color=error-lighter]){color:var(--error-lighter)}:host([background=error-light]){background-color:var(--error-light)}:host([color=error-light]){color:var(--error-light)}:host([background=error]){background-color:var(--error)}:host([color=error]){color:var(--error)}:host([background=error-dark]){background-color:var(--error-dark)}:host([color=error-dark]){color:var(--error-dark)}:host([background=error-darker]){background-color:var(--error-darker)}:host([color=error-darker]){color:var(--error-darker)}:host([background=on-error-lighter]){background-color:var(--on-error-lighter)}:host([color=on-error-lighter]){color:var(--on-error-lighter)}:host([background=on-error-light]){background-color:var(--on-error-light)}:host([color=on-error-light]){color:var(--on-error-light)}:host([background=on-error]){background-color:var(--on-error)}:host([color=on-error]){color:var(--on-error)}:host([background=on-error-dark]){background-color:var(--on-error-dark)}:host([color=on-error-dark]){color:var(--on-error-dark)}:host([background=on-error-darker]){background-color:var(--on-error-darker)}:host([color=on-error-darker]){color:var(--on-error-darker)}:host([background=shade-lighter]){background-color:var(--shade-lighter)}:host([color=shade-lighter]){color:var(--shade-lighter)}:host([background=shade-light]){background-color:var(--shade-light)}:host([color=shade-light]){color:var(--shade-light)}:host([background=shade]){background-color:var(--shade)}:host([color=shade]){color:var(--shade)}:host([background=shade-dark]){background-color:var(--shade-dark)}:host([color=shade-dark]){color:var(--shade-dark)}:host([background=shade-darker]){background-color:var(--shade-darker)}:host([color=shade-darker]){color:var(--shade-darker)}:host([background=on-shade-lighter]){background-color:var(--on-shade-lighter)}:host([color=on-shade-lighter]){color:var(--on-shade-lighter)}:host([background=on-shade-light]){background-color:var(--on-shade-light)}:host([color=on-shade-light]){color:var(--on-shade-light)}:host([background=on-shade]){background-color:var(--on-shade)}:host([color=on-shade]){color:var(--on-shade)}:host([background=on-shade-dark]){background-color:var(--on-shade-dark)}:host([color=on-shade-dark]){color:var(--on-shade-dark)}:host([background=on-shade-darker]){background-color:var(--on-shade-darker)}:host([color=on-shade-darker]){color:var(--on-shade-darker)}:host([background=foreground]){background-color:var(--foreground)}:host([color=foreground]){color:var(--foreground)}:host([background=background]){background-color:var(--background)}:host([color=background]){color:var(--background)}:host([direction=column]){flex-direction:column}:host([direction=row-reverse]){flex-direction:row-reverse}:host([direction=column-reverse]){flex-direction:column-reverse}:host([text=center]){text-align:center}:host([text=justify]){text-align:justify}:host([text=left]){text-align:left}:host([text=right]){text-align:right}:host([weight=\"100\"]){font-weight:100}:host([weight=\"200\"]){font-weight:200}:host([weight=\"300\"]){font-weight:300}:host([weight=\"400\"]){font-weight:400}:host([weight=\"500\"]){font-weight:500}:host([weight=\"600\"]){font-weight:600}:host([weight=\"700\"]){font-weight:700}:host([weight=\"800\"]){font-weight:800}:host([weight=\"900\"]){font-weight:900}:host([weight=lighter]){font-weight:lighter}:host([weight=bold]){font-weight:700}:host([weight=bolder]){font-weight:bolder}:host([direction=row]){flex-direction:row}:host([direction=row-reverse]){flex-direction:row}:host([elevation=xsmall]){box-shadow:var(--box-elevation,var(--elevation-1,0 1px 2px var(--shadow)))}:host([elevation=small]){box-shadow:var(--box-elevation,var(--elevation-2,0 2px 4px var(--shadow)))}:host([elevation=medium]){box-shadow:var(--box-elevation,var(--elevation-3,0 4px 8px var(--shadow)))}:host([elevation=large]){box-shadow:var(--box-elevation,var(--elevation-4,0 8px 16px var(--shadow)))}:host([elevation=xlarge]){box-shadow:var(--box-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}:host([fill=horizontal]){width:100%}:host([fill=vertical]){height:100%}:host([fill=true]){height:100%;width:100%}:host([flex=grow]){flex:1 0}:host([flex=shrink]){flex:0 1}:host([flex=true]){flex:1 1}:host([flex=false]){flex:0 0}:host([gap=xsmall]) ::slotted(*),:host([gap=xsmall][direction=column]) ::slotted(*){margin:var(--spacing-xs,.25rem) 0}:host([gap=xsmall][direction=row]) ::slotted(*){margin:0 var(--spacing-xs,.25rem)}:host([margin=xsmall]){margin:var(--box-margin,var(--spacing-xs,.25rem))}:host([margin=\"xsmall auto\"]){margin:var(--box-margin,var(--spacing-xs,.25rem)) auto}:host([margin=\"auto xsmall\"]){margin:auto var(--box-margin,var(--spacing-xs,.25rem))}:host([padding=xsmall]){padding:var(--box-padding,var(--spacing-xs,.25rem))}:host([gap=small]) ::slotted(*),:host([gap=small][direction=column]) ::slotted(*){margin:var(--spacing-s,.5rem) 0}:host([gap=small][direction=row]) ::slotted(*){margin:0 var(--spacing-s,.5rem)}:host([margin=small]){margin:var(--box-margin,var(--spacing-s,.5rem))}:host([margin=\"small auto\"]){margin:var(--box-margin,var(--spacing-s,.5rem)) auto}:host([margin=\"auto small\"]){margin:auto var(--box-margin,var(--spacing-s,.5rem))}:host([padding=small]){padding:var(--box-padding,var(--spacing-s,.5rem))}:host([gap=medium]) ::slotted(*),:host([gap=medium][direction=column]) ::slotted(*){margin:var(--spacing-m,1rem) 0}:host([gap=medium][direction=row]) ::slotted(*){margin:0 var(--spacing-m,1rem)}:host([margin=medium]){margin:var(--box-margin,var(--spacing-m,1rem))}:host([margin=\"medium auto\"]){margin:var(--box-margin,var(--spacing-m,1rem)) auto}:host([margin=\"auto medium\"]){margin:auto var(--box-margin,var(--spacing-m,1rem))}:host([padding=medium]){padding:var(--box-padding,var(--spacing-m,1rem))}:host([gap=large]) ::slotted(*),:host([gap=large][direction=column]) ::slotted(*){margin:var(--spacing-l,1.25rem) 0}:host([gap=large][direction=row]) ::slotted(*){margin:0 var(--spacing-l,1.25rem)}:host([margin=large]){margin:var(--box-margin,var(--spacing-l,1.25rem))}:host([margin=\"large auto\"]){margin:var(--box-margin,var(--spacing-l,1.25rem)) auto}:host([margin=\"auto large\"]){margin:auto var(--box-margin,var(--spacing-l,1.25rem))}:host([padding=large]){padding:var(--box-padding,var(--spacing-l,1.25rem))}:host([gap=xlarge]) ::slotted(*),:host([gap=xlarge][direction=column]) ::slotted(*){margin:var(--spacing-xl,2rem) 0}:host([gap=xlarge][direction=row]) ::slotted(*){margin:0 var(--spacing-xl,2rem)}:host([margin=xlarge]){margin:var(--box-margin,var(--spacing-xl,2rem))}:host([margin=\"xlarge auto\"]){margin:var(--box-margin,var(--spacing-xl,2rem)) auto}:host([margin=\"auto xlarge\"]){margin:auto var(--box-margin,var(--spacing-xl,2rem))}:host([padding=xlarge]){padding:var(--box-padding,var(--spacing-xl,2rem))}:host([font=xsmall]),:host([size=xsmall]){font-size:var(--box-font-size,var(--font-size-xs,.625rem))}:host([font=small]),:host([size=small]){font-size:var(--box-font-size,var(--font-size-s,.875rem))}:host([font=medium]),:host([size=medium]){font-size:var(--box-font-size,var(--font-size-m,1rem))}:host([font=large]),:host([size=large]){font-size:var(--box-font-size,var(--font-size-l,1.25rem))}:host([font=xlarge]),:host([size=xlarge]){font-size:var(--box-font-size,var(--font-size-xl,1.5rem))}:host([font=xxlarge]),:host([size=xxlarge]){font-size:var(--box-font-size,var(--font-size-xxl,2.25rem))}:host([justify=start]){justify-content:flex-start}:host([justify=end]){justify-content:flex-end}:host([justify=stretch]){justify-content:stretch}:host([justify=baseline]){justify-content:baseline}:host([justify=center]){justify-content:center}:host([justify=around]){justify-content:space-around}:host([justify=between]){justify-content:space-between}:host([justify=evenly]){justify-content:space-evenly}:host([overflow=auto]){overflow:auto}:host([overflow=hidden]){overflow:hidden}:host([overflow=scroll]){overflow:scroll}:host([overflow=visible]){overflow:visible}:host([radius=none]){border-radius:var(--box-border-radius,0)}:host([radius=small]){border-radius:var(--box-border-radius,var(--border-radius-small,.125rem))}:host([radius=medium]){border-radius:var(--box-border-radius,var(--border-radius-medium,.25rem))}:host([radius=large]){border-radius:var(--box-border-radius,var(--border-radius-large,.5rem))}:host([radius=xlarge]){border-radius:var(--box-border-radius,var(--border-radius-x-large,1rem))}:host([radius=circle]){border-radius:var(--box-border-radius,var(--border-radius-circle,50%))}:host([radius=pill]){border-radius:var(--box-border-radius,var(--border-radius-pill,9999px))}:host([max-width=xxsmall]){max-width:var(--box-max-width,var(--size-xxs,2rem))}:host([width=xxsmall]){width:var(--box-width,var(--size-xxs,2rem))}:host([max-height=xxsmall]){max-height:var(--box-max-height,var(--size-xxs,2rem))}:host([height=xxsmall]){height:var(--box-height,var(--size-xxs,2rem))}:host([max-width=xsmall]){max-width:var(--box-max-width,var(--size-xs,4rem))}:host([width=xsmall]){width:var(--box-width,var(--size-xs,4rem))}:host([max-height=xsmall]){max-height:var(--box-max-height,var(--size-xs,4rem))}:host([height=xsmall]){height:var(--box-height,var(--size-xs,4rem))}:host([max-width=small]){max-width:var(--box-max-width,var(--size-s,8rem))}:host([width=small]){width:var(--box-width,var(--size-s,8rem))}:host([max-height=small]){max-height:var(--box-max-height,var(--size-s,8rem))}:host([height=small]){height:var(--box-height,var(--size-s,8rem))}:host([max-width=medium]){max-width:var(--box-max-width,var(--size-m,16rem))}:host([width=medium]){width:var(--box-width,var(--size-m,16rem))}:host([max-height=medium]){max-height:var(--box-max-height,var(--size-m,16rem))}:host([height=medium]){height:var(--box-height,var(--size-m,16rem))}:host([max-width=large]){max-width:var(--box-max-width,var(--size-l,32rem))}:host([width=large]){width:var(--box-width,var(--size-l,32rem))}:host([max-height=large]){max-height:var(--box-max-height,var(--size-l,32rem))}:host([height=large]){height:var(--box-height,var(--size-l,32rem))}:host([max-width=xlarge]){max-width:var(--box-max-width,var(--size-xl,48rem))}:host([width=xlarge]){width:var(--box-width,var(--size-xl,48rem))}:host([max-height=xlarge]){max-height:var(--box-max-height,var(--size-xl,48rem))}:host([height=xlarge]){height:var(--box-height,var(--size-xl,48rem))}:host([max-width=xxlarge]){max-width:var(--box-max-width,var(--size-xxl,64rem))}:host([width=xxlarge]){width:var(--box-width,var(--size-xxl,64rem))}:host([max-height=xxlarge]){max-height:var(--box-max-height,var(--size-xxl,64rem))}:host([height=xxlarge]){height:var(--box-height,var(--size-xxl,64rem))}:host([wrap=true]){flex-wrap:wrap}:host([wrap=reverse]){flex-wrap:wrap-reverse}";
2
+ var stylesheet="*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{box-sizing:border-box;display:flex;flex-direction:column;position:relative;transition:background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease)}:host([hidden]){display:none}.ripple{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0}.ripple span{background-color:currentColor;border-radius:50%;opacity:.5;position:absolute}:host([align-content=start]){align-content:flex-start}:host([align-content=end]){align-content:flex-end}:host([align-content=stretch]){align-content:stretch}:host([align-content=center]){align-content:center}:host([align-content=around]){align-content:space-around}:host([align-content=between]){align-content:space-between}:host([align-items=start]){align-items:flex-start}:host([align-items=end]){align-items:flex-end}:host([align-items=stretch]){align-items:stretch}:host([align-items=center]){align-items:center}:host([align-items=baseline]){align-items:baseline}:host([align-self=start]){align-self:flex-start}:host([align-self=end]){align-self:flex-end}:host([align-self=stretch]){align-self:stretch}:host([align-self=center]){align-self:center}:host([background=primary-lighter]){background-color:var(--primary-lighter)}:host([color=primary-lighter]){color:var(--primary-lighter)}:host([background=primary-light]){background-color:var(--primary-light)}:host([color=primary-light]){color:var(--primary-light)}:host([background=primary]){background-color:var(--primary)}:host([color=primary]){color:var(--primary)}:host([background=primary-dark]){background-color:var(--primary-dark)}:host([color=primary-dark]){color:var(--primary-dark)}:host([background=primary-darker]){background-color:var(--primary-darker)}:host([color=primary-darker]){color:var(--primary-darker)}:host([background=on-primary-lighter]){background-color:var(--on-primary-lighter)}:host([color=on-primary-lighter]){color:var(--on-primary-lighter)}:host([background=on-primary-light]){background-color:var(--on-primary-light)}:host([color=on-primary-light]){color:var(--on-primary-light)}:host([background=on-primary]){background-color:var(--on-primary)}:host([color=on-primary]){color:var(--on-primary)}:host([background=on-primary-dark]){background-color:var(--on-primary-dark)}:host([color=on-primary-dark]){color:var(--on-primary-dark)}:host([background=on-primary-darker]){background-color:var(--on-primary-darker)}:host([color=on-primary-darker]){color:var(--on-primary-darker)}:host([background=accent-lighter]){background-color:var(--accent-lighter)}:host([color=accent-lighter]){color:var(--accent-lighter)}:host([background=accent-light]){background-color:var(--accent-light)}:host([color=accent-light]){color:var(--accent-light)}:host([background=accent]){background-color:var(--accent)}:host([color=accent]){color:var(--accent)}:host([background=accent-dark]){background-color:var(--accent-dark)}:host([color=accent-dark]){color:var(--accent-dark)}:host([background=accent-darker]){background-color:var(--accent-darker)}:host([color=accent-darker]){color:var(--accent-darker)}:host([background=on-accent-lighter]){background-color:var(--on-accent-lighter)}:host([color=on-accent-lighter]){color:var(--on-accent-lighter)}:host([background=on-accent-light]){background-color:var(--on-accent-light)}:host([color=on-accent-light]){color:var(--on-accent-light)}:host([background=on-accent]){background-color:var(--on-accent)}:host([color=on-accent]){color:var(--on-accent)}:host([background=on-accent-dark]){background-color:var(--on-accent-dark)}:host([color=on-accent-dark]){color:var(--on-accent-dark)}:host([background=on-accent-darker]){background-color:var(--on-accent-darker)}:host([color=on-accent-darker]){color:var(--on-accent-darker)}:host([background=error-lighter]){background-color:var(--error-lighter)}:host([color=error-lighter]){color:var(--error-lighter)}:host([background=error-light]){background-color:var(--error-light)}:host([color=error-light]){color:var(--error-light)}:host([background=error]){background-color:var(--error)}:host([color=error]){color:var(--error)}:host([background=error-dark]){background-color:var(--error-dark)}:host([color=error-dark]){color:var(--error-dark)}:host([background=error-darker]){background-color:var(--error-darker)}:host([color=error-darker]){color:var(--error-darker)}:host([background=on-error-lighter]){background-color:var(--on-error-lighter)}:host([color=on-error-lighter]){color:var(--on-error-lighter)}:host([background=on-error-light]){background-color:var(--on-error-light)}:host([color=on-error-light]){color:var(--on-error-light)}:host([background=on-error]){background-color:var(--on-error)}:host([color=on-error]){color:var(--on-error)}:host([background=on-error-dark]){background-color:var(--on-error-dark)}:host([color=on-error-dark]){color:var(--on-error-dark)}:host([background=on-error-darker]){background-color:var(--on-error-darker)}:host([color=on-error-darker]){color:var(--on-error-darker)}:host([background=shade-lighter]){background-color:var(--shade-lighter)}:host([color=shade-lighter]){color:var(--shade-lighter)}:host([background=shade-light]){background-color:var(--shade-light)}:host([color=shade-light]){color:var(--shade-light)}:host([background=shade]){background-color:var(--shade)}:host([color=shade]){color:var(--shade)}:host([background=shade-dark]){background-color:var(--shade-dark)}:host([color=shade-dark]){color:var(--shade-dark)}:host([background=shade-darker]){background-color:var(--shade-darker)}:host([color=shade-darker]){color:var(--shade-darker)}:host([background=on-shade-lighter]){background-color:var(--on-shade-lighter)}:host([color=on-shade-lighter]){color:var(--on-shade-lighter)}:host([background=on-shade-light]){background-color:var(--on-shade-light)}:host([color=on-shade-light]){color:var(--on-shade-light)}:host([background=on-shade]){background-color:var(--on-shade)}:host([color=on-shade]){color:var(--on-shade)}:host([background=on-shade-dark]){background-color:var(--on-shade-dark)}:host([color=on-shade-dark]){color:var(--on-shade-dark)}:host([background=on-shade-darker]){background-color:var(--on-shade-darker)}:host([color=on-shade-darker]){color:var(--on-shade-darker)}:host([background=foreground]){background-color:var(--foreground)}:host([color=foreground]){color:var(--foreground)}:host([background=background]){background-color:var(--background)}:host([color=background]){color:var(--background)}:host([direction=column]){flex-direction:column}:host([direction=row-reverse]){flex-direction:row-reverse}:host([direction=column-reverse]){flex-direction:column-reverse}:host([text=center]){text-align:center}:host([text=justify]){text-align:justify}:host([text=left]){text-align:left}:host([text=right]){text-align:right}:host([weight=\"100\"]){font-weight:100}:host([weight=\"200\"]){font-weight:200}:host([weight=\"300\"]){font-weight:300}:host([weight=\"400\"]){font-weight:400}:host([weight=\"500\"]){font-weight:500}:host([weight=\"600\"]){font-weight:600}:host([weight=\"700\"]){font-weight:700}:host([weight=\"800\"]){font-weight:800}:host([weight=\"900\"]){font-weight:900}:host([weight=lighter]){font-weight:lighter}:host([weight=bold]){font-weight:700}:host([weight=bolder]){font-weight:bolder}:host([direction=row]){flex-direction:row}:host([direction=row-reverse]){flex-direction:row}:host([elevation=xsmall]){box-shadow:var(--box-elevation,var(--elevation-1,0 1px 2px var(--shadow)))}:host([elevation=small]){box-shadow:var(--box-elevation,var(--elevation-2,0 2px 4px var(--shadow)))}:host([elevation=medium]){box-shadow:var(--box-elevation,var(--elevation-3,0 4px 8px var(--shadow)))}:host([elevation=large]){box-shadow:var(--box-elevation,var(--elevation-4,0 8px 16px var(--shadow)))}:host([elevation=xlarge]){box-shadow:var(--box-elevation,var(--elevation-5,0 12px 24px var(--shadow)))}:host([fill=horizontal]){width:100%}:host([fill=vertical]){height:100%}:host([fill=true]){height:100%;width:100%}:host([flex=grow]){flex:1 0}:host([flex=shrink]){flex:0 1}:host([flex=true]){flex:1 1}:host([flex=false]){flex:0 0}:host([gap=xsmall]) ::slotted(*),:host([gap=xsmall][direction=column]) ::slotted(*){margin:var(--spacing-xs,.25rem) 0}:host([gap=xsmall][direction=row]) ::slotted(*){margin:0 var(--spacing-xs,.25rem)}:host([margin=xsmall]){margin:var(--box-margin,var(--spacing-xs,.25rem))}:host([margin=\"xsmall auto\"]){margin:var(--box-margin,var(--spacing-xs,.25rem)) auto}:host([margin=\"auto xsmall\"]){margin:auto var(--box-margin,var(--spacing-xs,.25rem))}:host([padding=xsmall]){padding:var(--box-padding,var(--spacing-xs,.25rem))}:host([gap=small]) ::slotted(*),:host([gap=small][direction=column]) ::slotted(*){margin:var(--spacing-s,.5rem) 0}:host([gap=small][direction=row]) ::slotted(*){margin:0 var(--spacing-s,.5rem)}:host([margin=small]){margin:var(--box-margin,var(--spacing-s,.5rem))}:host([margin=\"small auto\"]){margin:var(--box-margin,var(--spacing-s,.5rem)) auto}:host([margin=\"auto small\"]){margin:auto var(--box-margin,var(--spacing-s,.5rem))}:host([padding=small]){padding:var(--box-padding,var(--spacing-s,.5rem))}:host([gap=medium]) ::slotted(*),:host([gap=medium][direction=column]) ::slotted(*){margin:var(--spacing-m,1rem) 0}:host([gap=medium][direction=row]) ::slotted(*){margin:0 var(--spacing-m,1rem)}:host([margin=medium]){margin:var(--box-margin,var(--spacing-m,1rem))}:host([margin=\"medium auto\"]){margin:var(--box-margin,var(--spacing-m,1rem)) auto}:host([margin=\"auto medium\"]){margin:auto var(--box-margin,var(--spacing-m,1rem))}:host([padding=medium]){padding:var(--box-padding,var(--spacing-m,1rem))}:host([gap=large]) ::slotted(*),:host([gap=large][direction=column]) ::slotted(*){margin:var(--spacing-l,1.25rem) 0}:host([gap=large][direction=row]) ::slotted(*){margin:0 var(--spacing-l,1.25rem)}:host([margin=large]){margin:var(--box-margin,var(--spacing-l,1.25rem))}:host([margin=\"large auto\"]){margin:var(--box-margin,var(--spacing-l,1.25rem)) auto}:host([margin=\"auto large\"]){margin:auto var(--box-margin,var(--spacing-l,1.25rem))}:host([padding=large]){padding:var(--box-padding,var(--spacing-l,1.25rem))}:host([gap=xlarge]) ::slotted(*),:host([gap=xlarge][direction=column]) ::slotted(*){margin:var(--spacing-xl,2rem) 0}:host([gap=xlarge][direction=row]) ::slotted(*){margin:0 var(--spacing-xl,2rem)}:host([margin=xlarge]){margin:var(--box-margin,var(--spacing-xl,2rem))}:host([margin=\"xlarge auto\"]){margin:var(--box-margin,var(--spacing-xl,2rem)) auto}:host([margin=\"auto xlarge\"]){margin:auto var(--box-margin,var(--spacing-xl,2rem))}:host([padding=xlarge]){padding:var(--box-padding,var(--spacing-xl,2rem))}:host([font=xsmall]),:host([size=xsmall]){font-size:var(--box-font-size,var(--font-size-xs,.625rem))}:host([font=small]),:host([size=small]){font-size:var(--box-font-size,var(--font-size-s,.875rem))}:host([font=medium]),:host([size=medium]){font-size:var(--box-font-size,var(--font-size-m,1rem))}:host([font=large]),:host([size=large]){font-size:var(--box-font-size,var(--font-size-l,1.25rem))}:host([font=xlarge]),:host([size=xlarge]){font-size:var(--box-font-size,var(--font-size-xl,1.5rem))}:host([font=xxlarge]),:host([size=xxlarge]){font-size:var(--box-font-size,var(--font-size-xxl,2.25rem))}:host([justify=start]){justify-content:flex-start}:host([justify=end]){justify-content:flex-end}:host([justify=stretch]){justify-content:stretch}:host([justify=baseline]){justify-content:baseline}:host([justify=center]){justify-content:center}:host([justify=around]){justify-content:space-around}:host([justify=between]){justify-content:space-between}:host([justify=evenly]){justify-content:space-evenly}:host([overflow=auto]){overflow:auto}:host([overflow=hidden]){overflow:hidden}:host([overflow=scroll]){overflow:scroll}:host([overflow=visible]){overflow:visible}:host([radius=none]){border-radius:var(--box-border-radius,0)}:host([radius=small]){border-radius:var(--box-border-radius,var(--border-radius-small,.125rem))}:host([radius=medium]){border-radius:var(--box-border-radius,var(--border-radius-medium,.25rem))}:host([radius=large]){border-radius:var(--box-border-radius,var(--border-radius-large,.5rem))}:host([radius=xlarge]){border-radius:var(--box-border-radius,var(--border-radius-x-large,1rem))}:host([radius=circle]){border-radius:var(--box-border-radius,var(--border-radius-circle,50%))}:host([radius=pill]){border-radius:var(--box-border-radius,var(--border-radius-pill,9999px))}:host([max-width=xxsmall]){max-width:var(--box-max-width,var(--size-xxs,2rem))}:host([width=xxsmall]){width:var(--box-width,var(--size-xxs,2rem))}:host([max-height=xxsmall]){max-height:var(--box-max-height,var(--size-xxs,2rem))}:host([height=xxsmall]){height:var(--box-height,var(--size-xxs,2rem))}:host([max-width=xsmall]){max-width:var(--box-max-width,var(--size-xs,4rem))}:host([width=xsmall]){width:var(--box-width,var(--size-xs,4rem))}:host([max-height=xsmall]){max-height:var(--box-max-height,var(--size-xs,4rem))}:host([height=xsmall]){height:var(--box-height,var(--size-xs,4rem))}:host([max-width=small]){max-width:var(--box-max-width,var(--size-s,8rem))}:host([width=small]){width:var(--box-width,var(--size-s,8rem))}:host([max-height=small]){max-height:var(--box-max-height,var(--size-s,8rem))}:host([height=small]){height:var(--box-height,var(--size-s,8rem))}:host([max-width=medium]){max-width:var(--box-max-width,var(--size-m,16rem))}:host([width=medium]){width:var(--box-width,var(--size-m,16rem))}:host([max-height=medium]){max-height:var(--box-max-height,var(--size-m,16rem))}:host([height=medium]){height:var(--box-height,var(--size-m,16rem))}:host([max-width=large]){max-width:var(--box-max-width,var(--size-l,32rem))}:host([width=large]){width:var(--box-width,var(--size-l,32rem))}:host([max-height=large]){max-height:var(--box-max-height,var(--size-l,32rem))}:host([height=large]){height:var(--box-height,var(--size-l,32rem))}:host([max-width=xlarge]){max-width:var(--box-max-width,var(--size-xl,48rem))}:host([width=xlarge]){width:var(--box-width,var(--size-xl,48rem))}:host([max-height=xlarge]){max-height:var(--box-max-height,var(--size-xl,48rem))}:host([height=xlarge]){height:var(--box-height,var(--size-xl,48rem))}:host([max-width=xxlarge]){max-width:var(--box-max-width,var(--size-xxl,64rem))}:host([width=xxlarge]){width:var(--box-width,var(--size-xxl,64rem))}:host([max-height=xxlarge]){max-height:var(--box-max-height,var(--size-xxl,64rem))}:host([height=xxlarge]){height:var(--box-height,var(--size-xxl,64rem))}:host([wrap=true]){flex-wrap:wrap}:host([wrap=reverse]){flex-wrap:wrap-reverse}";
3
+
4
+ export { css_248z as default, stylesheet };
@@ -0,0 +1,13 @@
1
+ import { TkBox } from "./box";
2
+ declare class TkFocusableBox extends TkBox {
3
+ /**
4
+ * Element random id
5
+ */
6
+ protected _id: string;
7
+ /**
8
+ * disabled atribute
9
+ */
10
+ disabled: boolean;
11
+ updated(props: any): void;
12
+ }
13
+ export { TkFocusableBox };
@@ -0,0 +1,30 @@
1
+ import { __decorate } from 'tslib';
2
+ import { property } from 'lit/decorators.js';
3
+ import { uniqueID } from '../utils/unique.js';
4
+ import { TkBox } from './box.js';
5
+
6
+ class TkFocusableBox extends TkBox {
7
+ constructor() {
8
+ super(...arguments);
9
+ /**
10
+ * Element random id
11
+ */
12
+ this._id = uniqueID();
13
+ /**
14
+ * disabled atribute
15
+ */
16
+ this.disabled = false;
17
+ }
18
+ updated(props) {
19
+ this.tabIndex = this.disabled ? -1 : 0;
20
+ super.updated(props);
21
+ }
22
+ }
23
+ __decorate([
24
+ property({ type: Boolean })
25
+ ], TkFocusableBox.prototype, "_id", void 0);
26
+ __decorate([
27
+ property({ type: Boolean })
28
+ ], TkFocusableBox.prototype, "disabled", void 0);
29
+
30
+ export { TkFocusableBox };
package/box/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./box";
package/box/index.js ADDED
@@ -0,0 +1 @@
1
+ export { TkBox } from './box.js';
@@ -0,0 +1,39 @@
1
+ import { TkBox } from "../box/index";
2
+ /**
3
+ * A button web component
4
+ *
5
+ * @cssprop --tk-badge-color - Color of widget
6
+ * @cssprop [--tk-badge-color=--primary]
7
+ * @cssprop --tk-badge-text-color - Text color of widget to --on-primary-color
8
+ *
9
+ * @attr {Boolean} accent - accent colors
10
+ * @attr {Boolean} disabled - Disable this element
11
+ * @attr {Boolean} inverted - color and text-color are inverted
12
+ * @attr {Boolean} outlined - outlined
13
+ * @attr {Boolean} pill - rounded corner
14
+ * @attr {Boolean} ripple - display ripple when active
15
+ * @attr {Boolean} small - mini button
16
+ */
17
+ declare class TkButton extends TkBox {
18
+ static get styles(): import("lit").CSSResult[];
19
+ private _id;
20
+ href: string | null;
21
+ target: "_blank" | "_parent" | "_self" | "_top";
22
+ type: "submit" | "reset" | "button";
23
+ disabled: boolean;
24
+ protected $ahref: HTMLAnchorElement;
25
+ protected $button: HTMLButtonElement;
26
+ render(): import("lit-html").TemplateResult<1>;
27
+ connectedCallback(): void;
28
+ disconnectedCallback(): void;
29
+ updated(props: any): void;
30
+ protected onKeyDown(e: KeyboardEvent): void;
31
+ firstUpdated(): void;
32
+ protected handleClick(e: Event): void;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ "tk-button": TkButton;
37
+ }
38
+ }
39
+ export { TkButton };