Skip to content

Commit

Permalink
chore(tailwind): remove uneccesseary folder nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Dec 19, 2023
1 parent d95b80d commit ac8ec3d
Show file tree
Hide file tree
Showing 23 changed files with 359 additions and 361 deletions.
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
Expand Up @@ -4,7 +4,7 @@ import orbitPreset from "../..";

describe("orbitPreset", () => {
it("should match snapshot", () => {
const cfg = resolveConfig(orbitPreset());
const cfg = resolveConfig(orbitPreset({ disablePreflight: true }));
expect(cfg).toMatchSnapshot();
expect(cfg.corePlugins).not.toContain("preflight");
});
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

0 comments on commit ac8ec3d

Please sign in to comment.