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

fix: move SetThemeScript and themeHelper from styled to react #701

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"storybook:experimental-vite": "USE_VITE=1 storybook dev -p 6006",
"storybook:build": "storybook build",
"storybook:build-vite": "USE_VITE=1 storybook build",
"build": "yarn workspaces foreach -vpt -j unlimited run build",
"build": "yarn workspaces foreach -vp --topological-dev -j unlimited run build",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これによってtextfield--prefixのsnapshotにiconが表示さるように治った

"clean": "yarn workspaces foreach -vp run clean",
"test": "vitest",
"test:image-snapshot": "TEST_RUNNER=vrt concurrently -k -s first -n \"SB,TEST\" -c \"magenta,blue\" \"http-server storybook-static --port 6006 --silent\" \"wait-on tcp:127.0.0.1:6006 && test-storybook ${*}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
assertKeyString,
DEFAULT_ROOT_ATTRIBUTE,
LOCAL_STORAGE_KEY,
} from './helper'
} from './themeHelper'

interface Props {
localStorageKey: string
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ export {
CharcoalProvider,
type CharcoalProviderProps,
} from './core/CharcoalProvider'
export { makeSetThemeScriptCode, SetThemeScript } from './core/SetThemeScript'
export {
getThemeSync,
themeSetter,
themeSelector,
prefersColorScheme,
useTheme,
useThemeSetter,
useLocalStorage,
useMedia,
} from './core/themeHelper'
export { default as Button, type ButtonProps } from './components/Button'
export {
default as Clickable,
Expand Down
2 changes: 2 additions & 0 deletions packages/styled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"test": "vitest run --passWithNoTests"
},
"devDependencies": {
"@charcoal-ui/react": "^4.2.1",
"@types/react": "^18.3.3",
"@types/react-test-renderer": "^18.3.0",
"@types/styled-components": "^5.1.21",
Expand All @@ -44,6 +45,7 @@
"warning": "^4.0.3"
},
"peerDependencies": {
"@charcoal-ui/react": "^4.2.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここバージョンアップで更新されるかやや不安

"react": ">=17.0.0",
"styled-components": ">=5.1.1"
},
Expand Down
5 changes: 3 additions & 2 deletions packages/styled/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export {
useThemeSetter,
useLocalStorage,
useMedia,
} from './helper'
makeSetThemeScriptCode,
SetThemeScript,
} from '@charcoal-ui/react'
export { defineThemeVariables } from './util'
export { removeHalfLeadingCss } from './utils/typographyCss'
export * from './SetThemeScript'

type Blank = null | undefined | false

Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ __metadata:
resolution: "@charcoal-ui/styled@workspace:packages/styled"
dependencies:
"@charcoal-ui/foundation": ^4.2.1
"@charcoal-ui/react": ^4.2.1
"@charcoal-ui/theme": ^4.2.1
"@charcoal-ui/utils": ^4.2.1
"@types/react": ^18.3.3
Expand All @@ -2267,6 +2268,7 @@ __metadata:
vitest: ^2.0.2
warning: ^4.0.3
peerDependencies:
"@charcoal-ui/react": ^4.2.1
react: ">=17.0.0"
styled-components: ">=5.1.1"
languageName: unknown
Expand Down
Loading