@ilo-org/react 0.24.5 → 0.24.6

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.
@@ -19,6 +19,10 @@ export interface TabsProps {
19
19
  * Specify the default active tab
20
20
  */
21
21
  defaultActiveTab?: number;
22
+ /**
23
+ * Allows you to override the default tab behaviour and set the active tab programatically
24
+ */
25
+ activeTab?: number;
22
26
  }
23
27
  export interface TabItem {
24
28
  icon?: IconProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/react",
3
- "version": "0.24.5",
3
+ "version": "0.24.6",
4
4
  "description": "React components for the ILO's Design System",
5
5
  "keywords": [
6
6
  "ui_patterns",
@@ -73,11 +73,11 @@
73
73
  "video.js": "^7.21.2",
74
74
  "videojs-youtube": "^3.0.1",
75
75
  "@ilo-org/brand-assets": "1.0.1",
76
- "@ilo-org/fonts": "1.0.0",
77
76
  "@ilo-org/icons-react": "1.0.3",
77
+ "@ilo-org/fonts": "1.0.0",
78
78
  "@ilo-org/styles": "1.8.5",
79
- "@ilo-org/themes": "0.9.1",
80
- "@ilo-org/utils": "0.1.1"
79
+ "@ilo-org/utils": "0.1.1",
80
+ "@ilo-org/themes": "0.9.1"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@storybook/addon-actions": "^8.1.9",
@@ -1 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),h=require("react"),m=require("./useGlobalSettings-chunk-DEacV16j.js"),j=require("./index-chunk-D921N0ug.js"),p=require("./Icon-chunk-QFryHTpy.js"),v=({items:n,className:c,theme:i="light",defaultActiveTab:o=0})=>{const[l,r]=h.useState(o),b=(s,e)=>{r(s),e.preventDefault()},{prefix:$}=m.useGlobalSettings(),a=`${$}--tabs`,u=j.classnames(a,c,`${a}__theme__${i}`);return t.jsxs("div",{className:u,children:[t.jsx("ul",{className:`${a}--selection`,role:"tablist",tabIndex:0,children:n.map((s,e)=>t.jsx("li",{role:"presentation",className:`${a}--selection--item ${l===e?"active":""}`,onClick:d=>b(e,d),id:`tab--${e}`,children:t.jsxs("a",{href:`#tab--${e}`,className:`${a}--selection--button${s.icon?" icon":""}`,role:"tab","aria-controls":`tab--${e}`,"aria-selected":e===l,title:s.label,tabIndex:e===l?0:-1,children:[t.jsx("span",{className:`${a}--selection--label`,children:s.label}),s.icon&&t.jsx(p.Icon,{name:s.icon.name,hidden:s.icon.hidden})]})},`#tab--${e}`))}),t.jsx("div",{className:`${a}--content`,role:"tabpanel","aria-labelledby":`tab--${l}`,tabIndex:0,children:n[l].content})]})},x=v;exports.Tabs=x;
@@ -1,60 +0,0 @@
1
- import { jsxs as o, jsx as l } from "react/jsx-runtime";
2
- import { useState as p } from "react";
3
- import { u as f } from "./useGlobalSettings-chunk-Bu2lRvQa.js";
4
- import { c as u } from "./index-chunk-CY3PQDr4.js";
5
- import { I as v } from "./Icon-chunk-DIxw5wWq.js";
6
- const N = ({
7
- items: c,
8
- className: n,
9
- theme: i = "light",
10
- defaultActiveTab: r = 0
11
- }) => {
12
- const [t, b] = p(r), m = (a, e) => {
13
- b(a), e.preventDefault();
14
- }, { prefix: $ } = f(), s = `${$}--tabs`, d = u(
15
- s,
16
- n,
17
- `${s}__theme__${i}`
18
- );
19
- return /* @__PURE__ */ o("div", { className: d, children: [
20
- /* @__PURE__ */ l("ul", { className: `${s}--selection`, role: "tablist", tabIndex: 0, children: c.map((a, e) => /* @__PURE__ */ l(
21
- "li",
22
- {
23
- role: "presentation",
24
- className: `${s}--selection--item ${t === e ? "active" : ""}`,
25
- onClick: (h) => m(e, h),
26
- id: `tab--${e}`,
27
- children: /* @__PURE__ */ o(
28
- "a",
29
- {
30
- href: `#tab--${e}`,
31
- className: `${s}--selection--button${a.icon ? " icon" : ""}`,
32
- role: "tab",
33
- "aria-controls": `tab--${e}`,
34
- "aria-selected": e === t,
35
- title: a.label,
36
- tabIndex: e === t ? 0 : -1,
37
- children: [
38
- /* @__PURE__ */ l("span", { className: `${s}--selection--label`, children: a.label }),
39
- a.icon && /* @__PURE__ */ l(v, { name: a.icon.name, hidden: a.icon.hidden })
40
- ]
41
- }
42
- )
43
- },
44
- `#tab--${e}`
45
- )) }),
46
- /* @__PURE__ */ l(
47
- "div",
48
- {
49
- className: `${s}--content`,
50
- role: "tabpanel",
51
- "aria-labelledby": `tab--${t}`,
52
- tabIndex: 0,
53
- children: c[t].content
54
- }
55
- )
56
- ] });
57
- }, j = N;
58
- export {
59
- j as T
60
- };
@@ -1,4 +0,0 @@
1
- import { T as r } from "./Tabs-chunk-CMh7UcxO.js";
2
- export {
3
- r as Tabs
4
- };