@e280/shiny 0.1.0-1 → 0.1.0-11

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 (162) hide show
  1. package/README.md +113 -3
  2. package/package.json +3 -3
  3. package/s/components/button/component.ts +30 -0
  4. package/s/components/button/style.css.ts +64 -0
  5. package/s/{ui → components}/copy/component.ts +11 -6
  6. package/s/{ui → components}/copy/style.css.ts +6 -6
  7. package/s/components/drawer/component.ts +92 -0
  8. package/s/components/drawer/control.ts +31 -0
  9. package/s/components/drawer/style.css.ts +120 -0
  10. package/s/{ui → components}/example/component.ts +7 -5
  11. package/s/{ui → components}/example/style.css.ts +2 -2
  12. package/s/components/foundation.css.ts +15 -0
  13. package/s/components/framework.ts +10 -0
  14. package/s/components/raw-components.ts +15 -0
  15. package/s/components/tabs/component.ts +70 -0
  16. package/s/components/tabs/control.ts +31 -0
  17. package/s/components/tabs/style.css.ts +43 -0
  18. package/s/demo/aura-views.ts +6 -0
  19. package/s/demo/demo.bundle.ts +287 -14
  20. package/s/demo/demo.css +3 -1
  21. package/s/demo/utils/lipsum.ts +19 -0
  22. package/s/demo/views/demonstration/style.css.ts +18 -2
  23. package/s/demo/views/demonstration/view.ts +24 -16
  24. package/s/icons/tabler/menu-2.svg.ts +4 -0
  25. package/s/icons/tabler/x.svg.ts +4 -0
  26. package/s/index.html.ts +2 -2
  27. package/s/index.ts +16 -4
  28. package/s/install/aura.bundle.ts +9 -0
  29. package/s/install/plain.bundle.ts +9 -0
  30. package/s/shiny.ts +15 -0
  31. package/s/themes/aura.css.ts +86 -0
  32. package/s/themes/index.barrel.ts +2 -1
  33. package/s/themes/index.ts +1 -0
  34. package/s/themes/infra/css-vars.ts +41 -0
  35. package/s/themes/plain.css.ts +11 -0
  36. package/s/utils/states.ts +15 -0
  37. package/x/components/button/component.d.ts +5 -0
  38. package/x/components/button/component.js +25 -0
  39. package/x/components/button/component.js.map +1 -0
  40. package/x/components/button/style.css.js +63 -0
  41. package/x/components/button/style.css.js.map +1 -0
  42. package/x/{ui → components}/copy/component.d.ts +8 -4
  43. package/x/{ui → components}/copy/component.js +10 -5
  44. package/x/components/copy/component.js.map +1 -0
  45. package/x/{ui → components}/copy/style.css.js +6 -6
  46. package/x/components/copy/style.css.js.map +1 -0
  47. package/x/components/drawer/component.d.ts +387 -0
  48. package/x/components/drawer/component.js +76 -0
  49. package/x/components/drawer/component.js.map +1 -0
  50. package/x/components/drawer/control.d.ts +9 -0
  51. package/x/components/drawer/control.js +24 -0
  52. package/x/components/drawer/control.js.map +1 -0
  53. package/x/components/drawer/style.css.d.ts +2 -0
  54. package/x/components/drawer/style.css.js +119 -0
  55. package/x/components/drawer/style.css.js.map +1 -0
  56. package/x/{ui → components}/example/component.d.ts +3 -3
  57. package/x/{ui → components}/example/component.js +6 -4
  58. package/x/components/example/component.js.map +1 -0
  59. package/x/components/example/style.css.d.ts +2 -0
  60. package/x/components/example/style.css.js +10 -0
  61. package/x/components/example/style.css.js.map +1 -0
  62. package/x/components/foundation.css.d.ts +1 -0
  63. package/x/components/foundation.css.js +14 -0
  64. package/x/components/foundation.css.js.map +1 -0
  65. package/x/components/framework.d.ts +8 -0
  66. package/x/components/framework.js +5 -0
  67. package/x/components/framework.js.map +1 -0
  68. package/x/components/raw-components.d.ts +12 -0
  69. package/x/components/raw-components.js +13 -0
  70. package/x/components/raw-components.js.map +1 -0
  71. package/x/components/tabs/component.d.ts +374 -0
  72. package/x/components/tabs/component.js +60 -0
  73. package/x/components/tabs/component.js.map +1 -0
  74. package/x/components/tabs/control.d.ts +9 -0
  75. package/x/components/tabs/control.js +24 -0
  76. package/x/components/tabs/control.js.map +1 -0
  77. package/x/components/tabs/style.css.d.ts +2 -0
  78. package/x/components/tabs/style.css.js +42 -0
  79. package/x/components/tabs/style.css.js.map +1 -0
  80. package/x/demo/aura-views.d.ts +15 -0
  81. package/x/demo/aura-views.js +4 -0
  82. package/x/demo/aura-views.js.map +1 -0
  83. package/x/demo/demo.bundle.js +280 -14
  84. package/x/demo/demo.bundle.js.map +1 -1
  85. package/x/demo/demo.bundle.min.js +561 -45
  86. package/x/demo/demo.bundle.min.js.map +4 -4
  87. package/x/demo/demo.css +3 -1
  88. package/x/demo/utils/lipsum.d.ts +2 -0
  89. package/x/demo/utils/lipsum.js +11 -0
  90. package/x/demo/utils/lipsum.js.map +1 -0
  91. package/x/demo/views/demonstration/style.css.js +18 -2
  92. package/x/demo/views/demonstration/style.css.js.map +1 -1
  93. package/x/demo/views/demonstration/view.d.ts +6 -4
  94. package/x/demo/views/demonstration/view.js +20 -12
  95. package/x/demo/views/demonstration/view.js.map +1 -1
  96. package/x/icons/tabler/menu-2.svg.d.ts +2 -0
  97. package/x/icons/tabler/menu-2.svg.js +3 -0
  98. package/x/icons/tabler/menu-2.svg.js.map +1 -0
  99. package/x/icons/tabler/x.svg.d.ts +2 -0
  100. package/x/icons/tabler/x.svg.js +3 -0
  101. package/x/icons/tabler/x.svg.js.map +1 -0
  102. package/x/index.d.ts +10 -4
  103. package/x/index.html +7 -5
  104. package/x/index.html.js +2 -2
  105. package/x/index.js +10 -4
  106. package/x/index.js.map +1 -1
  107. package/x/install/aura.bundle.d.ts +1 -0
  108. package/x/install/aura.bundle.js +5 -0
  109. package/x/install/aura.bundle.js.map +1 -0
  110. package/x/install/aura.bundle.min.js +463 -0
  111. package/x/install/aura.bundle.min.js.map +7 -0
  112. package/x/install/plain.bundle.d.ts +1 -0
  113. package/x/install/plain.bundle.js +5 -0
  114. package/x/install/plain.bundle.js.map +1 -0
  115. package/x/install/plain.bundle.min.js +390 -0
  116. package/x/install/plain.bundle.min.js.map +7 -0
  117. package/x/shiny.d.ts +47 -0
  118. package/x/shiny.js +8 -0
  119. package/x/shiny.js.map +1 -0
  120. package/x/themes/aura.css.d.ts +1 -0
  121. package/x/themes/aura.css.js +85 -0
  122. package/x/themes/aura.css.js.map +1 -0
  123. package/x/themes/index.barrel.d.ts +2 -1
  124. package/x/themes/index.barrel.js +2 -1
  125. package/x/themes/index.barrel.js.map +1 -1
  126. package/x/themes/index.d.ts +1 -0
  127. package/x/themes/infra/css-vars.d.ts +14 -0
  128. package/x/themes/infra/css-vars.js +21 -0
  129. package/x/themes/infra/css-vars.js.map +1 -0
  130. package/x/themes/plain.css.d.ts +1 -0
  131. package/x/themes/plain.css.js +10 -0
  132. package/x/themes/plain.css.js.map +1 -0
  133. package/x/utils/states.d.ts +5 -0
  134. package/x/utils/states.js +13 -0
  135. package/x/utils/states.js.map +1 -0
  136. package/s/themes/basic.css.ts +0 -18
  137. package/s/tools/untab.ts +0 -30
  138. package/s/ui/components.ts +0 -9
  139. package/s/ui/framework.ts +0 -8
  140. package/s/ui/themers.ts +0 -28
  141. package/x/themes/basic.css.d.ts +0 -1
  142. package/x/themes/basic.css.js +0 -17
  143. package/x/themes/basic.css.js.map +0 -1
  144. package/x/tools/untab.d.ts +0 -1
  145. package/x/tools/untab.js +0 -26
  146. package/x/tools/untab.js.map +0 -1
  147. package/x/ui/components.d.ts +0 -6
  148. package/x/ui/components.js +0 -7
  149. package/x/ui/components.js.map +0 -1
  150. package/x/ui/copy/component.js.map +0 -1
  151. package/x/ui/copy/style.css.js.map +0 -1
  152. package/x/ui/example/component.js.map +0 -1
  153. package/x/ui/example/style.css.js +0 -10
  154. package/x/ui/example/style.css.js.map +0 -1
  155. package/x/ui/framework.d.ts +0 -4
  156. package/x/ui/framework.js +0 -6
  157. package/x/ui/framework.js.map +0 -1
  158. package/x/ui/themers.d.ts +0 -8
  159. package/x/ui/themers.js +0 -12
  160. package/x/ui/themers.js.map +0 -1
  161. /package/x/{ui/copy → components/button}/style.css.d.ts +0 -0
  162. /package/x/{ui/example → components/copy}/style.css.d.ts +0 -0
