Skip to content

Commit

Permalink
Meta: Start migration to tailwindcss.
Browse files Browse the repository at this point in the history
filiphsps committed Sep 24, 2024
1 parent e586f33 commit 9dfeb3f
Showing 153 changed files with 4,723 additions and 3,949 deletions.
15 changes: 15 additions & 0 deletions .changeset/neat-moons-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@nordcom/nordstar-accented': patch
'@nordcom/nordstar-details': patch
'@nordcom/nordstar-heading': patch
'@nordcom/nordstar-button': patch
'@nordcom/nordstar-header': patch
'@nordcom/nordstar-input': patch
'@nordcom/nordstar-label': patch
'@nordcom/nordstar-card': patch
'@nordcom/nordstar-view': patch
'@nordcom/nordstar': patch
'@nordcom/nordstar-system': patch
---

- Refactor components to use tailwind and `cva`.
17 changes: 17 additions & 0 deletions .changeset/pink-eggs-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@nordcom/nordstar-accented': patch
'@nordcom/nordstar-details': patch
'@nordcom/nordstar-heading': patch
'@nordcom/nordstar-button': patch
'@nordcom/nordstar-header': patch
'@nordcom/nordstar-input': patch
'@nordcom/nordstar-label': patch
'@nordcom/nordstar-card': patch
'@nordcom/nordstar-view': patch
'@nordcom/nordstar': patch
'@nordcom/nordstar-system': patch
'@nordcom/nordstar-storybook': patch
'@nordcom/nordstar-docs': patch
---

- Update domain to `https://nordstar.dev/`
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -59,7 +59,15 @@
"prefer": "type-imports"
}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-require-imports": [
"error",
{
"allow": [
"tailwindcss",
"autoprefixer"
]
}
],
"@typescript-eslint/no-unnecessary-condition": "warn",
"brace-style": [
"error",
18 changes: 16 additions & 2 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"extends": ["development"],
"browserslist": [
"defaults",
"not ie 11",
"not ie <= 10",
"not and_ff <= 119",
"not firefox <= 121",
"not opera <= 104"
],
"hints": {
"typescript-config/is-valid": "off",
"compat-api/css": [
@@ -10,9 +18,15 @@
"font-smooth",
"overflow: clip",
"overscroll-behavior",
"text-size-adjust"
"text-size-adjust",
"user-select"
]
}
]
],
"no-inline-styles": "off",
"typescript-config/strict": "off",
"typescript-config/consistent-casing": "off",
"disown-opener": "off",
"manifest-is-valid": "off"
}
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore artifacts
build
dist
coverage
node_modules
.next
9 changes: 9 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const prettierConfig = require('@nordcom/prettier');

/** @type {import('prettier').Config} */
module.exports = {
...prettierConfig,
$schema: 'http://json.schemastore.org/prettierrc',
plugins: [...(prettierConfig.plugins || []), 'prettier-plugin-tailwindcss'],
quoteProps: 'consistent'
};
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
"formulahendry.auto-rename-tag",
"jgclark.vscode-todo-highlight",
"medo64.render-crlf",
"mikestead.dotenv"
"mikestead.dotenv",
"bradlc.vscode-tailwindcss"
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@
"cSpell.words": [
"Brandly",
"compat",
"Docgen",
"Filiph",
"lockb",
"Nordcom",
@@ -52,6 +53,8 @@
"registrator",
"Sandström",
"Siitam",
"tailwindcss",
"testid",
"treeshake",
"tsbuildinfo",
"typecheck",
@@ -75,5 +78,23 @@
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"tailwindCSS.classAttributes": ["class", "className", ".*ClassName", ".*Styles"],
"tailwindCSS.lint.invalidVariant": "warning",
"tailwindCSS.colorDecorators": true,
"tailwindCSS.experimental.classRegex": [
"[a-zA-Z]*ClassName='([^']+)'",
"[a-zA-Z]*ClassName=\"([^\"]+)\"",
"[a-zA-Z]*ClassName={`([^`]+)`}",
["Styles\\s*=\\s*([^;]*);", "'([^']*)'"],
["Styles\\s*=\\s*([^;]*);", "\"([^\"]*)\""],
["Styles\\s*=\\s*([^;]*);", "\\`([^\\`]*)\\`"],
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"tailwindCSS.includeLanguages": {
"html": "html",
"javascript": "javascript",
"css": "css"
}
}
4 changes: 4 additions & 0 deletions @types/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -16,3 +16,7 @@ declare module '*.scss' {
const content: { [className: string]: string };
export = content;
}

declare module 'hex-to-hsl' {
export default function convert(input?: string): [number, number, number] | undefined;
}
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2023 Nordcom Group Inc.
Copyright (c) 2023-2024 Nordcom AB <[email protected]>
Copyright (c) 2023-2024 Filiph Sandström <[email protected]>
Copyright (c) 2020 Junior Garcia (Next UI)

Permission is hereby granted, free of charge, to any person obtaining a copy
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security

Nordcom Group Inc. takes the security of its software extremely seriously. However, due to our size and being such a new and novel company, we do not accept and cannot offer any form of liability (legal or otherwise) as per the included license unless otherwise explicitly granted in writing.
Nordcom AB takes the security of its software extremely seriously. However, due to our size and being such a new and novel company, we do not accept and cannot offer any form of liability (legal or otherwise) as per the included license unless otherwise explicitly granted in writing.

If you believe you have found a security flaw or vulnerability, If you believe you have found a security flaw or vulnerability, please report it to us following the instructions below.

@@ -21,7 +21,7 @@ For any questions or need for clarification, feel free to reach out to us on

## Policy

**Nordcom Group Inc. is committed to the security of its software and the safety of its users.**
**Nordcom AB is committed to the security of its software and the safety of its users.**

We will investigate all reported security vulnerabilities promptly and responsibly. We will prioritize and address vulnerabilities based on their severity and potential impact to our users.

34 changes: 20 additions & 14 deletions docs/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
{
"extends": ["../.eslintrc"],
"ignorePatterns": ["!**/*"],
"$schema": "https://json.schemastore.org/eslintrc.json",
"extends": ["next/core-web-vitals", "../.eslintrc"],
"ignorePatterns": [ "!**/*", "/*"],
"env": {
"browser": true,
"es2024": true,
"node": true
},
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"files": ["*.ts", "*.tsx", "*.mdx"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["docs/tsconfig(.*)?.json"],
"ecmaFeatures": {
"jsx": true
}
},
"sourceType": "module",
"ecmaVersion": "latest",
"project": ["./tsconfig.json", "./tsconfig.test.json"]
},
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
],
"settings": {
"next": {
"rootDir": "docs/"
}
}
}
61 changes: 57 additions & 4 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
import createVercelToolbar from '@vercel/toolbar/plugins/next';

