Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5e578ae
refactor: add global.css with lsd theme variables
nipsysdev May 26, 2025
7dfb3f7
refactor: set theme name in root element's data-theme
nipsysdev May 26, 2025
6e3a782
refactor(autocomplete): write component style in pure css
nipsysdev May 26, 2025
d0553d3
refactor(badge): write component style in pure css
nipsysdev May 26, 2025
3adb2bc
refactor(breadcrumb): write component style in pure css
nipsysdev May 27, 2025
bcdcc2a
refactor(button): write component style in pure css
nipsysdev May 27, 2025
e036f7a
refactor(calendar): write component style in pure css
nipsysdev May 28, 2025
0e416ac
refactor(styling): replace root class name by component name
nipsysdev May 28, 2025
9ac46c9
refactor(card): write component style in pure css
nipsysdev May 28, 2025
f22b8b4
fix(breadcrumb): fix link class name
nipsysdev May 28, 2025
967c2aa
refactor(checkbox): write component style in pure css
nipsysdev May 28, 2025
103d687
refactor(collapse): write component style in pure css
nipsysdev May 28, 2025
eff1990
refactor: migrate remaining components' styles to pure css
JulesFiliot May 28, 2025
b8f1698
chore: remove CSSBaseline as styles migrated to pure css
JulesFiliot May 28, 2025
feadbe8
chore(styling): rename css root class to root-[component-name]
nipsysdev Jun 2, 2025
31e4739
fix(card): use only one css module for card components
nipsysdev Jun 2, 2025
fa2d10e
fix(icon-button): fix root class name
nipsysdev Jun 2, 2025
37197e6
fix(tabs): remove bottom-border on TabItem inside Tabs
nipsysdev Jun 2, 2025
63828b6
fix(icon-button): fix iconButton border issue
nipsysdev Jun 2, 2025
4d279c9
chore(tabs): minor cleanup
nipsysdev Jun 2, 2025
f60ec75
fix(table): fix table border issue
nipsysdev Jun 2, 2025
aad0f8f
chore: fix naming of components root class
nipsysdev Jun 2, 2025
0ac68ca
refactor(provider): wip pure css provider
nipsysdev Jun 5, 2025
2dec37d
refactor(storybook): remove code depending on emotion
nipsysdev Jun 5, 2025
9401189
refactor: remove emotion from project
nipsysdev Jun 9, 2025
44c3cfd
refactor(autocomplete,breadcrumb): remove unused class
nipsysdev Jun 13, 2025
f0d38ff
fix(storybook): fix storybook theme switching
nipsysdev Jun 13, 2025
f1d7b00
fix(types): add globalStyles as optional field to Theme type
nipsysdev Jun 20, 2025
fe98814
fix(storybook): restore font switching ability
nipsysdev Jun 20, 2025
a0cff42
fix(storybook): fix default theme color value
nipsysdev Jun 21, 2025
de55a02
fix(card): fix card body text size
nipsysdev Jun 21, 2025
b388be7
fix(storybook): use monospace as default font
nipsysdev Jun 21, 2025
07e3de9
fix(storybook): wrap component in PortalProvider
nipsysdev Jun 22, 2025
b5f64f9
chore(icons): rename fill-rule & clip-rule to camelCase
nipsysdev Jun 22, 2025
b287fd7
fix(table): fix line-height
nipsysdev Jun 29, 2025
4fda14d
fix(tableItem): fix font-size
nipsysdev Jun 29, 2025
ef80035
fix(tableRow): fix checkbox & radio item class
nipsysdev Jun 29, 2025
3118eaa
fix(textField): fix button icon size
nipsysdev Jun 29, 2025
3049edc
fix(toast): fix icon size
nipsysdev Jun 29, 2025
65b6c17
refactor(useTheme): re-implement useTheme. hook reading theme name an…
nipsysdev Jun 29, 2025
b260861
refactor(themeProvider): re-introducing the Colors story
nipsysdev Jun 29, 2025
ab0d66d
refactor(themeProvider): re-introduce the Spacing story
nipsysdev Jun 30, 2025
8cc7ba7
refactor(themeProvider): re-introduce the TypographyComponent story
nipsysdev Jun 30, 2025
956dec4
fix(design-token): remove invalid import
nipsysdev Jul 2, 2025
29f808c
fix(storybook): use light theme for docs
nipsysdev Jul 2, 2025
0120ebd
chore(style): remove useless global.css
nipsysdev Jul 2, 2025
7561f34
fix(build): export as es module, include css into js entrypoint
nipsysdev Jul 2, 2025
ec7d2a9
fix(vite): remove camelCaseOnly setting
nipsysdev Jul 4, 2025
34169b5
chore(readme): update setup theme section
nipsysdev Jul 4, 2025
03c5845
refactor: separate theme logic from components,
nipsysdev Jul 5, 2025
eb631a8
build: implement vite plugin to preserve `use client` directives
nipsysdev Jul 6, 2025
79b43db
refactor(vite): refactor plugins
nipsysdev Jul 6, 2025
27521bb
chore: update readme
nipsysdev Jul 6, 2025
b76b5bf
build: refactor vite plugins
nipsysdev Jul 6, 2025
7f6e784
fix(typography): enable global use of the sansSerif, serif and monosp…
nipsysdev Jul 6, 2025
2b7dcb4
chore(vite): build configuration cleanup
nipsysdev Jul 6, 2025
71d81d8
refactor(build): modernize build system with modular plugins and subp…
nipsysdev Jul 10, 2025
35dec06
refactor: move components into client directory
nipsysdev Jul 10, 2025
de95dde
refactor(components): remove unused index.ts file
nipsysdev Jul 10, 2025
910c767
feat: add legacy compatibility support with bulk imports and manual CSS
nipsysdev Jul 14, 2025
5d6aad7
fix: update theme imports to use the correct path for theme module
nipsysdev Jul 14, 2025
a9c74fe
chore: downgrade lint-staged
nipsysdev Jul 15, 2025
b408414
feat: update canary-release.yml
jinhojang6 Jul 15, 2025
b351ecd
fix: fix bugs with canary-release.yml
jinhojang6 Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
fetch-depth: 0
fetch-tags: 1
ref: ${{ github.event.pull_request.head.sha }}
# ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/setup-node@v3
with:
Expand Down
274 changes: 3 additions & 271 deletions packages/lsd-react/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,111 +1,8 @@
import { Global, css } from '@emotion/react'
import {
Canvas,
Controls,
Description,
Subtitle,
Title,
useOf,
} from '@storybook/blocks'
import type { Preview } from '@storybook/react'
import clsx from 'clsx'
import React, { useEffect, useState } from 'react'
import { Dropdown, ThemeProvider, defaultThemes } from '../src'
import { THEME_TYPOGRAPHY_FONT_CATEGORIES } from '../src/components/Theme/constants'
import { docTheme, storybookThemes } from './themes'
import { withTheme } from './withTheme.decorator'