@@ -1,9 +1,11 @@
1
- import { dom, view } from "@e280/sly";
2
1
  import { html } from "lit";
2
+ import { dom, view } from "@e280/sly";
3
3
  import styleCss from "./style.css.js";
4
+ import { foundationCss } from "../foundation.css.js";
4
5
  import { ShinyElement } from "../framework.js";
5
- export class ShinyExample extends (view(use => (theme, start) => {
6
- use.styles(theme, styleCss);
6
+ export class ShinyExample extends (view(use => (context, start) => {
7
+ use.name("shiny-example");
8
+ use.styles(foundationCss, context.theme, styleCss);
7
9
  const $count = use.signal(start);
8
10
  const increment = () => { $count.value++; };
9
11
  return html `
@@ -15,6 +17,6 @@ export class ShinyExample extends (view(use => (theme, start) => {
15
17
  .component(class extends ShinyElement {
16
18
  attrs = dom.attrs(this).spec({ start: Number });
17
19
  })
18
- .props(el => [el.theme, el.attrs.start ?? 1])) {
20
+ .props(el => [el.context, el.attrs.start ?? 1])) {
19
21
  }
20
22
  //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/example/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,OAAO,YAAa,SAAQ,CACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,KAAa,EAAE,EAAE;IACpD,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IACzB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAElD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,SAAS,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAA;IAE1C,OAAO,IAAI,CAAA;qBACQ,SAAS;MACxB,MAAM,EAAE;;GAEX,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,KAAM,SAAQ,YAAY;IACpC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,CAAA;CAC7C,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAU,CAAC,CACxD;CAAG"}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { css } from "lit";
2
+ export default css `@layer view {
3
+
4
+ button {
5
+ padding: 1em;
6
+ min-width: 4em;
7
+ }
8
+
9
+ }`;
10
+ //# sourceMappingURL=style.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/example/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;EAOhB,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const foundationCss: import("lit").CSSResult;
@@ -0,0 +1,14 @@
1
+ import { css } from "lit";
2
+ import { cssReset } from "@e280/sly";
3
+ export const foundationCss = css `
4
+
5
+ @layer reset, underlay, view, overlay;
6
+
7
+ ${cssReset}
8
+
9
+ @layer overlay {
10
+ [hidden] { display: none !important; }
11
+ }
12
+
13
+ `;
14
+ //# sourceMappingURL=foundation.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foundation.css.js","sourceRoot":"","sources":["../../s/components/foundation.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;EAI9B,QAAQ;;;;;;CAMT,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { CSSResultGroup } from "lit";
2
+ import { BaseElement } from "@e280/sly";
3
+ export type ShinyContext = {
4
+ theme: CSSResultGroup;
5
+ };
6
+ export declare class ShinyElement extends BaseElement {
7
+ context: ShinyContext;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseElement } from "@e280/sly";
2
+ export class ShinyElement extends BaseElement {
3
+ context;
4
+ }
5
+ //# sourceMappingURL=framework.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.js","sourceRoot":"","sources":["../../s/components/framework.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAIrC,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAe;CACtB"}
@@ -0,0 +1,12 @@
1
+ import { ShinyButton } from "./button/component.js";
2
+ import { ShinyCopy } from "./copy/component.js";
3
+ import { ShinyDrawer } from "./drawer/component.js";
4
+ import { ShinyExample } from "./example/component.js";
5
+ import { ShinyTabs } from "./tabs/component.js";
6
+ export declare const rawComponents: {
7
+ ShinyButton: typeof ShinyButton;
8
+ ShinyCopy: typeof ShinyCopy;
9
+ ShinyDrawer: typeof ShinyDrawer;
10
+ ShinyExample: typeof ShinyExample;
11
+ ShinyTabs: typeof ShinyTabs;
12
+ };
@@ -0,0 +1,13 @@
1
+ import { ShinyButton } from "./button/component.js";
2
+ import { ShinyCopy } from "./copy/component.js";
3
+ import { ShinyDrawer } from "./drawer/component.js";
4
+ import { ShinyExample } from "./example/component.js";
5
+ import { ShinyTabs } from "./tabs/component.js";
6
+ export const rawComponents = {
7
+ ShinyButton,
8
+ ShinyCopy,
9
+ ShinyDrawer,
10
+ ShinyExample,
11
+ ShinyTabs,
12
+ };
13
+ //# sourceMappingURL=raw-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-components.js","sourceRoot":"","sources":["../../s/components/raw-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,SAAS;CACT,CAAA"}
@@ -0,0 +1,374 @@
1
+ import { TabControl } from "./control.js";
2
+ import { ShinyContext } from "../framework.js";
3
+ declare const ShinyTabs_base: import("@e280/sly").ComponentClass<{
4
+ new (): {
5
+ control: TabControl;
6
+ get index(): number;
7
+ get length(): number;
8
+ setIndex: (index: number) => Promise<number>;
9
+ shimmy: (delta: number) => Promise<number>;
10
+ context: ShinyContext;
11
+ #private: any;
12
+ readonly shadow: ShadowRoot;
13
+ createShadow(): ShadowRoot;
14
+ render(_use: import("@e280/sly").Use): import("@e280/sly").Content;
15
+ updateNow: () => void;
16
+ update: import("@e280/stz").DebounceReturn<() => void>;
17
+ connectedCallback(): void;
18
+ disconnectedCallback(): void;
19
+ accessKey: string;
20
+ readonly accessKeyLabel: string;
21
+ autocapitalize: string;
22
+ autocorrect: boolean;
23
+ dir: string;
24
+ draggable: boolean;
25
+ hidden: boolean;
26
+ inert: boolean;
27
+ innerText: string;
28
+ lang: string;
29
+ readonly offsetHeight: number;
30
+ readonly offsetLeft: number;
31
+ readonly offsetParent: Element | null;
32
+ readonly offsetTop: number;
33
+ readonly offsetWidth: number;
34
+ outerText: string;
35
+ popover: string | null;
36
+ spellcheck: boolean;
37
+ title: string;
38
+ translate: boolean;
39
+ writingSuggestions: string;
40
+ attachInternals(): ElementInternals;
41
+ click(): void;
42
+ hidePopover(): void;
43
+ showPopover(): void;
44
+ togglePopover(options?: boolean): boolean;
45
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
46
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
47
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
48
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
49
+ readonly attributes: NamedNodeMap;
50
+ get classList(): DOMTokenList;
51
+ set classList(value: string);
52
+ className: string;
53
+ readonly clientHeight: number;
54
+ readonly clientLeft: number;
55
+ readonly clientTop: number;
56
+ readonly clientWidth: number;
57
+ readonly currentCSSZoom: number;
58
+ id: string;
59
+ innerHTML: string;
60
+ readonly localName: string;
61
+ readonly namespaceURI: string | null;
62
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
63
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
64
+ outerHTML: string;
65
+ readonly ownerDocument: Document;
66
+ get part(): DOMTokenList;
67
+ set part(value: string);
68
+ readonly prefix: string | null;
69
+ readonly scrollHeight: number;
70
+ scrollLeft: number;
71
+ scrollTop: number;
72
+ readonly scrollWidth: number;
73
+ readonly shadowRoot: ShadowRoot | null;
74
+ slot: string;
75
+ readonly tagName: string;
76
+ attachShadow(init: ShadowRootInit): ShadowRoot;
77
+ checkVisibility(options?: CheckVisibilityOptions): boolean;
78
+ closest<K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
79
+ closest<K extends keyof SVGElementTagNameMap>(selector: K): SVGElementTagNameMap[K] | null;
80
+ closest<K extends keyof MathMLElementTagNameMap>(selector: K): MathMLElementTagNameMap[K] | null;
81
+ closest<E extends Element = Element>(selectors: string): E | null;
82
+ computedStyleMap(): StylePropertyMapReadOnly;
83
+ getAttribute(qualifiedName: string): string | null;
84
+ getAttributeNS(namespace: string | null, localName: string): string | null;
85
+ getAttributeNames(): string[];
86
+ getAttributeNode(qualifiedName: string): Attr | null;
87
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
88
+ getBoundingClientRect(): DOMRect;
89
+ getClientRects(): DOMRectList;
90
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
91
+ getElementsByTagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
92
+ getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;
93
+ getElementsByTagName<K extends keyof MathMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
94
+ getElementsByTagName<K extends keyof HTMLElementDeprecatedTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
95
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
96
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
97
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
98
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1998/Math/MathML", localName: string): HTMLCollectionOf<MathMLElement>;
99
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
100
+ getHTML(options?: GetHTMLOptions): string;
101
+ hasAttribute(qualifiedName: string): boolean;
102
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
103
+ hasAttributes(): boolean;
104
+ hasPointerCapture(pointerId: number): boolean;
105
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
106
+ insertAdjacentHTML(position: InsertPosition, string: string): void;
107
+ insertAdjacentText(where: InsertPosition, data: string): void;
108
+ matches(selectors: string): boolean;
109
+ releasePointerCapture(pointerId: number): void;
110
+ removeAttribute(qualifiedName: string): void;
111
+ removeAttributeNS(namespace: string | null, localName: string): void;
112
+ removeAttributeNode(attr: Attr): Attr;
113
+ requestFullscreen(options?: FullscreenOptions): Promise<void>;
114
+ requestPointerLock(options?: PointerLockOptions): Promise<void>;
115
+ scroll(options?: ScrollToOptions): void;
116
+ scroll(x: number, y: number): void;
117
+ scrollBy(options?: ScrollToOptions): void;
118
+ scrollBy(x: number, y: number): void;
119
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
120
+ scrollTo(options?: ScrollToOptions): void;
121
+ scrollTo(x: number, y: number): void;
122
+ setAttribute(qualifiedName: string, value: string): void;
123
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
124
+ setAttributeNode(attr: Attr): Attr | null;
125
+ setAttributeNodeNS(attr: Attr): Attr | null;
126
+ setHTMLUnsafe(html: string): void;
127
+ setPointerCapture(pointerId: number): void;
128
+ toggleAttribute(qualifiedName: string, force?: boolean): boolean;
129
+ webkitMatchesSelector(selectors: string): boolean;
130
+ get textContent(): string;
131
+ set textContent(value: string | null);
132
+ readonly baseURI: string;
133
+ readonly childNodes: NodeListOf<ChildNode>;
134
+ readonly firstChild: ChildNode | null;
135
+ readonly isConnected: boolean;
136
+ readonly lastChild: ChildNode | null;
137
+ readonly nextSibling: ChildNode | null;
138
+ readonly nodeName: string;
139
+ readonly nodeType: number;
140
+ nodeValue: string | null;
141
+ readonly parentElement: HTMLElement | null;
142
+ readonly parentNode: ParentNode | null;
143
+ readonly previousSibling: ChildNode | null;
144
+ appendChild<T extends Node>(node: T): T;
145
+ cloneNode(subtree?: boolean): Node;
146
+ compareDocumentPosition(other: Node): number;
147
+ contains(other: Node | null): boolean;
148
+ getRootNode(options?: GetRootNodeOptions): Node;
149
+ hasChildNodes(): boolean;
150
+ insertBefore<T extends Node>(node: T, child: Node | null): T;
151
+ isDefaultNamespace(namespace: string | null): boolean;
152
+ isEqualNode(otherNode: Node | null): boolean;
153
+ isSameNode(otherNode: Node | null): boolean;
154
+ lookupNamespaceURI(prefix: string | null): string | null;
155
+ lookupPrefix(namespace: string | null): string | null;
156
+ normalize(): void;
157
+ removeChild<T extends Node>(child: T): T;
158
+ replaceChild<T extends Node>(node: Node, child: T): T;
159
+ readonly ELEMENT_NODE: 1;
160
+ readonly ATTRIBUTE_NODE: 2;
161
+ readonly TEXT_NODE: 3;
162
+ readonly CDATA_SECTION_NODE: 4;
163
+ readonly ENTITY_REFERENCE_NODE: 5;
164
+ readonly ENTITY_NODE: 6;
165
+ readonly PROCESSING_INSTRUCTION_NODE: 7;
166
+ readonly COMMENT_NODE: 8;
167
+ readonly DOCUMENT_NODE: 9;
168
+ readonly DOCUMENT_TYPE_NODE: 10;
169
+ readonly DOCUMENT_FRAGMENT_NODE: 11;
170
+ readonly NOTATION_NODE: 12;
171
+ readonly DOCUMENT_POSITION_DISCONNECTED: 1;
172
+ readonly DOCUMENT_POSITION_PRECEDING: 2;
173
+ readonly DOCUMENT_POSITION_FOLLOWING: 4;
174
+ readonly DOCUMENT_POSITION_CONTAINS: 8;
175
+ readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
176
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
177
+ dispatchEvent(event: Event): boolean;
178
+ ariaActiveDescendantElement: Element | null;
179
+ ariaAtomic: string | null;
180
+ ariaAutoComplete: string | null;
181
+ ariaBrailleLabel: string | null;
182
+ ariaBrailleRoleDescription: string | null;
183
+ ariaBusy: string | null;
184
+ ariaChecked: string | null;
185
+ ariaColCount: string | null;
186
+ ariaColIndex: string | null;
187
+ ariaColIndexText: string | null;
188
+ ariaColSpan: string | null;
189
+ ariaControlsElements: ReadonlyArray<Element> | null;
190
+ ariaCurrent: string | null;
191
+ ariaDescribedByElements: ReadonlyArray<Element> | null;
192
+ ariaDescription: string | null;
193
+ ariaDetailsElements: ReadonlyArray<Element> | null;
194
+ ariaDisabled: string | null;
195
+ ariaErrorMessageElements: ReadonlyArray<Element> | null;
196
+ ariaExpanded: string | null;
197
+ ariaFlowToElements: ReadonlyArray<Element> | null;
198
+ ariaHasPopup: string | null;
199
+ ariaHidden: string | null;
200
+ ariaInvalid: string | null;
201
+ ariaKeyShortcuts: string | null;
202
+ ariaLabel: string | null;
203
+ ariaLabelledByElements: ReadonlyArray<Element> | null;
204
+ ariaLevel: string | null;
205
+ ariaLive: string | null;
206
+ ariaModal: string | null;
207
+ ariaMultiLine: string | null;
208
+ ariaMultiSelectable: string | null;
209
+ ariaOrientation: string | null;
210
+ ariaOwnsElements: ReadonlyArray<Element> | null;
211
+ ariaPlaceholder: string | null;
212
+ ariaPosInSet: string | null;
213
+ ariaPressed: string | null;
214
+ ariaReadOnly: string | null;
215
+ ariaRelevant: string | null;
216
+ ariaRequired: string | null;
217
+ ariaRoleDescription: string | null;
218
+ ariaRowCount: string | null;
219
+ ariaRowIndex: string | null;
220
+ ariaRowIndexText: string | null;
221
+ ariaRowSpan: string | null;
222
+ ariaSelected: string | null;
223
+ ariaSetSize: string | null;
224
+ ariaSort: string | null;
225
+ ariaValueMax: string | null;
226
+ ariaValueMin: string | null;
227
+ ariaValueNow: string | null;
228
+ ariaValueText: string | null;
229
+ role: string | null;
230
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation;
231
+ getAnimations(options?: GetAnimationsOptions): Animation[];
232
+ after(...nodes: (Node | string)[]): void;
233
+ before(...nodes: (Node | string)[]): void;
234
+ remove(): void;
235
+ replaceWith(...nodes: (Node | string)[]): void;
236
+ readonly nextElementSibling: Element | null;
237
+ readonly previousElementSibling: Element | null;
238
+ readonly childElementCount: number;
239
+ readonly children: HTMLCollection;
240
+ readonly firstElementChild: Element | null;
241
+ readonly lastElementChild: Element | null;
242
+ append(...nodes: (Node | string)[]): void;
243
+ prepend(...nodes: (Node | string)[]): void;
244
+ querySelector<K extends keyof HTMLElementTagNameMap>(selectors: K): HTMLElementTagNameMap[K] | null;
245
+ querySelector<K extends keyof SVGElementTagNameMap>(selectors: K): SVGElementTagNameMap[K] | null;
246
+ querySelector<K extends keyof MathMLElementTagNameMap>(selectors: K): MathMLElementTagNameMap[K] | null;
247
+ querySelector<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): HTMLElementDeprecatedTagNameMap[K] | null;
248
+ querySelector<E extends Element = Element>(selectors: string): E | null;
249
+ querySelectorAll<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
250
+ querySelectorAll<K extends keyof SVGElementTagNameMap>(selectors: K): NodeListOf<SVGElementTagNameMap[K]>;
251
+ querySelectorAll<K extends keyof MathMLElementTagNameMap>(selectors: K): NodeListOf<MathMLElementTagNameMap[K]>;
252
+ querySelectorAll<K extends keyof HTMLElementDeprecatedTagNameMap>(selectors: K): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
253
+ querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
254
+ replaceChildren(...nodes: (Node | string)[]): void;
255
+ readonly assignedSlot: HTMLSlotElement | null;
256
+ readonly attributeStyleMap: StylePropertyMap;
257
+ get style(): CSSStyleDeclaration;
258
+ set style(cssText: string);
259
+ contentEditable: string;
260
+ enterKeyHint: string;
261
+ inputMode: string;
262
+ readonly isContentEditable: boolean;
263
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
264
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
265
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
266
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
267
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
268
+ onauxclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
269
+ onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null;
270
+ onbeforematch: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
+ onbeforetoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
272
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
273
+ oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null;
274
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
276
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ onclick: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
278
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ oncontextlost: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
+ oncontextmenu: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
281
+ oncontextrestored: ((this: GlobalEventHandlers, ev: Event) => any) | null;
282
+ oncopy: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
283
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ oncut: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
285
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
286
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
287
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
288
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
289
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
290
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
291
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
292
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
293
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
294
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onerror: OnErrorEventHandler;
297
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
298
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
299
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
300
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
301
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
302
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
303
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
304
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
305
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
306
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
307
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
308
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
309
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
310
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
311
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
312
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
313
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
314
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
315
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
316
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
317
+ onpaste: ((this: GlobalEventHandlers, ev: ClipboardEvent) => any) | null;
318
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
319
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
320
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
321
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
322
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
323
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
324
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
325
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
326
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
327
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
328
+ onpointerrawupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
329
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
330
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null;
331
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
332
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
333
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
334
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
335
+ onscrollend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
336
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
337
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
338
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
339
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
340
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
341
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
342
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
343
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
344
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
345
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
346
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
347
+ ontoggle: ((this: GlobalEventHandlers, ev: ToggleEvent) => any) | null;
348
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
349
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
350
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
351
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
352
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
353
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
354
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
355
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
356
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
357
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
358
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
359
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
360
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
361
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
362
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
363
+ autofocus: boolean;
364
+ readonly dataset: DOMStringMap;
365
+ nonce?: string;
366
+ tabIndex: number;
367
+ blur(): void;
368
+ focus(options?: FocusOptions): void;
369
+ };
370
+ styles: import("lit").CSSResultGroup | undefined;
371
+ }, [context: ShinyContext, controlOption?: TabControl | undefined]>;
372
+ export declare class ShinyTabs extends ShinyTabs_base {
373
+ }
374
+ export {};
@@ -0,0 +1,60 @@
1
+ import { html } from "lit";
2
+ import { dom, view } from "@e280/sly";
3
+ import styleCss from "./style.css.js";
4
+ import { TabControl } from "./control.js";
5
+ import { foundationCss } from "../foundation.css.js";
6
+ import { ShinyElement } from "../framework.js";
7
+ export class ShinyTabs extends (view(use => (context, controlOption) => {
8
+ use.name("shiny-tabs");
9
+ use.styles(foundationCss, context.theme, styleCss);
10
+ const attrs = use.attrs.spec({ index: Number });
11
+ const control = use.once(() => controlOption ?? new TabControl(attrs.index ?? 0));
12
+ const $tabs = use.signal([]);
13
+ const $panels = use.signal([]);
14
+ async function tabchange(event) {
15
+ const slot = event.currentTarget;
16
+ await $tabs.set(slot.assignedElements());
17
+ }
18
+ async function panelchange(event) {
19
+ const slot = event.currentTarget;
20
+ await $panels.set(slot.assignedElements());
21
+ }
22
+ attrs.index = control.$index();
23
+ control.length = $tabs().length;
24
+ function isNeighborActive(index, delta) {
25
+ const nextIndex = control.clamp(index + delta);
26
+ if (nextIndex === index)
27
+ return false;
28
+ return (nextIndex === control.index);
29
+ }
30
+ for (const [index, tab] of $tabs().entries()) {
31
+ const active = (index === control.index);
32
+ const tabAttrs = dom.attrs(tab);
33
+ tabAttrs.booleans.disabled = active;
34
+ tabAttrs.booleans["data-active"] = active;
35
+ tabAttrs.booleans["data-first"] = (index === 0);
36
+ tabAttrs.booleans["data-last"] = (index === (control.length - 1));
37
+ tabAttrs.booleans["data-next-is-active"] = isNeighborActive(index, 1);
38
+ tabAttrs.booleans["data-previous-is-active"] = isNeighborActive(index, -1);
39
+ tab.onclick = () => control.setIndex(index);
40
+ }
41
+ for (const [index, tab] of $panels().entries()) {
42
+ const active = (index === control.index);
43
+ dom.attrs(tab).booleans.active = active;
44
+ dom.attrs(tab).booleans.hidden = !active;
45
+ }
46
+ return html `
47
+ <slot part=tabs @slotchange="${tabchange}"></slot>
48
+ <slot part=panels name=panel @slotchange="${panelchange}"></slot>
49
+ `;
50
+ })
51
+ .component(class extends ShinyElement {
52
+ control = new TabControl();
53
+ get index() { return this.control.index; }
54
+ get length() { return this.control.length; }
55
+ setIndex = this.control.setIndex.bind(this.control);
56
+ shimmy = this.control.shimmy.bind(this.control);
57
+ })
58
+ .props(el => [el.context, el.control])) {
59
+ }
60
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/tabs/component.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ export declare class TabControl {
2
+ length: number;
3
+ $index: import("@e280/strata").SignalFn<number>;
4
+ constructor(start?: number);
5
+ clamp(index: number): number;
6
+ get index(): number;
7
+ setIndex(index: number): Promise<number>;
8
+ shimmy(delta: number): Promise<number>;
9
+ }
@@ -0,0 +1,24 @@
1
+ import { signal } from "@e280/strata";
2
+ export class TabControl {
3
+ length = 1;
4
+ $index = signal(0);
5
+ constructor(start = 0) {
6
+ this.$index.value = start;
7
+ }
8
+ clamp(index) {
9
+ index = Math.min(index, this.length - 1);
10
+ index = Math.max(index, 0);
11
+ return index;
12
+ }
13
+ get index() {
14
+ return this.clamp(this.$index.get());
15
+ }
16
+ async setIndex(index) {
17
+ return this.$index.set(index);
18
+ }
19
+ async shimmy(delta) {
20
+ const index = this.clamp(this.index + delta);
21
+ return this.setIndex(index);
22
+ }
23
+ }
24
+ //# sourceMappingURL=control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.js","sourceRoot":"","sources":["../../../s/components/tabs/control.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAA;AAEnC,MAAM,OAAO,UAAU;IACtB,MAAM,GAAG,CAAC,CAAA;IACV,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAElB,YAAY,KAAK,GAAG,CAAC;QACpB,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;IAC1B,CAAC;IAED,KAAK,CAAC,KAAa;QAClB,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAC1B,OAAO,KAAK,CAAA;IACb,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;QAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;CACD"}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import { css } from "lit";
2
+ export default css `@layer view {
3
+
4
+ :host {
5
+ display: inline-flex;
6
+ flex-direction: column;
7
+ }
8
+
9
+ slot[part="tabs"] {
10
+ display: flex;
11
+
12
+ &::slotted(*) {
13
+ border-radius: 0.3em;
14
+ }
15
+
16
+ &::slotted([data-active]) {
17
+ opacity: 1;
18
+ color: currentColor;
19
+ text-decoration: underline;
20
+ }
21
+
22
+ &::slotted(:not([data-last], [data-next-is-active])) {
23
+ border-right: none;
24
+ }
25
+
26
+ &::slotted([data-active]:not([data-first])) {
27
+ border-left: none;
28
+ }
29
+
30
+ &::slotted(:not([data-last])) {
31
+ border-top-right-radius: 0;
32
+ border-bottom-right-radius: 0;
33
+ }
34
+
35
+ &::slotted(:not([data-first])) {
36
+ border-top-left-radius: 0;
37
+ border-bottom-left-radius: 0;
38
+ }
39
+ }
40
+
41
+ } `;
42
+ //# sourceMappingURL=style.css.js.map