const withVercelToolbar = createVercelToolbar();

export function getBaseUrl() {
if (process.env.VERCEL_ENV === 'production') {
return 'https://nordstar.dev';
}

return process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : undefined;
}

/** @type {import('next').NextConfig} */
let config = {
poweredByHeader: false,
@@ -6,26 +18,67 @@ let config = {
swcMinify: true,
productionBrowserSourceMaps: true,
compress: true,
assetPrefix: getBaseUrl(),
experimental: {
scrollRestoration: true,
appNavFailHandling: true,
caseSensitiveRoutes: true,
cssChunking: 'strict',
esmExternals: true,
optimizePackageImports: []
optimizePackageImports: [],
optimizeServerReact: true,
parallelServerBuildTraces: true,
parallelServerCompiles: true,
scrollRestoration: true,
serverComponentsHmrCache: true,
serverSourceMaps: true,
useEarlyImport: true,
webpackBuildWorker: true
},
images: {
dangerouslyAllowSVG: true,
minimumCacheTTL: 60,
contentDispositionType: 'inline',
remotePatterns: [
{
protocol: 'https',
hostname: 'nordcom.io'
},
{
protocol: 'https',
hostname: '**.nordcom.io'
},
{
protocol: 'https',
hostname: '**.github.io'
},
{
protocol: 'https',
hostname: '**.gravatar.com'
}
]
],
formats: ['image/webp', 'image/avif']
},
eslint: {
ignoreDuringBuilds: true
},
typescript: {
ignoreBuildErrors: true,
tsconfigPath: 'tsconfig.json'
},

async generateBuildId() {
return process.env.VERCEL_GIT_COMMIT_SHA || 'unknown';
},

webpack(config, _context) {
return {
...config,
experiments: {
...config.experiments,
topLevelAwait: true
}
};
}
};

export default config;
export default withVercelToolbar(config);
25 changes: 19 additions & 6 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -8,23 +8,26 @@
"cacheDirectories": [
".next/cache"
],
"prettier": "@nordcom/prettier",
"scripts": {
"build": "next build",
"dev": "next dev",
"clean": "rm -rf dist coverage storybook-static .turbo .next *.tsbuildinfo *.log",
"start": "next start -p $PORT",
"typecheck": "tsc --noEmit",
"lint": "concurrently -i pnpm:lint:*",
"lint:next": "next lint",
"lint:prettier": "prettier src/**/*.* --check"
"lint:prettier": "prettier --check \"./**/*.{ts,tsx}\"",
"fix": "concurrently -i pnpm:fix:*",
"fix:next": "next lint --fix",
"fix:prettier": "prettier --write \"./**/*.{cjs,mjs,ts,tsx,scss,json}\""
},
"keywords": [
"nordstar",
"nordcom",
"docs"
],
"author": {
"name": "Nordcom Group Inc.",
"name": "Nordcom AB",
"email": "[email protected]",
"url": "https://nordcom.io/"
},
@@ -44,15 +47,25 @@
"bugs": {
"url": "https://github.com/NordcomInc/nordstar/issues"
},
"homepage": "https://nordstar.nordcom.io/",
"homepage": "https://nordstar.dev/",
"dependencies": {
"@nordcom/nordstar": "workspace:*",
"@vercel/toolbar": "0.1.20",
"geist": "1.3.1",
"next": "14.2.10",
"react": "18.3.1",
"react-dom": "18.3.1"
"react-dom": "18.3.1",
"react": "18.3.1"
},
"devDependencies": {
"@nordcom/prettier": "0.1.1",
"autoprefixer": "10.4.20",
"concurrently": "9.0.1",
"eslint-config-next": "15.0.0-canary.162",
"eslint": "8.57.1",
"postcss": "8.4.47",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"tailwindcss": "3.4.13",
"typescript": "5.6.2"
}
}
6 changes: 6 additions & 0 deletions docs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
Loading

0 comments on commit 9dfeb3f

Please sign in to comment.