@neovici/cosmoz-tabs 8.9.0 → 8.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-tabs",
3
- "version": "8.9.0",
3
+ "version": "8.10.0",
4
4
  "description": "A multi views container element that allow navigation between the views using tabs or an accordion.",
5
5
  "keywords": [
6
6
  "web-components"
@@ -24,10 +24,10 @@ interface Result<T extends Tab> {
24
24
  onActivate: (e: Event) => void;
25
25
  }
26
26
 
27
- export type RenderTabs<T extends Tab> = Pick<
28
- Result<T>,
29
- 'tabs' | 'active' | 'onActivate'
30
- >;
27
+ export interface RenderTabs<T extends Tab>
28
+ extends Pick<Result<T>, 'tabs' | 'active' | 'onActivate'> {
29
+ className?: string;
30
+ }
31
31
 
32
32
  export declare const useTabs: <T extends Tab, P extends Options>(
33
33
  tabs: T[],
@@ -48,15 +48,16 @@ export const useTabs = (tabs, { hashParam, onActivate }) => {
48
48
  };
49
49
  };
50
50
 
51
- export const renderTabs = ({ tabs, active, onActivate }) =>
51
+ export const renderTabs = ({ tabs, active, onActivate, className }) =>
52
52
  tabs.map((tab) => {
53
53
  const title = invoke(tab.title);
54
54
  return html`<cosmoz-tab-next
55
55
  name=${tab.name}
56
+ class=${ifDefined(className)}
57
+ title=${ifDefined(typeof title === 'string' ? title : undefined)}
56
58
  ?active=${active.name === tab.name}
57
59
  ?hidden=${tab.hidden}
58
60
  ?disabled=${tab.disabled}
59
- title=${ifDefined(typeof title === 'string' ? title : undefined)}
60
61
  @click=${onActivate}
61
62
  >${tab.content ?? title}</cosmoz-tab-next
62
63
  >`;
package/src/render.js CHANGED
@@ -80,7 +80,7 @@ const style = `
80
80
  }
81
81
 
82
82
  .badge {
83
- font-family: var(--cosmoz-font-base, "Verdana, Arial, sans-serif");
83
+ font-family: var(--cosmoz-tabs-badge-font-family, var(--cosmoz-font-base, inherit))
84
84
  font-weight: normal;
85
85
  font-size: 11px;
86
86
  line-height: 1;