From a046fa3907efa85482bd9bce60de44ea2253be55 Mon Sep 17 00:00:00 2001 From: Francisco Ramos Date: Wed, 22 Mar 2023 09:06:45 +0100 Subject: [PATCH] feat(bridge-ui): Tabs Component (#13380) --- packages/bridge-ui/src/App.svelte | 1 + .../bridge-ui/src/components/Tabs/Tab.svelte | 24 +++++++ .../src/components/Tabs/TabList.svelte | 3 + .../src/components/Tabs/TabPanel.svelte | 16 +++++ .../bridge-ui/src/components/Tabs/Tabs.svelte | 17 +++++ .../bridge-ui/src/components/Tabs/index.ts | 4 ++ packages/bridge-ui/src/pages/home/Home.svelte | 65 ++++++++++--------- 7 files changed, 101 insertions(+), 29 deletions(-) create mode 100644 packages/bridge-ui/src/components/Tabs/Tab.svelte create mode 100644 packages/bridge-ui/src/components/Tabs/TabList.svelte create mode 100644 packages/bridge-ui/src/components/Tabs/TabPanel.svelte create mode 100644 packages/bridge-ui/src/components/Tabs/Tabs.svelte create mode 100644 packages/bridge-ui/src/components/Tabs/index.ts diff --git a/packages/bridge-ui/src/App.svelte b/packages/bridge-ui/src/App.svelte index efcacff5f57..f2abd6c37fa 100644 --- a/packages/bridge-ui/src/App.svelte +++ b/packages/bridge-ui/src/App.svelte @@ -242,6 +242,7 @@ pausable: false, }; + // TODO: Not found route const routes = { '/:tab?': wrap({ component: Home, diff --git a/packages/bridge-ui/src/components/Tabs/Tab.svelte b/packages/bridge-ui/src/components/Tabs/Tab.svelte new file mode 100644 index 00000000000..341cbd1abd6 --- /dev/null +++ b/packages/bridge-ui/src/components/Tabs/Tab.svelte @@ -0,0 +1,24 @@ + + + ($activeTab = name)} + {href} + use:link> + + diff --git a/packages/bridge-ui/src/components/Tabs/TabList.svelte b/packages/bridge-ui/src/components/Tabs/TabList.svelte new file mode 100644 index 00000000000..f4ee3e9e0c9 --- /dev/null +++ b/packages/bridge-ui/src/components/Tabs/TabList.svelte @@ -0,0 +1,3 @@ +
+ +
diff --git a/packages/bridge-ui/src/components/Tabs/TabPanel.svelte b/packages/bridge-ui/src/components/Tabs/TabPanel.svelte new file mode 100644 index 00000000000..64d24625ffb --- /dev/null +++ b/packages/bridge-ui/src/components/Tabs/TabPanel.svelte @@ -0,0 +1,16 @@ + + +
+ +
diff --git a/packages/bridge-ui/src/components/Tabs/Tabs.svelte b/packages/bridge-ui/src/components/Tabs/Tabs.svelte new file mode 100644 index 00000000000..62d494e78d0 --- /dev/null +++ b/packages/bridge-ui/src/components/Tabs/Tabs.svelte @@ -0,0 +1,17 @@ + + + + +
+ +
diff --git a/packages/bridge-ui/src/components/Tabs/index.ts b/packages/bridge-ui/src/components/Tabs/index.ts new file mode 100644 index 00000000000..bf3b89282c0 --- /dev/null +++ b/packages/bridge-ui/src/components/Tabs/index.ts @@ -0,0 +1,4 @@ +export { default as Tabs } from './Tabs.svelte'; +export { default as TabList } from './TabList.svelte'; +export { default as Tab } from './Tab.svelte'; +export { default as TabPanel } from './TabPanel.svelte'; diff --git a/packages/bridge-ui/src/pages/home/Home.svelte b/packages/bridge-ui/src/pages/home/Home.svelte index f6296d722b2..b4d1903f9d3 100644 --- a/packages/bridge-ui/src/pages/home/Home.svelte +++ b/packages/bridge-ui/src/pages/home/Home.svelte @@ -1,18 +1,30 @@