@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.
- package/lib/cjs/_store/{ScoreCard-chunk-CrUY_fv3.js → CardGroup-chunk-DVgx8_lR.js} +1 -1
- package/lib/cjs/_store/{Cards-entry-CsnvxElJ.js → Cards-entry-CzMtOpW3.js} +1 -1
- package/lib/cjs/_store/Tabs-chunk-DvMQf2Ae.js +1 -0
- package/lib/cjs/_store/{Tabs-entry-B-Axwj7H.js → Tabs-entry-BYFc5J8n.js} +1 -1
- package/lib/cjs/_store/{components-entry-1s3FUUOQ.js → components-entry-DeDQ601R.js} +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/_store/{ScoreCard-chunk-DCJ-Xysl.js → CardGroup-chunk-DAuoDC3W.js} +75 -74
- package/lib/esm/_store/{Cards-entry-C2-z4ntb.js → Cards-entry-CfOjTSQy.js} +1 -1
- package/lib/esm/_store/Tabs-chunk-Bugbnb4X.js +65 -0
- package/lib/esm/_store/Tabs-entry-DehhOPET.js +4 -0
- package/lib/esm/_store/{components-entry-YMq-4TvM.js → components-entry-Dr7wNA4h.js} +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/styles/components/scorecard.css +1 -1
- package/lib/styles/global.css.map +1 -1
- package/lib/styles/index.css +1 -1
- package/lib/styles/index.css.map +1 -1
- package/lib/styles/monorepo.css +1 -1
- package/lib/styles/monorepo.css.map +1 -1
- package/lib/types/components/Cards/CardGroup.d.ts +2 -0
- package/lib/types/components/Tabs/Tabs.props.d.ts +4 -0
- package/lib/types/types/index.d.ts +1 -1
- package/package.json +5 -5
- package/lib/cjs/_store/Tabs-chunk-n0swxLit.js +0 -1
- package/lib/esm/_store/Tabs-chunk-CMh7UcxO.js +0 -60
- package/lib/esm/_store/Tabs-entry-Bh8o3rp8.js +0 -4
|
@@ -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.
|
|
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.
|
|
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/
|
|
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
|
-
};
|