Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tailwind): remove uneccesseary folder nesting #4201

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";
import { getTokens } from "@kiwicom/orbit-design-tokens";

import Button from "../__fixtures__/Button";
import { render, screen } from "../../testUtils";
import { firstToUpper } from "../foundation/helpers";
import { render, screen } from "../testUtils";
import firstToUpper from "../utils/firstToUpper";
import cssVarsFoundation from "../foundation/cssVarsFoundation";

const testIds = ["primary", "secondary", "info", "success", "warning", "critical"];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { defaultTokens } from "@kiwicom/orbit-design-tokens";

import { render, screen } from "../../testUtils";
import { render, screen } from "../testUtils";
import FontSizes from "../__fixtures__/FontSizes";
import FontWeight from "../__fixtures__/FontWeight";
import LineHeight from "../__fixtures__/LineHeight";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";
import { defaultTokens } from "@kiwicom/orbit-design-tokens";

import Headings from "../__fixtures__/Headings";
import { render, screen } from "../../testUtils";
import { firstToUpper } from "../foundation/helpers";
import { render, screen } from "../testUtils";
import firstToUpper from "../utils/firstToUpper";

const HEADINGS = [
"title1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getComponentLevelTokens } from "../presets/foundation/helpers";
import getComponentLevelTokens from "../getComponentLevelTokens";

describe("orbit-tailwind-preset", () => {
it("should get component level token", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { defaultTokens } from "@kiwicom/orbit-design-tokens";

import { render, screen } from "../../testUtils";
import { render, screen } from "../testUtils";
import Spacings from "../__fixtures__/Spacings";

const SPACINGS = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { defaultTokens } from "@kiwicom/orbit-design-tokens";

export const kebabCase = (str: string) => str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();

export const firstToUpper = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
import kebabCase from "./utils/kebabCase";

export type ExportedComponentLevelTokens =
| "alert"
Expand Down Expand Up @@ -43,7 +41,7 @@ type ExportedComponentLevelTypes =
| "fontWeight"
| "lineHeight";

export const getComponentLevelTokens =
const getComponentLevelTokens =
(tokens: typeof defaultTokens = defaultTokens) =>
(component: ExportedComponentLevelTokens, type: ExportedComponentLevelTypes) => {
return Object.keys(tokens).reduce((acc, key) => {
Expand All @@ -67,3 +65,5 @@ export const getComponentLevelTokens =
return acc;
}, {});
};

export default getComponentLevelTokens;
Loading