From 1ede3f2cb0238de440e22b9d2bc02da9f2f76311 Mon Sep 17 00:00:00 2001 From: vicky-comeau <110498164+vicky-comeau@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:20:15 -0400 Subject: [PATCH] Feat: [HOP-68, HOP-69] Data Viz tokens and color sections (#81) --- .changeset/proud-clocks-worry.md | 6 + .../components/tableSection/TableSection.tsx | 2 + apps/docs/components/tabs/Tabs.tsx | 16 +- apps/docs/content/tokens/semantic/color.mdx | 312 ++++- apps/docs/datas/tokens-dark.json | 20 + apps/docs/datas/tokens.json | 1060 +++++++++++++++ .../tokens/src/style-dictionary/config.ts | 2 +- .../tokens/semantic/dark/dataViz.tokens.json | 22 + .../tokens/semantic/light/dataViz.tokens.json | 1134 +++++++++++++++++ 9 files changed, 2561 insertions(+), 13 deletions(-) create mode 100644 .changeset/proud-clocks-worry.md create mode 100644 packages/tokens/src/tokens/semantic/dark/dataViz.tokens.json create mode 100644 packages/tokens/src/tokens/semantic/light/dataViz.tokens.json diff --git a/.changeset/proud-clocks-worry.md b/.changeset/proud-clocks-worry.md new file mode 100644 index 000000000..b33ecacf8 --- /dev/null +++ b/.changeset/proud-clocks-worry.md @@ -0,0 +1,6 @@ +--- +"@hopper-ui/tokens": minor +"docs": minor +--- + +Added data viz tokens and added sections to the color page in the docs. diff --git a/apps/docs/components/tableSection/TableSection.tsx b/apps/docs/components/tableSection/TableSection.tsx index d40156086..1a81e7649 100644 --- a/apps/docs/components/tableSection/TableSection.tsx +++ b/apps/docs/components/tableSection/TableSection.tsx @@ -1,3 +1,5 @@ +"use client"; + import React from "react"; import Table from "@/components/ui/table/Table"; diff --git a/apps/docs/components/tabs/Tabs.tsx b/apps/docs/components/tabs/Tabs.tsx index 4bda09288..c0418e95f 100644 --- a/apps/docs/components/tabs/Tabs.tsx +++ b/apps/docs/components/tabs/Tabs.tsx @@ -1,33 +1,31 @@ "use client"; -import { useState } from "react"; +import { Children, useState, type ReactElement, isValidElement } from "react"; import cx from "classnames"; -import Table from "@/components/ui/table/Table"; - import "./tabs.css"; interface TabProps { title: string; category: string; - data: { - name: string; - value: string; - }[]; } interface TabsProps { tabs: TabProps[]; className?: string; + children?: React.ReactNode; } -const Tabs = ({ tabs, className }: TabsProps) => { +const Tabs = ({ tabs, className, children }: TabsProps) => { const [selected, setSelected] = useState(0); const handleOnClick = (index: number): void => { setSelected(index); }; + const arrayChildren = Children.toArray(children); + const selectedChild = arrayChildren[selected]; + return (