const useGlobals = () => {
const GLOBAL_PROPS = {
themeColor: {
defaultValue: 'Dark',
description: 'Theme color',
name: 'Theme color',
toolbar: {
icon: '',
items: [
{
title: 'Dark',
value: 'Dark',
},
{
title: 'Light',
value: 'Light',
},
],
},
},
themeFont: {
defaultValue: 'sans-serif',
description: 'Theme font',
name: 'Theme font',
toolbar: {
icon: '',
items: [
{
title: 'monospace',
value: 'monospace',
},
{
title: 'sans-serif',
value: 'sans-serif',
},
{
title: 'serif',
value: 'serif',
},
],
},
},
}

const [updated, setUpdated] = useState(0)
const [state, setState] = useState(
Object.fromEntries(
Object.entries(GLOBAL_PROPS).map(([name, prop]) => [
name,
(window as any).__STORYBOOK_STORY_STORE__?.globals?.globals?.[name] ??
prop.defaultValue,
]),
),
)

const updateGlobals = async (func: (globals: any) => void) => {
const { __STORYBOOK_ADDONS_PREVIEW } = window as any
const { channel } = __STORYBOOK_ADDONS_PREVIEW

const allGlobals = channel.data.updateGlobals

allGlobals.map((g) => func(g.globals))
await Promise.all(
allGlobals.map((globals, index) =>
channel.events.updateGlobals[index](globals),
),
)
}

useEffect(() => {
updated > 0 &&
updateGlobals((globals) => {
Object.entries(state).forEach(([name, value]) => {
globals[name] = value
})
})
}, [updated, state])

return {
props: Object.entries(GLOBAL_PROPS).map(([name, prop]) => ({
key: name,
name: prop.name,
value: state[name],
values: prop.toolbar?.items ?? [],
set: (value: string) => {
setState((s) => ({ ...s, [name]: value }))
setUpdated((v) => v + 1)
},
})),
}
}
import { THEME_TYPOGRAPHY_FONT_CATEGORIES } from '../src/theme/constants'
import { baseTheme } from '../src/theme/baseTheme'

