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

Downgrade chakra UI #204

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion demo/modal-test-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<html>

<head>
<script src="https://unpkg.com/csv-import-js@latest/index.js"></script>
<!-- <script src="https://unpkg.com/csv-import-js@latest/index.js"></script> -->
<script src="../build/index.js"></script>
</head>

<body>
Expand Down
1 change: 1 addition & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"assert": "^2.1.0",
"constants": "^0.0.2",
"crypto": "^1.0.1",
"csv-import-react": "^1.0.6",
"fs": "^0.0.1-security",
"http": "^0.0.1-security",
"https": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion demo/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function App() {
<CSVImporter
isModal={true}
modalIsOpen={isOpen}
darkMode={true}
// darkMode={false}
template={template}
modalOnCloseTriggered={() => setIsOpen(false)}
modalCloseOnOutsideClick={true}
Expand Down
20 changes: 11 additions & 9 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4710,8 +4710,10 @@ csstype@^3.0.2, csstype@^3.1.2:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"
integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==

"csv-import-react@file:.yalc/csv-import-react":
version "1.0.5"
csv-import-react@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/csv-import-react/-/csv-import-react-1.0.6.tgz#ac525d8ff27b5d4ce8367a6ecc7ee349c3a21ce1"
integrity sha512-HUjknd8szw5aaZEQAq3XCcQAI7PrL33XA37pL72m/FSZqMesTqZR3jQU6pdGfGsrZcxlurrDIQB74dQ0BT6c0w==
dependencies:
"@chakra-ui/alert" "^2.2.2"
"@chakra-ui/button" "^2.1.0"
Expand Down Expand Up @@ -5786,10 +5788,10 @@ flatted@^3.2.9:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==

focus-lock@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-1.0.0.tgz#2c50d8ce59d3d6608cda2672be9e65812459206c"
integrity sha512-a8Ge6cdKh9za/GZR/qtigTAk7SrGore56EFcoMshClsh7FLk1zwszc/ltuMfKhx56qeuyL/jWQ4J4axou0iJ9w==
focus-lock@^0.9.1:
version "0.9.2"
resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.9.2.tgz#9d30918aaa99b1b97677731053d017f82a540d5b"
integrity sha512-YtHxjX7a0IC0ZACL5wsX8QdncXofWpGPNoVMuI/nZUrPGp6LmNI6+D5j0pPj+v8Kw5EpweA+T5yImK0rnWf7oQ==
dependencies:
tslib "^2.0.3"

Expand Down Expand Up @@ -9000,7 +9002,7 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"

react-clientside-effect@^1.2.6:
react-clientside-effect@^1.2.5:
version "1.2.6"
resolved "https://registry.yarnpkg.com/react-clientside-effect/-/react-clientside-effect-1.2.6.tgz#29f9b14e944a376b03fb650eed2a754dd128ea3a"
integrity sha512-XGGGRQAKY+q25Lz9a/4EPqom7WRjz3z9R2k4jhVKA/puQFH/5Nt27vFZYql4m4NVNdUvX8PS3O7r/Zzm7cjUlg==
Expand Down Expand Up @@ -10524,14 +10526,14 @@ url@^0.11.3:
punycode "^1.4.1"
qs "^6.11.2"

use-callback-ref@^1.3.0:
use-callback-ref@^1.2.5, use-callback-ref@^1.3.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.1.tgz#9be64c3902cbd72b07fe55e56408ae3a26036fd0"
integrity sha512-Lg4Vx1XZQauB42Hw3kK7JM6yjVjgFmFC5/Ab797s79aARomD2nEErc4mCgM8EZrARLmmbWpi5DGCadmK50DcAQ==
dependencies:
tslib "^2.0.0"

use-sidecar@^1.1.2:
use-sidecar@^1.0.5, use-sidecar@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2"
integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Open-source CSV and XLS/XLSX file importer for React and JavaScript",
"main": "build/index.js",
"module": "build/index.esm.js",
"umd": "build/index.umd.js",
"files": [
"build"
],
Expand Down Expand Up @@ -44,8 +45,8 @@
"build-storybook": "storybook build"
},
"peerDependencies": {
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
"react": ">=17.0.0",
"react-dom": ">=17.0.0"
},
"devDependencies": {
"@babel/preset-env": "^7.22.4",
Expand Down Expand Up @@ -101,10 +102,10 @@
"use-sync-external-store": "^1.2.0"
},
"dependencies": {
"@chakra-ui/alert": "^2.2.2",
"@chakra-ui/button": "^2.1.0",
"@chakra-ui/react": "^2.8.1",
"@chakra-ui/system": "^2.6.2",
"@chakra-ui/alert": "^1.3.7",
"@chakra-ui/button": "^1.5.10",
"@chakra-ui/react": "^1.8.8",
"@chakra-ui/system": "^1.8.8",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@rollup/plugin-json": "^6.1.0",
Expand Down
5 changes: 5 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import commonjs from "@rollup/plugin-commonjs";
import image from "@rollup/plugin-image";
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";

const packageJson = require("./package.json");

Expand All @@ -28,6 +29,10 @@ export default {
resolve({
browser: true,
}),
replace({
"import.meta.env": false,
preventAssignment: true,
}),
commonjs(),
typescript({ useTsconfigDeclarationDir: true }),
image(),
Expand Down
7 changes: 4 additions & 3 deletions src/importer/settings/chakra/components/alert.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineStyleConfig } from "@chakra-ui/styled-system";
// import { defineStyleConfig } from "@chakra-ui/styled-system";
import { extendTheme } from "@chakra-ui/react";

const Alert = defineStyleConfig({
baseStyle: (props) => ({
const Alert = extendTheme({
baseStyle: (props: { status: string; }) => ({
container: {
backgroundColor: props.status === "info" ? "var(--color-background-modal)" : "",
border: "1px solid var(--color-border)",
Expand Down
6 changes: 3 additions & 3 deletions src/importer/settings/chakra/components/button.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineStyleConfig } from "@chakra-ui/styled-system";
import { extendTheme } from "@chakra-ui/react";

const Button = defineStyleConfig({
const Button = extendTheme({
// The styles all buttons have in common
baseStyle: {
fontWeight: "normal",
Expand All @@ -24,7 +24,7 @@ const Button = defineStyleConfig({
},

variants: {
solid: (props) => {
solid: (props: { colorScheme: string; }) => {
if (props.colorScheme === "secondary") {
return {
color: "var(--color-text-on-secondary)",
Expand Down
2 changes: 1 addition & 1 deletion src/importer/settings/chakra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const direction: ThemeDirection = "ltr";

const config: ThemeConfig = {
useSystemColorMode: false,
initialColorMode: "light",
initialColorMode: "dark",
cssVarPrefix: "external",
};

Expand Down