Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Flcwl committed Jun 1, 2021
1 parent 2b115d5 commit 987d578
Show file tree
Hide file tree
Showing 49 changed files with 571 additions and 818 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Desktop.ini
Thumbs.db
.Spotlight-V100
.Trashes
postcss.config.js
postcss.config.js
16 changes: 10 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// const customWebpack = require('./webpack.config.js');
// .storybook/main.js

const path = require("path")
module.exports = {
stories: ["../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)", "../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
addons: ["@storybook/addon-links", "@storybook/addon-essentials", "storybook-addon-react-live-edit", "@storybook/preset-scss"],
stories: [
"../stories/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"storybook-addon-react-live-edit",
"@storybook/preset-scss",
],
}
7 changes: 0 additions & 7 deletions .storybook/manager-head.html

This file was deleted.

6 changes: 3 additions & 3 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { addons } from '@storybook/addons';
import hiuiTheme from './hiuiTheme';
import hiuiTheme from './themes/hiui-theme';

addons.setConfig({
theme: hiuiTheme,
isFullscreen: false,
showNav: true,
showPanel: false,
panelPosition: 'bottom',
sidebarAnimations: true,
enableShortcuts: true,
isToolshown: true,
theme: hiuiTheme,
selectedPanel: undefined,
initialActive: 'sidebar',
showRoots: false,
});
})
10 changes: 0 additions & 10 deletions .storybook/preview-body.html

This file was deleted.

6 changes: 0 additions & 6 deletions .storybook/preview-head.html

This file was deleted.

57 changes: 38 additions & 19 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

// .storybook/preview.js
import React, { useRef, useState } from "react"
import { addDecorator } from "@storybook/react"
// import theme from "./codeTheme"
import DocViewer from "../libs/doc-viewer"
import "./reset.css"
import theme from "./themes/code-theme"
import "@hi-ui/hiui/es/base-css"
import React, { useRef, useState } from "react"

// import { Meta, ArgsTable, Source, Story, Canvas } from "@storybook/addon-docs/blocks"
// import { Title, Subtitle, Description, Primary, ArgsTable, Stories, PRIMARY_STORY } from "@storybook/addon-docs/blocks"
// import { LiveProvider, LiveEditor, LiveError, LivePreview } from "react-live"
Expand All @@ -18,9 +17,16 @@ import React, { useRef, useState } from "react"
// import Checkbox from "../packages/ui/checkbox/src"
// import EmptyState from "../packages/ui/empty-state/src"

const importRegx = /import\s+([\w*{}\n, ])+.*;?/gm
const withThemeProvider = (Story,context) => {
const theme = getTheme(context.globals.theme);
return (
<ThemeProvider theme={theme}>
<Story {...context} />
</ThemeProvider>
)
}

function addSbCodeEditro(cb, props) {
const withCodeEditor = (cb, props) => {
const { argTypes, args } = props
const Component = props.parameters.component
const { parameters = {}, globals } = props
Expand All @@ -40,43 +46,56 @@ function addSbCodeEditro(cb, props) {
)
}

addDecorator(addSbCodeEditro)
/**
* Add global stories Decorators
*/
export const decorators = [withThemeProvider];

/**
* Add global stories context
*/
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
layout: "centered",
options: {
storySort: {
order: ["HiUI 简介", "Alert", "页面", "数据录入"],
locales: "en-US"
}
}
}

/**
* Add global toolbar menus for switching to theme, i18n and RTL-LTR
*/
export const globalTypes = {
theme: {
name: "Theme",
description: "Global theme for components",
defaultValue: "light",
toolbar: {
icon: "circlehollow",
// array of plain string values or MenuItem shape (see below)
items: ["light", "dark"]
}
items: ["light", "dark"],
},
},
locale: {
name: "Locale",
description: "Internationalization locale",
defaultValue: "en",
defaultValue: "zh",
toolbar: {
icon: "globe",
items: [
{ value: "en", right: "🇺🇸", title: "English" },
{ value: "fr", right: "🇫🇷", title: "Français" },
{ value: "es", right: "🇪🇸", title: "Español" },
{ value: "zh", right: "🇨🇳", title: "中文" },
{ value: "kr", right: "🇰🇷", title: "한국어" }
]
}
}
{ value: "en", right: "🇺🇸", title: "English" },
],
},
},
direction: {
name: "Direction",
description: "Direction for layout",
defaultValue: "LTR",
toolbar: {
icon: "transfer",
items: ["LTR", "RTL"],
},
},
}
38 changes: 0 additions & 38 deletions .storybook/reset.css

This file was deleted.

15 changes: 0 additions & 15 deletions .storybook/stringReplace.js

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions .storybook/hiuiTheme.js → .storybook/themes/hiui-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default create({
// inputBorderRadius: 4,

base: 'light',
brandTitle: 'My custom storybook',
brandTitle: 'HiUI',
brandUrl: 'https://infra.mioffice.cn/hiui/zh-CN/',
brandImage: '',
});
})
45 changes: 0 additions & 45 deletions .storybook/webpack.config.js

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 987d578

Please sign in to comment.