const preview: Preview = {
parameters: {
Expand Down Expand Up @@ -138,171 +35,6 @@ const preview: Preview = {
},
docs: {
theme: docTheme,
page: () => {
const globals = useGlobals()

const resolvedOf = useOf('meta', ['meta'])
const { stories, meta, moduleExports } = resolvedOf.csfFile

const controls =
typeof meta?.parameters?.docs?.controls === 'undefined' ||
meta?.parameters?.docs?.controls === true

const searchParams = new URLSearchParams(window.location.search)

const storyId = searchParams.get('storyId') as string
const embedded = searchParams.get('embedded') === 'true'
const globalControls = (searchParams.get('globalControls') || '').split(
',',
)
const hideElements = (searchParams.get('hide') || '').split(',')

const canvasPadding = searchParams.get('canvasPadding') || '0,0'

const hideTitle = hideElements.includes('title')
const hideSubtitle = hideElements.includes('subtitle')
const hideDescription = hideElements.includes('description')
const hideToolbar = hideElements.includes('toolbar')
const hideControls = hideElements.includes('controls')

return (
<ThemeProvider theme={defaultThemes.dark}>
<div
className={clsx(
'docs-wrapper',
embedded && 'docs-wrapper--embedded',
hideElements.map((element) => `docs-wrapper--hide-${element}`),
)}
style={
{
'--canvas-padding': canvasPadding.replace(',', ' '),
} as any
}
>
{!hideTitle && <Title />}
{!hideSubtitle && <Subtitle />}
{!hideDescription && <Description />}
{globalControls && globalControls.length > 0 && (
<div className="docs-global-controls">
{globals.props
.filter((prop) => globalControls.includes(prop.key))
.map((prop, index) => (
<Dropdown
id={prop.key + '-dropdown'}
key={index}
menuProps={{ className: 'docs-dropdown-menu' }}
value={prop.value}
onChange={(value) => prop.set(value as string)}
options={prop.values.map((i) => ({
name: i.title,
value: i.value,
}))}
triggerLabel={prop.name}
label={prop.name}
/>
))}
</div>
)}
<Canvas
className="canvas"
withToolbar={!hideToolbar}
{...(storyId && stories[storyId]
? { story: stories[storyId] as any }
: {})}
/>
{controls && !hideControls && <Controls />}
</div>
<Global
styles={css`
.docs-story,
#lsd-presentation .docs-dropdown-menu {
${defaultThemes.dark.cssVars}

background: rgb(var(--lsd-surface-primary));
}

.docs-global-controls {
display: flex;
flex-direction: row;
gap: 16px;
margin-top: 32px;
}

.sbdocs-wrapper {
.sbdocs-preview {
// source code
.docs-story + div {
border-top: 1px solid;
}

// toolbar
> div:nth-child(1) {
button:hover svg {
color: #fff !important;
}
}
}

.docblock-argstable-body {
.rejt-tree {
.rejt-name {
color: #fff !important;
}

.rejt-value-node:hover > .rejt-value {
color: #000 !important;
background: #fff !important;
}
}

input[type='checkbox'] {
box-shadow: none !important;
}

input[type='radio'] + span {
color: #fff !important;
}
}

.docs-wrapper--embedded {
}

.docs-wrapper {
&--hide-code {
.docblock-code-toggle {
display: none !important;
}
}

&--hide-canvas-border {
.sbdocs-preview {
border: none;
.docs-story > div:nth-child(1) {
padding: 0px !important;
}
}
}
}
}
`}
/>

{embedded && (
<Global
styles={css`
.sbdocs-wrapper {
padding: 1px;
}

.sbdocs-preview .story-wrapper {
padding: var(--canvas-padding) !important;
}
`}
/>
)}
</ThemeProvider>
)
},
},
},
decorators: [withTheme],
Expand All @@ -312,7 +44,7 @@ const preview: Preview = {
name: 'enum',
value: THEME_TYPOGRAPHY_FONT_CATEGORIES,
},
defaultValue: 'inherit',
defaultValue: baseTheme.typographyGlobal.genericFontFamily,
},
},
globalTypes: {
Expand Down
Loading
Loading