@ilo-org/react 0.24.4 → 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.
@@ -7,6 +7,7 @@ import { FeatureCardProps } from './FeatureCard';
7
7
  import { DetailCardProps } from './DetailCard';
8
8
  import { FactListCardProps } from './FactListCard';
9
9
  import { DataCardProps } from './DataCard';
10
+ import { ScoreCardProps } from './ScoreCard';
10
11
  import { LinkProps } from '../Link';
11
12
 
12
13
  type CardPropsMap = {
@@ -18,6 +19,7 @@ type CardPropsMap = {
18
19
  detail: DetailCardProps;
19
20
  factlist: FactListCardProps;
20
21
  data: DataCardProps;
22
+ score: ScoreCardProps;
21
23
  };
22
24
  type CardGroupComponentProps<T extends CardTypes> = CardPropsMap[T];
23
25
  export type CardGroupProps<T extends CardTypes> = {
@@ -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;
@@ -27,7 +27,7 @@ export type CardColor = "turquoise" | "green" | "yellow" | "blue";
27
27
  export type CardSize = "wide" | "standard" | "narrow" | "fluid";
28
28
  export type CardCornerType = boolean;
29
29
  export type CardAlignment = "left" | "right";
30
- export type CardTypes = "stat" | "multilink" | "text" | "promo" | "feature" | "detail" | "factlist" | "data";
30
+ export type CardTypes = "stat" | "multilink" | "text" | "promo" | "feature" | "detail" | "factlist" | "score" | "data";
31
31
  export type HeadingTypes = "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
32
32
  export interface EventDate {
33
33
  unix?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/react",
3
- "version": "0.24.4",
3
+ "version": "0.24.6",
4
4
  "description": "React components for the ILO's Design System",
5
5
  "keywords": [
6
6
  "ui_patterns",
@@ -72,12 +72,12 @@
72
72
  "use-breakpoint": "^4.0.6",
73
73
  "video.js": "^7.21.2",
74
74
  "videojs-youtube": "^3.0.1",
75
+ "@ilo-org/brand-assets": "1.0.1",
76
+ "@ilo-org/icons-react": "1.0.3",
75
77
  "@ilo-org/fonts": "1.0.0",
76
- "@ilo-org/styles": "1.8.4",
77
- "@ilo-org/themes": "0.9.1",
78
- "@ilo-org/brand-assets": "1.0.0",
78
+ "@ilo-org/styles": "1.8.5",
79
79
  "@ilo-org/utils": "0.1.1",
80
- "@ilo-org/icons-react": "1.0.3"
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
- };