@guardian/stand 0.0.56 → 0.0.57

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/dist/Tabs.cjs ADDED
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tabs = require("./styleD/build/typescript/component/tabs.cjs");
3
+ const require_Tabs = require("./components/Tabs/Tabs.cjs");
4
+ exports.Tabs = require_Tabs.Tabs;
5
+ exports.componentTabs = require_tabs.componentTabs;
@@ -0,0 +1,5 @@
1
+ import { ComponentTabs, componentTabs } from "./styleD/build/typescript/component/tabs.cjs";
2
+ import { PartialTabListTheme, PartialTabPanelTheme, PartialTabPanelsTheme, PartialTabTheme, PartialTabsTheme } from "./components/Tabs/styles.cjs";
3
+ import { TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabsProps } from "./components/Tabs/types.cjs";
4
+ import { Tabs } from "./components/Tabs/Tabs.cjs";
5
+ export { type ComponentTabs, type TabListProps, type PartialTabListTheme as TabListTheme, type TabPanelProps, type PartialTabPanelTheme as TabPanelTheme, type TabPanelsProps, type PartialTabPanelsTheme as TabPanelsTheme, type TabProps, type PartialTabTheme as TabTheme, Tabs, type TabsProps, type PartialTabsTheme as TabsTheme, componentTabs };
package/dist/Tabs.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { ComponentTabs, componentTabs } from "./styleD/build/typescript/component/tabs.js";
2
+ import { PartialTabListTheme, PartialTabPanelTheme, PartialTabPanelsTheme, PartialTabTheme, PartialTabsTheme } from "./components/Tabs/styles.js";
3
+ import { TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabsProps } from "./components/Tabs/types.js";
4
+ import { Tabs } from "./components/Tabs/Tabs.js";
5
+ export { type ComponentTabs, type TabListProps, type PartialTabListTheme as TabListTheme, type TabPanelProps, type PartialTabPanelTheme as TabPanelTheme, type TabPanelsProps, type PartialTabPanelsTheme as TabPanelsTheme, type TabProps, type PartialTabTheme as TabTheme, Tabs, type TabsProps, type PartialTabsTheme as TabsTheme, componentTabs };
package/dist/Tabs.js ADDED
@@ -0,0 +1,3 @@
1
+ import { componentTabs } from "./styleD/build/typescript/component/tabs.js";
2
+ import { Tabs } from "./components/Tabs/Tabs.js";
3
+ export { Tabs, componentTabs };
@@ -0,0 +1,88 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_mergeDeep = require("../../util/mergeDeep.cjs");
3
+ const require_Icon = require("../Icon/Icon.cjs");
4
+ const require_styles = require("./styles.cjs");
5
+ let react = require("react");
6
+ react = require_runtime.__toESM(react);
7
+ let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
8
+ let react_aria_components = require("react-aria-components");
9
+ //#region src/components/Tabs/Tabs.tsx
10
+ function TabsRoot({ children, orientation = "horizontal", size = "md", theme = {}, cssOverrides, ...props }) {
11
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultTabsTheme, theme);
12
+ const validChildren = [];
13
+ react.default.Children.forEach(children, (child, i) => {
14
+ if (!react.default.isValidElement(child)) return;
15
+ if (child.type === TabList || child.type === TabPanels) validChildren.push(react.default.cloneElement(child, {
16
+ key: `${child.key}-${i}`,
17
+ orientation,
18
+ size
19
+ }));
20
+ });
21
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.Tabs, {
22
+ css: [require_styles.tabsStyles(mergedTheme), cssOverrides],
23
+ orientation,
24
+ ...props,
25
+ children: validChildren
26
+ });
27
+ }
28
+ function TabList({ children, orientation = "horizontal", size = "md", theme = {}, cssOverrides, ...props }) {
29
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultTabListTheme, theme);
30
+ const tabs = [];
31
+ react.default.Children.forEach(children, (child, i) => {
32
+ if (!react.default.isValidElement(child)) return;
33
+ if (child.type === Tab) tabs.push(react.default.cloneElement(child, {
34
+ key: `${child.key}-${i}`,
35
+ orientation,
36
+ size
37
+ }));
38
+ });
39
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.TabList, {
40
+ css: [require_styles.tabListStyles(mergedTheme), cssOverrides],
41
+ ...props,
42
+ children: tabs
43
+ });
44
+ }
45
+ function Tab({ children, orientation = "horizontal", size = "md", icon, theme = {}, cssOverrides, ...props }) {
46
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultTabTheme, theme);
47
+ const iconSize = size === "md" ? "lg" : "sm";
48
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(react_aria_components.Tab, {
49
+ css: [require_styles.tabStyles(mergedTheme, {
50
+ orientation,
51
+ size,
52
+ icon
53
+ }), cssOverrides],
54
+ ...props,
55
+ children: [icon && /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_Icon.Icon, {
56
+ size: iconSize,
57
+ children: icon
58
+ }), children]
59
+ });
60
+ }
61
+ function TabPanels({ children, theme = {}, cssOverrides, ...props }) {
62
+ const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultTabPanelsTheme, theme);
63
+ const panels = [];
64
+ react.default.Children.forEach(children, (child, i) => {
65
+ if (!react.default.isValidElement(child)) return;
66
+ if (child.type === TabPanel) panels.push(react.default.cloneElement(child, { key: `${child.key}-${i}` }));
67
+ });
68
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.TabPanels, {
69
+ css: [require_styles.tabPanelsStyles(mergedTheme), cssOverrides],
70
+ ...props,
71
+ children: panels
72
+ });
73
+ }
74
+ function TabPanel({ children, theme = {}, cssOverrides, ...props }) {
75
+ return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(react_aria_components.TabPanel, {
76
+ css: [require_styles.tabPanelStyles(require_mergeDeep.mergeDeep(require_styles.defaultTabPanelTheme, theme)), cssOverrides],
77
+ ...props,
78
+ children
79
+ });
80
+ }
81
+ const Tabs = Object.assign(TabsRoot, {
82
+ TabList,
83
+ Tab,
84
+ TabPanels,
85
+ TabPanel
86
+ });
87
+ //#endregion
88
+ exports.Tabs = Tabs;
@@ -0,0 +1,15 @@
1
+ import { TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabPanelsProps as TabPanelsProps$1, TabProps as TabProps$1, TabsProps as TabsProps$1 } from "./types.cjs";
2
+ import { Tab, TabList, TabPanel, TabPanels, Tabs } from "react-aria-components";
3
+ import React from "react";
4
+
5
+ //#region src/components/Tabs/Tabs.d.ts
6
+ interface TabsCompound {
7
+ (props: TabsProps$1): React.ReactElement<TabsProps$1, typeof Tabs>;
8
+ TabList: (props: TabListProps$1) => React.ReactElement<TabListProps$1, typeof TabList>;
9
+ Tab: (props: TabProps$1) => React.ReactElement<TabProps$1, typeof Tab>;
10
+ TabPanels: (props: TabPanelsProps$1) => React.ReactElement<TabPanelsProps$1, typeof TabPanels>;
11
+ TabPanel: (props: TabPanelProps$1) => React.ReactElement<TabPanelProps$1, typeof TabPanel>;
12
+ }
13
+ declare const Tabs$1: TabsCompound;
14
+ //#endregion
15
+ export { Tabs$1 as Tabs };
@@ -0,0 +1,15 @@
1
+ import { TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabPanelsProps as TabPanelsProps$1, TabProps as TabProps$1, TabsProps as TabsProps$1 } from "./types.js";
2
+ import React from "react";
3
+ import { Tab, TabList, TabPanel, TabPanels, Tabs } from "react-aria-components";
4
+
5
+ //#region src/components/Tabs/Tabs.d.ts
6
+ interface TabsCompound {
7
+ (props: TabsProps$1): React.ReactElement<TabsProps$1, typeof Tabs>;
8
+ TabList: (props: TabListProps$1) => React.ReactElement<TabListProps$1, typeof TabList>;
9
+ Tab: (props: TabProps$1) => React.ReactElement<TabProps$1, typeof Tab>;
10
+ TabPanels: (props: TabPanelsProps$1) => React.ReactElement<TabPanelsProps$1, typeof TabPanels>;
11
+ TabPanel: (props: TabPanelProps$1) => React.ReactElement<TabPanelProps$1, typeof TabPanel>;
12
+ }
13
+ declare const Tabs$1: TabsCompound;
14
+ //#endregion
15
+ export { Tabs$1 as Tabs };
@@ -0,0 +1,86 @@
1
+ import { mergeDeep } from "../../util/mergeDeep.js";
2
+ import { Icon } from "../Icon/Icon.js";
3
+ import { defaultTabListTheme, defaultTabPanelTheme, defaultTabPanelsTheme, defaultTabTheme, defaultTabsTheme, tabListStyles, tabPanelStyles, tabPanelsStyles, tabStyles, tabsStyles } from "./styles.js";
4
+ import React from "react";
5
+ import { jsx, jsxs } from "@emotion/react/jsx-runtime";
6
+ import { Tab, TabList, TabPanel, TabPanels, Tabs } from "react-aria-components";
7
+ //#region src/components/Tabs/Tabs.tsx
8
+ function TabsRoot({ children, orientation = "horizontal", size = "md", theme = {}, cssOverrides, ...props }) {
9
+ const mergedTheme = mergeDeep(defaultTabsTheme, theme);
10
+ const validChildren = [];
11
+ React.Children.forEach(children, (child, i) => {
12
+ if (!React.isValidElement(child)) return;
13
+ if (child.type === TabList$1 || child.type === TabPanels$1) validChildren.push(React.cloneElement(child, {
14
+ key: `${child.key}-${i}`,
15
+ orientation,
16
+ size
17
+ }));
18
+ });
19
+ return /* @__PURE__ */ jsx(Tabs, {
20
+ css: [tabsStyles(mergedTheme), cssOverrides],
21
+ orientation,
22
+ ...props,
23
+ children: validChildren
24
+ });
25
+ }
26
+ function TabList$1({ children, orientation = "horizontal", size = "md", theme = {}, cssOverrides, ...props }) {
27
+ const mergedTheme = mergeDeep(defaultTabListTheme, theme);
28
+ const tabs = [];
29
+ React.Children.forEach(children, (child, i) => {
30
+ if (!React.isValidElement(child)) return;
31
+ if (child.type === Tab$1) tabs.push(React.cloneElement(child, {
32
+ key: `${child.key}-${i}`,
33
+ orientation,
34
+ size
35
+ }));
36
+ });
37
+ return /* @__PURE__ */ jsx(TabList, {
38
+ css: [tabListStyles(mergedTheme), cssOverrides],
39
+ ...props,
40
+ children: tabs
41
+ });
42
+ }
43
+ function Tab$1({ children, orientation = "horizontal", size = "md", icon, theme = {}, cssOverrides, ...props }) {
44
+ const mergedTheme = mergeDeep(defaultTabTheme, theme);
45
+ const iconSize = size === "md" ? "lg" : "sm";
46
+ return /* @__PURE__ */ jsxs(Tab, {
47
+ css: [tabStyles(mergedTheme, {
48
+ orientation,
49
+ size,
50
+ icon
51
+ }), cssOverrides],
52
+ ...props,
53
+ children: [icon && /* @__PURE__ */ jsx(Icon, {
54
+ size: iconSize,
55
+ children: icon
56
+ }), children]
57
+ });
58
+ }
59
+ function TabPanels$1({ children, theme = {}, cssOverrides, ...props }) {
60
+ const mergedTheme = mergeDeep(defaultTabPanelsTheme, theme);
61
+ const panels = [];
62
+ React.Children.forEach(children, (child, i) => {
63
+ if (!React.isValidElement(child)) return;
64
+ if (child.type === TabPanel$1) panels.push(React.cloneElement(child, { key: `${child.key}-${i}` }));
65
+ });
66
+ return /* @__PURE__ */ jsx(TabPanels, {
67
+ css: [tabPanelsStyles(mergedTheme), cssOverrides],
68
+ ...props,
69
+ children: panels
70
+ });
71
+ }
72
+ function TabPanel$1({ children, theme = {}, cssOverrides, ...props }) {
73
+ return /* @__PURE__ */ jsx(TabPanel, {
74
+ css: [tabPanelStyles(mergeDeep(defaultTabPanelTheme, theme)), cssOverrides],
75
+ ...props,
76
+ children
77
+ });
78
+ }
79
+ const Tabs$1 = Object.assign(TabsRoot, {
80
+ TabList: TabList$1,
81
+ Tab: Tab$1,
82
+ TabPanels: TabPanels$1,
83
+ TabPanel: TabPanel$1
84
+ });
85
+ //#endregion
86
+ export { Tabs$1 as Tabs };
@@ -0,0 +1,146 @@
1
+ const require_typography = require("../../styleD/utils/semantic/typography.cjs");
2
+ const require_tabs = require("../../styleD/build/typescript/component/tabs.cjs");
3
+ let _emotion_react = require("@emotion/react");
4
+ //#region src/components/Tabs/styles.ts
5
+ const defaultTabsTheme = require_tabs.componentTabs.tabs;
6
+ const tabsStyles = (theme) => {
7
+ return _emotion_react.css`
8
+ display: ${theme.shared.display};
9
+ max-width: ${theme.shared.maxWidth};
10
+
11
+ &[data-orientation='vertical'] {
12
+ flex-direction: ${theme.shared.orientation.vertical.flexDirection};
13
+ width: ${theme.shared.orientation.vertical.width};
14
+ }
15
+
16
+ &[data-orientation='horizontal'] {
17
+ flex-direction: ${theme.shared.orientation.horizontal.flexDirection};
18
+ }
19
+ `;
20
+ };
21
+ const defaultTabTheme = require_tabs.componentTabs.tab;
22
+ const tabStyles = (theme, { orientation, size, icon }) => {
23
+ const hasIcon = !!icon;
24
+ return _emotion_react.css`
25
+ position: ${theme.shared.position};
26
+ display: ${theme.shared.display};
27
+ gap: ${theme.shared.gap};
28
+ height: ${theme[size].height};
29
+ cursor: ${theme.shared.cursor};
30
+ flex-direction: ${theme.shared.flexDirection};
31
+ justify-content: ${theme.shared.justifyContent};
32
+ align-items: ${theme.shared.alignItems};
33
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
34
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
35
+ ${hasIcon && _emotion_react.css`
36
+ padding-right: ${theme.shared.padding.withIcon.right};
37
+ `}
38
+ color: ${theme.shared.color};
39
+ ${require_typography.convertTypographyToEmotionStringStyle(theme[size].typography)}
40
+
41
+ &[data-disabled] {
42
+ cursor: ${theme.shared.disabled.cursor};
43
+ color: ${theme.shared.disabled.color};
44
+ }
45
+
46
+ /* Override default browser focus behaviour */
47
+ &:focus-visible {
48
+ outline: none;
49
+ }
50
+
51
+ &[data-focus-visible] {
52
+ outline: ${theme.shared.focusVisible.outline};
53
+ outline-offset: ${theme.shared.focusVisible.outlineOffset};
54
+ }
55
+
56
+ &[data-selected] {
57
+ background: ${theme.shared.selected.background};
58
+ }
59
+
60
+ &[data-hovered]::after,
61
+ &[data-selected]::after {
62
+ background: ${theme.shared.selected.border.background};
63
+ }
64
+
65
+ ${orientation === "horizontal" && _emotion_react.css`
66
+ border-right: ${theme.shared.border};
67
+
68
+ &:first-child {
69
+ border-left: ${theme.shared.border};
70
+ }
71
+
72
+ &::after {
73
+ content: '';
74
+ position: absolute;
75
+ bottom: 0;
76
+ left: 0;
77
+ right: 0;
78
+ height: ${theme.shared.selected.border.size};
79
+ background: transparent;
80
+ }
81
+ `}
82
+
83
+ ${orientation === "vertical" && _emotion_react.css`
84
+ border-bottom: ${theme.shared.border};
85
+ padding-right: ${theme.shared.padding.verticalRight};
86
+ ${hasIcon && _emotion_react.css`
87
+ padding-right: ${theme.shared.padding.withIcon.verticalRight};
88
+ `}
89
+
90
+ &:first-child {
91
+ border-top: ${theme.shared.border};
92
+ }
93
+
94
+ &::after {
95
+ content: '';
96
+ position: absolute;
97
+ top: 0;
98
+ bottom: 0;
99
+ right: 0;
100
+ width: ${theme.shared.selected.border.size};
101
+ background: transparent;
102
+ }
103
+ `}
104
+ `;
105
+ };
106
+ const defaultTabListTheme = require_tabs.componentTabs.tabList;
107
+ const tabListStyles = (theme) => {
108
+ return _emotion_react.css`
109
+ display: ${theme.shared.display};
110
+
111
+ &[data-orientation='horizontal'] {
112
+ flex-direction: ${theme.shared.orientation.horizontal.flexDirection};
113
+ }
114
+
115
+ &[data-orientation='vertical'] {
116
+ flex-direction: ${theme.shared.orientation.vertical.flexDirection};
117
+ }
118
+ `;
119
+ };
120
+ const defaultTabPanelsTheme = require_tabs.componentTabs.tabPanels;
121
+ const tabPanelsStyles = (theme) => {
122
+ return _emotion_react.css`
123
+ position: ${theme.shared.position};
124
+ height: var(--tab-panel-height, auto);
125
+ width: var(--tab-panel-width, auto);
126
+ overflow: ${theme.shared.overflow};
127
+ `;
128
+ };
129
+ const defaultTabPanelTheme = require_tabs.componentTabs.tabPanel;
130
+ const tabPanelStyles = (theme) => {
131
+ return _emotion_react.css`
132
+ /* TODO: Designs to be provided for tab panel */
133
+ position: ${theme.shared.position};
134
+ `;
135
+ };
136
+ //#endregion
137
+ exports.defaultTabListTheme = defaultTabListTheme;
138
+ exports.defaultTabPanelTheme = defaultTabPanelTheme;
139
+ exports.defaultTabPanelsTheme = defaultTabPanelsTheme;
140
+ exports.defaultTabTheme = defaultTabTheme;
141
+ exports.defaultTabsTheme = defaultTabsTheme;
142
+ exports.tabListStyles = tabListStyles;
143
+ exports.tabPanelStyles = tabPanelStyles;
144
+ exports.tabPanelsStyles = tabPanelsStyles;
145
+ exports.tabStyles = tabStyles;
146
+ exports.tabsStyles = tabsStyles;
@@ -0,0 +1,17 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.cjs";
2
+ import { ComponentTabs } from "../../styleD/build/typescript/component/tabs.cjs";
3
+ import { SerializedStyles } from "@emotion/react";
4
+
5
+ //#region src/components/Tabs/styles.d.ts
6
+ type TabsTheme = Prettify<ComponentTabs['tabs']>;
7
+ type PartialTabsTheme = DeepPartial<TabsTheme>;
8
+ type TabTheme = Prettify<ComponentTabs['tab']>;
9
+ type PartialTabTheme = DeepPartial<TabTheme>;
10
+ type TabListTheme = Prettify<ComponentTabs['tabList']>;
11
+ type PartialTabListTheme = DeepPartial<TabListTheme>;
12
+ type TabPanelsTheme = Prettify<ComponentTabs['tabPanels']>;
13
+ type PartialTabPanelsTheme = DeepPartial<TabPanelsTheme>;
14
+ type TabPanelTheme = Prettify<ComponentTabs['tabPanel']>;
15
+ type PartialTabPanelTheme = DeepPartial<TabPanelTheme>;
16
+ //#endregion
17
+ export { PartialTabListTheme, PartialTabPanelTheme, PartialTabPanelsTheme, PartialTabTheme, PartialTabsTheme, TabListTheme, TabPanelTheme, TabPanelsTheme, TabTheme, TabsTheme };
@@ -0,0 +1,17 @@
1
+ import { DeepPartial, Prettify } from "../../util/types.js";
2
+ import { ComponentTabs } from "../../styleD/build/typescript/component/tabs.js";
3
+ import { SerializedStyles } from "@emotion/react";
4
+
5
+ //#region src/components/Tabs/styles.d.ts
6
+ type TabsTheme = Prettify<ComponentTabs['tabs']>;
7
+ type PartialTabsTheme = DeepPartial<TabsTheme>;
8
+ type TabTheme = Prettify<ComponentTabs['tab']>;
9
+ type PartialTabTheme = DeepPartial<TabTheme>;
10
+ type TabListTheme = Prettify<ComponentTabs['tabList']>;
11
+ type PartialTabListTheme = DeepPartial<TabListTheme>;
12
+ type TabPanelsTheme = Prettify<ComponentTabs['tabPanels']>;
13
+ type PartialTabPanelsTheme = DeepPartial<TabPanelsTheme>;
14
+ type TabPanelTheme = Prettify<ComponentTabs['tabPanel']>;
15
+ type PartialTabPanelTheme = DeepPartial<TabPanelTheme>;
16
+ //#endregion
17
+ export { PartialTabListTheme, PartialTabPanelTheme, PartialTabPanelsTheme, PartialTabTheme, PartialTabsTheme, TabListTheme, TabPanelTheme, TabPanelsTheme, TabTheme, TabsTheme };
@@ -0,0 +1,137 @@
1
+ import { convertTypographyToEmotionStringStyle } from "../../styleD/utils/semantic/typography.js";
2
+ import { componentTabs } from "../../styleD/build/typescript/component/tabs.js";
3
+ import { css } from "@emotion/react";
4
+ //#region src/components/Tabs/styles.ts
5
+ const defaultTabsTheme = componentTabs.tabs;
6
+ const tabsStyles = (theme) => {
7
+ return css`
8
+ display: ${theme.shared.display};
9
+ max-width: ${theme.shared.maxWidth};
10
+
11
+ &[data-orientation='vertical'] {
12
+ flex-direction: ${theme.shared.orientation.vertical.flexDirection};
13
+ width: ${theme.shared.orientation.vertical.width};
14
+ }
15
+
16
+ &[data-orientation='horizontal'] {
17
+ flex-direction: ${theme.shared.orientation.horizontal.flexDirection};
18
+ }
19
+ `;
20
+ };
21
+ const defaultTabTheme = componentTabs.tab;
22
+ const tabStyles = (theme, { orientation, size, icon }) => {
23
+ const hasIcon = !!icon;
24
+ return css`
25
+ position: ${theme.shared.position};
26
+ display: ${theme.shared.display};
27
+ gap: ${theme.shared.gap};
28
+ height: ${theme[size].height};
29
+ cursor: ${theme.shared.cursor};
30
+ flex-direction: ${theme.shared.flexDirection};
31
+ justify-content: ${theme.shared.justifyContent};
32
+ align-items: ${theme.shared.alignItems};
33
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
34
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
35
+ ${hasIcon && css`
36
+ padding-right: ${theme.shared.padding.withIcon.right};
37
+ `}
38
+ color: ${theme.shared.color};
39
+ ${convertTypographyToEmotionStringStyle(theme[size].typography)}
40
+
41
+ &[data-disabled] {
42
+ cursor: ${theme.shared.disabled.cursor};
43
+ color: ${theme.shared.disabled.color};
44
+ }
45
+
46
+ /* Override default browser focus behaviour */
47
+ &:focus-visible {
48
+ outline: none;
49
+ }
50
+
51
+ &[data-focus-visible] {
52
+ outline: ${theme.shared.focusVisible.outline};
53
+ outline-offset: ${theme.shared.focusVisible.outlineOffset};
54
+ }
55
+
56
+ &[data-selected] {
57
+ background: ${theme.shared.selected.background};
58
+ }
59
+
60
+ &[data-hovered]::after,
61
+ &[data-selected]::after {
62
+ background: ${theme.shared.selected.border.background};
63
+ }
64
+
65
+ ${orientation === "horizontal" && css`
66
+ border-right: ${theme.shared.border};
67
+
68
+ &:first-child {
69
+ border-left: ${theme.shared.border};
70
+ }
71
+
72
+ &::after {
73
+ content: '';
74
+ position: absolute;
75
+ bottom: 0;
76
+ left: 0;
77
+ right: 0;
78
+ height: ${theme.shared.selected.border.size};
79
+ background: transparent;
80
+ }
81
+ `}
82
+
83
+ ${orientation === "vertical" && css`
84
+ border-bottom: ${theme.shared.border};
85
+ padding-right: ${theme.shared.padding.verticalRight};
86
+ ${hasIcon && css`
87
+ padding-right: ${theme.shared.padding.withIcon.verticalRight};
88
+ `}
89
+
90
+ &:first-child {
91
+ border-top: ${theme.shared.border};
92
+ }
93
+
94
+ &::after {
95
+ content: '';
96
+ position: absolute;
97
+ top: 0;
98
+ bottom: 0;
99
+ right: 0;
100
+ width: ${theme.shared.selected.border.size};
101
+ background: transparent;
102
+ }
103
+ `}
104
+ `;
105
+ };
106
+ const defaultTabListTheme = componentTabs.tabList;
107
+ const tabListStyles = (theme) => {
108
+ return css`
109
+ display: ${theme.shared.display};
110
+
111
+ &[data-orientation='horizontal'] {
112
+ flex-direction: ${theme.shared.orientation.horizontal.flexDirection};
113
+ }
114
+
115
+ &[data-orientation='vertical'] {
116
+ flex-direction: ${theme.shared.orientation.vertical.flexDirection};
117
+ }
118
+ `;
119
+ };
120
+ const defaultTabPanelsTheme = componentTabs.tabPanels;
121
+ const tabPanelsStyles = (theme) => {
122
+ return css`
123
+ position: ${theme.shared.position};
124
+ height: var(--tab-panel-height, auto);
125
+ width: var(--tab-panel-width, auto);
126
+ overflow: ${theme.shared.overflow};
127
+ `;
128
+ };
129
+ const defaultTabPanelTheme = componentTabs.tabPanel;
130
+ const tabPanelStyles = (theme) => {
131
+ return css`
132
+ /* TODO: Designs to be provided for tab panel */
133
+ position: ${theme.shared.position};
134
+ `;
135
+ };
136
+ //#endregion
137
+ export { defaultTabListTheme, defaultTabPanelTheme, defaultTabPanelsTheme, defaultTabTheme, defaultTabsTheme, tabListStyles, tabPanelStyles, tabPanelsStyles, tabStyles, tabsStyles };
@@ -0,0 +1,63 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.cjs";
2
+ import { IconProps } from "../Icon/types.cjs";
3
+ import { TabListTheme, TabPanelTheme, TabPanelsTheme, TabTheme, TabsTheme } from "./styles.cjs";
4
+ import { TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabsProps } from "react-aria-components";
5
+
6
+ //#region src/components/Tabs/types.d.ts
7
+ interface TabsProps$1 extends DefaultPropsWithChildren<TabsTheme, TabsProps['className']>, Omit<TabsProps, 'children'> {
8
+ /**
9
+ * Size of the tab. Can be either 'sm', 'md'.
10
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
11
+ * @default 'md'
12
+ */
13
+ size?: keyof Omit<TabTheme, 'shared'>;
14
+ }
15
+ interface TabListProps$1 extends DefaultPropsWithChildren<TabListTheme, TabListProps<object>['className']>, Omit<TabListProps<object>, 'children'> {
16
+ /**
17
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
18
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
19
+ * @default 'horizontal'
20
+ */
21
+ orientation?: TabsProps$1['orientation'];
22
+ /**
23
+ * Size of the tab. Can be either 'sm', 'md'.
24
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
25
+ * @default 'md'
26
+ */
27
+ size?: keyof Omit<TabTheme, 'shared'>;
28
+ }
29
+ interface TabProps$1 extends DefaultPropsWithChildren<TabTheme, TabProps['className']>, Omit<TabProps, 'children'> {
30
+ /**
31
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
32
+ * Shouldn't need to set this manually, as it will be inherited from `Tabs` via `TabList`.
33
+ * @default 'horizontal'
34
+ */
35
+ orientation?: TabsProps$1['orientation'];
36
+ /**
37
+ * Size of the tab. Can be either 'sm', 'md'.
38
+ * Shouldn't need to set this manually, as it will be inherited from `Tabs` via `TabList`.
39
+ * @default 'md'
40
+ */
41
+ size?: keyof Omit<TabTheme, 'shared'>;
42
+ /**
43
+ * Icon to display in the tab. Can be either a symbol from the Icon component or a custom ReactNode.
44
+ */
45
+ icon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
46
+ }
47
+ interface TabPanelsProps$1 extends DefaultPropsWithChildren<TabPanelsTheme, TabPanelsProps<object>['className']>, Omit<TabPanelsProps<object>, 'children'> {
48
+ /**
49
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
50
+ * Shouldn't need to set this manually, as it will be inherited from the parent `TabList`.
51
+ * @default 'horizontal'
52
+ */
53
+ orientation?: TabsProps$1['orientation'];
54
+ /**
55
+ * Size of the tab. Can be either 'sm', 'md'.
56
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
57
+ * @default 'md'
58
+ */
59
+ size?: keyof Omit<TabTheme, 'shared'>;
60
+ }
61
+ interface TabPanelProps$1 extends DefaultPropsWithChildren<TabPanelTheme, TabPanelProps['className']>, Omit<TabPanelProps, 'children'> {}
62
+ //#endregion
63
+ export { TabListProps$1 as TabListProps, TabPanelProps$1 as TabPanelProps, TabPanelsProps$1 as TabPanelsProps, TabProps$1 as TabProps, TabsProps$1 as TabsProps };
@@ -0,0 +1,63 @@
1
+ import { DefaultPropsWithChildren } from "../../util/types.js";
2
+ import { IconProps } from "../Icon/types.js";
3
+ import { TabListTheme, TabPanelTheme, TabPanelsTheme, TabTheme, TabsTheme } from "./styles.js";
4
+ import { TabListProps, TabPanelProps, TabPanelsProps, TabProps, TabsProps } from "react-aria-components";
5
+
6
+ //#region src/components/Tabs/types.d.ts
7
+ interface TabsProps$1 extends DefaultPropsWithChildren<TabsTheme, TabsProps['className']>, Omit<TabsProps, 'children'> {
8
+ /**
9
+ * Size of the tab. Can be either 'sm', 'md'.
10
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
11
+ * @default 'md'
12
+ */
13
+ size?: keyof Omit<TabTheme, 'shared'>;
14
+ }
15
+ interface TabListProps$1 extends DefaultPropsWithChildren<TabListTheme, TabListProps<object>['className']>, Omit<TabListProps<object>, 'children'> {
16
+ /**
17
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
18
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
19
+ * @default 'horizontal'
20
+ */
21
+ orientation?: TabsProps$1['orientation'];
22
+ /**
23
+ * Size of the tab. Can be either 'sm', 'md'.
24
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
25
+ * @default 'md'
26
+ */
27
+ size?: keyof Omit<TabTheme, 'shared'>;
28
+ }
29
+ interface TabProps$1 extends DefaultPropsWithChildren<TabTheme, TabProps['className']>, Omit<TabProps, 'children'> {
30
+ /**
31
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
32
+ * Shouldn't need to set this manually, as it will be inherited from `Tabs` via `TabList`.
33
+ * @default 'horizontal'
34
+ */
35
+ orientation?: TabsProps$1['orientation'];
36
+ /**
37
+ * Size of the tab. Can be either 'sm', 'md'.
38
+ * Shouldn't need to set this manually, as it will be inherited from `Tabs` via `TabList`.
39
+ * @default 'md'
40
+ */
41
+ size?: keyof Omit<TabTheme, 'shared'>;
42
+ /**
43
+ * Icon to display in the tab. Can be either a symbol from the Icon component or a custom ReactNode.
44
+ */
45
+ icon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
46
+ }
47
+ interface TabPanelsProps$1 extends DefaultPropsWithChildren<TabPanelsTheme, TabPanelsProps<object>['className']>, Omit<TabPanelsProps<object>, 'children'> {
48
+ /**
49
+ * Orientation of the tabs. Can be either 'horizontal' or 'vertical'.
50
+ * Shouldn't need to set this manually, as it will be inherited from the parent `TabList`.
51
+ * @default 'horizontal'
52
+ */
53
+ orientation?: TabsProps$1['orientation'];
54
+ /**
55
+ * Size of the tab. Can be either 'sm', 'md'.
56
+ * Shouldn't need to set this manually, as it will be inherited from the parent `Tabs`.
57
+ * @default 'md'
58
+ */
59
+ size?: keyof Omit<TabTheme, 'shared'>;
60
+ }
61
+ interface TabPanelProps$1 extends DefaultPropsWithChildren<TabPanelTheme, TabPanelProps['className']>, Omit<TabPanelProps, 'children'> {}
62
+ //#endregion
63
+ export { TabListProps$1 as TabListProps, TabPanelProps$1 as TabPanelProps, TabPanelsProps$1 as TabPanelsProps, TabProps$1 as TabProps, TabsProps$1 as TabsProps };
package/dist/index.cjs CHANGED
@@ -26,6 +26,7 @@ const require_textArea = require("./styleD/build/typescript/component/textArea.c
26
26
  const require_textInput = require("./styleD/build/typescript/component/textInput.cjs");
27
27
  const require_topBar = require("./styleD/build/typescript/component/topBar.cjs");
28
28
  const require_typography = require("./styleD/build/typescript/component/typography.cjs");
29
+ const require_tabs = require("./styleD/build/typescript/component/tabs.cjs");
29
30
  const require_colors = require("./styleD/build/typescript/base/colors.cjs");
30
31
  const require_radius = require("./styleD/build/typescript/base/radius.cjs");
31
32
  const require_sizing = require("./styleD/build/typescript/base/sizing.cjs");
@@ -63,6 +64,7 @@ exports.componentMenu = require_menu.componentMenu;
63
64
  exports.componentModal = require_modal.componentModal;
64
65
  exports.componentRadioGroup = require_radioGroup.componentRadioGroup;
65
66
  exports.componentSelect = require_select.componentSelect;
67
+ exports.componentTabs = require_tabs.componentTabs;
66
68
  exports.componentTagTable = require_tagTable.componentTagTable;
67
69
  exports.componentTextArea = require_textArea.componentTextArea;
68
70
  exports.componentTextInput = require_textInput.componentTextInput;
package/dist/index.d.cts CHANGED
@@ -20,6 +20,7 @@ import { ComponentMenu, componentMenu } from "./styleD/build/typescript/componen
20
20
  import { ComponentModal, componentModal } from "./styleD/build/typescript/component/modal.cjs";
21
21
  import { ComponentRadioGroup, componentRadioGroup } from "./styleD/build/typescript/component/radioGroup.cjs";
22
22
  import { ComponentSelect, componentSelect } from "./styleD/build/typescript/component/select.cjs";
23
+ import { ComponentTabs, componentTabs } from "./styleD/build/typescript/component/tabs.cjs";
23
24
  import { ComponentAutocomplete, componentAutocomplete } from "./styleD/build/typescript/component/autocomplete.cjs";
24
25
  import { ComponentTagTable, componentTagTable } from "./styleD/build/typescript/component/tagTable.cjs";
25
26
  import { ComponentTextArea, componentTextArea } from "./styleD/build/typescript/component/textArea.cjs";
@@ -37,4 +38,4 @@ import { SemanticSizing, semanticSizing } from "./styleD/build/typescript/semant
37
38
  import { SemanticShadow, semanticShadow } from "./styleD/build/typescript/semantic/shadow.cjs";
38
39
  import { SemanticRadius, semanticRadius } from "./styleD/build/typescript/semantic/radius.cjs";
39
40
  import { SemanticSpacing, semanticSpacing } from "./styleD/build/typescript/semantic/spacing.cjs";
40
- export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentRadioGroup, type ComponentSelect, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTopBar, type ComponentTypography, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
41
+ export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentRadioGroup, type ComponentSelect, type ComponentTabs, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTopBar, type ComponentTypography, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTabs, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import { ComponentMenu, componentMenu } from "./styleD/build/typescript/componen
20
20
  import { ComponentModal, componentModal } from "./styleD/build/typescript/component/modal.js";
21
21
  import { ComponentRadioGroup, componentRadioGroup } from "./styleD/build/typescript/component/radioGroup.js";
22
22
  import { ComponentSelect, componentSelect } from "./styleD/build/typescript/component/select.js";
23
+ import { ComponentTabs, componentTabs } from "./styleD/build/typescript/component/tabs.js";
23
24
  import { ComponentAutocomplete, componentAutocomplete } from "./styleD/build/typescript/component/autocomplete.js";
24
25
  import { ComponentTagTable, componentTagTable } from "./styleD/build/typescript/component/tagTable.js";
25
26
  import { ComponentTextArea, componentTextArea } from "./styleD/build/typescript/component/textArea.js";
@@ -37,4 +38,4 @@ import { SemanticSizing, semanticSizing } from "./styleD/build/typescript/semant
37
38
  import { SemanticShadow, semanticShadow } from "./styleD/build/typescript/semantic/shadow.js";
38
39
  import { SemanticRadius, semanticRadius } from "./styleD/build/typescript/semantic/radius.js";
39
40
  import { SemanticSpacing, semanticSpacing } from "./styleD/build/typescript/semantic/spacing.js";
40
- export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentRadioGroup, type ComponentSelect, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTopBar, type ComponentTypography, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
41
+ export { type BaseColors, type BaseRadius, type BaseSizing, type BaseSpacing, type BaseTypography, type ComponentAlertBanner, type ComponentAutocomplete, type ComponentAvatar, type ComponentButton, type ComponentButtonGroup, type ComponentByline, type ComponentCheckbox, type ComponentDatePicker, type ComponentFavicon, type ComponentForm, type ComponentGrid, type ComponentIcon, type ComponentInlineMessage, type ComponentIntendedAudienceSignifier, type ComponentLayout, type ComponentLink, type ComponentMenu, type ComponentModal, type ComponentRadioGroup, type ComponentSelect, type ComponentTabs, type ComponentTagTable, type ComponentTextArea, type ComponentTextInput, type ComponentTopBar, type ComponentTypography, type ComponentUserMenu, type SemanticBreakpoints, type SemanticColors, type SemanticGrid, type SemanticRadius, type SemanticShadow, type SemanticSizing, type SemanticSpacing, type SemanticTypography, baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTabs, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ import { componentTextArea } from "./styleD/build/typescript/component/textArea.
25
25
  import { componentTextInput } from "./styleD/build/typescript/component/textInput.js";
26
26
  import { componentTopBar } from "./styleD/build/typescript/component/topBar.js";
27
27
  import { componentTypography } from "./styleD/build/typescript/component/typography.js";
28
+ import { componentTabs } from "./styleD/build/typescript/component/tabs.js";
28
29
  import { baseColors } from "./styleD/build/typescript/base/colors.js";
29
30
  import { baseRadius } from "./styleD/build/typescript/base/radius.js";
30
31
  import { baseSizing } from "./styleD/build/typescript/base/sizing.js";
@@ -37,4 +38,4 @@ import { semanticSizing } from "./styleD/build/typescript/semantic/sizing.js";
37
38
  import { semanticShadow } from "./styleD/build/typescript/semantic/shadow.js";
38
39
  import { semanticRadius } from "./styleD/build/typescript/semantic/radius.js";
39
40
  import { semanticSpacing } from "./styleD/build/typescript/semantic/spacing.js";
40
- export { baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
41
+ export { baseColors, baseRadius, baseSizing, baseSpacing, baseTypography, componentAlertBanner, componentAutocomplete, componentAvatar, componentButton, componentButtonGroup, componentByline, componentCheckbox, componentDatePicker, componentFavicon, componentForm, componentGrid, componentIcon, componentInlineMessage, componentIntendedAudienceSignifier, componentLayout, componentLink, componentMenu, componentModal, componentRadioGroup, componentSelect, componentTabs, componentTagTable, componentTextArea, componentTextInput, componentTopBar, componentTypography, componentUserMenu, semanticBreakpoints, semanticColors, semanticGrid, semanticRadius, semanticShadow, semanticSizing, semanticSpacing, semanticTypography };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */
4
+
5
+ :root {
6
+ --component-tabs-tabs-shared-display: flex;
7
+ --component-tabs-tabs-shared-max-width: 100%;
8
+ --component-tabs-tabs-shared-orientation-vertical-flex-direction: row;
9
+ --component-tabs-tabs-shared-orientation-vertical-width: 100%;
10
+ --component-tabs-tabs-shared-orientation-horizontal-flex-direction: column;
11
+ --component-tabs-tab-shared-position: relative;
12
+ --component-tabs-tab-shared-display: inline-flex;
13
+ --component-tabs-tab-shared-gap: 0.375rem;
14
+ --component-tabs-tab-shared-cursor: pointer;
15
+ --component-tabs-tab-shared-flex-direction: row;
16
+ --component-tabs-tab-shared-justify-content: center;
17
+ --component-tabs-tab-shared-align-items: center;
18
+ --component-tabs-tab-shared-padding-top: 0;
19
+ --component-tabs-tab-shared-padding-bottom: 0;
20
+ --component-tabs-tab-shared-padding-left: 1rem;
21
+ --component-tabs-tab-shared-padding-right: 1rem;
22
+ --component-tabs-tab-shared-padding-vertical-right: 1.25rem;
23
+ --component-tabs-tab-shared-padding-with-icon-right: 1.25rem;
24
+ --component-tabs-tab-shared-padding-with-icon-vertical-right: 1.5rem;
25
+ --component-tabs-tab-shared-color: #545454;
26
+ --component-tabs-tab-shared-border: 0.0625rem solid #cccccc;
27
+ --component-tabs-tab-shared-selected-background: #f6f6f6;
28
+ --component-tabs-tab-shared-selected-border-border: 0.5rem solid #0072a9;
29
+ --component-tabs-tab-shared-selected-border-size: 0.5rem;
30
+ --component-tabs-tab-shared-selected-border-background: #0072a9;
31
+ --component-tabs-tab-shared-disabled-cursor: not-allowed;
32
+ --component-tabs-tab-shared-disabled-color: #999999;
33
+ --component-tabs-tab-shared-focus-visible-outline: 0.125rem solid #0072a9;
34
+ --component-tabs-tab-shared-focus-visible-outline-offset: -0.0625rem;
35
+ --component-tabs-tab-md-height: 3rem;
36
+ --component-tabs-tab-md-typography-font: normal 700 1rem/1.15 'Open Sans';
37
+ --component-tabs-tab-md-typography-letter-spacing: -0.03125rem;
38
+ --component-tabs-tab-md-typography-font-width: 95;
39
+ --component-tabs-tab-sm-height: 2.5rem;
40
+ --component-tabs-tab-sm-typography-font: normal 700 0.875rem/1.15 'Open Sans';
41
+ --component-tabs-tab-sm-typography-letter-spacing: -0.0125rem;
42
+ --component-tabs-tab-sm-typography-font-width: 95;
43
+ --component-tabs-tab-list-shared-display: flex;
44
+ --component-tabs-tab-list-shared-orientation-horizontal-flex-direction: row;
45
+ --component-tabs-tab-list-shared-orientation-vertical-flex-direction: column;
46
+ --component-tabs-tab-panels-shared-position: relative;
47
+ --component-tabs-tab-panels-shared-overflow: clip;
48
+ --component-tabs-tab-panel-shared-position: initial;
49
+ }
@@ -0,0 +1,87 @@
1
+ //#region src/styleD/build/typescript/component/tabs.ts
2
+ /**
3
+ * Do not edit directly, this file was auto-generated.
4
+ */
5
+ const componentTabs = {
6
+ tabs: { shared: {
7
+ display: "flex",
8
+ maxWidth: "100%",
9
+ orientation: {
10
+ vertical: {
11
+ flexDirection: "row",
12
+ width: "100%"
13
+ },
14
+ horizontal: { flexDirection: "column" }
15
+ }
16
+ } },
17
+ tab: {
18
+ shared: {
19
+ position: "relative",
20
+ display: "inline-flex",
21
+ gap: "0.375rem",
22
+ cursor: "pointer",
23
+ flexDirection: "row",
24
+ justifyContent: "center",
25
+ alignItems: "center",
26
+ padding: {
27
+ top: "0",
28
+ bottom: "0",
29
+ left: "1rem",
30
+ right: "1rem",
31
+ verticalRight: "1.25rem",
32
+ withIcon: {
33
+ right: "1.25rem",
34
+ verticalRight: "1.5rem"
35
+ }
36
+ },
37
+ color: "#545454",
38
+ border: "0.0625rem solid #cccccc",
39
+ selected: {
40
+ background: "#f6f6f6",
41
+ border: {
42
+ border: "0.5rem solid #0072a9",
43
+ size: "0.5rem",
44
+ background: "#0072a9"
45
+ }
46
+ },
47
+ disabled: {
48
+ cursor: "not-allowed",
49
+ color: "#999999"
50
+ },
51
+ focusVisible: {
52
+ outline: "0.125rem solid #0072a9",
53
+ outlineOffset: "-0.0625rem"
54
+ }
55
+ },
56
+ md: {
57
+ height: "3rem",
58
+ typography: {
59
+ font: "normal 700 1rem/1.15 Open Sans",
60
+ letterSpacing: "-0.03125rem",
61
+ fontWidth: 95
62
+ }
63
+ },
64
+ sm: {
65
+ height: "2.5rem",
66
+ typography: {
67
+ font: "normal 700 0.875rem/1.15 Open Sans",
68
+ letterSpacing: "-0.0125rem",
69
+ fontWidth: 95
70
+ }
71
+ }
72
+ },
73
+ tabList: { shared: {
74
+ display: "flex",
75
+ orientation: {
76
+ horizontal: { flexDirection: "row" },
77
+ vertical: { flexDirection: "column" }
78
+ }
79
+ } },
80
+ tabPanels: { shared: {
81
+ position: "relative",
82
+ overflow: "clip"
83
+ } },
84
+ tabPanel: { shared: { position: "initial" } }
85
+ };
86
+ //#endregion
87
+ exports.componentTabs = componentTabs;
@@ -0,0 +1,104 @@
1
+ //#region src/styleD/build/typescript/component/tabs.d.ts
2
+ /**
3
+ * Do not edit directly, this file was auto-generated.
4
+ */
5
+ declare const componentTabs: {
6
+ tabs: {
7
+ shared: {
8
+ display: string;
9
+ maxWidth: string;
10
+ orientation: {
11
+ vertical: {
12
+ flexDirection: string;
13
+ width: string;
14
+ };
15
+ horizontal: {
16
+ flexDirection: string;
17
+ };
18
+ };
19
+ };
20
+ };
21
+ tab: {
22
+ shared: {
23
+ position: string;
24
+ display: string;
25
+ gap: string;
26
+ cursor: string;
27
+ flexDirection: string;
28
+ justifyContent: string;
29
+ alignItems: string;
30
+ padding: {
31
+ top: string;
32
+ bottom: string;
33
+ left: string;
34
+ right: string;
35
+ verticalRight: string;
36
+ withIcon: {
37
+ right: string;
38
+ verticalRight: string;
39
+ };
40
+ };
41
+ color: string;
42
+ border: string;
43
+ selected: {
44
+ background: string;
45
+ border: {
46
+ border: string;
47
+ size: string;
48
+ background: string;
49
+ };
50
+ };
51
+ disabled: {
52
+ cursor: string;
53
+ color: string;
54
+ };
55
+ focusVisible: {
56
+ outline: string;
57
+ outlineOffset: string;
58
+ };
59
+ };
60
+ md: {
61
+ height: string;
62
+ typography: {
63
+ font: string;
64
+ letterSpacing: string;
65
+ fontWidth: number;
66
+ };
67
+ };
68
+ sm: {
69
+ height: string;
70
+ typography: {
71
+ font: string;
72
+ letterSpacing: string;
73
+ fontWidth: number;
74
+ };
75
+ };
76
+ };
77
+ tabList: {
78
+ shared: {
79
+ display: string;
80
+ orientation: {
81
+ horizontal: {
82
+ flexDirection: string;
83
+ };
84
+ vertical: {
85
+ flexDirection: string;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ tabPanels: {
91
+ shared: {
92
+ position: string;
93
+ overflow: string;
94
+ };
95
+ };
96
+ tabPanel: {
97
+ shared: {
98
+ position: string;
99
+ };
100
+ };
101
+ };
102
+ type ComponentTabs = typeof componentTabs;
103
+ //#endregion
104
+ export { ComponentTabs, componentTabs };
@@ -0,0 +1,104 @@
1
+ //#region src/styleD/build/typescript/component/tabs.d.ts
2
+ /**
3
+ * Do not edit directly, this file was auto-generated.
4
+ */
5
+ declare const componentTabs: {
6
+ tabs: {
7
+ shared: {
8
+ display: string;
9
+ maxWidth: string;
10
+ orientation: {
11
+ vertical: {
12
+ flexDirection: string;
13
+ width: string;
14
+ };
15
+ horizontal: {
16
+ flexDirection: string;
17
+ };
18
+ };
19
+ };
20
+ };
21
+ tab: {
22
+ shared: {
23
+ position: string;
24
+ display: string;
25
+ gap: string;
26
+ cursor: string;
27
+ flexDirection: string;
28
+ justifyContent: string;
29
+ alignItems: string;
30
+ padding: {
31
+ top: string;
32
+ bottom: string;
33
+ left: string;
34
+ right: string;
35
+ verticalRight: string;
36
+ withIcon: {
37
+ right: string;
38
+ verticalRight: string;
39
+ };
40
+ };
41
+ color: string;
42
+ border: string;
43
+ selected: {
44
+ background: string;
45
+ border: {
46
+ border: string;
47
+ size: string;
48
+ background: string;
49
+ };
50
+ };
51
+ disabled: {
52
+ cursor: string;
53
+ color: string;
54
+ };
55
+ focusVisible: {
56
+ outline: string;
57
+ outlineOffset: string;
58
+ };
59
+ };
60
+ md: {
61
+ height: string;
62
+ typography: {
63
+ font: string;
64
+ letterSpacing: string;
65
+ fontWidth: number;
66
+ };
67
+ };
68
+ sm: {
69
+ height: string;
70
+ typography: {
71
+ font: string;
72
+ letterSpacing: string;
73
+ fontWidth: number;
74
+ };
75
+ };
76
+ };
77
+ tabList: {
78
+ shared: {
79
+ display: string;
80
+ orientation: {
81
+ horizontal: {
82
+ flexDirection: string;
83
+ };
84
+ vertical: {
85
+ flexDirection: string;
86
+ };
87
+ };
88
+ };
89
+ };
90
+ tabPanels: {
91
+ shared: {
92
+ position: string;
93
+ overflow: string;
94
+ };
95
+ };
96
+ tabPanel: {
97
+ shared: {
98
+ position: string;
99
+ };
100
+ };
101
+ };
102
+ type ComponentTabs = typeof componentTabs;
103
+ //#endregion
104
+ export { ComponentTabs, componentTabs };
@@ -0,0 +1,87 @@
1
+ //#region src/styleD/build/typescript/component/tabs.ts
2
+ /**
3
+ * Do not edit directly, this file was auto-generated.
4
+ */
5
+ const componentTabs = {
6
+ tabs: { shared: {
7
+ display: "flex",
8
+ maxWidth: "100%",
9
+ orientation: {
10
+ vertical: {
11
+ flexDirection: "row",
12
+ width: "100%"
13
+ },
14
+ horizontal: { flexDirection: "column" }
15
+ }
16
+ } },
17
+ tab: {
18
+ shared: {
19
+ position: "relative",
20
+ display: "inline-flex",
21
+ gap: "0.375rem",
22
+ cursor: "pointer",
23
+ flexDirection: "row",
24
+ justifyContent: "center",
25
+ alignItems: "center",
26
+ padding: {
27
+ top: "0",
28
+ bottom: "0",
29
+ left: "1rem",
30
+ right: "1rem",
31
+ verticalRight: "1.25rem",
32
+ withIcon: {
33
+ right: "1.25rem",
34
+ verticalRight: "1.5rem"
35
+ }
36
+ },
37
+ color: "#545454",
38
+ border: "0.0625rem solid #cccccc",
39
+ selected: {
40
+ background: "#f6f6f6",
41
+ border: {
42
+ border: "0.5rem solid #0072a9",
43
+ size: "0.5rem",
44
+ background: "#0072a9"
45
+ }
46
+ },
47
+ disabled: {
48
+ cursor: "not-allowed",
49
+ color: "#999999"
50
+ },
51
+ focusVisible: {
52
+ outline: "0.125rem solid #0072a9",
53
+ outlineOffset: "-0.0625rem"
54
+ }
55
+ },
56
+ md: {
57
+ height: "3rem",
58
+ typography: {
59
+ font: "normal 700 1rem/1.15 Open Sans",
60
+ letterSpacing: "-0.03125rem",
61
+ fontWidth: 95
62
+ }
63
+ },
64
+ sm: {
65
+ height: "2.5rem",
66
+ typography: {
67
+ font: "normal 700 0.875rem/1.15 Open Sans",
68
+ letterSpacing: "-0.0125rem",
69
+ fontWidth: 95
70
+ }
71
+ }
72
+ },
73
+ tabList: { shared: {
74
+ display: "flex",
75
+ orientation: {
76
+ horizontal: { flexDirection: "row" },
77
+ vertical: { flexDirection: "column" }
78
+ }
79
+ } },
80
+ tabPanels: { shared: {
81
+ position: "relative",
82
+ overflow: "clip"
83
+ } },
84
+ tabPanel: { shared: { position: "initial" } }
85
+ };
86
+ //#endregion
87
+ export { componentTabs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "repository": {
5
5
  "url": "https://github.com/guardian/stand"
6
6
  },
@@ -317,6 +317,16 @@
317
317
  "default": "./dist/Modal.cjs"
318
318
  }
319
319
  },
320
+ "./Tabs": {
321
+ "import": {
322
+ "types": "./dist/Tabs.d.ts",
323
+ "default": "./dist/Tabs.js"
324
+ },
325
+ "require": {
326
+ "types": "./dist/Tabs.d.cts",
327
+ "default": "./dist/Tabs.cjs"
328
+ }
329
+ },
320
330
  "./utils": {
321
331
  "import": {
322
332
  "types": "./dist/utils.d.ts",
@@ -370,7 +380,8 @@
370
380
  "./component/link.css": "./dist/styleD/build/css/component/link.css",
371
381
  "./component/grid.css": "./dist/styleD/build/css/component/grid.css",
372
382
  "./component/layout.css": "./dist/styleD/build/css/component/layout.css",
373
- "./component/modal.css": "./dist/styleD/build/css/component/modal.css"
383
+ "./component/modal.css": "./dist/styleD/build/css/component/modal.css",
384
+ "./component/tabs.css": "./dist/styleD/build/css/component/tabs.css"
374
385
  },
375
386
  "main": "./dist/index.cjs",
376
387
  "module": "./dist/index.js",
@@ -469,6 +480,9 @@
469
480
  ],
470
481
  "Modal": [
471
482
  "./dist/Modal.d.ts"
483
+ ],
484
+ "Tabs": [
485
+ "./dist/Tabs.d.ts"
472
486
  ]
473
487
  }
474
488
  },
@@ -515,7 +529,7 @@
515
529
  "prosemirror-view": "1.37.2",
516
530
  "publint": "0.3.21",
517
531
  "react": "17.0.2",
518
- "react-aria-components": "1.13.0",
532
+ "react-aria-components": "1.14.0",
519
533
  "react-dom": "17.0.2",
520
534
  "remark-gfm": "4.0.1",
521
535
  "rimraf": "6.1.3",
@@ -540,7 +554,7 @@
540
554
  "prosemirror-state": "^1.4.3",
541
555
  "prosemirror-view": "^1.37.2",
542
556
  "react": "^17.0.2 || ^18.0.0 || ^19.0.0",
543
- "react-aria-components": ">= 1.13.0 <= 1.18.0",
557
+ "react-aria-components": ">= 1.14.0 <= 1.19.0",
544
558
  "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
545
559
  "typescript": ">=5.0.0 <=5.9.3"
546
560
  },